/usr/bin/ld: cannot find -lauparse - gcc

How can I install the auparse library on Fedora 26?
$ gcc -lauparse me.c
/usr/bin/ld: cannot find -lauparse
I have tried many things, including these.
$ sudo find / -name *auparse.so
/usr/lib64/python3.6/site-packages/auparse.so
$ export LD_LIBRARY_PATH=/usr/lib64/python3.6/site-packages/
didnt help :{
sudo ln -s /usr/lib64/python3.6/site-packages/auparse.so /usr/lib/gcc/x86_64-redhat-linux/7/auparse.so
didnt help :{
$ pkg-config --libs auparse
Package auparse was not found in the pkg-config search path.
I'd really appreciate help.

You need audit-libs-devel. Here's how I found that:
$ sudo dnf install /usr/lib64/libauparse.so
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
audit-libs-devel x86_64 2.7.7-1.fc26 updates-testing 81 k
In general:
Libraries are gonna be in /usr/lib64 on x86_64 systems.
-lsomething means to look for /usr/lib64/libsomething.so
And DNF has this neat feature where it can find things by file, so there you go.
Also, for most libraries on Fedora, there's a runtime package (here, audit-libs and then a devel package (audit-libs-devel) which contains the .so symlink and usually header files and stuff.

Related

How can I let Graph-tool find boost libraries and install it?

I am trying to install Graph-tool, but the following error is returned.
./cofigure
...
...
graph-tool will be installed at: /home/my_name/anaconda2/lib/python2.7/site-packages
===========================
Using python version: 2.7.12
===========================
checking for boostlib >= 1.54.0... configure: We could not detect the boost libraries (version 1.54 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
checking whether the Boost::Python library is available... yes
checking whether boost_python is the correct library... yes
checking whether the Boost::IOStreams library is available... yes
configure: error: Could not link against boost_python !
It seems this error is same as
Installing Thrift on CentOS: can't find Boost 1.40 or higher
. So I guess I should make an appropriate symbolic link to let the configure file find the path to the boost libraries. But I'm not sure where I should make the link because the result of "find" command is different from the asker of the above-mentioned question.
[root#localhost my_name]# su
[root#localhost my_name]# find / -name boost
/home/my_name/python/graph-tool-2.19/src/boost-workaround/boost
/home/my_name/boost_1_63_0/doc/html/boost
/home/my_name/boost_1_63_0/doc/test/gold/boost
/home/my_name/boost_1_63_0/tools/boostbook/test/doxygen/boost
/home/my_name/boost_1_63_0/boost
/home/my_name/boost_1_63_0/boost/chrono/typeof/boost
/home/my_name/boost_1_63_0/boost/hana/ext/boost
/home/my_name/boost_1_63_0/libs/sort/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/sort/doc/html/boost
/home/my_name/boost_1_63_0/libs/chrono/stopwatches/include/boost
/home/my_name/boost_1_63_0/libs/hana/example/ext/boost
/home/my_name/boost_1_63_0/libs/hana/test/ext/boost
/home/my_name/boost_1_63_0/libs/vmd/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/convert/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/convert/doc/html/boost
/home/my_name/boost_1_63_0/libs/functional/overloaded_function/doc/html/boost
/home/my_name/boost_1_63_0/libs/math/include_private/boost
/home/my_name/boost_1_63_0/libs/compute/doc/html/boost
/home/my_name/boost_1_63_0/libs/pool/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/pool/doc/html/boost
/home/my_name/boost_1_63_0/libs/log/doc/html/boost
/home/my_name/boost_1_63_0/libs/tti/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/tti/doc/html/boost
/home/my_name/boost_1_63_0/libs/icl/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/icl/doc/html/boost
/home/my_name/boost_1_63_0/libs/numeric/odeint/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/numeric/odeint/doc/html/boost
/home/my_name/boost_1_63_0/libs/core/doc/html/boost
/home/my_name/boost_1_63_0/libs/test/doc/html/header/boost
/home/my_name/boost_1_63_0/libs/test/doc/html/boost
/usr/local/cuda-8.0/samples/6_Advanced/interval/boost
/usr/include/boost
Does anybody know how to solve this problem ? Thank you very much in advance.
After posting this question, I managed to solve this problem by my self.
It seems the error occurred because the Boost was actually not installed properly.
This time, I did:
$ cd /usr/local
$ tar --bzip2 -xf boost_1_63_0.tar.bz2
$ cd boost_1_63_0.tar.bz2
$ sh ./bootstrap.sh
$ sudo ./b2 install
Then, I found the following directories.
$ sudo find / -name boost
/home/tokudakeita/python/graph-tool-2.19/src/boost-workaround/boost
/usr/local/boost_1_63_0/doc/html/boost
/usr/local/boost_1_63_0/doc/test/gold/boost
/usr/local/boost_1_63_0/tools/boostbook/test/doxygen/boost
/usr/local/boost_1_63_0/boost
/usr/local/boost_1_63_0/boost/chrono/typeof/boost
/usr/local/boost_1_63_0/boost/hana/ext/boost
/usr/local/boost_1_63_0/libs/sort/doc/html/header/boost
/usr/local/boost_1_63_0/libs/sort/doc/html/boost
/usr/local/boost_1_63_0/libs/chrono/stopwatches/include/boost
/usr/local/boost_1_63_0/libs/hana/example/ext/boost
/usr/local/boost_1_63_0/libs/hana/test/ext/boost
/usr/local/boost_1_63_0/libs/vmd/doc/html/header/boost
/usr/local/boost_1_63_0/libs/convert/doc/html/header/boost
/usr/local/boost_1_63_0/libs/convert/doc/html/boost
/usr/local/boost_1_63_0/libs/functional/overloaded_function/doc/html/boost
/usr/local/boost_1_63_0/libs/math/include_private/boost
/usr/local/boost_1_63_0/libs/compute/doc/html/boost
/usr/local/boost_1_63_0/libs/pool/doc/html/header/boost
/usr/local/boost_1_63_0/libs/pool/doc/html/boost
/usr/local/boost_1_63_0/libs/log/doc/html/boost
/usr/local/boost_1_63_0/libs/tti/doc/html/header/boost
/usr/local/boost_1_63_0/libs/tti/doc/html/boost
/usr/local/boost_1_63_0/libs/icl/doc/html/header/boost
/usr/local/boost_1_63_0/libs/icl/doc/html/boost
/usr/local/boost_1_63_0/libs/numeric/odeint/doc/html/header/boost
/usr/local/boost_1_63_0/libs/numeric/odeint/doc/html/boost
/usr/local/boost_1_63_0/libs/core/doc/html/boost
/usr/local/boost_1_63_0/libs/test/doc/html/header/boost
/usr/local/boost_1_63_0/libs/test/doc/html/boost
/usr/local/cuda-8.0/samples/6_Advanced/interval/boost
/usr/local/include/boost
/usr/local/include/boost/chrono/typeof/boost
/usr/local/include/boost/hana/ext/boost
What I found was that just
$ ./b2
does not create the following directories:
/usr/local/include/boost
/usr/local/include/boost/chrono/typeof/boost
/usr/local/include/boost/hana/ext/boost
But the following command made the above directories:
$ sudo ./b2 install
Then, the configure file of the Graph-tool successfully found boost.

gcc unable to find shared library libisl.so

I installed gcc version 5.1 locally on a cluster having OS as CentOS where I dont have root access (so i cant use any commands like 'sudo'). (The global gcc version installed is 4.4). I also modified the path variable to include the path to my local version at the beginning of the path variable. Before, when I was trying to install boost using the global version, it worked fine. But now, when I try to install boost, it shows the following error:
/users/home/head/cmp/soft/sft/gcc/bin/../libexec/gcc/x86_64-unknown-linux-gnu/5.1.0/cc1: error while loading shared libraries: libisl.so.10: cannot open shared object file: No such file or directory
Any ideas on how to fix this will be highly appreciated.
Follow the instructions at https://gcc.gnu.org/wiki/InstallingGCC
Specifically, don't install ISL manually in some non-standard path, because GCC needs to find its shared libraries at run-time.
The simplest solution is to use the download_prerequisites script to add the GMP, MPFR, MPC and ISL source code to the GCC source tree, which will cause GCC to build them for you automatically, and link to them statically.
I have the same issue. I solved it as follows:
Download the source code of isl available here
Unzip and install: ./configure && make && make install
cp /usr/local/lib/libisl* /usr/lib
Note: a symlink also works:
$ cd /usr/lib
$ ln -s /usr/local/lib/libisl.so.10 libisl.so.10
You can do the same in Debian distros:
apt-get install libisl-dev
Adjust the references of shared libs:
$ cp /usr/local/lib/libisl* /usr/lib
Note: a symlink also works:
$ cd /usr/lib
$ ln -s /usr/local/lib/libisl.so.10 libisl.so.10

Compiling gcc-4.1

Unfortunately I'm forced to use gcc-4.1 and I'm using debian wheezy. Since gcc-4.1 is not in repository I'm trying to build gcc from sources.
But I'm getting compiling error:
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libc.a when searching for -lc
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crti.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/lib/x86_64-linux-gnu/crtn.o' is incompatible with i386 output
It looks that ld is picking wrong version of libraries, but I checked my /usr/lib32 and /usr/lib/x86_64-linux-gnu/ and it contains those files:
/usr/lib32/libc.a
/usr/lib32/libc.so
/usr/lib32/crtn.o
/usr/lib32/crti.o
/usr/lib/x86_64-linux-gnu/libc.a
/usr/lib/x86_64-linux-gnu/libc.so
/usr/lib/x86_64-linux-gnu/crtn.o
/usr/lib/x86_64-linux-gnu/crti.o
And ld should have access to them
~$ echo $LIBRARY_PATH
/usr/lib/x86_64-linux-gnu:/usr/lib32/
So I have no idea where the problem is.
I managed to work around the problem.
Run configure with:
./configure --disable-multilib ...
But than I encountered another problem with makeinfo, if you have newer version >=4.10 than it might not be found by configure. So simple fix in generated makefile worked for me:
Change this line:
MAKEINFO = /home/lecopivo/Downloads/gcc412/gcc412/gcc-4.1.2/missing makeinfo
To this:
MAKEINFO = makeinfo
I found this helpful.
LD_LIBRARY_PATH is only for running programs already linked.
You probably need to set LDFLAGS when you configure gcc:
./configure LDFLAGS="-L/usr/lib32" .....
It might be LDFLAGS_FOR_HOST or LIBS or something like that though.
I had this problem recently and finally solved it this way:
ln -s /usr/lib32 /usr/lib/i386-linux-gnu
Notes:
I assumed you do not have /usr/lib/i386-linux-gnu directory in your 64bit linux. If this directory exists and is empty, please delete it and make the above link.
If the directory already exists and is not empty, you have to make links inside it for (32bit) libraries which cause build error one by one; e.g.:
ln -s /usr/lib32/crti.o /usr/lib/i386-linux-gnu/crti.o
ln -s /usr/lib32/crtn.o /usr/lib/i386-linux-gnu/crtn.o
...
If 32bit development libraries are not installed, you may have to install them first. I've searched different forums and found that installing following set of packages in ubuntu will provide them:
libc6-dev libc6-dev-i386
gcc-multilib g++-multilib
zlib1g-dev lib32z1-dev
libncurses5-dev lib32ncurses5-dev libncursesw5-dev lib32ncursesw5-dev
Also adjust LD_LIBRARY_PATH and LIBRARY_PATH variables so that they contain /usr/lib/i386-linux-gnu and /usr/lib/x86_64-linux-gnu (i.e. multiarch lib-dirs). I am not sure which one of above variables is effective, so I adjust both of them the same.
If you use ./configure --disable-multilib as it is frequently suggested on web, though gcc will be built, but when you want to use that gcc for compiling e.g. legacy grub, you probably get error of "gcc cannot build executable" (or such).
Optionally, you can make similar linking for these pair of libdirs:
ln -s /lib32 /lib/i386-linux-gnu
Doing so, I managed to compile gcc-3.4.6 in a Ubuntu 16.04.6-amd64 used for compiling old 32bit programs like SDL 1.2 and legacy GRUB4DOS 0.4.4.
Also take a look at my answer to similar (though opposite) error here.
Good luck.

configure: error: leptonica library missing (when building tesseract-ocr-3.01 on MinGW)

When running configure it fails with
checking for leptonica... yes
checking for pixCreate in -llept... no
configure: error: leptonica library missing
But I have leptonica 1.69 built (downloaded source and ran ./configure && make install)
Edit
I think configure: error: leptonica library missing is a bit misleading, please note that it first says checking for leptonica... yes, and then fails on checking for pixCreate in -llept... no. So maybe the problem is not that the library is missing, but something else.
I finally managed to make it compile, after reading this and this thread. The proper steps for were:
./autogen.sh
export LIBLEPT_HEADERSDIR=/local/include
./configure --with-extra-libraries=/local/lib
make install
for leptonica 1.69, lib renamed to .libs, so, parameters are
export LIBLEPT_HEADERSDIR=<your_path>/leptonica-1.69/src
./autogen.sh
./configure --prefix= --with-extra-libraries=<your_path>/leptonica-1.69/src/.libs
and so on
Maybe this could solve the issue:
export LIBLEPT_HEADERSDIR=/usr-or-other/local/include
I am working on redhat linux 7.2 . None of the solution worked for me I was getting following errors in config.log. Package lept was not found in the pkg-config search path.
Perhaps you should add the directory containing `lept.pc'
to the PKG_CONFIG_PATH environment variable PKG_CONFIG_PATH
configure script uses pkg-config utility to check for packages . It was not able to find lept package ( although i had installed leptonica seperately ) By setting PKG_CONFIG_PATH pointing to the directory where lept.pc is present , i was able to resolve the issue . export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
The FAQ addresses this issue and worked for me with tesseract 3.02.02 on Mac OSX 10.6.8.
Apart from the Leptonica library, png, jpeg, tiff libraries had to passed to the configure script with CXX and CPP flags.
To run configure as non-root -
1. LIBLEPT_HEADERSDIR=; export LIBLEPT_HEADERSDIR;
2. CXXFLAGS="-ltiff -lpng -ljpeg" CPPFLAGS="-ltiff -lpng -ljpeg" ./configure --prefix= --with-extra-libraries=
In my case, this issue was caused by a missing compiler. Searching config.log revealed the following:
./configure:17287: g++ -o conftest -I/Usr/local/include/leptonica -L/usr/local/lib conftest.cpp -llept >&5
./configure: line 2040: g++ command not found
Running apt-get install g++ solved the problem. There is an issue in the tesseract issue tracker about this.
In my case (for Ubuntu/Debian) I downloaded the latest leptonica version and the error was not fixed.
To fix it I removed the package "leptonica-dev" with sudo apt-get remove libleptonica-dev and then tesseract found the leptonica version installed from the source code.
Hope it helps!
The answer is going to be slightly different for everyone, depending on the state of your system.
At a high level, the pkg-config software needs to know that leptonica is installed. It searches paths for a .pc file that has the definition for the leptonica package. That file will be in different locations for different people.
You can find it using the Linux locate utility at the command line. locate lept.pc. (If you've done some recent installing/uninstalling, you may need to refresh the locate utilities database with the command updatedb.)
Whichever directory locate finds the file in, export PKG_CONFIG_PATH as that directory (export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig for example).
Then you can continue your configure/build.
i had a similar problem with trying to compile from source, but did not experience it with
apt-get to install tesseract
sudo apt-get install tesseract-ocr
export LIBLEPT_HEADERSDIR=$dir/letonica168/include
./autogen.sh
./configure --prefix=$anotherdir --with-extra-libraries=/$dir/letonica168/lib
make
make install

changing search-dirs for $ sudo gcc

On OS X I'm trying to install the zlib prerequisite for haskell's Cabal. I get this error:
$ sudo ./Setup build
Preprocessing library zlib-0.5.0.0…
ld: library not found for -lgmp
collect2: ld returned 1 exit status
linking dist/build/Codec/Compression/Zlib/Stream_hsc_make.o failed
command was: /usr/bin/gcc -lz -L/sw/lib/ghc-6.8.3/lib/bytestring-0.9.0.1.1 -L/sw/lib/ghc-6.8.3/lib/array-0.1.0.0 -L/sw/lib/ghc-6.8.3/lib/base-3.0.2.0 -L/sw/lib/ghc-6.8.3 -lm -lgmp -ldl dist/build/Codec/Compression/Zlib/Stream_hsc_make.o -o dist/build/Codec/Compression/Zlib/Stream_hsc_make
The library -lgmp is found in /sw/lib, so I can run that command ("/usr/bin/gcc ...") successfully if I manually add -L/sw/lib. The problem is that sudo doesn't know about /sw/lib. Behold:
$ gcc -print-search-dirs | grep sw
libraries: =/lib/i686-apple-darwin9/4.0.1/:/lib/:/usr/lib/i686-apple-darwin9/4.0.1/:/usr/lib/:./i686-apple-darwin9/4.0.1/:./:/sw/lib/i686-apple-darwin9/4.0.1/:/sw/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../../i686-apple-darwin9/lib/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../i686-apple-darwin9/4.0.1/:/usr/lib/gcc/i686-apple-darwin9/4.0.1/../../../
$ sudo gcc -print-search-dirs | grep sw
$
How do I tell the sudo version of gcc to look in /sw/lib for libraries? Do I add an environment variable on root's .bash_profile? If so, which one?
UPDATE:
There’s probably a more proper way to do this, but here’s what worked. I created a bash script with this in it:
#!/bin/sh
export LIBRARY_PATH=/sw/lib:$LIBRARY_PATH
./Setup build
And then I ran
$ sudo ./script.sh
That compiled zlib without complaining - hooray! Unfortunately cabal-install is still giving me the error:
$ ./Setup configure
Configuring cabal-install-0.6.2…
Setup: At least the following dependencies are missing:
zlib >=0.4 && <0.6
So I went back to the cabal-install dir (which is what I'm trying to do in the first place), and ran...
$ ./bootstrap.sh
...and that installed everything as expected.
Why you use sudo ever? You should not compile as super user. Compile as normal user and install as super user.
Try setting LDFLAGS=-L/sw/lib.
GHC now comes with an installer for OS X (Leopard, not sure about Tiger). The only issue is that if you use macports or fink, these will probably not see that you have GHC installed and try to install their own version of it.

Resources