trying to run gromacs 4.6.7 with plumed 2, on Cray XE6,using shared libraries;after running it com compute nodes: cannot open shared object file: : : libcray_memcpy.so.0: : No such file or directory: libcray_memcpy.so.0cannot open shared object file

762 views
Skip to first unread message

sokovic....@gmail.com

unread,
May 1, 2015, 11:24:17 AM5/1/15
to plumed...@googlegroups.com
Hi Everybody,


I was trying to build Gromacs 4.6.7 with plumed and shared libraries with this recipe:
module swap PrgEnv-cray PrgEnv-gnu
module load fftw/3.3.0.4
module load cray-mpich/7.0.5
module load gsl/1.15
module load cmake

#the reason for bellow linking is that libblas and lapack on this Cray are inside of libsci.
ams@login1:/lustre/beagle2/ams/lib>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.a libblas.a
ams@login1:/lustre/beagle2/ams/lib>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.a liblapack.a

ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.so libblas.so
ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.so liblapack.so


###install plumed-2.1.1

wget https://dl.dropboxusercontent.com/u/23916760/plumed/plumed-2.1.1.tgz
tar xzf plumed-2.1.1.tgz
cd plumed-2.1.1

 
./configure SOEXT=so LDFLAGS="-L/lustre/beagle2/ams/groplu/lib2 -dynamic" --prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1 --enable-mpi

make
make install

export PATH=/lustre/beagle2/ams/groplu/plumed-2.1.1/bin:$PATH


### instal gromacs 4.6.7
wget ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.7.tar.gz
tar xzf gromacs-4.6.7.tar.gz
cd gromacs-4.6.7/
ams@login1:/lustre/beagle2/ams/groplu/gromacs-4.6.7> plumed patch -p
PLUMED patching tool

1) amber14        3) gromacs-4.6.7    5) lammps-6Apr13    7) namd-2.9
2) gromacs-4.5.5    4) gromacs-5.0    6) namd-2.8        8) qespresso-5.0.2

Choose the best matching code/version:3

mkdir build
cd build

export BUILD_WITH_INSTALL_RPATH=TRUE
export INSTALL_RPATH=""
export SKIP_BUILD_RPATH=TRUE
export CMAKE_LIBRARY_PATH="/lustre/beagle2/ams/groplu/lib:$CMAKE_LIBRARY_PATH"

cmake ../ -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=OFF -DGMX_MPI=ON -DCMAKE_INSTALL_PREFIX=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DGMX_FORCE_CXX=ON -DGMX_DOUBLE=OFF -DGMX_X11=OFF -DCMAKE_EXE_LINKER_FLAGS="-dynamic" -DGMX_BLAS_USER=/lustre/beagle2/ams/groplu/lib/libblas.so -DGMX_LAPACK_USER=/lustre/beagle2/ams/groplu/lib/liblapack.so -DCMAKE_SKIP_RPATH=ON

make
make install

#####
Installation completes without any errors, then I try to run it with PBS script bellow:

#!/bin/bash
#PBS -N test
#PBS -j oe
#PBS -l walltime=01:00:00
#PBS -l mppwidth=64

. /opt/modules/default/init/bash
export PATH=/lustre/beagle2/ams/groplu/plumed-2.1.1/bin:$PATH
export PATH=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib

cd $PBS_O_WORKDIR
module swap PrgEnv-cray PrgEnv-gnu
module load fftw/3.3.0.4
module load cray-mpich/7.0.5
module load gsl/1.15
module load cmake

aprun -n 64 -cc cpu /lustre/beagle2/ams/groplu/gromacs-4.6.7/build/bin/mdrun_mpi -deffnm reusL -multi 12 -replex 10000 -plumed plumed.dat > outnew 2> errnew

After running ti I am getting this error:
cannot open shared object file: : : libcray_memcpy.so.0: : No such file or directory: libcray_memcpy.so.0cannot open shared object file

What should I do?My guess it to set LD_LIBRARY_PATH somehow???

Thanks in advance

Giovanni Bussi

unread,
May 1, 2015, 12:08:40 PM5/1/15
to plumed...@googlegroups.com
Hi!

Does the problem appear also if you compile with identical settings gromacs *without* plumed? If so, then perhaps it is better to solve the problem in that case first.

