Linux Mint build error


I’m trying to build panda3d 1.9.0 on Linux Mint using my Python-2.7.10 installation. I get the following error though when using: python makepanda/ --everything --installer

[ 3%] Building C++ object built/tmp/p3interrogatedb_composite2.o
[ 3%] Building C++ object built/tmp/p3dtoolconfig_dtoolconfig.o
[ 3%] Linking dynamic library built/lib/
[ 3%] Building C++ object built/tmp/dtoolconfig_pydtool.o
[ 4%] Linking dynamic library built/panda3d/
/usr/bin/ld: /home/michael/Python-2.7.10/lib/python2.7/config/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct’ can not be used when making a shared object; recompile with -fPIC
/home/michael/Python-2.7.10/lib/python2.7/config/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Storing dependency cache.
Elapsed Time: 1 min 15 sec
The following command returned a non-zero value: g++ -shared -Wl, -Wl,-rpath ‘-Wl,$ORIGIN’ -o built/panda3d/ -Lbuilt/lib -Lbuilt/tmp built/tmp/dtoolconfig_pydtool.o built/lib/ built/lib/ -pthread -L/home/michael/Python-2.7.10/lib/python2.7/config -L/usr/X11R6/lib -lpython2.7 -lpthread -ldl -lutil -lm -ldl
Build terminated.

Any help is appreciated.

Thanks a lot

You’re trying to link against a static build of Python. You should compile Python dynamically instead (so that you end up with, or, you should compile it with -fPIC flag.

Thanks for the info. That solved the issue. I saw the -fPIC part in the error message but didn’t know how to pass that flag to the Python configure script. When you said dynamic build, that was the hint I needed. I added the --enable-shared flag to the configure script and rebuilt. Now it seems to work.