Error in compiling MBX in lammps

303 views
Skip to first unread message

Sagi Meir

unread,
Dec 29, 2022, 11:24:39 AM12/29/22
to MBX-users
Dear developers,
I think that the installation of MBX went well. However, I get the following error when I try to compile MBX in lammps:

[sagimeir@power9login src]$ make yes-USER-MBX yes-MOLECULE
Installing package USER-MBX
Installing package MOLECULE
  updating package USER-MISC
[sagimeir@power9login src]$ make mpi_mbx -j 4
Gathering installed package information (may take a little while)
make[1]: Entering directory `/hirshblab-storage/sagimeir/lammps/src'
Gathering git version information
make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src'
Compiling LAMMPS for machine mpi_mbx
make[1]: Entering directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make[1]: *** No rule to make target `depend'.  Stop.
make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make[1]: Entering directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make[1]: *** No rule to make target `../lmp_mpi_mbx'.  Stop.
make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make: *** [mpi_mbx] Error 2
[sagimeir@power9login src]$ 

I would like your help in understanding what could be the problem that raises this error.
Kind regards,
Sagi

Marc Riera

unread,
Dec 29, 2022, 11:27:03 AM12/29/22
to MBX-users
Hello Sagi,

I believe this is cause because you may not have copied the Makefile.mpi_mbx to the right place. In MBX_HOME/plugins/lammps there should be a Makefile file that must be copied into LAMMPS_HOME/src/MAKE . Otherwise the compilation will fail.

Please, let me know if the issue continues if this does not solve the problem!

All the best,
Marc

Sagi Meir

unread,
Jan 1, 2023, 8:54:05 AM1/1/23
to MBX-users

Hello Marc,
Thank you for your assistance. Indeed it was one of the problems. 
For some odd reason, the Makefile.mpi_mbx in the LAMMPS_HOME/src/MAKE folder was empty. So I recopied it from the MBX_HOME/plugins/lammps folder.
During compilation, I got several messages of "Error 127 (ignored)" with missing commands of "fix_somthing". Following, I tried to run:
rm style_fix.h style_pair.h
make yes-USER-MBX yes-MOLECULE yes-KSPACE yes-RIGID
touch fix_mbx.* pair_mbx.*
make mpi_mbx -j 8

Unfortunately, I got the same errors. The full compilation log is attached.
Appreciate your help,
Sagi
ב-יום חמישי, 29 בדצמבר 2022 בשעה 18:27:03 UTC+2, marc.ri...@gmail.com כתב/ה:
compilation.log

Marc Riera

unread,
Jan 1, 2023, 8:55:20 AM1/1/23
to MBX-users
Hello Sagi,

Could you please send me the Makefile you used? From the log, it seems that maybe the compiler is missing..? Thanks!

Marc

Sagi Meir

unread,
Jan 2, 2023, 9:22:26 AM1/2/23
to MBX-users
Hello Marc,
Sure! Attached hereto is the Makefile.
Thank you!
Sagi

ב-יום ראשון, 1 בינואר 2023 בשעה 15:55:20 UTC+2, marc.ri...@gmail.com כתב/ה:
Makefile.mpi_mbx

Marc Riera

unread,
Jan 2, 2023, 9:26:00 AM1/2/23
to MBX-users
Yup, as I expected, it seems like you don't have the environment variable MBX_CXX defined. Best thing to do is to replace that in lines 14 and 21 of the Makefile by the compiler you wanna use (CC = g++), and don't forget to define the env variable MBX_HOME. Otherwise, it won't find the MBX libraries.

Let me know if there are any further issues!

Marc

Sagi Meir

unread,
Jan 4, 2023, 9:37:16 AM1/4/23
to MBX-users
Hi Marc,
Thank you for your kind help.

I reinstalled both lammps and MBX to avoid any mistakes with old existing files. Then I made sure that the compiler in Makefile.mpi_mbx is the same as in Makefile.mpi of lammps.
After running in lammps/src the following:
make yes-USER-MBX 
make mpi_mbx -j 4

I got an error of undefined reference to FIX_MBX:
./liblammps_mpi_mbx.a(force.o): In function `LAMMPS_NS::Pair* LAMMPS_NS::Force::pair_creator<LAMMPS_NS::PairMBX>(LAMMPS_NS::LAMMPS*)':
/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx/../force.cpp:300: undefined reference to `LAMMPS_NS::PairMBX::PairMBX(LAMMPS_NS::LAMMPS*)'
./liblammps_mpi_mbx.a(modify.o): In function `LAMMPS_NS::Fix* LAMMPS_NS::Modify::fix_creator<LAMMPS_NS::FixMBX>(LAMMPS_NS::LAMMPS*, int, char**)':
/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx/../modify.cpp:1041: undefined reference to `LAMMPS_NS::FixMBX::FixMBX(LAMMPS_NS::LAMMPS*, int, char**)'
collect2: error: ld returned 1 exit status
make[1]: *** [../lmp_mpi_mbx] Error 1

make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make: *** [mpi_mbx] Error 2

Hence, I ran:
rm style_fix.h style_pair.h 
make yes-USER-MBX 
touch fix_mbx.* pair_mbx.* 
make mpi_mbx -j 8

and got the new following error:
../fix_mbx.cpp: In member function 'void LAMMPS_NS::FixMBX::mbx_init_dipole_history_local()':
../fix_mbx.cpp:2034:28: error: invalid conversion from 'LAMMPS_NS::FixMBX*' to 'int' [-fpermissive]
     comm->forward_comm(this);
                                                      ^
In file included from ../fix_mbx.cpp:20:
../comm.h:75:33: note:   initializing argument 1 of 'virtual void LAMMPS_NS::Comm::forward_comm(int)'
   virtual void forward_comm(int dummy = 0) = 0;  // forward comm of atom coords
                                               ~~~~^~~~~~~~~
make[1]: *** [fix_mbx.o] Error 1
make[1]: *** Waiting for unfinished jobs....

make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make: *** [mpi_mbx] Error 2

What could be the error?
For any case attached hereto is the new Makefile.
Best regards,
Sagi


ב-יום שני, 2 בינואר 2023 בשעה 16:26:00 UTC+2, marc.ri...@gmail.com כתב/ה:
Makefile.mpi_mbx

Marc Riera

unread,
Jan 4, 2023, 9:49:43 AM1/4/23
to MBX-users
Hello Sagi,

That error may be caused by 2 reasons: a) you are using the latest version of LAMMPS, which you should not use (per README, use the  LAMMPS version from September 29, 2021); or b) it is because you run make yes-USER-MBX instead of make yes-USER-MBX yes-MOLECULE yes-KSPACE yes-RIGID yes-EXTRA-PAIR. If it is not any of these two reasons, then I have to dig into it.

Please try the following and let me know if that works. Make sure to remove the repos you already downloaded.

1. Download MBX v0.7, and LAMMPS version from September 29, 2021. ANy version more recent than that will give you the error you are mentioning.
2. Install MBX (with an MPI compiler mpicxx or mpiicpc)
3. Install LAMMPS (with an MPI compiler; same as MBX). Install LAMMPS with:
make yes-USER-MBX yes-MOLECULE yes-KSPACE yes-RIGID yes-EXTRA-PAIR

make yes-USER-MBX
make mpi_mbx -j 4

Make sure you modify the Makefile.mpi_mbx to use mpicxx.

If this does not work, then we may have to meet, because I just run all these commands in my machine and it is properly compiling.

All the best,
Marc



Marc Riera

unread,
Jan 5, 2023, 11:14:37 AM1/5/23
to MBX-users
Hello Sagi,

Is the issue still there? If so, please let me know and I will be more than happy to have a quick chat with you to find the nature of this issue.

Thanks!

Sagi Meir

unread,
Jan 11, 2023, 12:53:59 PM1/11/23
to MBX-users
Hello Marc,
I am very sorry for my late reply. The issue is still there. I tried to use your recommended branch for lammps (stable_29Sep2021_update3), and I have reinstalled both MBX and lammps from scratch as you explained and got the following error:
 
mpicxx -g -O3 -fopenmp -std=c++11 -I/hirshblab-storage/sagimeir/MBX/install/include -I/powerapps/share/bin/fftw-3.3.8/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3   -c ../pair_lj_cut_coul_long.cpp
../fix_mbx.cpp: In member function 'void LAMMPS_NS::FixMBX::mbx_init_dipole_history_local()':
../fix_mbx.cpp:2034:28: error: invalid conversion from 'LAMMPS_NS::FixMBX*' to 'int' [-fpermissive]
     comm->forward_comm(this);
                            ^
In file included from ../fix_mbx.cpp:20:
../comm.h:78:33: note:   initializing argument 1 of 'virtual void LAMMPS_NS::Comm::forward_comm(int)'
   virtual void forward_comm(int dummy = 0) = 0;    // forward comm of atom coords
                             ~~~~^~~~~~~~~
mpicxx -g -O3 -fopenmp -std=c++11 -I/hirshblab-storage/sagimeir/MBX/install/include -I/powerapps/share/bin/fftw-3.3.8/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3   -c ../region_block.cpp
mpicxx -g -O3 -fopenmp -std=c++11 -I/hirshblab-storage/sagimeir/MBX/install/include -I/powerapps/share/bin/fftw-3.3.8/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3   -c ../deprecated.cpp
make[1]: *** [fix_mbx.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/hirshblab-storage/sagimeir/lammps/src/Obj_mpi_mbx'
make: *** [mpi_mbx] Error 2
[sagimeir@power9login src]$

Please let me know when you are available for a quick chat or zoom.
Thanks,
Sagi 
ב-יום חמישי, 5 בינואר 2023 בשעה 18:14:37 UTC+2, marc.ri...@gmail.com כתב/ה:

Marc Riera

unread,
Jan 19, 2023, 10:39:15 AM1/19/23
to MBX-users
Hello! 

We finally figured out the problem(s). 
1) One needs to make sure that MBX and LAMMPS are compatible. MBX v0.8 is compativel with the version of LAMMPS June 23rd, 2022.
2) It seems that sometimes extra libraries need to be added in LAMMPS for proper compilation with MBX. If the error is regarding GLIBC, please add the following to the Makefile.mpi_mbx :

CCFLAGS =    -g -O3 -fopenmp -std=c++11 
must be changed to 
CCFLAGS =    -g -O3 -fopenmp -std=c++11 -ldl

and 

LINKFLAGS =    -g -O3 -fopenmp
must be changed to 
LINKFLAGS =    -g -O3 -fopenmp -ldl

This made it work for this case. Thanks for pointing this out!

Yevhen Horbatenko

unread,
Mar 1, 2023, 11:25:04 AM3/1/23
to MBX-users
Dear all:

I have the same problem as the one mentioned in the last message of Sagi:
Compiling LAMMPS for machine mpi_mbx
make[1]: Entering directory '/home2/horbatenko/bin/lammps-29Sep2021.quip.mbx/src/Obj_mpi_mbx'
make[1]: Leaving directory '/home2/horbatenko/bin/lammps-29Sep2021.quip.mbx/src/Obj_mpi_mbx'
make[1]: Entering directory '/home2/horbatenko/bin/lammps-29Sep2021.quip.mbx/src/Obj_mpi_mbx'
mpicxx -g -O3 -fopenmp -std=c++11 -ldl -I/home2/horbatenko/bin/MBX-0.8/install/include -I/home2/seungchang/software/fftw3.3.7/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3    -c ../force.cpp
mpicxx -g -O3 -fopenmp -std=c++11 -ldl -I/home2/horbatenko/bin/MBX-0.8/install/include -I/home2/seungchang/software/fftw3.3.7/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3    -c ../pair_mbx.cpp
mpicxx -g -O3 -fopenmp -std=c++11 -ldl -I/home2/horbatenko/bin/MBX-0.8/install/include -I/home2/seungchang/software/fftw3.3.7/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3    -c ../modify.cpp
mpicxx -g -O3 -fopenmp -std=c++11 -ldl -I/home2/horbatenko/bin/MBX-0.8/install/include -I/home2/seungchang/software/fftw3.3.7/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3    -c ../lammps.cpp
mpicxx -g -O3 -fopenmp -std=c++11 -ldl -I/home2/horbatenko/bin/MBX-0.8/install/include -I/home2/seungchang/software/fftw3.3.7/include  -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64    -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1 -DFFT_FFTW3    -c ../fix_mbx.cpp

../fix_mbx.cpp: In member function ‘void LAMMPS_NS::FixMBX::mbx_init_dipole_history_local()’:
../fix_mbx.cpp:2034:28: error: invalid conversion from ‘LAMMPS_NS::FixMBX*’ to ‘int’ [-fpermissive]
     comm->forward_comm(this);
                            ^
In file included from ../fix_mbx.cpp:20:0:
../comm.h:78:16: note:   initializing argument 1 of ‘virtual void LAMMPS_NS::Comm::forward_comm(int)’

   virtual void forward_comm(int dummy = 0) = 0;    // forward comm of atom coords
                ^~~~~~~~~~~~
make[1]: *** [Makefile:117: fix_mbx.o] Error 1
make[1]: Leaving directory '/home2/horbatenko/bin/lammps-29Sep2021.quip.mbx/src/Obj_mpi_mbx'
make: *** [Makefile:389: mpi_mbx] Error 2

Ok, let me explain:
1. For LAMMPS, QUIP, and MBX compilation i used
quip 0.9.12 (from git clone --recursive https://github.com/libAtoms/QUIP.git)
mbx-0.7 (from https://github.com/paesanilab/MBX) By the way, not sure is it 0.7 or 0.8, since the web says README.md MBXv0.8, but make check reports MBX 0.7
gcc 6.5.0
mpicxx 6.5.0
make 4.2.1
fftw3.3.7
gsl 2.4

2. After installation of MBX with
autoreconf -fi
./configure
make && make install
i did make check and it showed all tests passed (34 out of 34).

3. After re-installation with
autoreconf -fi
./configure --enable-mpi CXX=mpicxx
make && make install
i did make check and it showed 28 out of 34 tests passed.
But i did not worry about the rest 6, since Marc mentioned that not all tests would pass with the mpi version.
(if someone is curious those not passed were
unittest-electrostatics
unittest-pme-nopolarization
unittest-pme-nopolarization-findif
unittest-pme-withpolarization
unittest-pme-withpolarization-findif
unittest-system)

4. After, for lammps and mbx, i did as mentioned at the mbx web:
cp Makefile.mpi_mbx LAMMPS_HOME/src/MAKE/Makefile.mpi_mbx
cp -rf USER-MBX LAMMPS_HOME/src
cp USER-MBX/*.cpp LAMMPS_HOME/src
cd LAMMPS_HOME/src/

5. Then, i modified LAMMPS_HOME/src/MAKEMakefile.mpi_mbx
(Please, see makefile_comparison.png, where i show the file modified by me as well as original ones from mbx and lammps)
makefiles_comparison.png
Basically, i modified CC, CCFLAGS, LINK, LINKFLAGS, since my compiler comes from gcc (mpicxx) rather than intel (mpiicpc).

6. For the first trial there were no -ldl options in my modified Makefile.mpi_mbx.
make yes-user-mbx yes-molecule yes-kspace yes-rigid yes-extra-pair      yes-body yes-manybody yes-ml-quip     (the last three i need for my purposes)
make yes-user-mbx
make mpi_mbx
Here, i received the FixMBX error.

7a. make clean-all before proceeding further.
7b. After, having found Marc's recommendation regarding -ldl, i modified my Makefile by adding -ldl option, as you see in the right pic.
make yes-user-mbx yes-molecule yes-kspace yes-rigid yes-extra-pair      yes-body yes-manybody yes-ml-quip     (the last three i need for my purposes)
make yes-user-mbx
make mpi_mbx
Again, i received the same FixMBX error.

Do i miss something?
I would be thankful for any help.
Kind regards,
Yevhen Horbatenko

Marc Riera

unread,
Mar 1, 2023, 11:29:42 AM3/1/23
to MBX-users
Hello!

Please try using the LAMMPS version of June 2022. We need to update the README, since it seems it points to the wrong place. Thanks for reminding it!

Regarding make check, the tests with MPI will fail. To ensure everything is working smoothly, please configure with
./configure --disable-optimization CXX=g++
make && make install
make check

The tests should pass. Then recompile with MPI and with the correct version of LAMMPS and you should be all set up.

Let us know if there is any issue!

Marc

Yevhen Horbatenko

unread,
Mar 2, 2023, 9:16:37 PM3/2/23
to MBX-users
Dear Marc:

With
./configure --disable-optimization CXX=g++
make && make install
make check
all tests have passed (34 out of 34).

Then, i reinstalled MBX with MPI.
I used the same method (step #3, as mentioned in my previous message).

After, i performed step #4 and step #5, from my previous message.
There, i used the same Makefile, as that shown in the rightmost pic.
With that Makelife, i performed step #7b, from my previous message.
As you suggested, i used lammps-23Jun2022 version.

I got a different error :(

Basically, there are many lines saying
electrostatics.cpp: undefined reference to 'fftw_free'
electrostatics.cpp: undefined reference to 'fftw_malloc'
and the same lines for dispersion.cpp and lj.cpp

dispersion.cpp:(.text._ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_[_ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_]+0x2937): undefined reference to `fftw_free'
/home2/horbatenko/bin/MBX/install/lib/libmbx.a(libmbx_la-dispersion.o):dispersion.cpp:(.text._ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_[_ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_]+0x294a): more undefined references to `fftw_free' follow
/home2/horbatenko/bin/MBX/install/lib/libmbx.a(libmbx_la-dispersion.o): In function `helpme::PMEInstance<double, 0>::computeEFVRec(int, helpme::Matrix<double> const&, helpme::Matrix<double> const&, helpme::Matrix<double>&, helpme::Matrix<double>&)':
dispersion.cpp:(.text._ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_[_ZN6helpme11PMEInstanceIdLi0EE13computeEFVRecEiRKNS_6MatrixIdEES5_RS3_S6_]+0x2bbb): undefined reference to `fftw_malloc'
/home2/horbatenko/bin/MBX/install/lib/libmbx.a(libmbx_la-lj.o): In function `lj::LennardJones::CalculateLennardJones(bool)':
lj.cpp:(.text+0x6419): undefined reference to `fftw_free'
lj.cpp:(.text+0x6432): undefined reference to `fftw_free'
lj.cpp:(.text+0x6443): undefined reference to `fftw_free'
lj.cpp:(.text+0x6454): undefined reference to `fftw_free'
lj.cpp:(.text+0x6485): undefined reference to `fftw_free'
/home2/horbatenko/bin/MBX/install/lib/libmbx.a(libmbx_la-lj.o):lj.cpp:(.text+0x6496): more undefined references to `fftw_free' follow

collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:97: ../lmp_mpi_mbx] Error 1
make[1]: Leaving directory '/home2/horbatenko/bin/lammps-23Jun2022.quip.mbx/src/Obj_mpi_mbx'
make: *** [Makefile:393: mpi_mbx] Error 2
 

I am totally confused what is going on here, since i use the same compilers and libs, the only thing that changed is the version of lammps.
With lammps-29Sep2021 i get FixMBX error, but with lammps-23Jun2022 i get udefine reference to 'fftw_free' :(

Marc Riera

unread,
Mar 2, 2023, 9:18:10 PM3/2/23
to MBX-users
Hello,

This looks like you may not have the proper path for the FFTW library in the LAMMPS makefile.
Where do you have the FFTW libraries installed, and how does the makefile used look like?

Yevhen Horbatenko

unread,
Mar 3, 2023, 11:01:31 AM3/3/23
to MBX-users
It is strange, because the only thing i did was change a version of lammps.
The rest, including Makefile and fftw3 lib  were exactly the same.

Before the installation, I exported FFTW_HOME var in my bashrc. (export FFTW_HOME=/home2/${USER}/software/fftw3.3.7)
And in the Makefile.mpi_mbx i did only those modifications shown i the pic in my previous message.
Just in case let me attach my Makefile.mpi_mbx.
Makefile.mpi_mbx

Marc Riera

unread,
Mar 3, 2023, 11:06:54 AM3/3/23
to MBX-users
Could you attach the full output of the lammps compilation?

Yevhen Horbatenko

unread,
Mar 6, 2023, 1:35:22 PM3/6/23
to MBX-users
Yes, sure.

Let me provide you a few of my outputs.

There, Sep21 and Jun22 mean the versions of lammps i tries to compile, 29Sept21 and 23Jun22, respectively.

File .log is for the first trial with
make yes-user-mbx yes-molecule yes-kspace yes-rigid yes-extra-pair      yes-body yes-manybody yes-ml-quip
make yes-user-mbx
make mpi_mbx -j 8

File  .2.log is for the second trial, when the previous compilation gave me the error.
rm style_fix.h style_pair.h
make yes-user-mbx yes-molecule yes-kspace yes-rigid yes-extra-pair      yes-body yes-manybody yes-ml-quip
make yes-user-mbx
touch fix_mbx.* pair_mbx.*
make mpi_mbx -j 8

In brief, different versions of lammps give different errors.
lammps-29Sep2021 gives FixMBX error,  
lammps-23Jun2022 gives undefined reference to 'fftw_free'

Within the same version, the first compilation ( .log) and the second compilation ( .2.log) give the same error.

Kind regards,
Yevhen
mklmp_mpi_mbx.Jun22.2.log
mklmp_mpi_mbx.Sep21.log
mklmp_mpi_mbx.Jun22.log
mklmp_mpi_mbx.Sep21.2.log

Yevhen Horbatenko

unread,
Mar 13, 2023, 10:02:39 AM3/13/23
to MBX-users
Dear Marc:

I understand you may be busy with your research, but let me ask whether there is any update regarding this error.

Kind regards,
Yevhen

Marc Riera

unread,
Mar 13, 2023, 10:07:09 AM3/13/23
to MBX-users
Can you try to add -I$(FFTW)/include to the LINKFLAGS in Makefile.mpi_mbx and recompile? 

Yevhen Horbatenko

unread,
Mar 14, 2023, 10:02:46 AM3/14/23
to MBX-users
Dear Marc:

Thank you for your reply and your help.

I added -I to the LINKFLAGS in my Makefile.mpi_mbx, as you suggested, but, unfortunately, it did not work :(

CC = mpicxx

CCFLAGS =       -g -O3 -fopenmp -std=c++11 -ldl
CCFLAGS +=      -I$(MBX_INC)
CCFLAGS +=      -I$(FFTW)/include
SHFLAGS =       -fPIC
DEPFLAGS =      -M

LINK = mpicxx
LINKFLAGS =     -g -O3 -fopenmp -std=c++11 -ldl -I$(FFTW)/include
LIB =
LIB +=          $(MBX_LIB)/libmbx.a
SIZE =          size

ARCHIVE =       ar
ARFLAGS =       -rc
SHLIBFLAGS =    -shared

The error is the same.

My colleague (we are trying this together) also tried this option with -L$(FFTW)/lib

He got the same error too.


One thing, do you remember i mentioned that there are two different errors, i.e.
lammps-29Sep2021 gives FixMBX error,  
lammps-23Jun2022 gives undefined reference to 'fftw_free'.

From the  Sep21.log file i have attached in my previous message, it seems FixMBX error is not related to fftw, although i am not sure 100%.
If it indeed is not related, do you think we can try to concentrate on solving this issue rather than the fftw issue?

Kind regards,
Yevhen

Marc Riera

unread,
Mar 14, 2023, 10:11:07 AM3/14/23
to MBX-users
The main reason for that is that the LAMMPS version from Sep2021 is not supported by MBX anymore. There were some function call changes that are now deprecated, and were changed in the MBX plugin too. In order to use the LAMMPS version 2021, you should use MBX 0.7, not the current 0.8 version.

Regarding June2022, can you try adding -lm to the CCFLAGS and LINKFLAGS?



Yevhen Horbatenko

unread,
Mar 16, 2023, 1:23:04 PM3/16/23
to MBX-users
Dear Marc:

> The main reason for that is that the LAMMPS version from Sep2021 is not supported by MBX anymore
Ah, I see. Then i do not have to use this version anymore.

> Regarding June2022, can you try adding -lm to the CCFLAGS and LINKFLAGS?
Still the same error "undefined reference to fftw_free" :(

When you have time, how about we set up a  zoom meeting (considering we are in different time zones, e.g., mine is South Korea).
If you see my installation and log files maybe a specific solution can appear in your mind. 

Yevhen Horbatenko

unread,
Mar 21, 2023, 3:09:01 PM3/21/23
to MBX-users
Dear Marc:

Thank you so much for your help!
You were right, the problem was that the fftw3 lib was a static library in my case.
I reinstalled it as a dynamic one, and the problem of `undefined reference  to fftw_...' disappeared.
I could link MBX and lammps (ver 23Jun2022) without any errors.

The commands  that i used:
For fftw3,
./configure    --enable-shared=yes                   --prefix=${HOME}/bin/fftw3.3.10        CC=gcc
make && make install

Then, for MBX with this fftw3,
autoreconf -fi
./configure --enable-mpi --disable-optimization CXX=mpicxx
make -j4 && make install


I also compiled MPI version of  fftw3 as
./configure    --enable-shared=yes    --enable-mpi   --prefix=${HOME}/bin/fftw3.3.10.mpi        MPICC=mpicc
make && make install

After, for MBX with fftw3.mpi,
autoreconf -fi
./configure --enable-mpi    CXX=mpicxx
make -j4 && make install

By the way, do you think it makes sense to compile MPI version of fftw3 to link it to MBX before linking MBX itself to lammps?


Kind regards,
Yevhen

Marc Riera

unread,
Mar 21, 2023, 3:10:51 PM3/21/23
to MBX-users
YAY! Glad it is solved now!!

Just a remark, remember to recompile MBX WITH optimizations before starting production runs.

Regarding MPI, I think it is better to have the non-mpi version, since the MPI parallelization in MBX is a level above the FFTW. I think that you are all set to start running simulations. Please let us know if there is any other issue!

Yevhen Horbatenko

unread,
Mar 23, 2023, 10:03:12 AM3/23/23
to MBX-users
Sure, i will.
So far, it is ok.
Although I have another question, regarding Na+...H2O and Cl-...H2O potentials, but for that, I better open a new conversation.

Reply all
Reply to author
Forward
0 new messages