numba: [FreeBSD] ImportError: /lib/libgcc_s.so.1

When running in ipython, starting with one of the numba examples:

from numba import jit

the following error shows up:

ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found

Restarting ipython, an running:

import numpy from numba import jit

Seems to fix the problem, and the example code executes correctly. I am assuming this is not an issue with Anaconda. However I am porting numba and llvmlite to Freebsd, and this seems to be an issue. Any help would be great!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Okay thanks! A manual fix for FreeBSD is for the user to map the libgcc_s.so.1 using the /etc/libmap.conf file as such: echo "libgcc_s.so.1 gcc48/libgcc_s.so.1" >> /etc/libmap.conf

However, this is only a manual/temporary fix. I checked numba’s .so’s using readelf -d /usr/local/lib/python2.7/site-packages/numba/**/*.so and got the following:

File: typeconv/_typeconv.so

Dynamic section at offset 0x3058 contains 27 entries: Tag Type Name/Value 0x0000000000000001 (NEEDED) Shared library: [libpython2.7.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc++.so.1] 0x0000000000000001 (NEEDED) Shared library: [libcxxrt.so.1] 0x0000000000000001 (NEEDED) Shared library: [libm.so.5] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED) Shared library: [libc.so.7] 0x000000000000001d (RUNPATH) Library runpath: [/usr/local/lib/gcc48] 0x000000000000000c (INIT) 0x12a8 0x000000000000000d (FINI) 0x26c8 0x0000000000000004 (HASH) 0x158 0x000000006ffffef5 (GNU_HASH) 0x2c0 0x0000000000000005 (STRTAB) 0x848 0x0000000000000006 (SYMTAB) 0x398 0x000000000000000a (STRSZ) 1302 (bytes) 0x000000000000000b (SYMENT) 24 (bytes) 0x0000000000000003 (PLTGOT) 0x203270 0x0000000000000002 (PLTRELSZ) 600 (bytes) 0x0000000000000014 (PLTREL) RELA 0x0000000000000017 (JMPREL) 0x1050 0x0000000000000007 (RELA) 0xe28 0x0000000000000008 (RELASZ) 552 (bytes) 0x0000000000000009 (RELAENT) 24 (bytes) 0x000000006ffffffe (VERNEED) 0xdc8 0x000000006fffffff (VERNEEDNUM) 3 0x000000006ffffff0 (VERSYM) 0xd5e 0x000000006ffffff9 (RELACOUNT) 17 0x0000000000000000 (NULL) 0x0

So _typeconv.so is using libgcc_s.so.1, although the rpath is set which is wierd.

Ah, I see some confusion has arisen due to me not being specific.

I am not using Anaconda, as I assumed it would be more challenging to port over. However I just installed llvmlite-0.12.1 from source using LLVM 3.7, and documentation says LLVM 3.8 for v0.12+, but the 0.12.1 branch clearly wants LLVM 3.7 due to build error indication. llvmlite installed just fine no hiccups, then moved onto numba-0.27.0, everything installed just fine, just using the base packages provided by the FreeBSD ports system.

Fast forward to a few days ago, I decided to make an installable port for the FreeBSD ports system which allows for use of the native package manager, due to Anaconda not being present. All available packages aside from llvmlite were in the ports tree. However the default version of python in the ports tree is Python 2.7, and most scientific packages work just fine this way. This allows a user to either use

$ cd /usr/ports/devel/py-numba $ make install

or pkg install py27-numba

to install numba on the system. Using numba however requires that the user input either

import scipy import numba

or

import numpy import numba

to use the features provided by numba, otherwise if you try to import numba first, you get:

[…] ImportError: /lib/libgcc_s.so.1: version GCC_4.6.0 required by /usr/local/lib/gcc48/libgfortran.so.3 not found

and all subsequent imports report the same error, unless you restart the interpreter.

Based on post by @stuartarchibald, it sounds like the conda environment pre-loads scipy in the environment when an interpreter is run? Correct me if I am wrong as I do not have Anaconda or use it.

Funny thing is last year it was a bit tricky to get numba working nicely on a Ubuntu system, however it installs quite effortlessly on FreeBSD. It is just odd that import numpy needs to be imported first, but everything works great, it just seems to me that numba requires numpy, or scipy, but doesn’t check if they are loaded upon loading itself.

Again, thanks for being patient with me on this, I appreciate all of the help.