pdftotext on Centos 6 64bit? - centos

I have a HostGator VPS server, and want to be able to run pdftotext, part of xpdf (http://www.foolabs.com/xpdf/download.html).
After testing this out on my Mac, it worked fine, so I went to installing it on my VPS server.
I followed the installation instructions and it all isntalled flawlessly:
Copy the executables (xpdf, pdftotext, etc.) to to /usr/local/bin.
Copy the man pages (*.1 and *.5) to /usr/local/man/man1 and /usr/local/man/man5.
Copy the sample-xpdfrc file to /usr/local/etc/xpdfrc
Then I tested it out:
root#*** [~]# pdftotext
pdftotext: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by pdftotext)
So as you can see, it couldn't find /lib64/libc.so.6. /lib64/libc.so.6 is there, however, as shown by this:
root#*** [~]# /lib64/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-52).
Compiled on a Linux 2.6.9 system on 2012-03-19.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
GNU libio by Per Bothner
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
I then contacted HostGator, where they told me that it will not work on my server, as it can't find /lib64/libc.so.6, and is therefor not available on Centos 6 64bit.
If this is indeed true, are there any alternatives to pdftotext that do a simple and fast conversion that would work on this server? Is it possible that the pdftotext can be complied for a different version, or that I installed it incorrectly with permissions?

Neither of these commands will work:
yum install xpdf
yum install poppler-utils
xpdf will install poppler-utils anyway and this will result in this pdftotext
pdftotext version 0.26.5
Copyright 2005-2014 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
This is not the version you want. You want this one:
pdftotext version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
This will require going to www.xpdfreader.com and then clicking on "Download". Use the latest versions from this page to set up the newer pdftotext command.
I actually compiled the sources myself:
cd /tmp
wget https://dl.xpdfreader.com/xpdf-4.03.tar.gz
tar -xf xpdf-4.03.tar.gz
cd xpdf-4.03
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release
If successful you should see:
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/xpdf-4.03
Then just type:
make
It should end with:
[100%] Built target pdftotext
Then type
make install
Now when you type pdftotext you should see:
pdftotext version 4.03 [www.xpdfreader.com]
Copyright 1996-2021 Glyph & Cog, LLC
Note: I wrote all my code for pdftotext version 4.03. Took me a while to realise 4.03 and 0.26 produce vastly different results.

Related

How can I get Ada GNAT gcc 7.3 for Solaris 11?

