8

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.

fuz
  • 88,405
  • 25
  • 200
  • 352
Python_user
  • 1,378
  • 3
  • 12
  • 25
  • What OS are you using ? if Ubuntu (or its family) try this `sudo sudo apt-get install libisl-dev` – Michi Nov 16 '15 at 11:34
  • 1
    @Michi I am using CentOS.. and I do not have root access, so I cant use sudo... – Python_user Nov 16 '15 at 11:35
  • Can you run this `ls -al /usr/lib/libisl.so*` ? – Michi Nov 16 '15 at 11:36
  • @Michi It shows `ls: cannot access /usr/lib/libisl.so: No such file or directory`.. – Python_user Nov 16 '15 at 11:37
  • what happens if you try to compile with default `GCC` ? `gcc program.c -o program` ? – Michi Nov 16 '15 at 11:39
  • @Michi with default gcc it works, but with the local one, I get the same error... – Python_user Nov 16 '15 at 11:41
  • Your gcc installation is broken -- gcc requires ISL. See the [prerequisites page](https://gcc.gnu.org/install/prerequisites.html) for what is required. – David Schwartz Nov 16 '15 at 11:42
  • try `find /users/home/head/cmp/soft/sft/gcc -name 'libisl.so.10'` and adding the directory it resides in to LD_LIBRARY PATH. – decltype_auto Nov 16 '15 at 11:43
  • @Python_user Please try to recompile GCC using this [Method](http://stackoverflow.com/questions/32771977/error-building-and-compiling-gcc-5-2-0-from-scratch-on-vortex86dx/32792077#32792077). – Michi Nov 16 '15 at 11:43
  • @davmac I am using the command ./bootstrap.sh of the boost installation – Python_user Nov 16 '15 at 11:44
  • @decltype_auto It shows blank! – Python_user Nov 16 '15 at 11:45
  • Then ceteris paribus I'd second David Schwartz' hypothesis about a broken gcc install. – decltype_auto Nov 16 '15 at 11:47
  • @decltype_auto But the installation proceeded without any issue! No complains at all! – Python_user Nov 16 '15 at 12:04
  • How did you install *gcc-5.1*, did you compile it from source or did you use `rpm -i` and ignored dependencies? – Iharob Al Asimi Nov 16 '15 at 12:06
  • @iharob I modified the path variable to include the location of my local gcc at the start.. I followed the tutorial: http://stackoverflow.com/questions/9450394/how-to-install-gcc-from-scratch-with-gmp-mpfr-mpc-elf-without-shared-librari (the answer by user adobe) – Python_user Nov 16 '15 at 12:08
  • @iharob but i used the --enable-shared options for the dependancies. – Python_user Nov 16 '15 at 12:11
  • @Python_user I'd doubt that. Better grep your install log for libisl. – decltype_auto Nov 16 '15 at 12:16
  • @decltype_auto At the end of the installation, I found the exectables 'gcc' in the bin folder... Is it sufficient for proper installation? Btw, I am retrying the installation.... so my logfile has changed... Moreover, there was a statement by configure "checking for system-wide compatible ISL: yes"... Is this statement sufficient enough to guarantee proper installation? But for some reasons, now the installation is failing.. :( – Python_user Nov 16 '15 at 12:20
  • @Python_user it seems that you are not doing it right! Did you compile *gcc* from source?, and `--enable-shared` is not for dependencies. It's to compile shared libraries like `libstdc++.so` and other libraries that come with *gcc*. – Iharob Al Asimi Nov 16 '15 at 12:23
  • @Python_user: well - apparently it is not, or is it. – decltype_auto Nov 16 '15 at 12:24
  • @decltype_auto Now, the error is `configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[2]: *** [configure-stage1-target-libgcc] Error 1 make[2]: Leaving directory `/users/home/hranjan/cmp/soft/sft/tar_files_extracted/gcc-5.1.0/build' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/users/home/hranjan/cmp/soft/sft/tar_files_extracted/gcc-5.1.0/build' make: *** [bootstrap] Error 2 ` – Python_user Nov 16 '15 at 12:24
  • @iharob I compiled it from source using the tutorial mentioned in the link... – Python_user Nov 16 '15 at 12:25
  • You broke you *gcc*, did you change your `PATH` variable? Are you using also `LD_LIBRARY_PATH` to ensure that `ld.so` can find the libraries? And again, why do you need *gcc-5.1*? – Iharob Al Asimi Nov 16 '15 at 12:25
  • @iharob yes, i changed my path variable.. and my original gcc is still intact.. when i remove the path to my local gcc from the path variable, i am able to compile my c and c++ programs as usual... I need gcc for a project of mine where i use the command option '--std=c++11'... – Python_user Nov 16 '15 at 12:26
  • And that's also why `./configure` is not working! You need to set `LD_LIBRARY_PATH` then to where `libisl.so` is located too. Just like you did with your `PATH` variable. – Iharob Al Asimi Nov 16 '15 at 12:28
  • @iharob I used the `LD_LIBRARY_PATH` mentioned in the answer by user adobe in http://stackoverflow.com/questions/9450394/how-to-install-gcc-from-scratch-with-gmp-mpfr-mpc-elf-without-shared-librari ... SHould I include the path to libisl in it too? Moreover, my configure is working... the make command is failing.. :( – Python_user Nov 16 '15 at 12:30
  • Did you install *isl* yourself? And if you did, well yes you should. – Iharob Al Asimi Nov 16 '15 at 12:32
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/95233/discussion-between-python-user-and-iharob). – Python_user Nov 16 '15 at 12:33
  • Why is everyone using adobe's answer at that other question? **IT IS NOT THE RIGHT WAY!** It causes exactly this kind of problem. Ignore that answer and follow my answer there, http://stackoverflow.com/a/10662297/981959 – Jonathan Wakely Nov 16 '15 at 13:06

2 Answers2

5

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.

Jonathan Wakely
  • 166,810
  • 27
  • 341
  • 521
  • i am unable to use ftp at the cluster-node on which i am working... so the ./contrib/download_prerequisites is not working... how can i get a workaround this? – Python_user Nov 16 '15 at 13:20
  • more specifically, i am getting the following error: `--2015-11-16 18:49:34-- ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-2.4.2.tar.bz2 (try: 3) => mpfr-2.4.2.tar.bz2' Connecting to gcc.gnu.org|209.132.180.131|:21... failed: Connection timed out. Retrying.` – Python_user Nov 16 '15 at 13:27
  • Look in the script, it's not complicated. Find the URLs, download the packages manually, unpack them in the GCC source tree and create the symlinks that the script would have created. – Jonathan Wakely Nov 16 '15 at 14:58
  • using this script is definitely simpler for a newcomer! – Python_user Nov 16 '15 at 17:01
  • 2
    I don't know why people insist on doing it the hard way, when that is harder to do and harder to use the resulting compiler! :-) – Jonathan Wakely Nov 16 '15 at 17:53
3

I have the same issue. I solved it as follows:

  1. Download the source code of isl available here

  2. Unzip and install: ./configure && make && make install

  3. 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

  4. You can do the same in Debian distros:

    apt-get install libisl-dev

  5. 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

JJJ
  • 1,009
  • 6
  • 19
  • 31