If the problem only appears when you link plumed, it might be that the compiler you used to compile with plumed looks for some library that is not available on the compute nodes. You can try to compile and link plumed as a shared library loaded at runtime. In this way, libraries it relies on should be linked automatically. You should:
a. configure plumed with LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH"
b. patch gromacs with "plumed patch -p --runtime"
c. set properly the PLUMED_KERNEL variable at runtime.

I suggest anyway to go in this direction if you are installing PLUMED on a supercomputer, since this will allow you to easily update PLUMED and GROMACS independently of each other.

Giovanni


--
You received this message because you are subscribed to the Google Groups "PLUMED users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users...@googlegroups.com.
To post to this group, send email to plumed...@googlegroups.com.
Visit this group at http://groups.google.com/group/plumed-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/51a6a526-8833-4554-b23c-48ee69b3fde2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ana Marija

unread,
May 1, 2015, 12:18:23 PM5/1/15
to plumed...@googlegroups.com
Hi Giovanni,

Gromacs without plumed runs just fine.

The thing is that I was trying to do static build of gromacs and plumed which would be better on supercomputer then using shared libraries.
I did build with, all setting the same as in previous email just for compile steps I used:
#plumed
./configure SOEXT=so LDFLAGS="-L/lustre/beagle2/ams/groplu/lib -dynamic" --prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1 --enable-mpi
#gromacs
cmake ../ -DFFTWF_INCLUDE_DIR=/opt/fftw/3.3.0.4/abudhabi/include -DFFTWF_LIBRARY=/opt/fftw/3.3.0.4/abudhabi/lib/libfftw3f.a -DGMX_GPU=OFF -DGMX_MPI=ON -DGMX_DOUBLE=OFF  -DCMAKE_INSTALL_PREFIX=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DGMX_FORCE_CXX=ON -DGMX_X11=OFF -DGMX_PREFER_STATIC_LIBS=ON -DCMAKE_EXE_LINKER_FLAGS="-static" -DGMX_BLAS_USER=/lustre/beagle2/ams/groplu/lib/libblas.a -DGMX_LAPACK_USER=/lustre/beagle2/ams/groplu/lib/liblapack.a -DCMAKE_SKIP_RPATH=ON -DBUILD_SHARED_LIB=OFF

but during run I would get this error:
+++ message: you are trying to use an MPI function, but PLUMED has been compiled without MPI support

which is strange because during compilation plumed didn't complain about this, and also as I understand from the plumed documentation plumed is compiled by default with MPI.

Also as you see here I am using for plumed dynamic libraries, so would that ever work together with gromacs with static libraries? If not how you would compile plumed with static libraries?

And one more question about your previous replay: where LD_LIBRARY_PATH should point to?

Thanks
Ana


--
You received this message because you are subscribed to a topic in the Google Groups "PLUMED users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plumed-users/1b0oLEBYt1Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users...@googlegroups.com.

To post to this group, send email to plumed...@googlegroups.com.
Visit this group at http://groups.google.com/group/plumed-users.

Giovanni Bussi

unread,
May 1, 2015, 12:59:17 PM5/1/15
to plumed...@googlegroups.com
On Fri, May 1, 2015 at 6:18 PM, Ana Marija <sokovic....@gmail.com> wrote:
Hi Giovanni,

Gromacs without plumed runs just fine.

The thing is that I was trying to do static build of gromacs and plumed which would be better on supercomputer then using shared libraries.

I see. Is there some specific limitation on the machine you are installing on? Notice that when you link statically, plumed is linked as a list of object files, so that there is no way for the linker to track if they depend on some library. Since plumed is a library that could depend on many other libraries it is often more robust to use the .so approach. In my setup I have several modules that can be loaded in any combination (gromacs, amber, and plumed) making the updates much easier, e.g.:
module load gromacs/4.6.7
module load plumed/2.1.2
The only case when it is necessary to recompile gromacs is when there is a fix in the plumed patch for gromacs (we always indicate this in the changelog).

I did build with, all setting the same as in previous email just for compile steps I used:
#plumed
./configure SOEXT=so LDFLAGS="-L/lustre/beagle2/ams/groplu/lib -dynamic" --prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1 --enable-mpi
#gromacs
cmake ../ -DFFTWF_INCLUDE_DIR=/opt/fftw/3.3.0.4/abudhabi/include -DFFTWF_LIBRARY=/opt/fftw/3.3.0.4/abudhabi/lib/libfftw3f.a -DGMX_GPU=OFF -DGMX_MPI=ON -DGMX_DOUBLE=OFF  -DCMAKE_INSTALL_PREFIX=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DGMX_FORCE_CXX=ON -DGMX_X11=OFF -DGMX_PREFER_STATIC_LIBS=ON -DCMAKE_EXE_LINKER_FLAGS="-static" -DGMX_BLAS_USER=/lustre/beagle2/ams/groplu/lib/libblas.a -DGMX_LAPACK_USER=/lustre/beagle2/ams/groplu/lib/liblapack.a -DCMAKE_SKIP_RPATH=ON -DBUILD_SHARED_LIB=OFF