We have a Solaris 11 system with gcc 7.3, we need to install the Ada package. On Linux gcc 7 came with the Ada/GNAT as part of the gcc install:
apt install gcc
I visited AdaCore looks like Solaris (SPARC) is not longer on the list. I need to use Ada95 and we want the same compiler on both Linux and Solaris in any case.
pkg install gcc
Only installed various C++ commands and Fortran.
pkg install gcc-ada
And variants like gcc7ada, found nothing to install.
If must, we can rebuild the Ada component of GCC 7, however I haven't found a clear cood-book style "How To ..."for that (yet).
Hopefully you can point me to these items in order of preference to help us get back-on-track.
Solaris 11 gcc-ada package for gcc7/Solaris 11 spark, and the package repository.
An 'alternative' package repository were I can retrieve the GCC Ada tooling.
Pre-build GCC 7 Ada module that we can copy to the right places.
Ready-rolled Build Ada/GNAT project for Solaris and how to download and get start building.
Instructions to download and build gcc-ada with gcc 7 on Solaris (or Unix).
From th epast few days searching about on Gnu Compiler Collection, Oracle, the package manager searches, google and so forth ... It really seems like there's next to no support for CGG Ada on Solaris these days.
I very interested in other solutions beyond that list. For instance, has anyone cross-compiled from Linux to Solaris? Would that work with GDB on the Solaris machine anyway?
Looking forward to your suggestions.
I've successfully built gcc 7.50 (x86_64 native with i386 cross-compiler) with GNAT on OpenIndiana (Hipster 2020/10) using the following procedure.
Download the bootstrap compiler from Dragonlace at http://downloads.dragonlace.net/src/ada-bootstrap.x86_64.solaris.511.tar.bz2
Get the illumos gcc 7.5.0 source from https://github.com/illumos/gcc/tree/il-7_5_0
Put the bootstrap compiler's bin directory at the front of $PATH, replace /usr/bin/gcc /usr/bin/cpp /usr/bin/g++ with symlinks to their counterparts in the bootstrap compiler directory (see note below re g++ and c++)
Make sure you've got gnu-binutils and gmake; then run contrib/download_prerequisites
Configure with
--enable-languages='c ada c++' --build=x86_64-aux-solaris2.11 --enable-threads=posix --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-nls --disable-shared --disable-lto --disable-libstdcxx-pch --enable-multilib --with-gnu-as --with-as=/usr/bin/gas --without-gnu-ld --with-ld=/usr/bin/ld
gmake and then gmake install
NOTES:
This setup should be close enough to Solaris 11 to work. If it doesn't, try using the regular gcc 7.5.0 release rather than the illumos-modified branch.
If you get stuck at a linking stage, try using a gcc ld, but you should definitely try to use the Solaris ld first. The gnu as (gas) makes the build go much more smoothly. I didn't have any problems, but if you get stuck at the end of stage 1 or the beginning of stage 2, try setting $CONFIG_SHELL=/usr/bin/ksh -- I think it has been fixed, but at least with older gcc releases one needed to specify ksh because the built-in sh had some non-POSIX peculiarities that didn't work with some of the components' makefiles
I couldn't get one of the support libs for gnat to compile easily without building gcc c++ and using g++ with a full bootstrap. You might be able to figure it out, but the path of least resistance is likely to build gcc c++ and put the g++ symlink in /usr/bin, which is where the makefile wanted to find it.
Please note that I don't know much about Solaris, but a quick search on Google gave me the website OpenCSW. This website provides the packages gcc4ada and gcc5ada.
It appears that gcc5ada is build using a makefile (as found here, in particular notice line 424). A similar makefile exists for gcc7ada (as found here, in particular notice line 426). However, while it seems that the package "gcc7ada" can be created with the latter makefile, it is not published on the OpenCSW.org website (website is no longer updated?).
You could try to install gcc5ada first and then use this old GCC/GNAT compiler as a bootstrapper for compiling the required version (using the GCC 7 makefile).

Specify perl script to run on an earlier version of perl

I have some old production computer which has Perl 5.0 (updated version 1998).
I developed a script on my office computer with Activestate Perl 5.24.1
When i tried to run on the older version (installed on Windows XP) it drops several warnings, etc can not know about USE Warnings;, or three parameter open function.
The our keyword cannot be used with use strict;
our %Config = (
'SourcePath' => "",
'TargetPath' => "",
'Station' => "",
'Product' => "",
'LogLevel' => 0
);
When i tried to print a string with a hash variable in, it drops a warning too.
The code is:
print $fhw qq/ <FACTORY NAME="FLEX_ZALA" TESTER="$Config{'Station'}" FIXTURE="" USER="" LINE="" SHIFT="" \/>\n/;
The Station variable is not known for it.
I cannot develop on a production machine, but cannot install this old version on my office computer too.
How can i force to run my script with perl 5.24.1 in compatibily mode 5.0?
I using a windows 7 X64 PC for office.
Thanks.
UPD1:
The XP Perl version is:
Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001
Microsoft Corp.
C:\Documents and Settings\grprog1>perl -v
This is perl, version 5.003_07
Copyright 1987-1996, Larry Wall
+ suidperl security patch
Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
All rights reserved.
Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
Perl for Win32 Build 316 - Built 09:44:44 Mar 13 1998
Perl may be copied only under the terms of either the Artistic License
or the GNU General Public License, which may be found in the Perl 5.0
source kit.
UPD2:
C:\Documents and Settings\grprog1>perl -V Summary of my perl5 (patchlevel 1) configuration: Platform:
osname=MSWin32, osver=3.51, archname=i386-win32
uname=''
hint=recommended Compiler:
cc='cl', optimize=''
cppflags=''
ccflags =''
ldflags =''
stdchar='char', d_stdstdio=, usevfork=false
voidflags=15, castflags=0, d_casti32=, d_castneg=
intsize=4, alignbytes=4, usemymalloc=n, randbits=15 Libraries:
so=dll
libpth=
libs=
libc= Dynamic Linking:
dlsrc=dl_win32.xs, dlext=pll, d_dlsymun=
cccdlflags='', ccdlflags='', lddlflags=''
Characteristics of this binary (from libperl): Built under MSWin32 Compiled at Mar 13 1998 09:44:44 #INC:
C:\Teradyne\GRNavigate\228x\lib\perl
..\lib\i386-win32
..\lib
.
If I understand you correctly, you have Computer A which has perl 5.003_7. Therefore, copying that distribution from Computer A to Computer B where you want to do development is the most straightforward answer.
You say the testers also have this version of Perl. Therefore, your company must have bought either a site license or some specific number of licenses from ActiveState. You should investigate that first.
If you are stuck, contact ActiveState for support. They may provide you one for a fee.
Your company, however, faces the problem of having operations depend on ancient, no longer supported software to run programs which probably have problems of their own. It would be a good idea to move into this century.
If you absolutely must, no way around it, run ancient perl, your scripts cannot use more modern stuff.
Check out perlbrew to have more than one version of perl on your development/test box so you can test your code on several versions of perl with one command.
And perhaps also http://perldoc.perl.org/perl.html to see the docs of older perls.
It goes back only to 5.8.8 (~2005), but better than using docs for 5.24 in your situation.

