Dear Dam,

On Wed, Apr 21, 2010 at 11:58 PM, Komath Damodaran <[email protected]> wrote:
> Hi,
> I am trying to compile RD kit on an enterprise-Linux machine.
> When I run make in the $RDBASE/build directory, I get the following error:
> -------------------
> [  3%] Building CXX object
> Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/RDBase.cpp.o
> Linking CXX shared module rdBase.so
> /usr/bin/ld: /usr/local/lib/python2.6/config/libpython2.6.a(boolobject.o):
> relocation R_X86_64_32 again
> st `a local symbol' can not be used when making a shared object; recompile
> with -fPIC
> /usr/local/lib/python2.6/config/libpython2.6.a: could not read symbols: Bad
> value
> collect2: ld returned 1 exit status
> make[2]: *** [Code/RDBoost/Wrap/rdBase.so] Error 1
> make[1]: *** [Code/RDBoost/Wrap/CMakeFiles/rdBase.dir/all] Error 2
> make: *** [all] Error 2
> ------------------------------------------

Ah, this is going to be a frequently asked question; I need to put
something about it in the wiki and build instructions.

>
> The error message suggests recompiling with -fPIC flag. But the file:
> $RDBASE/CMakeLists.txt has already -fPIC
> In the compilation flag:
>
> # setup our compiler flags:
> if(CMAKE_COMPILER_IS_GNUCXX)
> ADD_DEFINITIONS("-Wno-deprecated -Wno-unused-function -fno-strict-aliasing
> -fPIC")
> endif()
>
> If you know the solution, I'd highly appreciate that.

The error message is actually telling you that python needs to be
rebuilt, not the RDKit.

Based on my limited understanding of the situation (and I really hope
someone will correct me if I get this wrong), if you want to create a
64bit shared library that includes functionality from a static library
you need to be sure that the files that go into the static library
have been compiled with the -fPIC argument. This affects the RDKit
build because the python wrappers are shared libraries that link
against the static python library. So you need to build python with
-fPIC.

The recipe for this is to make sure that the EXTRA_CFLAGS environment
variable contains -fPIC when you build python. An easy way to do this
is building python like this;
EXTRA_CFLAGS="-fPIC" make

> BTW, for whatever reason, I also had to run the cmake command with python
> include libraries etc.
> in the command line for the compiler to work, in spite of these specified in
> my .cshrc.

I have always provided the cmake configuration variables at the
command line, I'm not sure if/how it's possible to cause cmake to pick
them up from the environment.

Best Regards,
-greg

------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to