but during run I would get this error:
+++ message: you are trying to use an MPI function, but PLUMED has been compiled without MPI support

which is strange because during compilation plumed didn't complain about this, and also as I understand from the plumed documentation plumed is compiled by default with MPI.

Yes this is strange. Notice that if you re-configure plumed changing some fundamental setting (e.g. with/without mpi) it is better to also use "make clean" first to be sure all files are recompiled. Anyway, if you arrive at this point it means that the simulation started and plumed has been loaded correctly, so the link problem seems solved!

Also notice that if you patch with "--runtime", as long as you launch gromacs with -plumed flag you should see in the standard error a message indicating the path of the libplumedKernel.so that you are loading. This is specified using the PLUMED_KERNEL environment variable. Double check if this is the version of plumed that you meant to use.

 

Also as you see here I am using for plumed dynamic libraries, so would that ever work together with gromacs with static libraries? If not how you would compile plumed with static libraries?

I think it should work anyway. It seems it is actually working, the only problem is that apparently you are loading a version of plumed that was compiled without MPI.


And one more question about your previous replay: where LD_LIBRARY_PATH should point to?

As far as I know (but I am not an expert of this) LD_LIBRARY_PATH should be set by the modules you are loading. In case it is not set, usually you can set it to the same as $LIBRARY_PATH (which is the path searched during linking).

Giovanni
 

Ana Marija

unread,
May 1, 2015, 4:30:55 PM5/1/15
to plumed...@googlegroups.com
does this help?
ok I did it with :
#!/bin/bash
#PBS -N test_new

#PBS -j oe
#PBS -l walltime=01:00:00
#PBS -l mppwidth=64

. /opt/modules/default/init/bash

export LD_LIBRARY_PATH=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib:$LD_LIBRARY_PATH

cd $PBS_O_WORKDIR
module swap PrgEnv-cray PrgEnv-gnu
module load fftw/3.3.0.4
module load cray-mpich/7.0.5
module load gsl/1.15
module load cmake

ldd /lustre/beagle2/ams/groplu/gromacs-4.6.7/build/bin/mdrun_mpi

and I got this:

