From 73b170367e46ca852ac1b39f08a82a1a80b2fb19 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 23 Oct 2014 16:17:45 +0100 Subject: [PATCH] GRIB-616: Python object file _gribapi_swig.so links to wrong library --- python/setup.py.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/setup.py.in b/python/setup.py.in index c485368f1..311461277 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -10,6 +10,7 @@ attdict = dict( library_dirs = ["%s/lib" % sys.prefix], libraries = [], extra_objects = [], + extra_link_args = [], # See GRIB-616 ) add_attribute = lambda **args: [list.append(attdict[key],value) for key,value in args.items()] @@ -27,7 +28,8 @@ if with_jasper: if jasper_dir and jasper_dir != 'system': add_attribute( include_dirs = os.path.join(jasper_dir,'include'), - library_dirs = os.path.join(jasper_dir,'lib') + library_dirs = os.path.join(jasper_dir,'lib'), + extra_link_args = '-Wl,-rpath,' + os.path.join(jasper_dir,'lib') ) add_attribute(libraries = 'jasper') @@ -37,7 +39,8 @@ if with_openjpeg: if openjpeg_dir and openjpeg_dir != 'system': add_attribute( include_dirs = os.path.join(openjpeg_dir,'include'), - library_dirs = os.path.join(openjpeg_dir,'lib') + library_dirs = os.path.join(openjpeg_dir,'lib'), + extra_link_args = '-Wl,-rpath,' + os.path.join(openjpeg_dir,'lib') ) add_attribute(libraries = 'openjpeg') @@ -53,7 +56,8 @@ if with_aec: if aec_dir and aec_dir != 'system': add_attribute( include_dirs = os.path.join(aec_dir,'include'), - library_dirs = os.path.join(aec_dir,'lib') + library_dirs = os.path.join(aec_dir,'lib'), + extra_link_args = '-Wl,-rpath,' + os.path.join(aec_dir,'lib') ) add_attribute(libraries = 'aec')