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&#39;t use fftw without pic with shared libraries in GROMACS.<div><br>


</div><div>Roland<br><br><div class="gmail_quote">On Mon, Dec 20, 2010 at 6:31 PM, Chris Neale <span dir="ltr">&lt;<a href="mailto:chris.neale@utoronto.ca" target="_blank">chris.neale@utoronto.ca</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Gromacs users:<br>
<br>
I pulled the master version of the source code today at 2pm via:<br>
git clone git://<a href="http://git.gromacs.org/gromacs.git" target="_blank">git.gromacs.org/gromacs.git</a><br>
and I tried to compile it following the instructions posted here: <a href="http://www.gromacs.org/Developer_Zone/Cmake" target="_blank">http://www.gromacs.org/Developer_Zone/Cmake</a> 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<br>



<br>
I have a recent enough version of cmake:<br>
$ cmake --version<br>
cmake version 2.8.0<br>
<br>
And I have installed fftw:<br>
$ echo $FFTW_LOCATION<br>
/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec<br>
$ ls $FFTW_LOCATION/lib<br>
libfftw3f.a  <a href="http://libfftw3f.la" target="_blank">libfftw3f.la</a>  libfftw3f_threads.a  <a href="http://libfftw3f_threads.la" target="_blank">libfftw3f_threads.la</a>  pkgconfig<br>
<br>
But then when I try to compile gromacs:<br>
$ 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<br>



$ make -j 4<br>
<br>
I get the error:<br>
... &lt;snip&gt; ...<br>
[ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o<br>
Linking C shared library libmd.so<br>
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&#39; can not be used when making a shared object; recompile with -fPIC<br>
/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/libfftw3f.a: could not read symbols: Bad value<br>
make[2]: *** [src/mdlib/libmd.so.6] Error 1<br>
make[1]: *** [src/mdlib/CMakeFiles/md.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
Just to be sure, I recompiled my FFTW and also tried a few different options for FFTW3F_LIBRARIES, all with errors.<br>
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:<br>
export CC=icc<br>
export CXX=icpc<br>
./configure --enable-float --enable-threads --prefix=$(pwd)/exec<br>
make<br>
make install<br>
<br>
############################ USING -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/libfftw3f_threads.a<br>
... &lt;snip&gt; ...<br>
../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_c2r_3d&#39;<br>
../mdlib/libmd.so.6: undefined reference to `fftwf_plan_guru_dft_r2c&#39;<br>
../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_r2c_2d&#39;<br>
<br>
... &lt;snip&gt; ...<br>
<br>
 78%] Building C object src/kernel/CMakeFiles/g_luck.dir/g_luck.c.o<br>
Linking C executable g_luck<br>
Scanning dependencies of target g_protonate<br>
[ 79%] Building C object src/kernel/CMakeFiles/g_protonate.dir/g_protonate.c.o<br>
[ 79%] /scinet/gpc/intel/Compiler/11.1/072/lib/intel64//libimf.so: warning: warning: feupdateenv is not implemented and will always fail<br>
Building C object src/tools/CMakeFiles/gmxana.dir/gmx_bundle.c.o<br>
../mdlib/libmd.so.6: undefined reference to `fftwf_plan_dft_3d&#39;<br>
../mdlib/libmd.so.6: undefined reference to `fftwf_execute_dft_r2c&#39;<br>
<br>
... &lt;snip&gt; ...<br>
<br>
Building C object src/tools/CMakeFiles/gmxana.dir/edittop.c.o<br>
[ 88%] Building C object src/tools/CMakeFiles/gmxana.dir/gmx_bar.c.o<br>
[ 89%] Building C object src/tools/CMakeFiles/gmxana.dir/gmx_pme_error.c.o<br>
Linking C shared library libgmxana.so<br>
[ 89%] Built target gmxana<br>
make: *** [all] Error 2<br>
<br>
############################ USING -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/<a href="http://libfftw3f.la" target="_blank">libfftw3f.la</a><br>
... &lt;snip&gt; ...<br>
[ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o<br>
Linking C shared library libmd.so<br>
/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/<a href="http://libfftw3f.la" target="_blank">libfftw3f.la</a>: file not recognized: File format not recognized<br>
<br>
############################ USING -DFFTW3F_LIBRARIES=$FFTW_LOCATION/lib/<a href="http://libfftw3f_threads.la" target="_blank">libfftw3f_threads.la</a><br>
... &lt;snip&gt; ...<br>
[ 72%] Building C object src/mdlib/CMakeFiles/md.dir/mvxvf.c.o<br>
[ 72%] Building C object src/mdlib/CMakeFiles/md.dir/tables.c.o<br>
Linking C shared library libmd.so<br>
/project/pomes/cneale/GPC/exe/intel/fftw-3.1.2_again/exec/lib/<a href="http://libfftw3f_threads.la" target="_blank">libfftw3f_threads.la</a>: file not recognized: File format not recognized<br>
make[2]: *** [src/mdlib/libmd.so.6] Error 1<br>
make[1]: *** [src/mdlib/CMakeFiles/md.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
<br>
Thank you,<br>
Chris.<br><font color="#888888">
-- <br>
gmx-users mailing list    <a href="mailto:gmx-users@gromacs.org" target="_blank">gmx-users@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-users" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-users</a><br>
Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/Search" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/Search</a> before posting!<br>
Please don&#39;t post (un)subscribe requests to the list. Use the www interface or send it to <a href="mailto:gmx-users-request@gromacs.org" target="_blank">gmx-users-request@gromacs.org</a>.<br>
Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>
</div>