GSL version 1.15 (gnu compiler) loaded
CMake version 2.8.4 loaded
        linux-vdso.so.1 =>  (0x00007fff32381000)
        libgmxpreprocess_mpi.so.8 => /lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmxpreprocess_mpi.so.8 (0x00002b28635ee000)
        libmd_mpi.so.8 => /lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libmd_mpi.so.8 (0x00002b28638d3000)
        libgmx_mpi.so.8 => /lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmx_mpi.so.8 (0x00002b2864180000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002b2864893000)
        libstdc++.so.6 => /opt/gcc/4.9.1/snos/lib64/libstdc++.so.6 (0x00002b2864a98000)
        libz.so.1 => /lib64/libz.so.1 (0x00002b2864daf000)
        librt.so.1 => /lib64/librt.so.1 (0x00002b2864fc5000)
        libsci_gnu_49.so.5 => /opt/cray/lib64/libsci_gnu_49.so.5 (0x00002b28651cf000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b2866acb000)
        libfftw3f_mpi.so.mpi30.3 => /opt/cray/lib64/libfftw3f_mpi.so.mpi30.3 (0x00002b2866ce8000)
        libfftw3f_threads.so.mpi30.3 => /opt/cray/lib64/libfftw3f_threads.so.mpi30.3 (0x00002b2866efe000)
        libfftw3f.so.mpi30.3 => /opt/cray/lib64/libfftw3f.so.mpi30.3 (0x00002b2867104000)
        libfftw3_mpi.so.mpi30.3 => /opt/cray/lib64/libfftw3_mpi.so.mpi30.3 (0x00002b2867476000)
        libmpich_gnu_49.so.3 => /opt/cray/lib64/libmpich_gnu_49.so.3 (0x00002b286768c000)
        libfftw3_threads.so.mpi30.3 => /opt/cray/lib64/libfftw3_threads.so.mpi30.3 (0x00002b2867bb1000)
        libfftw3.so.mpi30.3 => /opt/cray/lib64/libfftw3.so.mpi30.3 (0x00002b2867db7000)
        libcray_memcpy.so.0 => not found
        libAtpSigHandler.so.0 => /opt/cray/lib64/libAtpSigHandler.so.0 (0x00002b2868132000)
        libm.so.6 => /lib64/libm.so.6 (0x00002b2868338000)
        libgomp.so.1 => /opt/gcc/4.9.1/snos/lib64/libgomp.so.1 (0x00002b28685b2000)
        libgcc_s.so.1 => /opt/gcc/4.9.1/snos/lib64/libgcc_s.so.1 (0x00002b28687c9000)
        libc.so.6 => /lib64/libc.so.6 (0x00002b28689e0000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b28633cd000)
        libcray_memcpy.so.0 => not found
        libcray_memcpy.so.0 => not found
        libcray_memcpy.so.0 => not found
        libgfortran.so.3 => /opt/gcc/4.9.1/snos/lib64/libgfortran.so.3 (0x00002b2868d5b000)
        libmpl.so.0 => /opt/cray/lib64/libmpl.so.0 (0x00002b286907c000)
        libxpmem.so.0 => /opt/cray/xpmem/default/lib64/libxpmem.so.0 (0x00002b2869281000)
        libugni.so.0 => /opt/cray/ugni/default/lib64/libugni.so.0 (0x00002b2869484000)
        libudreg.so.0 => /opt/cray/udreg/default/lib64/libudreg.so.0 (0x00002b28696ca000)
        libpmi.so.0 => /opt/cray/pmi/default/lib64/libpmi.so.0 (0x00002b28698d3000)
        libquadmath.so.0 => /opt/gcc/4.9.1/snos/lib64/libquadmath.so.0 (0x00002b2869b0e000)

also when I do:
ams@login1:/lustre/beagle2/ams/GromacsTest> find /lustre/beagle2/ams/groplu/ -name \*.so\*
/lustre/beagle2/ams/groplu/plumed-2.1.1/lib/plumed/src/lib/libplumedKernel.so
/lustre/beagle2/ams/groplu/plumed-2.1.1/lib/plumed/src/lib/libplumed.so
/lustre/beagle2/ams/groplu/plumed-2.1.1/lib/libplumedKernel.so
/lustre/beagle2/ams/groplu/plumed-2.1.1/lib/libplumed.so
/lustre/beagle2/ams/groplu/plumed-2.1.1/src/lib/libplumedKernel.so
/lustre/beagle2/ams/groplu/plumed-2.1.1/src/lib/libplumed.so
/lustre/beagle2/ams/groplu/lib2/liblapack.so
/lustre/beagle2/ams/groplu/lib2/libblas.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libmd_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmxana_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmxpreprocess_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmx_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libmd_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmxana_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmxpreprocess_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/lib/libgmx_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/tools/libgmxana_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/tools/libgmxana_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/mdlib/libmd_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/mdlib/libmd_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/kernel/libgmxpreprocess_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/kernel/libgmxpreprocess_mpi.so
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/gmxlib/libgmx_mpi.so.8
/lustre/beagle2/ams/groplu/gromacs-4.6.7/build/src/gmxlib/libgmx_mpi.so
/lustre/beagle2/ams/groplu/lib/liblapack.so
/lustre/beagle2/ams/groplu/lib/libblas.so

so libcray_memcpy.so.0 definitely not there.

if I search it in /opt of the machine:

ams@login1:/lustre/beagle2/ams/GromacsTest> find /opt -name libcray_memcpy.so.0
/opt/fftw/3.3.0.4/sandybridge/lib/libcray_memcpy.so.0
/opt/fftw/3.3.0.4/interlagos/lib/libcray_memcpy.so.0
find: `/opt/fftw/3.3.4.0/share/man/man3': Permission denied
/opt/fftw/3.3.0.1/interlagos/lib/libcray_memcpy.so.0
find: `/opt/cray/ccm/2.0.0-1.0301.24765.9.9/man': Permission denied
find: `/opt/cray/ccm/1.4.0-1.0301.24581.4.5/man': Permission denied
find: `/opt/cray/ccm/2.0.0-1.0301.25332.12.32/man': Permission denied
find: `/opt/cray/ccm/2.2.0-1.0400.32319.14.3/man': Permission denied
find: `/opt/cray/modulefiles/PrgEnv-intel': Permission denied
find: `/opt/modulefiles/PrgEnv-pathscale': Permission denied
find: `/opt/munge': Permission denied

