[gmx-users] cmake --> relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object;

chris.neale at utoronto.ca chris.neale at utoronto.ca
Tue Dec 21 02:20:09 CET 2010


Thank you Roland.

The static build of gromacs worked:

$ cmake ../ -DFFTW3F_INCLUDE_DIR=$FFTW_LOCATION/include  
-DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f.a  
-DCMAKE_INSTALL_PREFIX=$(pwd) -DGMX_X11=OFF  
-DCMAKE_CXX_COMPILER=/scinet/gpc/intel/Compiler/11.1/072/bin/intel64/icpc  
-DCMAKE_C_COMPILER=/scinet/gpc/intel/Compiler/11.1/072/bin/intel64/icc  
-DGMX_PREFER_STATIC_LIBS=ON
$ make
$ make install

Just for completeness, I could not get fftw to compile with  
--enable-shared (although I don't need to any more):

$ ./configure --enable-float --enable-threads --enable-shared  
--prefix=/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2/exec
$ make

.. <snip> ...
rm -fr  .libs/libfftw3f.a .libs/libfftw3f.la .libs/libfftw3f.lai
icc -c99 -shared  -Wl,--whole-archive kernel/.libs/libkernel.a  
dft/.libs/libdft.a dft/codelets/.libs/libdft_codelets.a  
dft/codelets/standard/.libs/libdft_standard.a rdft/.libs/librdft.a  
rdft/codelets/.libs/librdft_codelets.a  
rdft/codelets/r2hc/.libs/librdft_codelets_r2hc.a  
rdft/codelets/hc2r/.libs/librdft_codelets_hc2r.a  
rdft/codelets/r2r/.libs/librdft_codelets_r2r.a  
reodft/.libs/libreodft.a api/.libs/libapi.a -Wl,--no-whole-archive   
-L/scratch/cneale/GPC/exe/intel/fftw-3.1.2/exec/lib -lm  -pthread  
-Wl,-soname -Wl,libfftw3f.so.3 -o .libs/libfftw3f.so.3.1.2
icc: command line remark #10010: option '-c99' is deprecated and will  
be removed in a future release. See '-help deprecated'
ld: kernel/.libs/libkernel.a(alloc.o): relocation R_X86_64_32 against  
`a local symbol' can not be used when making a shared object;  
recompile with -fPIC
kernel/.libs/libkernel.a(alloc.o): could not read symbols: Bad value
make[2]: *** [libfftw3f.la] Error 1
make[2]: Leaving directory  
`/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory  
`/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again'
make: *** [all] Error 2

It will be nice to see some example build instructions on the gromacs  
site as people have time to add them.

Chris.

> From: Roland Schulz <roland at utk.edu>
> Subject: Re: [gmx-users] cmake --> relocation R_X86_64_32S against `a
> 	local	symbol' can not be used when making a shared object;	recompile
> 	with -fPIC
> To: Discussion list for GROMACS users <gmx-users at gromacs.org>
> Message-ID:
> 	<AANLkTik+V+7738y6EqGy6fNm4ygCVk-Mzh1Aw1sgJaeF at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> You want to compile fftw with either --enable-shared or with --with-pic. Or
> you need to compile a static version of Gromacs. As the message says you
> can't use fftw without pic with shared libraries in GROMACS.
>
> Roland
>
> On Mon, Dec 20, 2010 at 6:31 PM, Chris Neale <chris.neale at utoronto.ca>wrote:
>
>> Dear Gromacs users:
>>
>> I pulled the master version of the source code today at 2pm via:
>> git clone git://git.gromacs.org/gromacs.git
>> and I tried to compile it following the instructions posted here:
>> http://www.gromacs.org/Developer_Zone/Cmake but I was unsuccessful.  This
>> is my first attempt at using cmake, but I have been compiling gromacs
>> successfully with autoconf since version 3.3.1
>>
>> I have a recent enough version of cmake:
>> $ cmake --version
>> cmake version 2.8.0
>>
>> And I have installed fftw:
>> $ echo $FFTW_LOCATION
>> /project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec
>> $ ls $FFTW_LOCATION/lib
>> libfftw3f.a  libfftw3f.la  libfftw3f_threads.a    
>> libfftw3f_threads.la pkgconfig
>>
>> But then when I try to compile gromacs:
>> $ cmake ../ -DFFTW3F_INCLUDE_DIR=$FFTW_LOCATION/include
>> -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f.a
>> -DCMAKE_INSTALL_PREFIX=$(pwd) -DGMX_X11=OFF
>> -DCMAKE_CXX_COMPILER=/scinet/gpc/intel/Compiler/11.1/072/bin/intel64/icpc
>> -DCMAKE_C_COMPILER=/scinet/gpc/intel/Compiler/11.1/072/bin/intel64/icc
>> $ make -j 4
>>
>> I get the error:
>> ... <snip> ...
>> [ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o
>> Linking C shared library libmd.so
>> ld:
>> /project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/libfftw3f.a(mapflags.o):
>> relocation R_X86_64_32S against `a local symbol' can not be used when making
>> a shared object; recompile with -fPIC
>> /project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/libfftw3f.a:
>> could not read symbols: Bad value
>> make[2]: *** [src/mdlib/libmd.so.6] Error 1
>> make[1]: *** [src/mdlib/CMakeFiles/md.dir/all] Error 2
>> make: *** [all] Error 2
>>
>> Just to be sure, I recompiled my FFTW and also tried a few different
>> options for FFTW3F_LIBRARIES, all with errors.
>> This fftw was compiled the same way I did previously, but just in case our
>> version of icc was updated and this is causing the problem:
>> export CC=icc
>> export CXX=icpc
>> ./configure --enable-float --enable-threads --prefix=$(pwd)/exec
>> make
>> make install
>>
>> ############################ USING
>> -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f_threads.a
>> ... <snip> ...
>> ../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_c2r_3d'
>> ../mdlib/libmd.so.6: undefined reference to `fftwf_plan_guru_dft_r2c'
>> ../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_r2c_2d'
>>
>> ... <snip> ...
>>
>>  78%] Building C object src/kernel/CMakeFiles/g_luck.dir/g_luck.c.o
>> Linking C executable g_luck
>> Scanning dependencies of target g_protonate
>> [ 79%] Building C object
>> src/kernel/CMakeFiles/g_protonate.dir/g_protonate.c.o
>> [ 79%] /scinet/gpc/intel/Compiler/11.1/072/lib/intel64//libimf.so: warning:
>> warning: feupdateenv is not implemented and will always fail
>> Building C object src/tools/CMakeFiles/gmxana.dir/gmx_bundle.c.o
>> ../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_3d'
>> ../mdlib/libmd.so.6: undefined reference to `fftwf_execute_dft_r2c'
>>
>> ... <snip> ...
>>
>> Building C object src/tools/CMakeFiles/gmxana.dir/edittop.c.o
>> [ 88%] Building C object src/tools/CMakeFiles/gmxana.dir/gmx_bar.c.o
>> [ 89%] Building C object src/tools/CMakeFiles/gmxana.dir/gmx_pme_error.c.o
>> Linking C shared library libgmxana.so
>> [ 89%] Built target gmxana
>> make: *** [all] Error 2
>>
>> ############################ USING -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/
>> libfftw3f.la
>> ... <snip> ...
>> [ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o
>> Linking C shared library libmd.so
>> /project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/libfftw3f.la:
>> file not recognized: File format not recognized
>>
>> ############################ USING -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/
>> libfftw3f_threads.la
>> ... <snip> ...
>> [ 72%] Building C object src/mdlib/CMakeFiles/md.dir/mvxvf.c.o
>> [ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o
>> Linking C shared library libmd.so
>> /project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/
>> libfftw3f_threads.la: file not recognized: File format not recognized
>> make[2]: *** [src/mdlib/libmd.so.6] Error 1
>> make[1]: *** [src/mdlib/CMakeFiles/md.dir/all] Error 2
>> make: *** [all] Error 2
>>
>>
>> Thank you,
>> Chris.
>> --
>> gmx-users mailing list    gmx-users at gromacs.org
>> http://lists.gromacs.org/mailman/listinfo/gmx-users
>> Please search the archive at
>> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
>> Please don't post (un)subscribe requests to the list. Use the www interface
>> or send it to gmx-users-request at gromacs.org.
>> Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>>
>>
>>
>
>
> --
> ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
> 865-241-1537, ORNL PO BOX 2008 MS6309
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:   
> http://lists.gromacs.org/pipermail/gmx-users/attachments/20101220/a6a71aac/attachment.html
>
> ------------------------------
>
> --
> gmx-users mailing list
> gmx-users at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at   
> http://www.gromacs.org/Support/Mailing_Lists/Search before posting!
>
> End of gmx-users Digest, Vol 80, Issue 135
> ******************************************
>






More information about the gromacs.org_gmx-users mailing list