Need help to install user-atc package

Dear users,

I am trying to build lammps with user-atc package. As I do not know much about ubuntu, I am struggling with the documentation. Please help figure out my problem:

I have previously installed mpi with pre-built lammps for ubuntu, so some prerequisites like g++, mpi, build-essential are alreay installed.
In order to install user package, I used
make yes-user-atc
make ps
I have got a yes for user-atc.

In order to build the library, as I do not know the path for mpi library( as required in README of atc), I tried to use make.py by
python Make.py -a lib-atc
but I got a fatal error: mpi.h: No such file or directory

I tried with not much hope this command “make ubuntu”, and got error:

/usr/bin/ld: cannot find -latc
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
make[1]: *** […/lmp_ubuntu] Error 1

These errors are from wrong library settings.

Now the problem seems to be, how to build mpi library and link to lammps makefile with or without make.py (make -a lib-mpi is invalid)?
After setting up mpi library, do I need to build mpi again to get mpi.h in place for “python Make.py -a lib-atc”? Sounds like previous installation of mpi is no use for current build of lammps?

Thanks for any suggestion and help.

Dear users,

I am trying to build lammps with user-atc package. As I do not know much
about ubuntu, I am struggling with the documentation. Please help figure out
my problem:

how about looking for somebody near you that *does* know about ubuntu
(and compiling software). that would make for much easier learning and
debugging than going via e-mail.

I have previously installed mpi with pre-built lammps for ubuntu, so some
prerequisites like g++, mpi, build-essential are alreay installed.

please see the first lines of src/MAKE/MACHINES/Makefile.ubuntu for
prerequisites.
please also search the mailing list archives for advice to compile
LAMMPS from source on ubuntu. it has been posted quite a few times.

In order to install user package, I used
make yes-user-atc
make ps
I have got a yes for user-atc.

In order to build the library, as I do not know the path for mpi library( as
required in README of atc), I tried to use make.py by
python Make.py -a lib-atc

you should *not* use Make.py, if you don't have things set up to
compile without.
also, it is just common sense that you first try to compile *without*
any packages and only if that is successful, you move on to install
desired packages. otherwise, you make your live needlessly complicated
and debugging much more difficult.

but I got a fatal error: mpi.h: No such file or directory

that you indicate that you are missing the mpi development package.

I tried with not much hope this command "make ubuntu", and got error:
/usr/bin/ld: cannot find -latc
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack
collect2: error: ld returned 1 exit status
make[1]: *** [../lmp_ubuntu] Error 1
These errors are from wrong library settings.

Now the problem seems to be, how to build mpi library and link to lammps
makefile with or without make.py (make -a lib-mpi is invalid)?
After setting up mpi library, do I need to build mpi again to get mpi.h in
place for "python Make.py -a lib-atc"? Sounds like previous installation of
mpi is no use for current build of lammps?

you really should talk to somebody that has some experience in
compiling (parallel) software. the explanation is trivial, but you are
missing too much basic knowledge that it is going to be far too
complicated to explain all of this via e-mail.

axel.

I have posted on university website for help. Meanwhile I am also exploring.
Now I have successfully compiled lammps with default ubuntu settings after installing the required programs in makefile.ubuntu. Thanks to Andrew’s previous post. This part is relatively easy. Now I can run lammps with mpirun.

I am now stumped by the library part. I think the next step for me is to go to user-atc folder and build it with library. In user-atc/README, it says,

“Note that the ATC library makes MPI calls, so you must build it with
the same MPI library that is used to build LAMMPS, i.e. as specified
by settings in the lammps/src/MAKE/Makefile.machine file you are
using.”

but in makefile.ubuntu, it has LIB, MPI_PATH, MPI_LIB and MPI_INC left blank.
while in user-atc/makefile.g++, it says,

"# include any MPI settings needed for the ATC library to build with

must be the same MPI library that LAMMPS is built with"

Then for now the question goes to : where is the MPI library? Without the MPI setting, there will be errors like, “mpi.h: No such file or directory”.

Thanks!

Looks like I have solved the problem. This is what I did:

  1. Easier version: install lammps without any additional package

Follow Andrew’s instruction until
" sudo cp lmp_ubuntu /usr/local/bin/ "

  1. Now go forward: with ATC

in src, use

make yes-user-atc

make ps

cd …/lib/atc

Open makefile.g++ and change (before I made this change, there was fatal error: mpi.h: No such file or directory)
CC = g++

to
CC = mpicxx

(thanks for Axel)

Go to src again, make ubuntu. This error came up:
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -llapack

-lblas and -llapack are libraries setting in Makefile.LAMMPS in lib/atc.

Now follow http://askubuntu.com/questions/623578/installing-blas-package to install both. You can avoid installing the doc.

Then go back to src folder and make ubuntu, it went thru with no error.

I run an input file with AtC commands, it is not reporting error. So it should be good.

During this process, I did not know how to set up library settings, and I have avoided doing so. Hope there is no problem with this.

Sorry guys, forgot to post Andrew’s link : http://lammps.sandia.gov/threads/msg56965.html

And thanks for Axel for help.

Hope my solution help others in need.