Linking Error while installing plumed-2.4.1 with Intel MPI

758 views
Skip to first unread message

Abhi

unread,
Jun 19, 2018, 9:04:06 AM6/19/18
to PLUMED users
Hello

I have been trying to install plumed-2.4.1 (with gromacs-5.1.4) on a linux cluster. Initially, I installed both gromacs and plumed using MVAPICH2(ver-2.3) that was installed locally. In this case both plumed and gromacs were compiled without errors. But while running a test simulation with gromacs, I got a number of errors that indicated problems with MVAPICH2 MPI stack. The cluster admin recommeded using Intel MPI compilers they provide.

Now using Intel MPI, although gromacs was compiled and ran without any errors, I found problems compiling plumed. Following describes the steps I followed:

1.  >  ./configure --prefix=/home/acusers/pbalaji/install/plumed-2.4.1 LDFLAGS="-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/" CPPFLAGS="-I/home/acusers/pbalaji/install/libmatheval/include/ -I/home/acusers/pbalaji/install/xdrfile/include/ -I/home/apps/ics/impi/latest/include64/" CXX=/home/apps/ics/impi/latest/bin64/mpicxx
      >>During configuration step, I found warning during lookup for mpi.h
Output:
>   checking mpi.h presence... yes
configure: WARNING: mpi.h: present but cannot be compiled
configure: WARNING: mpi.h:     check for missing prerequisite headers?
configure: WARNING: mpi.h: see the Autoconf documentation
configure: WARNING: mpi.h:     section "Present But Cannot Be Compiled"
configure: WARNING: mpi.h: proceeding with the compiler's result
checking for mpi.h... no
configure: WARNING: cannot enable __PLUMED_HAS_MPI

I found elsewhere online (some Intel MPI forum) that adding CXXFLAGS=-DMPICH_IGNORE_CXX_SEEK should help. So my updated configure command was:

    >  ./configure --prefix=/home/acusers/pbalaji/install/plumed-2.4.1 LDFLAGS="-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64    /libmpi.so -L/home/acusers/pbalaji/install/libmatheval/lib/" CPPFLAGS="-I/home/acusers/pbalaji/install/libmatheval/include/ -I/home/acusers/pbalaji/install/xdrfile/include/ -I/home/apps/ics/impi/latest/include64/" CXX=/home/apps/ics/impi/latest/bin64/mpicxx CXXFLAGS=-DMPICH_IGNORE_CXX_SEEK

This time, the configuration ran without any errors.

2. > make

In this step while linking, I got errors, again related to MPI.

Linking step that fails:
    /home/apps/ics/impi/latest/bin64/mpicxx  ../main/main.o "/home/acusers/pbalaji/install/plumed-2.4.1/src/lib/libplumed.so" -o plumed-shared -ldl

The error was:
    /usr/bin/ld: MPIR_Thread: TLS definition in /home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi_mt.so.4 section .tbss mismatches non-TLS definition in /home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi.so section .bss
    /home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi_mt.so.4: could not read symbols: Bad value
    collect2: error: ld returned 1 exit status
    make[4]: *** [plumed-shared] Error 1
 
Please notice that the Intel MPI library path that I passed to configure is was different compared to the library path the crops up in the error. So, it is entirely unclear what is the problem here. I checked that there are a number of locations where different version of Intel MPI (even openmpi and mvapich2) are installed.
Eg:
/usr/mpi/gcc/openmpi-1.4.3/lib64/libmpi.so
/usr/mpi/gcc/mvapich-1.2.0/lib/shared/libmpich.so
/home/apps/ics/impi/4.1.3.049/lib64/libmpi.so
/home/apps/ics/impi/latest/lib64/libmpi.so

The last one is the recommended library, that I have passed in configure step. But plumed somehow finds the penultimate library (ver-4.1.3.049).

Finally, I repeated the configure and make step using ver 4.1.3.049 Intel MPI. But surprisingly I still get the exact same error during linking.

Some clues towards solving this would be a great help.

Thanks in advance.

Abhishek


Abhi

unread,
Jun 19, 2018, 3:20:25 PM6/19/18
to PLUMED users
 Updates:

 Based on suggestions I found by googling, I ran the configure step (as mentioned in prev. mail) using additional flags( CXXFLAGS=-mt_mpi and LDFLAGS=-lmpi_mt).
 
This time, both configure and make steps ran without any errors. But at the end of the compilation step, I could not find libKernel.so in $install_dir/src/lib. I have attached the make output as outf_make.txt.

 I also ran > make check
 Output:
+++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Final report:
+ 262 tests performed, 145 tests not applicable
+ 0 errors found
+ Well done!!
+++++++++++++++++++++++++++++++++++++++++++++++++++++

So it seems everything was compiled correctly.

Finally when I run >make install, I get an error.

cp install/libplumedWrapper.a "/home/acusers/pbalaji/install/plumed-2.4.1/lib/libplumedWrapper.a"
cp: cannot stat `install/libplumedWrapper.a': No such file or directory
make[2]: *** [install] Error 1
make[2]: Leaving directory `/home/acusers/pbalaji/install/plumed-2.4.1/src/lib'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/acusers/pbalaji/install/plumed-2.4.1/src'
make: *** [install] Error 2

The full output is attached as outf_install.txt.

It would be helpful if Plumed developers can suggest some workaround.

Thanks. 
outf_make.txt
outf_install.txt

Giovanni Bussi

unread,
Jun 19, 2018, 3:38:14 PM6/19/18
to plumed...@googlegroups.com
Can you share the output of configure as well?

--
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 https://groups.google.com/group/plumed-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/plumed-users/9a187eba-f7d9-4e01-8bb8-9ec538cf34ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Sent from Gmail mobile

Giovanni Bussi

unread,
Jun 19, 2018, 4:06:15 PM6/19/18
to plumed...@googlegroups.com
From your output files it looks like for some reason shared libraries are not working on your system.

Which operating system are you using?

