lammps compile problem

Dear All,

Recently I have to transfer LAMMPS to a new server, which is parallel machine supporting OPENMPI. When I compile it, it always shows the MPI library is not correct. I have already changed Makefile.g++ as below:

MPI_INC = -I/usr/local/include
MPI_PATH = -L/usr/local/lib
MPI_LIB =

MPI_INC is where mpi.h located and MPI_PATH is where MPI library located. However, I cannot make sure which MPI_LIB I should use since there many suspicious library names there. I have listed here

libmpi.la -------(I suspect this is the right one but LAMMPS does not support this type)
libmpi_cxx.la
libmpi_f77.la
libmpi_f90.la
libopenmpi_malloc.la
libopen-pal.la
libopen-rte.la
libotf.a
libotf.la
libvt.a
libvt.fmpi.a
libvt.mpi.a
libvt.omp.a
libvt.ompi.a
there is also a openmpi directory in /usr/local/lib.

I know limited knowledge about LINUX so please help me. Many thanks.

Regards,
Mengyu

Dear All,

Recently I have to transfer LAMMPS to a new server, which is parallel
machine supporting OPENMPI. When I compile it, it always shows the MPI
library is not correct. I have already changed Makefile.g++ as below:

MPI_INC = -I/usr/local/include
MPI_PATH = -L/usr/local/lib
MPI_LIB =

MPI_INC is where mpi.h located and MPI_PATH is where MPI library located.
However, I cannot make sure which MPI_LIB I should use since there many
suspicious library names there. I have listed here

you should not use any of them. just use "mpicxx" as compiler
and linker and it will automatically add whatever is needed.

axel.

Thank you so much Axel, it works!

I have another account on BlueGene machine (http://www.bnl.gov). When I tried to compile using the same way you provided (leaving MPI setting blank and set CC and LINK = mpicxx), it always following information

/bgl/BlueLight/V1R3M4_300_2008-080728/ppc/blrts-gnu/lib/gcc/powerpc-bgl-blrts-gnu/3.4.3/…/…/…/…/powerpc-bgl-blrts-gnu/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status

Is there any way to solve this problem?

I know the fortran compiler name on that server (not -lgfortran), but I do not see anywhere to add it.

Thank you again.

Hi Mengyu,

you are apparently missing libgfortran. See if the file is there (use loacte libgfortran or find / -name ‘libgfortran*’ -print). If it’s not there, you should install the gfortran compiler (or ask the system admin to do so). If it is there, then I would tell the system administrator that the link to this library is broken ad ask him to repair it. I’m not an expert here either, but as an alternative you could try to add something like
-I/pathToLibGFortran to the LIB variable in your Makefile.

Regards,
Nikita

Hi Mengyu,

you are apparently missing libgfortran. See if the file is there (use loacte libgfortran or find / -name 'libgfortran*' -print). If it's not
there, you should install the gfortran compiler (or ask the system admin to
do so). If it is there, then I would tell the system administrator that the
link to this library is broken ad ask him to repair it. I'm not an expert
here either, but as an alternative you could try to add something like
-I/pathToLibGFortran to the LIB variable in your Makefile.

sorry, but this is bad advice. a blue gene is not a linux cluster
and compilation is not a regular compilation, but a cross-compilation
(i.e. the processors and operating system on the login and compile
nodes are different from the compute nodes). also, blue gene machines
use the IBM xlF fortran compiler, not gfortran, by default.

axel.

ugh, i’m sorry for the wrong information.

Thank you so much Axel, it works!

I have another account on BlueGene machine (http://www.bnl.gov). When I
tried to compile using the same way you provided (leaving MPI setting blank
and set CC and LINK = mpicxx), it always following information

/bgl/BlueLight/V1R3M4_300_2008-080728/ppc/blrts-gnu/lib/gcc/powerpc-bgl-blrts-gnu/3.4.3/../../../../powerpc-bgl-blrts-gnu/bin/ld:
cannot find -lgfortran
collect2: ld returned 1 exit status

Is there any way to solve this problem?

I know the fortran compiler name on that server (not -lgfortran), but I do
not see anywhere to add it.

why don't you try adapting the Makefile.bgl to the machine you
are running on. it should have some hints where to look for the
right components (but you may need to adapt it for newer versions).

the -lgfortran is likely being pulled in from the Makefile.lammps
instances in the lib subdirectories. if you don't need any of those
libraries (and the corresponding MEAM or REAX packages), you
can completely circumvent the issue.

cheers,
     axel.

Thanks for your reply Axel.

I was using Makefile.bgl and made modification based on the compiler location. Still I am getting following error, where I have already changed the -lxlfmath to -libxlfmath

/bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/bin/ld: cannot find -libxlfmath.a

I can locate where my libxlfmath is on the machine and I have added this location to LINKFLAGS. However, it is stilling looking into the same location as /bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/bin

How to fix this problem ?

Regards,
Mengyu

Thanks for your reply Axel.

I was using Makefile.bgl and made modification based on the compiler
location. Still I am getting following error, where I have already changed
the -lxlfmath to -libxlfmath

/bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/bin/ld: cannot find
-libxlfmath.a

I can locate where my libxlfmath is on the machine and I have added this
location to LINKFLAGS. However, it is stilling looking into the same
location as /bgl/BlueLight/ppcfloor/blrts-gnu/powerpc-bgl-blrts-gnu/bin

How to fix this problem ?

talk to your system admin or user support staff. they should know the
details of the installation. i have not used or compiled on a blue gene
in years...

axel.