Having error recompiling lammps in wsl ubuntu

I got this error after making yes-all packages and tried to recompile lammps.
How can i resolve this please?

zac3553@i-Zac:~/lammps-23Jun2022/src$ make mpi
Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src’
make[1]: ‘lmpinstalledpkgs.h’ is up to date.
Gathering git version information
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
…/…/lib/quip/Makefile.lammps:17: *** Environment or make variable QUIP_ROOT must be set… Stop.
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
…/…/lib/quip/Makefile.lammps:17: *** Environment or make variable QUIP_ROOT must be set… Stop.
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
make: *** [Makefile:393: mpi] Error 2
zac3553@i-Zac:~/lammps-23Jun2022/src$

How about looking at the error messages and correcting their cause?

Like this one.

I had to “make no-few packages”. I tried recompiling and got a different error.

below is the error message

zac3553@i-Zac://home/zac3553/lammps-23Jun2022/src$ make mpi
Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src’
make[1]: ‘lmpinstalledpkgs.h’ is up to date.
Gathering git version information
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src’
Compiling LAMMPS for machine mpi
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:16: …/…/lib/electrode/Makefile.lammps: No such file or directory
make[1]: *** No rule to make target ‘…/…/lib/electrode/Makefile.lammps’. Stop.
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
make[1]: Entering directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
Makefile.package.settings:16: …/…/lib/electrode/Makefile.lammps: No such file or directory
make[1]: *** No rule to make target ‘…/…/lib/electrode/Makefile.lammps’. Stop.
make[1]: Leaving directory ‘/home/zac3553/lammps-23Jun2022/src/Obj_mpi’
make: *** [Makefile:393: mpi] Error 2

You should download the latest update for the stable release where this issue is fixed.

The workaround is to issue “make no-all”, “make purge” and then delete Makefile.package.settings and start over.

In general, “make yes-all” is not recommended. It mostly exists because it is used in some integration testing configurations.

Better would be to first use either “make yes-basic” or “make yes-most” and then selectively add the packages that you need in addition with the caveat that if any of those need you to build or configure libraries in the lib folder to do those compilations first, e.g. do make lib-colvars args="-m mpi" before “make yes-colvars”. The two selections “basic” and “most” are safe in that respect since they are chosen to not include any packages that require building in lib.

Of course, the alternative would be to build using CMake which avoids many of these issues and uses a single build step, including packages with libraries.

At any rate, I strongly recommend the latest update to the stable version because of the number of bugs we have fixed since summer.

Thanks for the response.
I tried doing this, its still not working.
I am actually using the tar ball 23Jun2022 version, and I think that’s the latest because I just tried getting a newer version and I ended up with same version.

Moreover, when I did make li-colvars args=“-m mpi” make lib-pace args=“-b”

I got this “/bin/bash: line 3: python: command not found”

Please look at the file src/version.h
What does it contain?

Well, obviously you have to install python or install the package that provides the version independent python executable.

it contains the following

#define LAMMPS_VERSION “23 Jun 2022”
#define LAMMPS_UPDATE “Update 3”

  • List item

Ok. But that means that you won’t get the same error or you did not follow the installation instructions correctly.

As mentioned before, you will likely be better off using the CMake based compilation procedure.

Thank you.
I am now able to recompile without having error.
I had to install python using “sudo apt-get install python-is-python3” then “python --version” to confirm the version.

Next, I followed the documentation [3.7. Packages with extra build options — LAMMPS documentationhttps://docs.lammps.org/Build_extras.html#electrode-package]

make lib-electrode args=“-m mpi”
“make mpi” which recompiled without error

But unfortunately, this has also brought me back to the issue I was having before trying to recompile lammps and found out that I am having error which have fixed with the above steps.

The error message is : ERROR: Unrecognized fix style ‘mol/swap’ is part of the MC package which is not enabled in this LAMMPS binary. (…/modify.cpp:903)

I have “make yes-mc” followed by "make mpi " but I am still having the same error message.

what could be the problem again?

You are probably not using the new executable or the compilation didn’t complete and you only thought there was no error.

FYI, you can check the configuration of a LAMMPS executable by running it with the -h flag, which should output a lot of information about how to use it, how it was configured, what version it is and which packages and styles are included.

Thank you.
I got this.
MC is working fine now.

Please can you guide on how to build with gpu. I do not understand the steps in the lammps documentaions

I am using "MSI laptop with 8gb nvidia dedicated graphics card.

zac3553@i-Zac://home/zac3553$ nvidia-smi
Fri Mar 10 10:59:51 2023
±----------------------------------------------------------------------------+
| NVIDIA-SMI 525.89.02 Driver Version: 528.49 CUDA Version: 12.0 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce … On | 00000000:01:00.0 Off | N/A |
| N/A 48C P8 5W / 30W | 34MiB / 8192MiB | 5% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 26 G /Xwayland N/A |
±----------------------------------------------------------------------------+
zac3553@i-Zac://home/zac3553$

where do I start please

Then please find somebody local that can explain those to you.

Consider using CMake to configure and build LAMMPS.

ok

Thank you