# libgcc_s.so.1 incorrect for port



## David Kalliecharan (Jul 27, 2016)

Hello,

I am in the process of porting numba to FreeBSD, the submitted port PR 211347 has an outstanding issue. Documentation requires that a user should be able to type from a python interpreter:


```
import numba
```
However, this complains with /lib/libgcc_s.so.1 not using the gcc48 library. Instead the workaround is


```
import numpy
import numba
```
This is wrong as documentation doesn't require this. Another possible workaround is to set LD_LIBRARY_PATH=/usr/local/lib/gcc48, however I keep coming across that this is a big no no.

I am unsure of how to specify this in the port to ensure that the port points to the correct library.

Help in pointing this out has come from numba's Issue 2001

Any suggestions?


```
In [1]: import numba
---------------------------------------------------------------------------
ImportError  Traceback (most recent call last)
<ipython-input-1-6d1098de51de> in <module>()
----> 1 import numba

/usr/local/lib/python2.7/site-packages/numba/__init__.py in <module>()
  7 import sys
  8
----> 9 from . import config, errors, runtests, types
  10
  11 # Re-export typeof

/usr/local/lib/python2.7/site-packages/numba/types/__init__.py in <module>()
  3 import struct
  4
----> 5 import numpy as np
  6
  7 from .abstract import *

/usr/local/lib/python2.7/site-packages/numpy/__init__.py in <module>()
  178  return loader(*packages, **options)
  179
--> 180  from . import add_newdocs
  181  __all__ = ['add_newdocs',
  182  'ModuleDeprecationWarning',

/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py in <module>()
  11 from __future__ import division, absolute_import, print_function
  12
---> 13 from numpy.lib import add_newdoc
  14
  15 ###############################################################################

/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
  6 from numpy.version import version as __version__
  7
----> 8 from .type_check import *
  9 from .index_tricks import *
  10 from .function_base import *

/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py in <module>()
  9  'common_type']
  10
---> 11 import numpy.core.numeric as _nx
  12 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
  13  obj2sctype, zeros

/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py in <module>()
  12  os.environ[envkey] = '1'
  13  env_added.append(envkey)
---> 14 from . import multiarray
  15 for envkey in env_added:
  16  del os.environ[envkey]

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


----------



## cpm@ (Aug 23, 2016)

Please, read and follow the discussion:

https://lists.freebsd.org/pipermail/freebsd-ports/2016-August/104461.html


----------



## David Kalliecharan (Aug 23, 2016)

Thanks for this! I was a bit busy at work and haven't had time to look into this. I appreciate the help!


----------



## David Kalliecharan (Sep 4, 2016)

So it turns out numba was not the culprit for the libgcc_s.so.1 error. It was llvmlite, which is not correctly setting 

```
-shared -Wl,-rpath=/usr/local/lib/gcc48
```
 for the LDFLAGS set in Makefile.freebsd. I can hard code it but it isn't elegant, the only other place that seems to touch this is the variable LLVM_LDFLAGS, and is set by build.py.

Currently there is an issue posted by me for llvmlite:
https://github.com/numba/llvmlite/issues/202


----------