Doxygen generated latex failing with pdflatex

I have generated latex with doxygen, then I run the make pdf command.
This is the first time I tried it.
[mysite.lan] (liberz) latex> make pdf
rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out *.brf *.blg *.bbl refman.pdf
pdflatex refman
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
restricted \write18 enabled.
kpathsea: Running mktexfmt pdflatex.fmt
/usr/bin/mktexfmt: line 395: /usr/share/texlive/texmf/texconfig/tcfmgr: No such file or directory
fmtutil: config file `fmtutil.cnf' not found.
I can't find the format file `pdflatex.fmt'!
make: *** [refman.pdf] Error 1
I looked at the mkexfmt command and it is trying to invoke tcfmgr as a command.
The /usr/share/texlive/texmf/texconfig folder exists, but there is no tcfmgr command in it.
Previously I was getting the pdflatex command was not found, so that is recently installed.
[edit to answer version information question] I am sure I need to install more tools, but it is not clear what packages I need to install. I am using CentOS 7.1.
> pdflatex -version
pdfTeX 3.1415926-2.5-1.40.14 (TeX Live 2013)
kpathsea version 6.1.1
Copyright 2013 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.5.13; using libpng 1.5.13
Compiled with zlib 1.2.7; using zlib 1.2.7
Compiled with poppler version 0.22.5
Doxygen PDF output depends on pdflatex command, which in CentOS 7 is provided by texlive-latex-bin-bin package, but runnig make pdf invokes yet another command, tcfmgr, which is provided by texlive-texconfig, hence, run the following command to install those dependencies:
yum install -y texlive-latex-bin-bin texlive-texconfig
You can check which packages provide any necessary file:
$ yum --quiet provides "*bin/pdflatex"
...
2:texlive-latex-bin-bin-svn14050.0-38.20130427_r30134.el7.noarch :
Binaries for latex-bin
Repo : base
Matched from:
Filename : /usr/bin/pdflatex
$ yum --quiet provides /usr/share/texlive/texmf/texconfig/tcfmgr
...
2:texlive-texconfig-svn29349.0-38.el7.noarch : texconfig package
Repo : base
Matched from:
Filename : /usr/share/texlive/texmf/texconfig/tcfmgr
But even with these 2 basic requirements satisfied, I found that many other messages followed, and the whole list to reduce warnings was:
xargs <<_EOF_ yum -y install
texlive-latex-bin-bin
texlive-texconfig
texlive-metafont-bin
texlive-iftex
texlive-cm
texlive-xtab
texlive-multirow
texlive-ec
texlive-sectsty
texlive-fancyhdr
texlive-natbib
texlive-tocloft
texlive-tex4ht
texlive-helvetic
texlive-pslatex
texlive-courier
texlive-times
texlive-metapost
texlive-symbol
texlive-rsfs
texlive-dvips
texlive-base
texlive-makeindex-bin
_EOF_
...
Transaction Summary
==============================================================================================================================
Install 23 Packages (+132 Dependent packages)
Total download size: 43 M
Installed size: 134 M
...
And yet Tex2PDF conversion produces many warnings, but the resulting document is quite satisfatory.
[Edited on Nov 8th]
If you want a "recommended" package installation, you might choose one of these "virtual" packages that require other sets of packages, to compose a more "complete" Latex environment, in order of higher comprehensiveness:
texlive-collection-latex : LaTeX fundamental packages
texlive-collection-latexrecommended : LaTeX recommended packages
texlive

