No,
This is the set in makefile in dir Machine…
How can I modify to use only g++?
Al
This setting is ok?
CC = g++
CCFLAGS = -g -O3
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = g++
LINKFLAGS = -g -O3
LIB =
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
Al
Just change “g++” to mpicxx in the Makefile and see if that works.
Also, are you compiling as root? That is usually a very bad idea.
So, to install in /opt I must be root…and only root.
Have you any ideas about the error ???
To install, yes. To compile you don’t have to. Typically you do
make …
first, to compile everything, and then to install you become root and then do
make install.
The error is because g++ does not seem to be able to find your mpi library. mpicxx is a wrapper around g++ specifically made to help with these things.
Hi,
this is my makefile
export OMPI_CXX = g++
CC = /opt/openmpi-1.4.5/bin/mpicxx
CCFLAGS = -g -O3
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = /opt/openmpi-1.4.5/bin/mpicxx
LINKFLAGS = -g -O
LIB =
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
---------------------------------------------------------------------
LAMMPS-specific settings, all OPTIONAL
specify settings for LAMMPS features you will use
if you change any -D setting, do full re-compile after “make clean”
LAMMPS ifdef settings
see possible settings in Section 2.2 (step 4) of manual
LMP_INC = -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64
MPI library
see discussion in Section 2.2 (step 5) of manual
MPI wrapper compiler/linker can provide this info
can point to dummy MPI library in src/STUBS as in Makefile.serial
use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
INC = path for mpi.h, MPI compiler settings
PATH = path for MPI library
LIB = name of MPI library
MPI_INC = -I/opt/openmpi-1.6.3/include -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH = -L/opt/openmpi-1.6.3/lib
MPI_LIB = -lmpi_f90 -lmpi_f77 -lmpi -ldl -Wl,–export-dynamic -lnsl -lutil
FFT library
see discussion in Section 2.2 (step 6) of manual
can be left blank to use provided KISS FFT library
INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
PATH = path for FFT library
LIB = name of FFT library
FFT_INC = -I/usr/local/fftw-3.3.6-pl2/include -DFFT_FFTW3
FFT_PATH = -L/usr/local/fftw-3.3.6-pl2/lib
FFT_LIB = -lfftw3f
I think that peraphs the problem is in MPI_LIB and in FFT_LIB
because the error change with extension of lib
with this setting the error is
/usr/bin/ld: cannot find -lfftw3f
collect2: ld returned 1 exit status
make[1]: *** […/lmp_mpi] Error 1
make[1]: Leaving directory `/opt/lammps-31Mar17/src/Obj_mpi’
make: *** [mpi] Error 2
Al
Unless I am missing something, you’ll want to link to fftw3 instead, so your flag should be “-lfftw3”.