Installation/compilation problem using MPI

Submitted by dventuri on Wed, 05/02/2018 - 22:59

Hello,

I'm trying to compile/install LIGGGHTS latest version but I'm having problem with the MPI.

I've set the following in [...]/LIGGGHTS-PUBLIC/src/MAKE/Makefile.user:
USE_MPI = "ON"
MPICXX_USR=/home/dventuri/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/bin/mpicxx
MPI_INC_USR=/home/dventuri/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/include/
MPI_LIB_USR=/home/dventuri/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/

These are the folders where the Intel MPI is installed (installation is up-to-date).

However I get the following error when i type "make auto":
Creating list of contact models completed.
make[1]: Entering directory '/home/dventuri/Software/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:499: *** 'Could not compile and link a simple MPI example. Test was done with MPI_LIB=/home/dventuri/intel/compilers_and_libraries_2018.2.199/linux/mpi/intel64/lib/'. Stop.
make[1]: Leaving directory '/home/dventuri/Software/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:106: recipe for target 'auto' failed
make: *** [auto] Error 2

Is it possible that there is any library missing?

Thank you.

dventuri | Thu, 05/03/2018 - 15:25

I think it is possible that the automated Makefile is not prepared for the IntelMPI.

Checking [...]/src/Obj_auto/Makefile we see at line 459 that it checks for the MPI_TYPE (MPICH or OpenMPI). I don't know where the IntelMPI falls but I know it is base on the MPICH. If so, the Makefile adds the following flags to MPI_ADDLIBS:
-lmpich -lmpichcxx
which are not available for IntelMPI.

I'll try with the MPICH in the meantime, but can we have a correction for the IntelMPI?

dventuri | Thu, 05/03/2018 - 19:03

Confirmed. Using MPICH works.

Can a moderator move the topic to the Bug section so developers can modify the Makefile?

Dheeraj420 | Thu, 05/07/2020 - 13:27

I m getting the same error.
"MPICH" i could not able to identify where exactly i need to do the changes in the file.

Can you please help me out.

Thanks

aaigner's picture

aaigner | Tue, 05/08/2018 - 10:05

Hi dventuri,

it is on our issue list. Hopefully, we can fix this with the next release.

Best wishes
Andreas

arnavajmani | Wed, 07/03/2019 - 15:09

Hi Andreas,

I just wanted to try compiling cfdem with intelmpi on our cluster. Could you please tell me if the bug has been resolved or not? Because I still encounter compilation problems and get the following error

Creating list of contact models completed.
make[1]: Entering directory `/.../LIGGGHTS/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:499: *** 'Could not compile and link a simple MPI example. Test was done with MPI_LIB=/opt/intel/compilers_and_libraries_2017/linux/mpi/lib64'. Stop.
make[1]: Leaving directory `/.../LIGGGHTS/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [auto] Error 2

Thank you and Regards,
Arnav

tjleps | Thu, 05/07/2020 - 22:40

I've had success compiling using intel 2016 compilers, on a cluster, using "$ make mpi" instead of "$ make auto". I edited the make file as follows:

CC = mpiicpc
CCFLAGS = -Ofast -funroll-loops -fstrict-aliasing -Wall -fPIC

LINK = mpiicpc
LINKFLAGS = -Ofast -fPIC

Dheeraj420 | Tue, 05/26/2020 - 08:37

hello,
I tried with "make mpi" and getting this error

make[1]: *** [Makefile:115: neigh_respa.o] Error 1
make[1]: Leaving directory '/home/dheeraj/LIGGGHTS-PUBLIC/src/Obj_mpi'
make: *** [Makefile:114: mpi] Error 2

Even I did the changes in the MAKEFILE as you recommended, after executing the command "make mpi" still getting this error.

make[1]: *** [Makefile:115: neigh_respa.o] Error 1
make[1]: Leaving directory '/home/dheeraj/LIGGGHTS-PUBLIC/src/Obj_mpi'
make: *** [Makefile:114: mpi] Error 2

The changes which i did in MAKEFILE, automatically set back to original command.

Help me out.
Thanks

MIRAND KOSUMI | Sun, 05/10/2020 - 19:19

hello,
Can you help me please:

make[1]: Entering directory '/home/mirand/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:425: *** 'Could not find a suitable mpi compiler (mpicxx or mpic++). Please specify one in the MAKE/Makefile.user using the MPICXX_USR variable or set USE_MPI to "OFF"'. Stop.
make[1]: Leaving directory '/home/mirand/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile.shlib:62: recipe for target 'auto' failed
make: *** [auto] Error 2

mdvalencia | Fri, 05/29/2020 - 04:19

Hello

I have just updated to Ubuntu 20.04 and I just downloaded the latest version of LIGGGHTS, but when I compile ```make auto``` I get:

Creating list of contact models completed.
make[1]: Entering directory '/mnt/d/Linux/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:456: *** 'Could not compile a simple MPI example. Test was done with MPI_INC="" and MPICXX="mpicxx"'. Stop.
make[1]: Leaving directory '/mnt/d/Linux/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

when I change the path for mpicxx in the Makefile.user I get this:

Creating list of contact models completed.
make[1]: Entering directory '/mnt/d/Linux/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:456: *** 'Could not compile a simple MPI example. Test was done with MPI_INC="" and MPICXX="/usr/bin/mpicxx"'. Stop.
make[1]: Leaving directory '/mnt/d/Linux/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

Could you please help me.

Thanks

mdvalencia | Fri, 05/29/2020 - 21:57

Thanks for your answer
I get :

--------------------------------------------------------------------------
The Open MPI wrapper compiler was unable to find the specified compiler
g++ in your PATH.

Note that this compiler was either specified at configure time or in
one of several possible environment variables.
--------------------------------------------------------------------------

the directory of mpicxx is:

/usr/bin/mpicxx

mdvalencia | Sat, 05/30/2020 - 02:44

When I wrote the command you said, the terminal said g++ was not installed. Then I installed it and I could run make auto.

Thank you so much

tjleps | Fri, 05/29/2020 - 22:40

You need to update your path variable I think. Try:

PATH=$PATH:/usr/bin

Then run the commands mschramm suggested and see if you get a better result.

tjleps | Fri, 05/29/2020 - 22:42

Sorry I misread your post, it sounds like the path to your gcc compiler is not set, so replace what I put in the last post with whatever the path to your C++ compiler is.

mingliang_qu | Thu, 03/17/2022 - 11:31

Hi,

I'm trying to install liggghts, and I get the following error when I run "make auto":

Creating list of contact models completed.
make[1]: Entering directory '/home/htmt/Documents/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:461: *** 'Could not compile a simple MPI example. Test was done with MPI_INC="" and MPICXX="mpicxx"'. Stop.
make[1]: Leaving directory '/home/htmt/Documents/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

Could you please help me.
Thanks

Spelunkee | Fri, 09/29/2023 - 04:59

Hello,
I also need help regarding this problem. How do I check that the makefile can find my compilers?

mpicxx --version
returns: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

whereis mpicxx
returns: /usr/bin/mpicxx /usr/share/man/man1/mpicxx.1.gz

g++ --version
returns: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

whereis g++
returns: /usr/bin/g++ /usr/share/man/man1/g++.1.gz

Running make auto still returns:
Creating list of contact models completed.
make[1]: Entering directory '/home/spelunkee/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:461: *** 'Could not compile a simple MPI example. Test was done with MPI_INC=" " and MPICXX="mpicxx"'. Stop.
make[1]: Leaving directory '/home/spelunkee/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

Should I put something in MPI_INC_USR= and MPI_LIB_USR= ?

Yeasir Mohammad Akib | Fri, 06/03/2022 - 04:13

Hello,

When I am trying to install LIGGGHTS using make auto, I am getting the following error. May I please know how to solve this problem?

reating list of contact models completed.
make[1]: Entering directory '/home/slm_lab/LIGGGHTS-PUBLIC/src/Obj_auto'
mpicxx -funroll-loops -fstrict-aliasing -Wall -Wno-unused-result -O2 -std=c++17 -fPIC -I/usr/include/vtk-7.1 -DLAMMPS_VTK -DSUPERQUADRIC_ACTIVE_FLAG -DNONSPHERICAL_ACTIVE_FLAG -c ../compute_pair_gran_local.cpp
In file included from ../granular_pair_style.h:47,
from ../pair_gran_proxy.h:58,
from ../compute_pair_gran_local.cpp:50:
../utils.h: In function ‘std::string LIGGGHTS::Utils::int_to_string(int)’:
../utils.h:70:12: error: invalid ‘static_cast’ from type ‘std::__cxx11::basic_ostringstream’ to type ‘std::ostringstream&’ {aka ‘std::__cxx11::basic_ostringstream&’}
70 | return static_cast< std::ostringstream & >(( std::ostringstream() << std::dec << a ) ).str();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1399: compute_pair_gran_local.o] Error 1
make[1]: Leaving directory '/home/slm_lab/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

anand204's picture

anand204 | Wed, 12/07/2022 - 12:23

I have done everything right following the steps yet getting following error
Creating list of contact models completed.
make[1]: Entering directory '/home/anand/LIGGGHTS-PUBLIC/src/Obj_auto'
Makefile:461: *** 'Could not compile a simple MPI example. Test was done with MPI_INC="" and MPICXX="mpicxx"'. Stop.
make[1]: Leaving directory '/home/anand/LIGGGHTS-PUBLIC/src/Obj_auto'
make: *** [Makefile:114: auto] Error 2

Anand kumar