Skip to content

Commit

Permalink
python-3.7.6: Add LD_LIBRARY_PATH
Browse files Browse the repository at this point in the history
We are going to install Tensorflow into this package.

Tensorflow loads implementation libraries at runtime which need to be
found. Add LD_LIBRARY_PATH to avoid runtime errors like

    Traceback (most recent call last):
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow.py", line 58, in <module>
        from tensorflow.python.pywrap_tensorflow_internal import *
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow_internal.py", line 28, in <module>
        _pywrap_tensorflow_internal = swig_import_helper()
      File "/dev/shm/python-3.7.6-0/lib/python3.7/site-packages/tensorflow-2.1.0-py3.7-linux-x86_64.egg/tensorflow_core/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
        _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
      File "/dev/shm/python-3.7.6-0/lib/python3.7/imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "/dev/shm/python-3.7.6-0/lib/python3.7/imp.py", line 342, in load_dynamic
        return _load(spec)
    ImportError: libnccl.so.2: cannot open shared object file: No such file or directory
  • Loading branch information
david authored and donald committed Mar 29, 2020
1 parent 7ccba0b commit 44d3f2f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python-3.7.6-0.build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
. $CUDADIR/profile
PATH=$PREFIX/bin:\$PATH
export LD_LIBRARY_PATH=$PREFIX/lib\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\${PKG_CONFIG_PATH:+:\$PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi
Expand Down

0 comments on commit 44d3f2f

Please sign in to comment.