Also notice that there is a small bug in the src/lib/Makefile of v2.4.1 (fixed in 2.4 branch, you can just replace it with this one:
https://raw.githubusercontent.com/plumed/plumed2/v2.4/src/lib/Makefile). Namely, when shared libs are disabled the makefile still tries to install a file that is not present. By fixing this I think you will be able to install plumed and patch gromacs with `plumed patch --static`.

However, I would suggest you to find out why configure does not enable shared libraries on your system

Giovanni



Abhi

unread,
Jun 20, 2018, 1:01:54 AM6/20/18
to PLUMED users

Abhi

unread,
Jun 20, 2018, 2:12:03 AM6/20/18
to PLUMED users
Hi,

The output of configure step is attached herein (config.log).

On Wednesday, 20 June 2018 01:36:15 UTC+5:30, Giovanni Bussi wrote:
From your output files it looks like for some reason shared libraries are not working on your system.

I believe it does work on the system as I have been installing local copies of a number of libs and packages required. I am sure .so files are being created and I am able to link to them. Actually, as mentioned initially, I could successfully compile plumed on the same system (with shared libraries as i can find libplumed.so and libplumedKernel.so in $install/src/lib) using a local installation of MVAPICH2. It is only when I use the available Intel MPI stack, I get this error. See config_mvapich2.log and outf_make_mvapich2.txt, also attached.

Which operating system are you using?


I am using Red Hat Linux Server 6.1
 
Also notice that there is a small bug in the src/lib/Makefile of v2.4.1 (fixed in 2.4 branch, you can just replace it with this one:
https://raw.githubusercontent.com/plumed/plumed2/v2.4/src/lib/Makefile). Namely, when shared libs are disabled the makefile still tries to install a file that is not present. By fixing this I think you will be able to install plumed and patch gromacs with `plumed patch --static`.

I will do this and let you know the result shortly. Thank you for the suggestion.
 
config.log
config_mvapich2.log
outf_make_mvapich2.txt

Giovanni Bussi

unread,
Jun 20, 2018, 2:44:46 AM6/20/18
to plumed...@googlegroups.com
It looks like this command is failing:

configure:8438: Using LDSHARED='/home/apps/ics/impi/latest/bin64/mpicxx -shared'
configure:8440: Using LDFLAGS='-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/ -lmpi_mt -rdynamic'
configure:8442: checking whether LDSHARED can create dynamic libraries
configure:8453: result: no

Notice that LDSHARED in our configure.ac does not include CXXFLAGS and thus does not include the option "-mt_mpi".

Can you try if configuring with this extra option solves the problem?

./configure __all_your_options__ LDSHARED="/home/apps/ics/impi/latest/bin64/mpicxx -mt_mpi"

Notice that the result of "checking whether LDSHARED can create dynamic libraries" should be positive in order for shared libraries to work correctly with plumed.

Giovanni


Abhi

unread,
Jun 20, 2018, 3:34:22 AM6/20/18
to PLUMED users
The results:

1. Your first suggestion (replacing the src/lib/Makefile). Everything worked fine. Plumed is now installed with static libs only.

2. Adding LDSHARED="/home/apps/ics/impi/latest/bin64/mpicxx -mt_mpi", the configure step does not get past the C++ compiler check.

checking whether the C++ compiler works... no
configure: error: in `/home/acusers/pbalaji/plumed-2.4.1':
configure: error: C++ compiler cannot create executables

In config.log:

configure:3212: /home/apps/ics/impi/latest/bin64/mpicxx -DMPICH_IGNORE_CXX_SEEK -I/home/acusers/pbalaji/install/libmatheval/include/ -I/home/acusers/pbalaji/install/xdrfile/include/ -I/home/apps/ics/impi/latest/include64/ -L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/ -lmpi_mt conftest.cpp  >&5
/usr/bin/ld: MPIR_Thread: TLS definition in /home/apps/ics/impi/latest/lib64//libmpi_mt.so section .tbss mismatches non-TLS definition in /home/apps/ics/impi/latest/lib64//libmpi.so section .bss
/home/apps/ics/impi/latest/lib64//libmpi.so: could not read symbols: Bad value

collect2: error: ld returned 1 exit status


This is the same error I got during the make linking step WITHOUT using CXXFLAGS=-mt_mpi and LDFLAGS=-lmpi_mt (see my first post in this thread).

Please let me know if anything else can be tried. Meanwhile, I will try patching with the -static version of plumed that installed.

Thanks.

Giovanni Bussi

unread,
Jun 20, 2018, 3:38:27 AM6/20/18
to plumed...@googlegroups.com
Hi,

I think the flat -mt_mpi should appear both in CXXFLAGS and in LDSHARED.

I guess you removed it from the former.

Giovanni


Abhi

unread,
Jun 20, 2018, 5:00:51 AM6/20/18
to PLUMED users
Okey, this time included -mt_mpi in both CXXFLAGS and LDFLAGS. The result is the same however.

The config command used:

./configure --prefix=/home/acusers/pbalaji/install/plumed-2.4.1 LDFLAGS="-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/ -lmpi_mt" CPPFLAGS="-I/home/acusers/pbalaji/install/libmatheval/include/ -I/home/acusers/pbalaji/install/xdrfile/include/ -I/home/apps/ics/impi/latest/include64/" CXX=/home/apps/ics/impi/latest/bin64/mpicxx --enable-mpi --enable-external-blas --enable-external-lapack --enable-shared CXXFLAGS="-DMPICH_IGNORE_CXX_SEEK -mt_mpi" LDSHARED="/home/apps/ics/impi/latest/bin64/mpicxx -mt_mpi"

From config.log:


configure:8438: Using LDSHARED='/home/apps/ics/impi/latest/bin64/mpicxx -shared'
configure:8440: Using LDFLAGS='-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/ -lmpi_mt -rdynamic'
configure:8442: checking whether LDSHARED can create dynamic libraries
configure:8453: result: no
configure:8455: WARNING: dynamic library will be disabled

Giovanni Bussi

unread,
Jun 20, 2018, 6:55:53 AM6/20/18
to plumed...@googlegroups.com
Sorry, there's a bug in configure.ac and env var LDSHARED is not recognized (I will fix it).

You should be able to obtain the same effect by adding the flag to LDFLAGS (and also in CXXFLAGS)

Giovanni

Abhi

unread,
Jun 20, 2018, 7:48:46 AM6/20/18
to PLUMED users
Thanks for looking into this issue.

Yes, now I can see the following in the configure output.
...
configure: Using LDSHARED='/home/apps/ics/impi/latest/bin64/mpicxx -shared'
configure: Using LDFLAGS='-L/home/acusers/pbalaji/install/lapack-3.8.0/lib64/ -L/home/acusers/pbalaji/install/xdrfile/lib/ -L/home/apps/ics/impi/latest/lib64/ -L/home/acusers/pbalaji/install/libmatheval/lib/ -lmpi_mt -mt_mpi -rdynamic'
checking whether LDSHARED can create dynamic libraries... yes

...

So, that seems like a progress. But, I am also getting the following warnings:

checking whether C can link a C++ object... no
checking whether C can link a C++ object with library -lstdc++... no
checking whether C can link a C++ object with library -lc++... no
checking whether C can link a C++ object with library -lmpi_cxx... no
configure: WARNING: You might have problems linking C programs.
configure: WARNING: Please add c++ library to LIBS
checking whether FORTRAN can link a C++ object... no
checking whether FORTRAN can link a C++ object with library -lstdc++... no
checking whether FORTRAN can link a C++ object with library -lc++... no
checking whether FORTRAN can link a C++ object with library -lmpi_cxx... no
configure: WARNING: You might have problems linking FORTRAN programs.
configure: WARNING: Please add c++ library to LIBS


Finally, on running > make I again get an error at the linking step, same as I obtained without the extra flags.

/home/apps/ics/impi/latest/bin64/mpicxx  ../main/main.o "/home/acusers/pbalaji/install/plumed-2.4.1/src/lib/libplumed.so" -o plumed-shared -ldl
/usr/bin/ld: MPIR_Thread: TLS definition in /home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi_mt.so.4 section .tbss mismatches non-TLS definition in /home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi.so section .bss
/home/apps/ics/impi/4.1.3.049/intel64/lib/libmpi_mt.so.4: could not read symbols: Bad value
collect2: error: ld returned 1 exit status

Abhishek

Giovanni Bussi

unread,
Jun 20, 2018, 8:34:48 AM6/20/18
to plumed...@googlegroups.com
I see. If you need -mt_mpi also when linking the plumed-shared executable (that is: when linking an executable that has no MPI call but is just linked to plumed library) you might have to put it in STATIC_LIBS as well. Something like

./configure __same_as_before__ STATIC_LIBS=-mt_mpi

This will make this flag also available in gromacs when you will try to link it later.

Giovanni


Abhi

unread,
Jun 20, 2018, 9:18:50 AM6/20/18
to PLUMED users
Hello Giovanni,

I tried installation with STATIC_LIBS=-mt_mpi  flags as you suggested. Worked ike a charm. Plumed is now installed with shared libraries.

Many thanks for your help.

Cheers.
Abhishek

Abhi

unread,
Jun 21, 2018, 7:17:44 AM6/21/18
to PLUMED users
Finally, I successfully ran some test simulations our cluster with gromacs (v 5.1.4) patched with plumed-2.4.1 using Intel MPI.

Some final remarks that may be helpful to any users facing the problem of installing plumed with Intel MPI.

1. Plumed-2.4.1 was installed with shared library enabled using the following command:

./configure --prefix=/home/acusers/pbalaji/install/plumed-shared CXX=/home/apps/ics/impi/latest/bin64/mpicxx --enable-mpi --enable-external-blas --enable-external-lapack --enable-shared
LDFLAGS="-L/_____path to required libraries/lib/ ___ -lmpi_mt"  CPPFLAGS="-I__path to include dirs/include___"  CXXFLAGS="-DMPICH_IGNORE_CXX_SEEK -mt_mpi" STATIC_LIBS=-mt_mpi

Note the -lmpi_mt flag in LDFLAGS and -mt_mpi flag in CXXFLAGS as well as in STATIC_LIBS. This way plumed will be installed with shared libraries. However, you might notice a warning too such as "configure: WARNING: You might have problems linking C/FORTRAN programs.". But this is harmless, unless you are trying to patch an MD code with plumed-patch --static.

With gromacs, I have always found a note saying that 'building shared libraries may be problematic with MPI'; one may be inclined to try a static installation first. But as suggested in plumed installation manual, patching plumed with --static is always more cumbersome. Shared or runtime options are recommended. So I would suggest to first try --shared/--runtime patch with gromacs and check if gromacs runs without errors. Static can be tried as a last resort.

In case you absolutely want a static executable (may be needed on a cluster), then you can try the suggestion in the following link to solve the issue.

https://groups.google.com/forum/#!topic/plumed-users/y8BniXuSdHw
In my case, I patched gromacs-5.1.4 using  > plumed-patch --patch --shared. No problems whatsoever.

Cheers.

Giovanni Bussi

unread,
Jun 21, 2018, 7:19:51 AM6/21/18
to plumed...@googlegroups.com
Thanks a lot!

If you are ok with it, I will summarize some of your hints in the manual.

Giovanni

Abhishek Acharya

unread,
Jun 22, 2018, 4:36:12 AM6/22/18
to plumed...@googlegroups.com
None whatsoever. Glad to contribute to the community in any way I can.

Cheers.
Abhishek

Abhishek Acharya
Research Associate,
Department of Molecular Nutrition
CSIR-Central Food Technological Research Institute,
Mysuru-570020

To unsubscribe from this group and stop receiving emails from it, send an email to plumed-users+unsubscribe@googlegroups.com.

--
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+unsubscribe@googlegroups.com.

To post to this group, send email to plumed...@googlegroups.com.
Visit this group at https://groups.google.com/group/plumed-users.
Reply all
Reply to author
Forward
0 new messages