gcc unable to find shared library libisl.so - gcc

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

Related

gcc-11 from Homebrew Not Found by MacOS - installation and $PATH seem OK

I'm trying to compile a package called Kraken on my M1 Mac running Big Sur.
MacOS fails to compile: clang gets upset. I installed gcc from Homebrew (twice) and $ brew doctor says I'm ready to go.
My path is now:
/usr/local/opt/llvm/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin.
The gcc-11 etc files exist at /opt/homebrew/bin
But /usr/local/bin does not exist!
MacOS does not update the command alias for gcc:
$ rm gcc
then
$ ln -s /opt/homebrew/bin/gcc-11 gcc
return no error
but then
$ which gcc
returns
/usr/bin/gcc
I'm lost and gather this compiler-pointing has been a mess; is there any new insight here? I've seen a bunch of entries but nothing I've tried has worked.
Hoping this is a stupid newbie (me) problem, I thank you for any help you can give.
Michael
Homebrew avoids linking binaries with the same name as system binaries like gcc(appleclang). ln -s /opt/homebrew/bin/gcc-11 /opt/homebrew/bin/gcc or tell your configurator to explicitly use gcc-11 via CC= etc. and the same for g++-11 if C++ is used.
If it's a ./configure script, you can try calling CC=/opt/homebrew/bin/gcc-11 CXX=/opt/homebrew/bin/g++-11 ./configure
if cmake then use cmake .. -DCMAKE_C_COMPILER=/opt/homebrew/bin/gcc-11 -DCMAKE_CXX_COMPILER=/opt/homebrew/gcc++-11
Also, try seeing where the homebrew gcc link points ls -l /opt/homebrew/bin/gcc

How to Compile mingw-w64-crt

I'm on Windows 10 and using the latest version of MSYS2 (with gcc installed: pacman -S gcc)
I'm trying to compile mingw-w64-headers and mingw-w64-crt from mingw-w64-v7.0.0
Inside of my MSYS2 installation directory C:\msys2 I have created the folder mingw-w64 which I reference in the prefix argument below.
To compile each of these I use the same steps (replace name of library where appropriate):
mkdir mingw-w64-crt && cd mingw-w64-crt
../mingw-w64-v7.0.0/mingw-w64-crt/configure --prefix=/mingw-w64
make
make install
This works for mingw-w64-headers however for mingw-w64-crt I encounter errors at the make step. Specifically: incompatible types when assigning to type 'mbstate_t' {aka 'struct anonymous'} from type 'int'. A more detailed error image can be found here.
I would appreciate some guidance as to how to proceed.
I suggest that you just open one of MSYS2's MinGW environments (by running mingw32.exe or mingw64.exe) and then install the complete MinGW-w64 toolchain by running this:
pacman -S $MINGW_PACKAGE_PREFIX-toolchain
The toolchain includes GCC, the MinGW-w64 libraries, and the MinGW-w64 headers. If those prebuilt MinGW-w64 things are good enough for you, then you're done.
If you want to compile your own MinGW-w64, then should be able to use the environment you just installed to do it. To double-check that you are using the right toolchain, run which gcc and make sure it returns /mingw64/bin/gcc or /mingw32/bin/gcc.
Performing the following has allowed me to successfully compile:
pacman -S $MINGW_PACKAGE_PREFIX-toolchain
mkdir mingw-w64-crt && cd mingw-w64-crt
../mingw-w64-v7.0.0/mingw-w64-crt/configure --prefix=/mingw-w64 --with-sysroot=/mingw64
make -j %NUMBER_OF_PROCESSORS%
make install

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.

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

How to build libpcap source for static lib and headers only

I have source for libpcap and I want to build static lib and headers for my linux platform.
I tried with ./configure and make command but it is not generating lib and headers.
Anyone does know the configure cmd for doing this.
Thanks.
At least on Ubuntu 10.0.4.2 LTS, building the latest libpcap release produces both the shared and static libraries.
$ wget http://www.tcpdump.org/beta/libpcap-1.2.0rc1.tar.gz
$ tar xf libpcap-1.2.0rc1.tar.gz && cd libpcap-1.2.0rc1
$ ./configure && make
$ find -name "libpcap.so*" -o -name "libpcap.a"
./libpcap.a
./libpcap.so.1.2.0
Information about your specific build environment would be necessary to further answer the question, e.g. Linux distribution, version of libpcap.

Resources