which is again problematic because I suppose to use abudhabi's library and not sandybridge or interlagos

also you are noticing from here that I am building gromacs own FFTW with -DGMX_BUILD_OWN_FFTW=ON


cmake ../ -DGMX_BUILD_OWN_FFTW=ON -DGMX_GPU=OFF -DGMX_MPI=ON -DCMAKE_INSTALL_PREFIX=/lustre/beagle2/ams/groplu/gromacs-4.6.7/build -DCMAKE_CXX_COMPILER=CC -DCMAKE_C_COMPILER=cc -DGMX_FORCE_CXX=ON -DGMX_DOUBLE=OFF -DGMX_X11=OFF -DCMAKE_EXE_LINKER_FLAGS="-dynamic" -DGMX_BLAS_USER=/lustre/beagle2/ams/groplu/lib/libblas.so -DGMX_LAPACK_USER=/lustre/beagle2/ams/groplu/lib/liblapack.so -DCMAKE_SKIP_RPATH=ON

do I repeat the whole build with: plumed patch -p --runtime

or should I do something else?




Ana Marija

unread,
May 14, 2015, 7:49:00 PM5/14/15
to plumed...@googlegroups.com
HI,

I took different approach to installing this since previous didn't work, I was getting message that plumed is not MPI enabled.

Now I am doing this:
module swap PrgEnv-cray PrgEnv-gnu

module load cray-mpich/7.0.5
module load gsl/1.15
module load cmake

ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.so libblas.so
ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.so liblapack.so
ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.a libblas.a
ams@login1:/lustre/beagle2/ams/lib2>ln -s /opt/cray/libsci/13.0.1/GNU/49/abudhabi/lib/libsci_gnu.a liblapack.a

/doing previous step since on our machine laplack and blas are under libsci

./configure CC=cc CXX=CC F77=ftn  LDFLAGS="-L/lustre/beagle2/ams/groplu/lib2 -rdynamic" --prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1 --enable-mpi --disable-basic-warnings

after thi sstep I open Makefile.config and I add "-D__PLUMED_MPI=1" at the end of CPPFLAGS

then after compiling stage my Makefile.config looks like this:

CC=cc
FC=gfortran
LDF90=gfortran
CFLAGS=-g -O2
CXX=CC
CXXFLAGS=-O -fPIC
CPPFLAGS= -DPACKAGE_NAME=\"PLUMED\" -DPACKAGE_TARNAME=\"plumed\" -DPACKAGE_VERSION=\"2\" -DPACKAGE_STRING=\"PLUMED\ 2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__PLUMED_HAS_MOLFILE=1 -D__PLUMED_INTERNAL_MOLFILE_PLUGINS=1 -D__PLUMED_MPI=1 -D__PLUMED_HAS_CLOCK_GETTIME=1 -D__PLUMED_HAS_GETTIMEOFDAY=1 -D__PLUMED_HAS_CREGEX=1 -D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_HAS_EXECINFO=1 -D__PLUMED_HAS_ZLIB=1 -DNDEBUG=1 -D_REENTRANT=1 -D__PLUMED_MPI=1
LDFLAGS=
DYNAMIC_LIBS=-lstdc++ -L/lustre/beagle2/ams/groplu/lib2
LIBS=-ldl
SOEXT=so
LD=CC
LDSO=CC -shared
GCCDEP=CC
prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1

when I run make I got this error:

