[lammps-users] LAMMPS with CMake

Hi all,

I was just curious if anyone has used CMAKE to build LAMMPS. For those that do not know, CMAKE is a cross-platform build system. It’s really nice because it can automatically generate a Makefile (or other project solutions) given some simple scripting. Essentially, this might remove the need for hacking together multiple Makefiles on different systems and consolidate all of this to a single system. I don’t have a lot of experience with CMAKE but the results so far have been very positive. If people have CMAKE scripts that they would be willing to share, that would be great as I’m trying to build LAMMPS for a friend who wants to use it for research.

Thank you.

-Patrick

I haven't done anything with CMake. I don't think it's
a universal solution, since many users won't have CMake installed
on their boxes, nor will they want to, just to build LAMMPS.

I don't see how CMake magically lets you ignore (or not have
to specify) settings
unique to different machines - like where to find the FFT or
MPI libs, or what Fortran compiler to use? Is it more magical
than I envision?

Steve

patrick, steve,

I haven't done anything with CMake. I don't think it's
a universal solution, since many users won't have CMake installed
on their boxes, nor will they want to, just to build LAMMPS.

there have been discussions on the gpulammps project's mailing
list, whether a CMake build system would make LAMMPS more
portable. the outcome is still undecided, since the person that
was the most in favor of it, has not yet been able to provide a
prototype implementation and the person most critical (i.e. me)
still thinks that it would just replace one way of guessing stuff (picking
the right preconfigured make file and adjusting it) with a second,
more complex mechanism which only looks easier, since it more
often guesses right and has a nice GUI for cases where people need
to adjust the settings. the success however, depends entirely on
how good the properties needed can be guessed, and for what
lammps needs, they are fairly difficult to guess, but rather easy
to find out in person with a little bit of extra effort.

I don't see how CMake magically lets you ignore (or not have
to specify) settings
unique to different machines - like where to find the FFT or
MPI libs, or what Fortran compiler to use? Is it more magical
than I envision?

it does very similar things to what autoconf/automake does buy
in a different way and using tools that would also work well on
windows (which is the main motivation behind cmake vs. autoconf/automake).

Steve

Hi all,

I was just curious if anyone has used CMAKE to build LAMMPS. For those that
do not know, CMAKE is a cross-platform build system. It's really nice
because it can automatically generate a Makefile (or other project
solutions) given some simple scripting. Essentially, this might remove the
need for hacking together multiple Makefiles on different systems and
consolidate all of this to a single system. I don't have a lot of

no. this will not remove this need for adjustment. it will only
delegate it to different locations. if you don't know what you
have to provide, you will still be confused. parallel supercomputers
(on of the main targets of lammps, are not easy to guess). in
general the settings for a parallel environment are difficult to
test, since very often the compile host by itself, may not be able
to run the resulting executable successfully.

experience with CMAKE but the results so far have been very positive. If
people have CMAKE scripts that they would be willing to share, that would be
great as I'm trying to build LAMMPS for a friend who wants to use it for
research.

why don't you just follow the instructions? out of all scientific program
packages that i had to build during my career, i found lammps to be
the most easy to build and configure. unless you need some of the
add-on libraries from the lib directory, the configuration effort is very
minimal.

and if you have trouble building, why don't you simply describe the
problems or search the mailing list archive. chances are, the problem
is fairly simple to solve, and you may even learn something useful
about your machine in the process...

cheers,
    axel.

Yes, I agree. It’s certainly not a magic box solution but I was just thinking it might be nice to have a centralized place where you could launch CMake, identify the dependencies that you need and check those based on your system, and then generate a makefile for the entire thing including the dependencies right there. It just seems like a more centralized solution as opposed to going through and compiling each item individually. But then, perhaps that’s better for a complicated science system such as LAMMPS since you have to know exactly what is required for your particular setup.

I’ll go through and continue trying the current makefiles and post if I get stuck I suppose.

Thanks.

-Patrick