Error in patching Plumed2-2.1-hrex with Gromacs-4.6.7

858 views
Skip to first unread message

Abhi Acharya

unread,
Sep 18, 2014, 11:34:01 AM9/18/14
to plumed...@googlegroups.com
Hello,
I am facing a problem in installing the patched version of gromacs-4.6.7. I have tried both the -static as well as -shared modes of patching plumed.
In case of patch --static -p, in the 'make' step i have an error as below:

/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Op::Init(void (*)(void const*, void*, int, MPI::Datatype const&), bool)':
Analysis.cpp:(.text._ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb[_ZN3MPI2Op4InitEPFvPKvPviRKNS_8DatatypeEEb]+0x19): undefined reference to `ompi_mpi_cxx_op_intercept'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Intracomm::Create_graph(int, int const*, int const*, bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intracomm12Create_graphEiPKiS2_b[_ZNK3MPI9Intracomm12Create_graphEiPKiS2_b]+0x28): undefined reference to `MPI::Comm::Comm()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Graphcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI9Graphcomm5CloneEv[_ZNK3MPI9Graphcomm5CloneEv]+0x25): undefined reference to `MPI::Comm::Comm()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Cartcomm::Clone() const':
Analysis.cpp:(.text._ZNK3MPI8Cartcomm5CloneEv[_ZNK3MPI8Cartcomm5CloneEv]+0x25): undefined reference to `MPI::Comm::Comm()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Intercomm::Merge(bool) const':
Analysis.cpp:(.text._ZNK3MPI9Intercomm5MergeEb[_ZNK3MPI9Intercomm5MergeEb]+0x28): undefined reference to `MPI::Comm::Comm()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o: In function `MPI::Intracomm::Split(int, int) const':
Analysis.cpp:(.text._ZNK3MPI9Intracomm5SplitEii[_ZNK3MPI9Intracomm5SplitEii]+0x26): undefined reference to `MPI::Comm::Comm()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o:Analysis.cpp:(.text._ZNK3MPI9Intracomm6CreateERKNS_5GroupE[_ZNK3MPI9Intracomm6CreateERKNS_5GroupE]+0x2a): more undefined references to `MPI::Comm::Comm()' follow
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o:(.data.rel.ro._ZTVN3MPI8DatatypeE[_ZTVN3MPI8DatatypeE]+0x78): undefined reference to `MPI::Datatype::Free()'
/usr/local/plumed/lib/plumed///src/analysis/Analysis.o:(.data.rel.ro._ZTVN3MPI3WinE[_ZTVN3MPI3WinE]+0x48): undefined reference to `MPI::Win::Free()'
collect2: error: ld returned 1 exit status
make[2]: *** [src/kernel/mdrun_p] Error 1
make[1]: *** [src/kernel/CMakeFiles/mdrun.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

In case of shared, it was something like "No rule to make....path some plumed dynamic library file (.so)"

Kindly help.

Regards,
Abhishek

davide branduardi

unread,
Sep 18, 2014, 12:21:03 PM9/18/14
to plumed...@googlegroups.com
can you check if that looks like related to this post:

Hope that helps
D

******************************************************
Davide Branduardi
davide.b...@gmail.com
Web:
https://sites.google.com/site/davidebranduardi
******************************************************

--
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/CAB1aw3xkS%3D_McdfG-nZifZG6Knw8dAXTLdotiTxcMz7a-xNTsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Abhi Acharya

unread,
Sep 18, 2014, 1:29:23 PM9/18/14
to plumed...@googlegroups.com
Hello Dr. Davide

Thank you for your reply.

Looking at the link, I thought maybe some MPI dynamic library files are not installed properly.
So I checked OPEN-MPI install documentation and it says that the default installation is with shared libraries.
 
Regarding PLUMED, as far as I remember, it too builds dynamic libraries by default. (Someone please correct me if I am wrong.)
And PLUMED is working properly.

Only when I try to patch it with gromacs do I get the errors. Now I don't exactly have an idea how patching works, but by logic if I am patching plumed in shared mode, I would build gromacs with shared libraries enabled. I initially did that, but I got an error (I am pretty sure, the error was raised while building plumed enabled mdrun; sorry I did not have the sense at that point to copy the error). 

After that I tried to do a static build of gromacs (with of course plumed patch --static -p), but again a different error which I have provided in the first mail.

I wish I could magically decode what these errors mean. If someone can shed some more light (and some sense into me), I would be grateful. 

Thanks again.

Regards,
Abhishek

Giovanni Bussi

unread,
Sep 22, 2014, 6:27:56 AM9/22/14
to plumed...@googlegroups.com
Hi Abhi,

a few hints below.

Dynamic patch
I would try to use this, since it is a bit easier to solve these issues. Additionally, consider the --runtime patch, which allows you to install several gromacs and plumed versions and, with "module load", mix them at will. I find this setup very convenient on our local workstations.

The error you report is "No rule to make....path some plumed dynamic library file (.so)". Can you double check if the correct .so file exist?
After make you should have:
plumed2/src/lib/libplumed.so
plumed2/src/lib/libplumedKernel.so
After install you should have:
installpath/lib/plumed/src/lib/libplumed.so
installpath/lib/plumed/src/lib/libplumedKernel.so
additionally, you should have symbolic links to these files in
installpath/lib
Notice that currently all symbolic links use an absolute path, so you should not move directories around after install.

Static patch
Use this only if you are not able to solve problems with dynamic patch or if your machine requires a static executable.
Here it is often a bit of nightmare to properly find the libraries at gromacs link time. Possible solutions:
1. Configure gromacs so as to compile with a c++ compiler (I guess it should be possible, but never did it)
2. Configure gromacs so as to link with a c++ compiler (I guess it should be possible, but never did it)
3. When linking mdrun fails, redo it with "make VERBOSE=1". Then look at the (very long) command that failed. Typically:
/somepath/mpicc [+ a huge number of options]
Go to directory build/src/kermel and type
/somepath/mpicxx [+ the same options as before]
This approach works for me e.g. on BlueGene Q where I need a static executable.

Let us know if you manage to solve your issues...

Ciao!

Giovanni




Abhi Acharya

unread,
Sep 22, 2014, 10:45:38 AM9/22/14
to plumed...@googlegroups.com
Hello Dr. Giovanni.

Thank you for the response.

I checked in the install directory of plumed. It turns out that the plumed install directory (/usr/local/plumed/) does not have a directory /src. I just see /bin, /include, /lib. The said dynamic library files (libplumed.so, libplumedKernel.so) are infact in /usr/local/plumed/lib.

That seems to be the problem. So, maybe I can create the src directory and move the dynamic library files there. Will it work that way? Else kindly direct me what should I do to rectify this.

Regards,
Abhishek  


Abhi Acharya

unread,
Sep 22, 2014, 10:58:07 AM9/22/14
to plumed...@googlegroups.com
Hello, 

Sorry for the hasty response above, kindly ignore it.

I got confused initially between directories. I checked again the installation tree of plumed; the library files are in the correct directories. 

I will try to install gromacs using patch  --dynamic and give the exact output.

Regards,
Abhishek

Giovanni Bussi

unread,
Sep 22, 2014, 10:58:13 AM9/22/14
to plumed...@googlegroups.com
The right directories to check are:
/usr/local/plumed/lib/
for the symlinks and 
/usr/local/plumed/lib/plumed/src/lib
for the real file. Is this correct?

Giovanni

Abhi Acharya

unread,
Sep 22, 2014, 11:13:54 AM9/22/14
to plumed...@googlegroups.com
Hello, 

So I tried to install the patched gromacs-4.6.7 again. I get the following error in the make step:

make[2]: *** No rule to make target `/usr/local/plumed/lib/plumed/src/lib/usr/local/plumed/lib/plumed/src/lib/libplumed.so', needed by `src/kernel/mdrun_mpi'.  Stop.
make[1]: *** [src/kernel/CMakeFiles/mdrun.dir/all] Error 2

Regards,
Abhishek

Giovanni Bussi

unread,
Sep 22, 2014, 11:41:45 AM9/22/14
to plumed...@googlegroups.com
I see. Maybe there is a bug in the script that installs the Plumed.cmake.* files (which strangely does not show up on other machines).

You can fix the problem by hand as follows:

In files /usr/local/plumed/lib/plumed/src/lib/Plumed.cmake.shared and /usr/local/plumed/lib/plumed/src/lib/Plumed.cmake.runtime
replace the string "/usr/local/plumed/lib/plumed/src/lib/usr/local/plumed/lib/plumed/src/lib/libplumed.so"
with the correct path of the so file that should be "/usr/local/plumed/lib/plumed/src/lib/libplumed.so"

Everything should work properly then. I will check if the string replacement upon install can be made more robust. Let us know if this fixes your problem.

I also ask you a favor: could you send to my email the following files?
/usr/local/plumed/lib/plumed/src/lib/Plumed.cmake*
/usr/local/plumed/lib/plumed/src/lib/Plumed.inc*
plus the equivalent files in the build directory (where you compiled plumed), e.g. /plumed/root/src/lib/Plumed.cmake*

Many thanks for finding this problem!

Giovanni




Abhi Acharya

unread,
Sep 22, 2014, 1:05:14 PM9/22/14
to plumed...@googlegroups.com
Hello Dr. Giovanni,

Many thanks to you.

The error is resolved now. 

Regards,
Abhishek

Giovanni Bussi

unread,
Sep 25, 2014, 3:23:00 AM9/25/14
to plumed...@googlegroups.com
Hi,

I solved the issue (it was a bug introduced in 2.0.2). It only affects people that install plumed (with "make install") then patch an MD code using the --shared flag. The issue is fixed now on github, both v2.0 and v2.1 branches, and will appear in the next releases (2.0.5 and 2.1.1).

If someone has the same problem in the meantime, it can be solved by hand editing the Plumed.cmake.shared file (as Abhi did) or by applying the attached patch to plumed before installing.

cd /plumed/root/directory
patch -p1 < 0001-Fixed-issue-with-make-install.patch

Ciao!

Giovanni


0001-Fixed-issue-with-make-install.patch

visvald...@gmail.com

unread,
Oct 31, 2014, 6:07:24 AM10/31/14
to plumed...@googlegroups.com
I was trying to compile GROMACS467 with plumed2.1.0, and I kept getting "undefined reference to `MPI::Comm::Comm()'" errors.
It turned out the problem was my cmake being version 2.8.12, while I think this gromacs/plumed combination requires 2.8.2.
After I downgraded cmake, the problem went away.
The main problem was probably that the 2.8.12 cmake found MPI_C compiler as mpicc while the 2.8.2 cmake found mpic++ as the MPI_C_COMPILER; the latter was the required behavior.
(Also C compiler interpretation was also different, cc vs gcc, but that's probably not that important)

I hope this is helpful to someone.

Best regards,

Vis

Reply all
Reply to author
Forward
0 new messages