DLLoader.cpp:(.text+0xe4): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
../tools/FileBase.o: In function `PLMD::FileBase::close()':
FileBase.cpp:(.text+0x5d6): undefined reference to `gzclose'
../tools/FileBase.o: In function `PLMD::FileBase::~FileBase()':
FileBase.cpp:(.text+0x6f0): undefined reference to `gzclose'
../tools/IFile.o: In function `PLMD::IFile::llread(char*, unsigned long)':
IFile.cpp:(.text+0xe5): undefined reference to `gzread'
../tools/IFile.o: In function `PLMD::IFile::reset(bool)':
IFile.cpp:(.text+0x53c): undefined reference to `gzclearerr'
../tools/IFile.o: In function `PLMD::IFile::open(std::string const&)':
IFile.cpp:(.text+0xafc): undefined reference to `gzopen'
../tools/OFile.o: In function `PLMD::OFile::llwrite(char const*, unsigned long)':
OFile.cpp:(.text+0x126): undefined reference to `gzwrite'
../tools/OFile.o: In function `PLMD::OFile::rewind()':
OFile.cpp:(.text+0x1c75): undefined reference to `gzclose'
OFile.cpp:(.text+0x2138): undefined reference to `gzopen'
../tools/OFile.o: In function `PLMD::OFile::open(std::string const&)':
OFile.cpp:(.text+0x3b01): undefined reference to `gzopen'
OFile.cpp:(.text+0x3be4): undefined reference to `gzopen'
../tools/OFile.o: In function `PLMD::OFile::flush()':
OFile.cpp:(.text+0x462d): undefined reference to `gzclose'
OFile.cpp:(.text+0x4647): undefined reference to `gzopen'
OFile.cpp:(.text+0x4699): undefined reference to `gzflush'

Please tell me what should I correct here?

Thanks
Ana

Ana Marija

unread,
May 15, 2015, 11:39:21 AM5/15/15
to plumed...@googlegroups.com
Trying to link this dynamically with:

./configure CC=cc CXX=CC F77=ftn  LDFLAGS="-L/lustre/beagle2/ams/groplu/lib2 -rdynamic" --prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1 --enable-mpi --disable-basic-warnings

and my Makefile.conf looks like:

CC=cc
FC=gfortran
LDF90=gfortran
CFLAGS=-g -O2
CXX=CC
CXXFLAGS=-O -fPIC
CPPFLAGS= -DPACKAGE_NAME=\"PLUMED\" -DPACKAGE_TARNAME=\"plumed\" -DPACKAGE_VERSION=\"2\" -DPACKAGE_STRING=\"PLUMED\ 2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -D__PLUMED_HAS_MOLFILE=1 -D__PLUMED_INTERNAL_MOLFILE_PLUGINS=1 -D__PLUMED_MPI=1 -D__PLUMED_HAS_CLOCK_GETTIME=1 -D__PLUMED_HAS_GETTIMEOFDAY=1 -D__PLUMED_HAS_CREGEX=1 -D__PLUMED_HAS_DLOPEN=1 -D__PLUMED_HAS_EXECINFO=1 -D__PLUMED_HAS_ZLIB=1 -DNDEBUG=1 -D_REENTRANT=1
LDFLAGS=
DYNAMIC_LIBS=-lstdc++ -lz -ldl  -L/lustre/beagle2/ams/groplu/lib2 -dynamic

LIBS=-ldl
SOEXT=so
LD=CC
LDSO=CC -shared
GCCDEP=CC
prefix=/lustre/beagle2/ams/groplu/plumed-2.1.1

but after make I ma getting this error:

../cltools/SimpleMD.o: In function `PLMD::Plumed::~Plumed()':
SimpleMD.cpp:(.text._ZN4PLMD6PlumedD2Ev[_ZN4PLMD6PlumedD5Ev]+0x1d): undefined reference to `plumed_finalize'
../cltools/SimpleMD.o: In function `PLMD::Plumed::~Plumed()':
SimpleMD.cpp:(.text._ZN4PLMD6PlumedD0Ev[_ZN4PLMD6PlumedD5Ev]+0x1d): undefined reference to `plumed_finalize'
../cltools/SimpleMD.o: In function `PLMD::cltools::SimpleMD::main(_IO_FILE*, _IO_FILE*, PLMD::Communicator&)':
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x166): undefined reference to `plumed_create'
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x194): undefined reference to `plumed_cmd'
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x888): undefined reference to `plumed_cmd'
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x89f): undefined reference to `plumed_cmd'
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x8b6): undefined reference to `plumed_cmd'
SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x8cd): undefined reference to `plumed_cmd'
../cltools/SimpleMD.o:SimpleMD.cpp:(.text._ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE[_ZN4PLMD7cltools8SimpleMD4mainEP8_IO_FILES3_RNS_12CommunicatorE]+0x8e4): more undefined references to `plumed_cmd' follow
../core/PlumedMainInitializer.o: In function `_GLOBAL__sub_I_PlumedMainInitializer.cpp':
PlumedMainInitializer.cpp:(.text+0x34b): undefined reference to `plumed_kernel_register'
collect2: error: ld returned 1 exit status
make[4]: *** [libplumedKernel.so] Error 1
make[4]: Leaving directory `/lustre/beagle2/ams/groplu/plumed-2.1.1/src/lib'

somebody please help

Giovanni Bussi

unread,
May 15, 2015, 2:06:08 PM5/15/15
to plumed...@googlegroups.com
Hi,

it looks like the $LDSO cannot produce the shared object libplumedKernel.so
Plumed autoconf provides the flags needed on linux (-shared) and on mac (-undefined suppress -flat_namespace -dynamiclib). Perhaps your system requires some extra flag. If it is a Portland compiler, try to add "-Wl,-noinhibit-exec" to the LDSO command and let us know if it works.

Giovanni



Ana Marija

unread,
May 15, 2015, 2:09:04 PM5/15/15
to plumed...@googlegroups.com
Hi Giobanni,

I am doing this on Cray XE6 machine and I am using:
I use GNU compiler: gcc/4.9.1, would you know what flags in that case I should add to LDSO?

my whole module list is this:
1) modules/3.2.6.7
  2) nodestat/2.2-1.0502.53712.3.109.gem
  3) sdb/1.0-1.0502.55976.5.27.gem
  4) alps/5.2.1-2.0502.9072.13.1.gem
  5) lustre-cray_gem_s/2.5_3.0.101_0.31.1_1.0502.8394.10.1-1.0502.17198.8.50
  6) udreg/2.3.2-1.0502.9275.1.25.gem
  7) ugni/5.0-1.0502.9685.4.24.gem
  8) gni-headers/3.0-1.0502.9684.5.2.gem
  9) dmapp/7.0.1-1.0502.9501.5.211.gem
 10) xpmem/0.1-2.0502.55507.3.2.gem
 11) hss-llm/7.2.0
 12) Base-opts/1.0.2-1.0502.53325.1.2.gem
 13) craype-network-gemini
 14) craype/2.2.1
 15) craype-abudhabi
 16) ci
 17) moab/6.1.1
 18) torque/2.5.7
 19) gcc/4.9.1
 20) totalview-support/1.2.0.3
 21) totalview/8.14.1
 22) cray-libsci/13.0.1
 23) pmi/5.0.6-1.0000.10439.140.3.gem
 24) atp/1.7.5
 25) PrgEnv-gnu/5.2.40
 26) cray-mpich/7.0.5
 27) gsl/1.15
 28) cmake/2.8.4


Thanks
Ana


Ana Marija

unread,
May 15, 2015, 2:11:19 PM5/15/15
to plumed...@googlegroups.com
and one more thing of importance to mention is I am doing cross compiling with CC because I will run this on compute nodes that's why I have CC with LDSO

Giovanni Bussi

unread,
May 15, 2015, 2:11:43 PM5/15/15
to plumed...@googlegroups.com
Are you sure that when you load cray-mpich the compiler is actually gnu? Can you double check with 
CC --version
?

Also: when you received errors about missing gzclose etc, is it possible that you accidentally removed from the Makefile.conf the flag -lz?

Giovanni

Ana Marija

unread,
May 15, 2015, 2:15:11 PM5/15/15
to plumed...@googlegroups.com
ams@login5:/lustre/beagle2/ams/groplu/plumed-2.1.1> CC --version
g++ (GCC) 4.9.1 20140716 (Cray Inc.)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


and my module list when I do this is definetly:
ams@login5:/lustre/beagle2/ams/groplu/plumed-2.1.1> module list
Currently Loaded Modulefiles:
yes I removed by accident -lz I put it back but still I have those errors from the previous email

Giovanni Bussi

unread,
May 15, 2015, 2:24:53 PM5/15/15
to plumed...@googlegroups.com
I see.

In principle gcc should be able to link a shared object also if there are missing symbols.
Indeed libplumedKernel.so tries to call functions that are defined elsewhere (namely in Plumed.o).

Anyway, this looks like a version of gcc modified by Cray, so I have no experience with that. Perhaps you should look at the manual.

In principle you could take any of the object files produced by plumed (e.g. src/colvar/Distance.o), copy it to an empty directory, and type:

CC -shared Distance.o -o test.so

This should *not* fail (whereas "CC Distance.o -o test.so" should fail complaining about missing refs). If it complains about missing references, you have to find which flags besides -shared should be added for it to work.

Giovanni


Reply all
Reply to author
Forward
0 new messages