ec2 server postgres error "version `GLIBC_2.14' not found"

While trying to \i create_db.sql psql throws the error:
psql:create_db.sql:123: ERROR: could not load library
"/usr/lib64/pgsql/plpgsql.so": /lib64/libc.so.6: version
`GLIBC_2.14' not found (required by /usr/lib64/pgsql/plpgsql.so)
Line 123 of create_db.sql is the last line of the file, at the end of a a function definition:
$$ language plpgsql;
Versions of stuff:
$ psql --version
psql (PostgreSQL) 9.2.7
$ /lib64/libc.so.6 --version
GNU C Library (GNU libc) stable release version 2.17, by Roland McGrath et al.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.8.2 20131212 (Red Hat 4.8.2-7).
Compiled on a Linux 3.2.5 system on 2014-06-09.
Available extensions:
The C stubs add-on version 2.1.2.
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
RT using linux kernel aio
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
Do I need to have glibc exactly version 2.14 or should 2.17 work too?
Your PostgreSQL install, or your OS install in general, is at least somewhat broken.
At a guess, you must've force-installed some RPM you found somewhere random instead of configuring repositories and using yum install to install PostgreSQL.
You don't need an exactly matching glibc version. It just has to declare that it's compatible with the required version by exposing a suitable GLIBC_ symbol .
e.g. on my Fedora 20, with glibc 2.18, I'd have no problems running programs compiled for glibc 2.14 because:
$ /lib64/libc.so.6 --version
GNU C Library (GNU libc) stable release version 2.18, by Roland McGrath et al.
$ nm /lib64/libc.so.6| grep GLIBC_2.14
0000000000000000 A GLIBC_2.14
my glibc declares that it's compatible with 2.14.

difference between qemu-kvm?

what is different between the following type i get qemu-kvm ? boths are use centos 6.4.
yum install qemu-kvm ,then show the version:
[root#centos6 qemu-kvm]# /usr/local/bin/qemu-system-x86_64 --version
QEMU emulator version 1.2.50 (qemu-kvm-devel), Copyright (c) 2003-2008 Fabrice Bellard
get the source code and build it by gcc.
[root#centos6 qemu-kvm]# /usr/libexec/qemu-kvm --version
QEMU PC emulator version 0.12.1 (qemu-kvm-0.12.1.2), Copyright (c) 2003-2008 Fabrice Bellard
Qemu uses 2 kinds of cpu virtualization, TCG (tiny code generator) and KVM. TCG emulates all instruction of guest code with plain c code, it translates guest code to host code in real-time. While KVM lets the host directly runs guest code, KVM requires the guest and the host to have the same instruction set (basically, the same cpu), not every cpu can do this, for intel cpus, it requires VMX feature. Which I assume you have understood these.
Qemu-kvm is obsolete, KVM comes with QEMU now if you download the latest code, you just have to compile it with "--enable-kvm" option. Your QEMU source code is very old, the latest version of QEMU is AFAIK, 1.7.
Your yum source provide 1.2.50 version of qemu. Try "yum install qemu", and try running with -enable-kvm if you don't want to build from source code (I haven't tried though)..
Qemu is Hypervisor.
KVM isn't. It is an accelerator(linux module which does the code translation fast) and used with Qemu, because Qemu when used with TCG is slow.