Plumed-2.1.0 Gromacs-5.0.2 installation error

2,418 views
Skip to first unread message

noor...@ualberta.ca

unread,
May 22, 2015, 6:44:23 PM5/22/15
to plumed...@googlegroups.com
Hello

I am trying to compile the gromacs with plumed patch applied. But I keep getting the following error:

PlumedStatic.cpp:(.text+0x476): multiple definition of `PLUMED_F_GLOBAL__'
/usr/local/lib/plumed///src/wrapper/PlumedStatic.o:PlumedStatic.cpp:(.text+0x476): first defined here
collect2: ld returned 1 exit status
make[2]: *** [lib/libgromacs.so.0.0.0] Error 1
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [all] Error 2

I tried all the methods suggested in previous threat but none of them works.

Any Idea?

James Krieger

unread,
Jun 8, 2015, 7:43:59 AM6/8/15
to plumed...@googlegroups.com
I'm having the same problem trying to install gromacs-5.0.4 with plumed-2.1.2

Any help would be much appreciated.

Thanks
James

Giovanni Bussi

unread,
Jun 8, 2015, 8:28:57 AM6/8/15
to plumed...@googlegroups.com
Did you try patching with "plumed patch --shared" or "plumed patch --runtime"?

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/23d189b6-cff2-4fe0-b278-564efed55587%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

James Krieger

unread,
Jun 8, 2015, 9:33:28 AM6/8/15
to plumed...@googlegroups.com
Thanks Giovanni,

Using "plumed patch -p --shared" got rid of that error and "make" ran fine but now I have a new error from "make install":

CMake Error at src/programs/cmake_install.cmake:42 (FILE):
  file INSTALL cannot find
  "/lmb/home/jkrieger/bin/gromacs-plumed-mpi/bin/gmx_mpi".
Call Stack (most recent call first):
  src/cmake_install.cmake:40 (INCLUDE)
  cmake_install.cmake:49 (INCLUDE)

Using "plumed patch -p --runtime" still makes an error during "make" but it's a different one:

Linking CXX shared library ../../lib/libgromacs_mpi.so
/usr/bin/ld: /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi///src/wrapper/Plumed.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi///src/wrapper/Plumed.o: could not read symbols: Bad value

collect2: ld returned 1 exit status
make[2]: *** [lib/libgromacs_mpi.so.0.0.0] Error 1

make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [all] Error 2

Any ideas?

Thanks again
James

James Krieger

unread,
Jun 8, 2015, 10:03:44 AM6/8/15
to plumed...@googlegroups.com
and for completeness: using both "--shared" and "--runtime" together gives the same error as "--runtime" alone.

Giovanni Bussi

unread,
Jun 8, 2015, 11:04:05 AM6/8/15
to plumed...@googlegroups.com
All these errors look strange.

Can you make a full clean of plumed and gromacs and retry?

The procedure should be
1. configure/make/install plumed.
2. patch gromacs (either --static/--shared/--runtime; shared and runtime should be easier to setup).
3. configure/make/install gromacs using the same compiler

Take note of the warnings given by plumed during configure.

To solve the error that you report for --runtime patch, you could try to do the following: after having configured plumed, edit Makefile.conf and add -fPIC to CFLAGS. Then compile/install and proceed with gromacs patch.

Giovanni


James Krieger

unread,
Jun 8, 2015, 12:06:42 PM6/8/15
to plumed...@googlegroups.com
I did the following:

1. I put all the previous tries in a separate folder and left just the tar/gz files to start again
2. tar -xvzf plumed-2.1.2.tgz
3. mv plumed-2.1.2 plumed-2.1.2-src
4. mkdir /lmb/home/jkrieger/bin/plumed-2.1.2_mpi
5. cd plumed-2.1.2-src
6. ./configure --prefix=/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/ CC=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicc CXX=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx

configure: WARNING: using internal molfile_plugins, which only support dcd and xtc/trr/trj
configure: WARNING: cannot enable __PLUMED_HAS_MATHEVAL
configure: WARNING: Doxygen version is <1.8. You might have problems in generating manuals

configure: PLUMED seems to be configured properly!
configure: **************************
configure: I will now check if C++ objects can be linked by C/Fortran compilers
configure: This is relevant if you want to use plumed patch --static on a non-C++ code
checking whether C can link a C++ object... no
checking whether C can link a C++ object with library -lstdc++... yes
checking whether FORTRAN can link a C++ object... yes
configure: **** PLUMED will be installed using prefix /lmb/home/jkrieger/bin/plumed-2.1.2_mpi
configure: **** You can change this later setting PLUMED_PREFIX environment variable before installing
configure: **** Executable will be named 'plumed'
configure: **** To add a suffix to this name, set PLUMED_LIBSUFFIX environment variable before installing
configure: **** PLUMED will be compiled using MPI
configure: creating ./config.status
config.status: creating Makefile.conf
config.status: creating sourceme.sh

7. add -fPIC to CFLAGS in Makefile.conf

8. setenv PLUMED_LIBSUFFIX mpi
make

lots of errors like the following:

/lmb/home/jkrieger/bin/mpich-3.1.4-build/include/mpi.h:549: warning: ISO C++ 1998 does not support 'long long'
Matrix.h:247: warning: comparison between signed and unsigned integer expressions

9. make install

cd ../../ ; tar cf - patches scripts src/*/*.h src/*/*.cpp src/*/*.o src/config/compile_options.sh *-doc/*.png *-doc/html *-doc/regtests *-doc/manual.pdf | tar xf - -C /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi//
tar: *-doc/html: Cannot stat: No such file or directory
tar: *-doc/regtests: Cannot stat: No such file or directory
tar: *-doc/manual.pdf: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

*** PLUMED has been installed ***

Install prefix : /lmb/home/jkrieger/bin/plumed-2.1.2_mpi
Full name      : plumed-mpi

Setup your environment
- Ensure this is in your execution path : /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/bin
- Ensure this is in your include path   : /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/include
- Ensure this is in your library path   : /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib
For runtime binding:
- Set this environment variable         : PLUMED_KERNEL=/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/libplumed-mpiKernel.so

To create a tcl module that sets all the variables above, use this one as a starting point:
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi//src/lib/modulefile

To uninstall, remove the following files and directories:
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi/
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/include/plumed-mpi
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/bin/plumed-mpi
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/bin/plumed-mpi-mklib
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/bin/plumed-mpi-newcv
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/bin/plumed-mpi-patch
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/libplumed-mpi.so
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/libplumed-mpiKernel.so

10. cd ..
tar -xvzf gromacs-5.0.4.tar.gz
mv gromacs-5.0.4 gromacs-5.0.4-src
mkdir gromacs-plumed-mpi
cd gromacs-5.0.4-src/
plumed-mpi patch -p --runtime

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:4
MD engine: gromacs-5.0
PLUMED location: /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi/
diff file: /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi//patches/gromacs-5.0.diff
sourcing config file: /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi//patches/gromacs-5.0.config
Linking Plumed.h and Plumed.inc (runtime mode)
Patching with on-the-fly diff from stored originals
patching file ./src/gromacs/CMakeLists.txt
Hunk #2 succeeded at 189 (offset -4 lines).
patching file ./src/gromacs/mdlib/force.c
Hunk #2 succeeded at 743 (offset -1 lines).
patching file ./src/gromacs/mdlib/minimize.c
Hunk #2 succeeded at 447 (offset 1 line).
Hunk #3 succeeded at 779 (offset 3 lines).
patching file ./src/programs/mdrun/md.c
patching file ./src/programs/mdrun/mdrun.cpp
patching file ./src/programs/mdrun/repl_ex.c

11. cd ../gromacs-plumed-mpi
ccmake -DGMX_MPI=ON ../gromacs-5.0.4-src/ -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/lmb/home/jkrieger/bin/gromacs-plumed-mpi -DCMAKE_C_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicc -DCMAKE_CXX_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx

c for configure

Boost >= 1.44 not found. Using minimal internal version. This may cause trouble if you plan on compiling/linking other software that uses Boost against Gromacs.

e for exit help

c for configure and g for generate                                                                                                                                                       
12. make

/lmb/home/jkrieger/bin/gromacs-5.0.4-src/src/gromacs/gmxana/gmx_bar.c: In function 'read_barsim_edr.clone.0':
/lmb/home/jkrieger/bin/gromacs-5.0.4-src/src/gromacs/gmxana/gmx_bar.c:3217: warning: 'start_lambda.index' may be used uninitialized in this function
/lmb/home/jkrieger/bin/gromacs-5.0.4-src/src/gromacs/gmxana/gmx_bar.c:3217: warning: 'start_lambda.val' may be used uninitialized in this function
At top level:
cc1: warning: unrecognized command line option "-Wno-maybe-uninitialized"

/lmb/home/jkrieger/bin/gromacs-5.0.4-src/src/gromacs/gmxlib/ewald_util.c: In function 'ewald_LRcorrection':
/lmb/home/jkrieger/bin/gromacs-5.0.4-src/src/gromacs/gmxlib/ewald_util.c:167: warning: 'dxdf_lj' may be used uninitialized in this function
At top level:
cc1: warning: unrecognized command line option "-Wno-maybe-uninitialized"

/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi///src/wrapper/Plumed.o: In function `plumed_dummy_create':
/lmb/home/jkrieger/bin/plumed-2.1.2-src/src/wrapper/Plumed.c:84: multiple definition of `plumed_dummy_create'
/lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi///src/wrapper/Plumed.o:/lmb/home/jkrieger/bin/plumed-2.1.2-src/src/wrapper/Plumed.c:84: first defined here

and similar then finally

collect2: ld returned 1 exit status
make[2]: *** [lib/libgromacs_mpi.so.0.0.0] Error 1
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [all] Error 2

Giovanni Bussi

unread,
Jun 8, 2015, 12:58:41 PM6/8/15
to plumed...@googlegroups.com
Everything seems correct.

Can you try cmake instead of ccmake? Anyway, I don't think this will solve the issue. Perhaps someone with more experience with GMX 5 can give a more informed help.

Giovanni 

Inviato da iPhone

James Krieger

unread,
Jun 8, 2015, 1:55:15 PM6/8/15
to plumed...@googlegroups.com
The final error is as before. Here's the full output from cmake in case that helps:


cmake -DGMX_MPI=ON ../gromacs-5.0.4-src/ -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/lmb/home/jkrieger/bin/gromacs-plumed-mpi -DCMAKE_C_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicc -DCMAKE_CXX_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicc
-- Check for working C compiler: /lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx
-- Check for working CXX compiler: /lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for NVIDIA GPUs present in the system
-- Could not detect NVIDIA GPUs
-- No compatible CUDA toolkit found (v4.0+), disabling native GPU acceleration
-- Checking for GCC x86 inline asm
-- Checking for GCC x86 inline asm - supported
-- Detecting best SIMD instructions for this CPU
-- Detected best SIMD instructions for this CPU - AVX_256
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp 
-- Performing Test CFLAGS_WARN
-- Performing Test CFLAGS_WARN - Success
-- Performing Test CFLAGS_WARN_EXTRA
-- Performing Test CFLAGS_WARN_EXTRA - Success
-- Performing Test CFLAGS_WARN_REL
-- Performing Test CFLAGS_WARN_REL - Success
-- Performing Test CFLAGS_WARN_UNINIT
-- Performing Test CFLAGS_WARN_UNINIT - Success
-- Performing Test CFLAGS_EXCESS_PREC
-- Performing Test CFLAGS_EXCESS_PREC - Failed
-- Performing Test CFLAGS_COPT
-- Performing Test CFLAGS_COPT - Success
-- Performing Test CFLAGS_NOINLINE
-- Performing Test CFLAGS_NOINLINE - Success
-- Performing Test CXXFLAGS_WARN
-- Performing Test CXXFLAGS_WARN - Success
-- Performing Test CXXFLAGS_WARN_EXTRA
-- Performing Test CXXFLAGS_WARN_EXTRA - Success
-- Performing Test CXXFLAGS_WARN_REL
-- Performing Test CXXFLAGS_WARN_REL - Success
-- Performing Test CXXFLAGS_EXCESS_PREC
-- Performing Test CXXFLAGS_EXCESS_PREC - Failed
-- Performing Test CXXFLAGS_COPT
-- Performing Test CXXFLAGS_COPT - Success
-- Performing Test CXXFLAGS_NOINLINE
-- Performing Test CXXFLAGS_NOINLINE - Success
-- gcc 4.4.7 detected, using -O3, will apply workaround for optimization bug (disable with GMX_DISABLE_GCC44_BUG_WORKAROUND)
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file dirent.h
-- Looking for include file dirent.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file io.h
-- Looking for include file io.h - not found
-- Looking for include file sched.h
-- Looking for include file sched.h - found
-- Looking for include file regex.h
-- Looking for include file regex.h - found
-- Looking for C++ include regex
-- Looking for C++ include regex - not found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for memalign
-- Looking for memalign - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for fsync
-- Looking for fsync - found
-- Looking for _fileno
-- Looking for _fileno - not found
-- Looking for fileno
-- Looking for fileno - found
-- Looking for _commit
-- Looking for _commit - not found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for rsqrt
-- Looking for rsqrt - not found
-- Looking for rsqrtf
-- Looking for rsqrtf - not found
-- Looking for sqrtf
-- Looking for sqrtf - found
-- Looking for sqrt in m
-- Looking for sqrt in m - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Checking for sched.h GNU affinity API
-- Performing Test sched_affinity_compile
-- Performing Test sched_affinity_compile - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- MPI is not compatible with thread-MPI. Disabling thread-MPI.
-- Checking for MPI_IN_PLACE
-- Performing Test MPI_IN_PLACE_COMPILE_OK
-- Performing Test MPI_IN_PLACE_COMPILE_OK - Success
-- Checking for MPI_IN_PLACE - yes
-- Performing Test CATAMOUNT_COMPILE_OK
-- Performing Test CATAMOUNT_COMPILE_OK - Failed
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.7.6")
-- Looking for xmlTextWriterEndAttribute in /usr/lib64/libxml2.so
-- Looking for xmlTextWriterEndAttribute in /usr/lib64/libxml2.so - found
-- Looking for include file libxml/parser.h
-- Looking for include file libxml/parser.h - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Atomic operations found
-- Performing Test PTHREAD_SETAFFINITY
-- Performing Test PTHREAD_SETAFFINITY - Success
-- Could NOT find Boost

Boost >= 1.44 not found. Using minimal internal version. This may cause trouble if you plan on compiling/linking other software that uses Boost against Gromacs.
-- Looking for zlibVersion in /usr/lib64/libz.so
-- Looking for zlibVersion in /usr/lib64/libz.so - found
-- Setting build user/date/host/cpu information
-- Setting build user & time - OK
-- Checking floating point format
-- Checking floating point format - IEEE754 (LE byte, LE word)
-- Checking for 64-bit off_t
-- Checking for 64-bit off_t - present
-- Checking for fseeko/ftello
-- Checking for fseeko/ftello - present
-- Checking for SIGUSR1
-- Checking for SIGUSR1 - found
-- Checking for pipe support
-- Checking for isfinite
-- Performing Test isfinite_compile_ok
-- Performing Test isfinite_compile_ok - Success
-- Checking for isfinite - yes
-- Checking for _isfinite
-- Performing Test _isfinite_compile_ok
-- Performing Test _isfinite_compile_ok - Failed
-- Checking for _isfinite - no
-- Checking for _finite
-- Performing Test _finite_compile_ok
-- Performing Test _finite_compile_ok - Failed
-- Checking for _finite - no
-- Performing Test CXXFLAG_STD_CXX0X
-- Performing Test CXXFLAG_STD_CXX0X - Success
-- Performing Test GMX_CXX11_SUPPORTED
-- Performing Test GMX_CXX11_SUPPORTED - Failed
-- Checking for system XDR support
-- Checking for system XDR support - present
-- Try C compiler AVX (256 bit) flag = [-mavx]
-- Performing Test C_FLAG_mavx
-- Performing Test C_FLAG_mavx - Success
-- Performing Test C_SIMD_COMPILES_FLAG_mavx
-- Performing Test C_SIMD_COMPILES_FLAG_mavx - Success
-- Try C++ compiler AVX (256 bit) flag = [-mavx]
-- Performing Test CXX_FLAG_mavx
-- Performing Test CXX_FLAG_mavx - Success
-- Performing Test CXX_SIMD_COMPILES_FLAG_mavx
-- Performing Test CXX_SIMD_COMPILES_FLAG_mavx - Success
-- Checking for gcc AVX maskload bug
-- Checking for gcc AVX maskload bug - not present
-- Enabling 256-bit AVX SIMD instructions
-- Performing Test _callconv___vectorcall
-- Performing Test _callconv___vectorcall - Failed
-- Performing Test _callconv___regcall
-- Performing Test _callconv___regcall - Failed
-- Performing Test _callconv_
-- Performing Test _callconv_ - Success
-- The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2
-- Using external FFT library - FFTW3
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Checking for dlopen
-- Performing Test HAVE_DLOPEN
-- Performing Test HAVE_DLOPEN - Success
-- Checking for dlopen - found
-- Using dynamic plugins (e.g VMD-supported file formats)
-- Checking for suitable VMD version
-- VMD plugins not found. Path to VMD can be set with VMDDIR.
-- Using default binary suffix: "_mpi"
-- Using default library suffix: "_mpi"
-- Could NOT find Pandoc (missing:  PANDOC_EXECUTABLE)
-- Found PythonInterp: /lmb/home/jkrieger/anaconda/bin/python (found version "2.7.6")
-- Performing Test HAS_NO_UNUSED_VARIABLE
-- Performing Test HAS_NO_UNUSED_VARIABLE - Success
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Performing Test HAS_NO_UNUSED_PARAMETER
-- Performing Test HAS_NO_UNUSED_PARAMETER - Success
-- Performing Test HAS_NO_DEPRECATED_REGISTER
-- Performing Test HAS_NO_DEPRECATED_REGISTER - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /lmb/home/jkrieger/bin/gromacs-plumed-mpi

Giovanni Bussi

unread,
Jun 8, 2015, 2:02:10 PM6/8/15
to plumed...@googlegroups.com
Hi perhaps I found the error. It seems that Plumed.o file is linked twice, once inside the library lib/libgromacs_mpi.so and once again in the executable gmx_mpi.

Type
make VERBOSE=1

Then check the command which contains "-o ../../bin/gmx_mpi". On the same line there should be explicitly written "/whateverpath/src/wrapper/Plumed.o". Just remove that .o file and re-execute the command on the command line. E.g., on my mac, the command is

cd /Users/bussi/gromacs/build2/src/programs && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/gmx.dir/link.txt --verbose=1
/opt/local/bin/mpicxx-openmpi-mp    -mavx    -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function -Wno-unknown-pragmas  -O3 -DNDEBUG   -Wl,-search_paths_first -Wl,-headerpad_max_install_names     CMakeFiles/gmx.dir/gmx.cpp.o CMakeFiles/gmx.dir/legacymodules.cpp.o CMakeFiles/mdrun_objlib.dir/mdrun/md.c.o CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o CMakeFiles/mdrun_objlib.dir/mdrun/pme_loadbal.c.o CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.c.o CMakeFiles/mdrun_objlib.dir/mdrun/runner.c.o CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o CMakeFiles/view_objlib.dir/view/view.cpp.o  -o ../../bin/gmx_mpi  ../../lib/libgromacs_mpi.0.0.0.dylib -lm /usr/lib/libz.dylib ../contrib/fftw/fftwBuild-prefix/lib/libfftw3f.a -framework Accelerate /Users/bussi/plumed2/src/wrapper/Plumed.o -ldl -Wl,-rpath,@executable_path/../lib

and I replaced it with 

cd /Users/bussi/gromacs/build2/src/programs && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/gmx.dir/link.txt --verbose=1
/opt/local/bin/mpicxx-openmpi-mp    -mavx    -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function -Wno-unknown-pragmas  -O3 -DNDEBUG   -Wl,-search_paths_first -Wl,-headerpad_max_install_names     CMakeFiles/gmx.dir/gmx.cpp.o CMakeFiles/gmx.dir/legacymodules.cpp.o CMakeFiles/mdrun_objlib.dir/mdrun/md.c.o CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o CMakeFiles/mdrun_objlib.dir/mdrun/pme_loadbal.c.o CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.c.o CMakeFiles/mdrun_objlib.dir/mdrun/runner.c.o CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o CMakeFiles/view_objlib.dir/view/view.cpp.o  -o ../../bin/gmx_mpi  ../../lib/libgromacs_mpi.0.0.0.dylib -lm /usr/lib/libz.dylib ../contrib/fftw/fftwBuild-prefix/lib/libfftw3f.a -framework Accelerate -ldl -Wl,-rpath,@executable_path/../lib

Perhaps your linked gets in trouble with this.

Let me know if this fix works.

Giovanni

James Krieger

unread,
Jun 8, 2015, 4:28:55 PM6/8/15
to plumed...@googlegroups.com
Hi Giovanni,

I have found the file with "-o ../../bin/gmx_mpi" (it is /lmb/home/jkrieger/bin/gromacs-plumed-mpi/src/programs/CMakeFiles/gmx.dir/link.txt) and I have made the following change:

/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx    -mavx    -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function  -O3 -DNDEBUG -fomit-frame-pointer -funroll-all-loops  -Wno-array-bounds       CMakeFiles/gmx.dir/gmx.cpp.o CMakeFiles/gmx.dir/legacymodules.cpp.o CMakeFiles/mdrun_objlib.dir/mdrun/pme_loadbal.c.o CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o CMakeFiles/mdrun_objlib.dir/mdrun/runner.c.o CMakeFiles/mdrun_objlib.dir/mdrun/md.c.o CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.c.o CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o CMakeFiles/view_objlib.dir/view/view.cpp.o  -o ../../bin/gmx_mpi -rdynamic ../../lib/libgromacs_mpi.so.0.0.0 -fopenmp -ldl -lrt -lm -lz ../contrib/fftw/fftwBuild-prefix/lib/libfftw3f.a -lblas -llapack -lblas -llapack /lmb/home/jkrieger/bin/plumed-2.1.2_mpi/lib/plumed-mpi///src/wrapper/Plumed.o -ldl -Wl,-rpath,/lmb/home/jkrieger/bin/gromacs-plumed-mpi/lib:

to

/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx    -mavx    -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function  -O3 -DNDEBUG -fomit-frame-pointer -funroll-all-loops  -Wno-array-bounds       CMakeFiles/gmx.dir/gmx.cpp.o CMakeFiles/gmx.dir/legacymodules.cpp.o CMakeFiles/mdrun_objlib.dir/mdrun/pme_loadbal.c.o CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o CMakeFiles/mdrun_objlib.dir/mdrun/runner.c.o CMakeFiles/mdrun_objlib.dir/mdrun/md.c.o CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.c.o CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o CMakeFiles/view_objlib.dir/view/view.cpp.o  -o ../../bin/gmx_mpi -rdynamic ../../lib/libgromacs_mpi.so.0.0.0 -fopenmp -ldl -lrt -lm -lz ../contrib/fftw/fftwBuild-prefix/lib/libfftw3f.a -lblas -llapack -ldl -Wl,-rpath,/lmb/home/jkrieger/bin/gromacs-plumed-mpi/lib:

However this has not helped.

Giovanni Bussi

unread,
Jun 9, 2015, 2:48:50 AM6/9/15
to plumed...@googlegroups.com
Hi,

I reproduced the problem on my workstation.

You should edit the file
build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt

It should contain the Plumed.o object twice (in my case /u/sbp/bussi/modules/Plumed/test/lib/plumed///src/wrapper/Plumed.o).
You have to manually remove one of the instances.

Let me know if this fixes your issue!

Giovanni

James Krieger

unread,
Jun 9, 2015, 6:48:24 AM6/9/15
to plumed...@googlegroups.com
Make works but make install fails with the following error:


CMake Error at src/programs/cmake_install.cmake:42 (FILE):
  file INSTALL cannot find
  "/lmb/home/jkrieger/bin/gromacs-plumed-mpi/bin/gmx_mpi".
Call Stack (most recent call first):
  src/cmake_install.cmake:40 (INCLUDE)
  cmake_install.cmake:49 (INCLUDE)

and indeed gmx_mpi isn't there.

Giovanni Bussi

unread,
Jun 9, 2015, 6:54:11 AM6/9/15
to plumed...@googlegroups.com
Did you remove the duplicate Plumed.o file also from:
/lmb/home/jkrieger/bin/gromacs-plumed-mpi/src/programs/CMakeFiles/gmx.dir/link.txt
?

Giovanni


James Krieger

unread,
Jun 9, 2015, 7:04:53 AM6/9/15
to plumed...@googlegroups.com
Yes. I removed the second mention. Should I try removing the first one instead?

James Krieger

unread,
Jun 9, 2015, 7:06:56 AM6/9/15
to plumed...@googlegroups.com
Actually no. I only deleted from /lmb/home/jkrieger/bin/gromacs-plumed-mpi/src/gromacs/CMakeFiles/libgromacs.dir/link.txt that time. I'll try now to delete from both.
...

Giovanni Bussi

unread,
Jun 9, 2015, 7:09:36 AM6/9/15
to plumed...@googlegroups.com
Sorry. I double checked on my workstation and it should be sufficient to remove one of the duplicate Plumed.o from src/gromacs/CMakeFiles/libgromacs.dir/link.txt

After compilation, you should have these files
/bin/gmx_mpi
/lib/libgromacs_mpi.so

Is one of those missing?

James Krieger

unread,
Jun 9, 2015, 7:25:12 AM6/9/15
to plumed...@googlegroups.com
Yes bin/gmx_mpi is missing. The same is true both times I deleted from src/gromacs/CMakeFiles/libgromacs.dir/link.txt (regardless of whether I deleted from /lmb/home/jkrieger/bin/gromacs-plumed-mpi/src/programs/CMakeFiles/gmx.dir/link.txt also).

Giovanni Bussi

unread,
Jun 9, 2015, 7:28:05 AM6/9/15
to plumed...@googlegroups.com
On my workstation bin/gmx_mpi is present and seems to be created by "make".

Do you see any error from "make" related to that?



James Krieger

unread,
Jun 9, 2015, 7:35:38 AM6/9/15
to plumed...@googlegroups.com
No. Make abruptly ends after that:

Linking CXX executable ../../bin/gmx_mpi
cd /lmb/home/jkrieger/bin/gromacs-plumed-mpi/src/programs && /usr/bin/cmake -E cmake_link_script CMakeFiles/gmx.dir/link.txt --verbose=1
/lmb/home/jkrieger/bin/mpich-3.1.4-build/bin/mpicxx    -mavx    -Wextra -Wno-missing-field-initializers -Wpointer-arith -Wall -Wno-unused-function  -O3 -DNDEBUG -fomit-frame-pointer -funroll-all-loops  -Wno-array-bounds       CMakeFiles/gmx.dir/gmx.cpp.o CMakeFiles/gmx.dir/legacymodules.cpp.o CMakeFiles/mdrun_objlib.dir/mdrun/pme_loadbal.c.o CMakeFiles/mdrun_objlib.dir/mdrun/membed.c.o CMakeFiles/mdrun_objlib.dir/mdrun/runner.c.o CMakeFiles/mdrun_objlib.dir/mdrun/md.c.o CMakeFiles/mdrun_objlib.dir/mdrun/repl_ex.c.o CMakeFiles/mdrun_objlib.dir/mdrun/mdrun.cpp.o CMakeFiles/view_objlib.dir/view/view.cpp.o  -o ../../bin/gmx_mpi -rdynamic ../../lib/libgromacs_mpi.so.0.0.0 -fopenmp -ldl -lrt -lm -lz ../contrib/fftw/fftwBuild-prefix/lib/libfftw3f.a -lblas -llapack -lblas -llapack -ldl -Wl,-rpath,/lmb/home/jkrieger/bin/gromacs-plumed-mpi/lib:
/usr/bin/cmake -E cmake_progress_report /lmb/home/jkrieger/bin/gromacs-plumed-mpi/CMakeFiles
[100%] Built target gmx
/usr/bin/cmake -E cmake_progress_start /lmb/home/jkrieger/bin/gromacs-plumed-mpi/CMakeFiles 0
...

Giovanni Bussi

unread,
Jun 9, 2015, 9:45:16 AM6/9/15
to plumed...@googlegroups.com
This is weird. The command you paste should create file bin/gmx_mpi, and I cannot understand why it doesn't. Sorry but I am afraid I can't help on this

Giovanni

James Krieger

unread,
Jun 9, 2015, 10:43:39 AM6/9/15
to plumed...@googlegroups.com
Thanks for trying. Hopefully someone else can.
...

James Krieger

unread,
Jun 9, 2015, 11:15:08 AM6/9/15
to plumed...@googlegroups.com
This appears to be a problem with my system or gromacs 5 as it still happens when I remove plumed (patch -r). I am now discussing it with Mark Abraham on the gmx-users list e.g. https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2015-June/098268.html
...

James Krieger

unread,
Jun 9, 2015, 2:23:14 PM6/9/15
to plumed...@googlegroups.com
Here is the solution. Thanks to both Giovanni Bussi and Mark Abraham for your help.

0. configure/make/install mpi compilers (separate src, build and install directories are used as suggested by MA)

tar -xvzfc mpich-3.1.4.tar.gz mpich-3.1.4-src
mkdir mpich-3.1.4-build
mkdir mpich-3.1.4-install
cd mpich-3.1.4-build
../mpich-3.1.4-src/configure --prefix=/lmb/home/jkrieger/bin/mpich-3.1.4-install | & tee c.txt
make VERBOSE=1 | & tee m.txt
make install VERBOSE=1 | & tee mi.txt

1. configure/make/install plumed with addition of -fPIC to CFLAGS in Makefile.conf before making (plumed-2.1.2 appears to need to be built in the src directory)

tar -xvzfc plumed-2.1.2.tgz plumed-2.1.2-src
mkdir plumed-2.1.2-install
cd plumed-2.1.2-src
./configure --prefix=/lmb/home/jkrieger/bin/plumed-2.1.2-install/ CC=/lmb/home/jkrieger/bin/mpich-3.1.4-install/bin/mpicc CXX=/lmb/home/jkrieger/bin/mpich-3.1.4-install/bin/mpicxx
manually add -fPIC to CFLAGS in Makefile.conf (done using vi)
make VERBOSE=1 | & tee m.txt
make install VERBOSE=1 | & tee mi.txt
update PATH and LD_LIBRARY_PATH (added to ~/.login on my system and applied by logging out and back in again)

2. patch plumed onto gromacs in --runtime mode (as per recommendation of GB)

cd ~/bin
cp -r gromacs-5.0.4-src/ gromacs-5.0.4-src-plumed/
mkdir gromacs-5.0.4-build-plumed
mkdir gromacs-5.0.4-install-plumed
cd gromacs-5.0.4-src-plumed/
plumed patch -p --runtime

3. configure/make/install gromacs with separate src/build/install directories (as per recommendation of MA) with removal of duplicate reference to Plumed.o from build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt (as per recommendation of GB)

cd ../
gromacs-5.0.4-build-plumed
cmake -DGMX_MPI=ON ../gromacs-5.0.4-src-plumed/ -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/lmb/home/jkrieger/bin/gromacs-5.0.4-install-plumed -DCMAKE_C_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-install/bin/mpicc -DCMAKE_CXX_COMPILER=/lmb/home/jkrieger/bin/mpich-3.1.4-install/bin/mpicxx
remove duplicate reference to Plumed.o from build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt (again with vi)
make VERBOSE=1 | & tee m.txt
make install VERBOSE=1 | & tee mi.txt
update PATH and LD_LIBRARY_PATH (vi ~/.login, log out, log in again)
...

Giovanni Bussi

unread,
Jun 9, 2015, 2:59:18 PM6/9/15
to plumed...@googlegroups.com
Hey James,

thanks for the very helpful report.

Concerning the two problematic points in plumed I opened an issue:

The first one (adding -fPIC to CFLAGS) is already fixed in branch 2.1 from github (to be 2.1.3) so that the flag will be automatically included.

The second one is more complex to be solved. Meanwhile, the workaround of editing by hand the file build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt  should work.

Giovanni


jamesm...@gmail.com

unread,
Jun 9, 2015, 4:41:55 PM6/9/15
to plumed...@googlegroups.com
You're welcome. Thanks again for your help.


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/stlK9-kaa6A/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.

James Krieger

unread,
Jun 10, 2015, 5:22:41 AM6/10/15
to plumed...@googlegroups.com
Unfortunately it's still not working. mdrun_mpi gives me the following error:

Fatal error:
Plumed is not available. Check your PLUMED_KERNEL variable.

Any ideas what's wrong now?
...

Giovanni Bussi

unread,
Jun 10, 2015, 5:24:48 AM6/10/15
to plumed...@googlegroups.com
You should set the PLUMED_KERNEL environment variable properly (see the modulefile generated upon install).
It should be the path of a file named libplumedKernel.so (with possible suffix)

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.

James Krieger

unread,
Jun 10, 2015, 6:51:17 AM6/10/15
to plumed...@googlegroups.com
Thanks. I've now fixed that.

--
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/stlK9-kaa6A/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,
Jun 10, 2015, 6:56:44 AM6/10/15
to plumed...@googlegroups.com
Just as a reminder: if you install a new plumed version (using same settings/compilers/etc) you should be able to use it by just setting PLUMED_KERNEL at run time.

Giovanni


James Krieger

unread,
Jun 10, 2015, 7:05:45 AM6/10/15
to plumed...@googlegroups.com
Message has been deleted

James Krieger

unread,
Jun 10, 2015, 8:38:19 AM6/10/15
to plumed...@googlegroups.com
Actually that solution wasn't quite right because I didn't have the mpi compilers set up properly. That resulted in gromacs not being mpi-aware but rather launching a separate mdrun_mpi process on each node requested.

Instead here's an updated solution that uses the default mpicc and mpicxx wrappers (from openmpi-1.5.4 on my system).


1. configure/make/install plumed with addition of -fPIC to CFLAGS in Makefile.conf before making (plumed-2.1.2 appears to need to be built in the src directory)

tar -xvzf plumed-2.1.2.tgz
mv plumed-2.1.2 plumed-2.1.2-src

mkdir plumed-2.1.2-install
cd plumed-2.1.2-src
./configure --prefix=/lmb/home/jkrieger/
bin/plumed-2.1.2-install/ CC=mpicc CXX=mpicxx

manually add -fPIC to CFLAGS in Makefile.conf (done using vi)
make VERBOSE=1 | & tee m.txt
make install VERBOSE=1 | & tee mi.txt
update PATH, LD_LIBRARY_PATH and PLUMED_KERNEL (added to ~/.login on my system and applied by logging out and back in again)


2. patch plumed onto gromacs in --runtime mode (as per recommendation of GB)

cd ~/bin
cp -r gromacs-5.0.4-src/ gromacs-5.0.4-src-plumed/
mkdir gromacs-5.0.4-build-plumed
mkdir gromacs-5.0.4-install-plumed
cd gromacs-5.0.4-src-plumed/
plumed patch -p --runtime

3. configure/make/install gromacs with separate src/build/install directories (as per recommendation of MA) with removal of duplicate reference to Plumed.o from build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt (as per recommendation of GB)

cd ../
gromacs-5.0.4-build-plumed
cmake -DGMX_MPI=ON ../gromacs-5.0.4-src-plumed/ -DGMX_BUILD_OWN_FFTW=ON -DCMAKE_INSTALL_PREFIX=/lmb/home/jkrieger/bin/gromacs-5.0.4-install-plumed -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx

remove duplicate reference to Plumed.o from build-dir/src/gromacs/CMakeFiles/libgromacs.dir/link.txt (again with vi)
make VERBOSE=1 | & tee m.txt
make install VERBOSE=1 | & tee mi.txt
update PATH and LD_LIBRARY_PATH (vi ~/.login, log out, log in again)
...

James Krieger

unread,
Jun 10, 2015, 11:19:49 AM6/10/15
to plumed...@googlegroups.com
Something's still not right. At this point GROMACS is MPI-aware and can spread across multiple computers (nodes) when submitted to SGE with -pe openmpi in the submission script. However when adding asking it to use plumed for metad it fails unless it stays on a single machine (specified with -pe smp). It's not a problem of plumed not being compiled in MPI mode as using plumed to report on CVs without metad works across multiple nodes.
...

James Krieger

unread,
Jun 11, 2015, 11:30:41 AM6/11/15
to plumed...@googlegroups.com
I've found a work-around: using -pe openmpi #nodes with -l dedicated #threads/node (24 in my case) and OMP_NUM_THREADS #threads/nodes.
...

James Krieger

unread,
Aug 10, 2016, 5:17:42 PM8/10/16
to PLUMED users
The duplicate reference to Plumed.o problem reasserts itself when compiling with GPU as the make install step re-runs cmake. The solution here is to follow my previous protocol then after running the make install step you delete the duplicate reference again and run the make install step again.

jbmvi...@gmail.com

unread,
Aug 18, 2016, 5:32:37 AM8/18/16
to PLUMED users
thanks a lot ! I used the option"plumed patch -p --shared" instead of "plumed-patch -p " successfully to compile  gromacs-5.0.2 with plumed-2.1.0 without any errors!

在 2015年5月23日星期六 UTC+8上午6:44:23,Abolfazl Noorjahan写道:
Hello

I am trying to compile the gromacs with plumed patch applied. But I keep getting the following error:

PlumedStatic.cpp:(.text+0x476): multiple definition of `PLUMED_F_GLOBAL__'
/usr/local/lib/plumed///src/wrapper/PlumedStatic.o:PlumedStatic.cpp:(.text+0x476): first defined here
collect2: ld returned 1 exit status
make[2]: *** [lib/libgromacs.so.0.0.0] Error 1
make[1]: *** [src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [all] Error 2

James Krieger

unread,
Aug 18, 2016, 5:37:52 AM8/18/16
to plumed...@googlegroups.com
You're welcome.

--
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/stlK9-kaa6A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to plumed-users+unsubscribe@googlegroups.com.

To post to this group, send email to plumed...@googlegroups.com.

dmitrii.m...@gmail.com

unread,
Mar 9, 2017, 10:28:05 AM3/9/17
to PLUMED users
Dear James,

As I understand you, in case of compiling with GPU I need to first run the cmake, then delete the extra links from both gromacs/src/programs/CMakeFiles/gmx.dir/link.txt and gromacs/src/gromacs/CMakeFiles/libgromacs.dir/link.txt. Then I ran make, make install, deleted again the extra links (-ldl -lrt /mnt/data/users/dm4/vol12/nikolaev_1772/lib/plumed/obj/Plumed.o), ran "make install". However, the error of multiple definition error occurs again.

Maybe I didn't understand something about fixing this problem?
</blockqu

James Krieger

unread,
Mar 9, 2017, 7:58:34 PM3/9/17
to plumed...@googlegroups.com
I don't remember the details exactly but it won't help to delete after make install. You should delete after make or after make check I think.
--
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/stlK9-kaa6A/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.
Reply all
Reply to author
Forward
0 new messages