Bug report: Symbol not found: ___gmpf_add

Yves-Laurent KOM SAMO yves-laurent.komsamo at eng.ox.ac.uk
Thu Jan 16 15:55:10 UTC 2014


Dear Sir/Madam,

I would like to report the following bug I encounter in a Python C 
extension I am writing.

* Platform: Mac OS 10.9.1, Processor  2.9 GHz Intel Core i7
* GMP version: gmp-4.3.2 packaged in GCC (checkout using /svn checkout 
svn://gcc.gnu.org/svn/gcc/trunk/)
* Source code: downloaded in a /gcc-source/ directory, and built in a 
/gcc-build neighbor/ directory as per the install instructions. The 
process ran smoothly and the build was successful.
* My C file (kernelgp.c) is in folder /kernelgp/. kernelgp, /gcc-build/ 
and /gcc-source/ are in the same parent directory.
* C include instruction: /#include "../gcc-build/gmp/gmp.h"/
* GCC build command (using Python distutils):

/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch 
x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c 
kernelgp.c -o build/temp.macosx-10.6-intel-2.7/kernelgp.o -lgmp/

and then

/gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g 
build/temp.macosx-10.6-intel-2.7/kernelgp.o -o 
build/lib.macosx-10.6-intel-2.7/kernelgp.so -lgmp/

(I've pasted the output of the compiler below in green).

* Problem: GCC does link the libgmp to my extension and when I import 
kernelgp in Python, it complains that it cannot find '___gmpf_add'. Full 
message below in blue.
/>>> import kernelgp//
//Traceback (most recent call last)://
//  File "<stdin>", line 1, in <module>//
//ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kernelgp.so, 
2): Symbol not found: ___gmpf_add//
//  Referenced from: 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kernelgp.so//
//  Expected in: flat namespace//
// in 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kernelgp.so/

Could you please help me with this?

Regards,
Yves-Laurent

Full GCC output.
/Yves-Laurents-MacBook-Pro:kernelgp yves-laurent$ sudo python setup.py 
install
running install
running build
running build_ext
building 'kernelgp' extension
creating build/temp.macosx-10.6-intel-2.7
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch 
x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes 
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c 
kernelgp.c -o build/temp.macosx-10.6-intel-2.7/kernelgp.o -lgmp
In file included from kernelgp.c:3:
../CLAPACK-3.2.1/INCLUDE/f2c.h:183: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:184: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:185: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:186: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:187: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:187: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:188: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:189: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:190: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:191: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:192: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:193: warning: function declaration isn't 
a prototype
In file included from kernelgp.c:5:
../CLAPACK-3.2.1/INCLUDE/clapack.h:7213: warning: function declaration 
isn't a prototype
../CLAPACK-3.2.1/INCLUDE/clapack.h:7220: warning: function declaration 
isn't a prototype
kernelgp.c: In function 'kernelgp_covariance_cholesky':
kernelgp.c:409: warning: passing argument 3 of 'dpotrf_' from 
incompatible pointer type
kernelgp.c:445: warning: passing argument 3 of 'dpotri_' from 
incompatible pointer type
i686-apple-darwin11-gcc-4.2.1: -lgmp: linker input file unused because 
linking not done
In file included from kernelgp.c:3:
../CLAPACK-3.2.1/INCLUDE/f2c.h:183: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:184: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:185: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:186: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:187: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:187: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:188: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:189: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:190: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:191: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:192: warning: function declaration isn't 
a prototype
../CLAPACK-3.2.1/INCLUDE/f2c.h:193: warning: function declaration isn't 
a prototype
In file included from kernelgp.c:5:
../CLAPACK-3.2.1/INCLUDE/clapack.h:7213: warning: function declaration 
isn't a prototype
../CLAPACK-3.2.1/INCLUDE/clapack.h:7220: warning: function declaration 
isn't a prototype
kernelgp.c: In function 'kernelgp_covariance_cholesky':
kernelgp.c:409: warning: passing argument 3 of 'dpotrf_' from 
incompatible pointer type
kernelgp.c:445: warning: passing argument 3 of 'dpotri_' from 
incompatible pointer type
i686-apple-darwin11-gcc-4.2.1: -lgmp: linker input file unused because 
linking not done
creating build/lib.macosx-10.6-intel-2.7
gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g 
build/temp.macosx-10.6-intel-2.7/kernelgp.o -o 
build/lib.macosx-10.6-intel-2.7/kernelgp.so -lgmp
ld: warning: ignoring file /usr/local/lib/libgmp.dylib, missing required 
architecture x86_64 in file /usr/local/lib/libgmp.dylib (1 slices)
running install_lib
copying build/lib.macosx-10.6-intel-2.7/kernelgp.so -> 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
running install_egg_info
Writing 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kernelgp-1.0-py2.7.egg-info/





More information about the gmp-bugs mailing list