Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with the link to mpi libraries (plumed version 2.9.0) #1009

Open
gekbuccella opened this issue Jan 26, 2024 · 2 comments
Open

problems with the link to mpi libraries (plumed version 2.9.0) #1009

gekbuccella opened this issue Jan 26, 2024 · 2 comments

Comments

@gekbuccella
Copy link

gekbuccella commented Jan 26, 2024

Goodmorning everyone,
we're trying to compile the code (version 2.9.0) with mpi features, after (hopefully)succesfully installing openMPI-5.0.1. This is the procedure we followed:

>>> pwd
/home/TTD/
>>> wget https://github.com/plumed/plumed2/releases/download/v2.9.0/plumed-2.9.0.tgz
>>> tar xvf plumed-2.9.0.tgz
>>> mkdir plumed-2.9.0-target
>>> cd plumed-2.9.0
>>> ./configure --prefix=/home/TTD/plumed-2.9.0-target \
FC=/home/TTD/openmpi-5.0.1-target/bin/mpif90 \
CC=/home/TTD/openmpi-5.0.1-target/bin/mpicc \
CXX=/home/TTD/openmpi-5.0.1-target/bin/mpic++ \
CXXFLAGS="-Wl,-rpath=/home/TTD/openmpi-5.0.1-target/lib" \
LDSHARED="/home/TTD/openmpi-5.0.1-target/bin/mpic++ -Wl,-rpath=${INSTALL_DIR}/lib -Wl,-rpath=/home/TTD/openmpi-5.0.1-target/lib"


This configuration went fine, apparently. Please find attached the archive logs.zip in which you can find the file produced by the executable (config.log) and what was screen-printed during the configuration (config.out).
Then, we did:

>>> make -j 4

This is the phase in which we found the issue, and we cannot figure out what's going on (see the file make.out). The problem seems to be linked to some libraries that plumed cannot find where they're supposed to be. Could this be related to the versione of openMPI we installed?

Thank you in advance for any kind of help
Best regards
Giacomo
logs.zip

@GiovanniBussi
Copy link
Member

Hi,

from a quick inspection it looks like you are using conda compilers. It's a bit tricky to use them outside conda, because they use conda libraries whose path is not in the standard search path.

The first warning is:

/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: warning: libgsl.so.25, needed by libplumedKernel.so, not found (try using -rpath or -rpath-link)

Can you check where the file libgsl.so.25 is? If it is in /opt/anaconda/lib you can you try to do what we do in our conda recipe:
https://github.com/conda-forge/plumed-feedstock/blob/f6b2aae20ec705173e59b6706c9b7ffa7908cee7/recipe/build.sh#L14
Something like

export STATIC_LIBS=-Wl,-rpath-link,/opt/anaconda/lib

This could fix the warnings.

I am however afraid that also your MPI installation is not properly pointing to the place where conda libraries are installed.

@gekbuccella
Copy link
Author

gekbuccella commented Jan 31, 2024

Hi Giovanni,
thank you very much for your reply. By adding the proper links to LD_LIBRARY_PATH and LIBRARY_PATH, we were able to apparently fix all the warnings. However, the compiler is still complaining for a number of undefined refereces:

/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_rocm_runtime_initialized'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_info_set_cstring'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_common_ucx_mca_register'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_finalize_cleanup_domain'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_tsd_tracked_key_set_destructor'
/opt/anaconda/bin/../lib/gcc/x86_64-conda-linux-gnu/13.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: /home/TTD/openmpi-5.0.1-target/lib/libmpi.so: undefined reference to `opal_common_ucx_mca_proc_added'
[......]
[...]

Can you suggest a way to fix this? Is there a particular keyword to be used in the configuration step?
Many thanks
Best
Giacomo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants