[lammps-users] Making LAMMPS with openmpi

Dear all,

I have a problem to make LAMMPS with OpenMPI with Red Hat Enterprise Linux.
We have makefile.g++, but I suppose it is for mpich....
Would you tell me how I need to modify it for OpenMPI?
I already tried Mlefile.openmpi, but it did not work on my computer.
Thank you very much.

Best regards,
Nanako Takahashi

Dear Nanako,
What was the problem with Makefile.openmpi? I tried it yesterday itself with Fedora and it worked.

Regards,
Vikas

Dear Vikas,

Thank you very much for your prompt reply.
I am not sure whether it is one of problem or not, but my computer is Red Hat Linux Enterprise, not Fedora.
I got an error as following when I tried to make LAMMPS with Makefile.openmpi....

Best regards,
Nanako Takahashi

Dear Vikas,

Thank you very much for your prompt reply.
I am not sure whether it is one of problem or not, but my computer is
Red Hat Linux Enterprise, not Fedora.

doesn't matter. fedora is more or lest the beta test
for RHEL.

I got an error as following when I tried to make LAMMPS with
Makefile.openmpi....

Best regards,
Nanako Takahashi

++++++++++++++++++++++++++++++++++++++
make openmpi
make[1]: Entering directory
`/home/nanakot/Desktop/research/lammps-7Jun08/src/Obj_openmpi'
Makefile:11: *** commands commence before first target. Stop.
make[1]: Leaving directory
`/home/nanakot/Desktop/research/lammps-7Jun08/src/Obj_openmpi'
make: *** [openmpi] Error 2

there must be some file corruption or something. i just downloaded
the lammps-upgrade.tar.gz and could compile out of the box on
both fedora and RHEL without problem.

check out line 11 in your src/Makefile
what does it say?

cheers,
    axel.

Dear Nanako

when you installed openmpi, can you run "mpirun"? (or "orterun")

When I built my lmp_opempi binary, i had to change the environment
variable "LD_LIBRARY_PATH". Depending on where you installed openmpi(it is
usually installed in "/usr/local/" . I needed to issue the command;

LD_LIBRARY_PATH="/usr/local/" ; export LD_LIBRARY_PATH

When you can run "mpirun" use the makefile.openmpi to build lammps

Dear all,

I have a problem to make LAMMPS with OpenMPI with Red Hat Enterprise Linux.
We have makefile.g++, but I suppose it is for mpich....
Would you tell me how I need to modify it for OpenMPI?
I already tried Mlefile.openmpi, but it did not work on my computer.

Thank you very much.

Best regards,
Nanako Takahashi

-------------------------------------------------------------------------

Check out the new SourceForge.net Marketplace.

Dear Axel,

Thank you so much for telling me about the Makefile.
In my src/Makefile, I haven't modified it, so it says

INC = $(wildcard *.h)

But in my src/MAKE/Makefile.openmpi, I added path to the folder for openmpi as following.

-g -O -I/home/nanakot/include -I/opt/openmpi.gcc/include -I/opt/openmpi.gcc/include/openmpi

I am not familiar with makefile, so it might be wrong...
Thank you very much.

Best regards,
Nanako Takahashi

Axel Kohlmeyer wrote:

I agree with Jan here. I could not run examples just after installing openmpi. After some searching on internet, I found what Jan is saying. Before making lammps, you make sure that you can run mpirun successfully.

Regards,
Vikas

Dear Axel,

Thank you so much for telling me about the Makefile.
In my src/Makefile, I haven't modified it, so it says

INC = $(wildcard *.h)

But in my src/MAKE/Makefile.openmpi, I added path to the folder for openmpi
as following.

-g -O -I/home/nanakot/include -I/opt/openmpi.gcc/include
-I/opt/openmpi.gcc/include/openmpi

ok. that is a problem. you either have to put everything for the
definition of CCFLAGS on one line or terminate all but the last
lines with a '\' as it was done in example.

that perfectly explains the error message that you are seeing
(but not why make assigns it to Makefile:11. oh, well.)

I am not familiar with makefile, so it might be wrong...
Thank you very much.

i did give an introduction to makefiles on several occasions
last year. you can find my talk slides at:
http://www.cmm.upenn.edu/linux2007/axel_makefiles_intro.pdf

it covers the basics from a more practical perspective.
but i just checked and it does _not_ explain continuation lines.
i'll have to add that for the next time. :wink:

cheers,
   axel.

I agree with Jan here. I could not run examples just after installing
openmpi. After some searching on internet, I found what Jan is saying.
Before making lammps, you make sure that you can run mpirun successfully.

that is important as well, but it would not explain the
error message. a missing continuation character does.

the make syntax is not the most obvious one in the world
(who would make the difference between a blank and a
tab character part of the syntax?), and writing portable
makefiles is not an easy task... the system lammps uses
i great if you have to compile for multiple platforms
and it is fairly well maintainable (unlike automake, which
can turn into a inflexible monstrosity very fast).

cheers,
   axel.

Thanks Axel for the info… as well as for the pdf.

Regards,
Vikas

Dear Axel, Jan and Vikas,

Thank you very much for solving the problem and slides!
I will learn about Makefile with your slide.
I could get rid of the error with just one backslash.

Actually, I get another error as following.....
I found the file called mpic++ in

-L/opt/openmpi.gcc/bin/

so I added it at LINKFLAGS, but it seems it doesn't work....
Would you tell me which line in the makefile I should add another path to somewhere?
Sorry for many trivial questions....
I appreciate your help very much.

Best regards,
Nanako Takahashi

Dear Nanako,
Add that path to your system path in your .bash_profile file (in your home directory).
and then use source .bash_profile
http://www.open-mpi.org/faq/?category=running#run-prereqs
Look at this page for details.

Regards,
Vikas

Dear Vikas,

I could make it! Thank you very much for everything!!

Best regards,
Nanako

Vikas Varshney wrote: