Error in compilation of lammps

Hi all! I am trying to compile lammps. I am on windows. Now when I am compiling with cmake I am getting the following error ,


This is the directory I am using

Why can’t cmake find the source directory. And I also want to know how to add package to lammps that is compiled already
Thanks in advance

Because the directory you specified does not exist!

Since you have a sufficiently recent version of CMake, you can simplify the build procedure: instead of creating a build folder and changing to the build folder, you can just stay in the main LAMMPS source folder and use: cmake -S cmake -B build ... and then cmake --build build to compile.

BTW: it is not advisable to use folder/path names with whitespace in them.

If you want to add a package to an executable/library in an existing LAMMPS build folder, you can just do: cmake -DPKG_NEWPKG=on -B build. It will first read and apply the cache from the previous configuration and then change the desired setting. Of course, after configuring, you need to compile again with cmake --build build to update library and executable.

P.S.: when building a shared library (i assume for use with python) it is strongly advised to also use the -DLAMMPS_EXCEPTIONS=on setting.

I never specified the source directory anywhere. I assumed that just being in the source folder is enough for cmake to detect. But why is it including that extra “lammps/lammps/”.

And now its spewing this error

FYI, I dont really know what most of the -D options do , I just want the python package and the Extra fix package for ttm(two temperature model). I got this commad line from a tutorial

Also cant attach the log file. Should i give a drive link?

There are detailed installation instructions for compiling LAMMPS from source in the LAMMPS manual. Also there is a short CMake tutorial and CMake has a great documentation on their home page. There is no point in continuing this discussion until after you have studied those well enough so you can understand my explanations (most likely you won’t need them at that point).

Why do you then try to compile from source and do not use a precompiled installer package for Windows?

To my knowledge even if python package installed in some precompiled version the extra fix package is not included.

Please confirm whether you want to use the PYTHON package i.e. call Python from LAMMPS or the LAMMPS Python module i.e. call LAMMPS from Python?

People, especially those that have not extensively studied the documentation, often confuse the two. A detailed discussion of LAMMPS vs. Python is in the manual at: 2. Use Python with LAMMPS — LAMMPS documentation

On what is your knowledge based? You may be looking at the wrong package. Please check out: LAMMPS Windows Installer Repository

call lammps from python

Extremely sorry for not being well informed. Yes the EXTRA-FIX package is already included

Then you don’t need the PYTHON package.
The https://rpm.lammps.org/windows/LAMMPS-64bit-stable.exe package for example should “just work™”. It has been tested with multiple Python distributions including those from python.org and the one included in Visual Studio or the Intel OneAPI compilers.

1 Like