Problem with ligomp.so

Dear LAMMPS list,

When I try to compile LAMMPS (via cmake) on my new-ish Ubuntu 22.04 installation, it fails at
[100%] Built target lammps
make[2]: *** No rule to make target ‘/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so’, needed by ‘lmp’. Stop.
Which package am I missing? Searching for ligomp in conjunction with LAMMOS does not return any hits either at this site or web at large.

There are two problems here:

  • You have a lot of spelling errors and for issues like this exact spelling is crucial
  • The path ‘/usr/lib/gcc/x86_64-linux-gnu/9/libgomp.so’ is inconsistent with Ubuntu 22.04LTS because that ships with GCC version 11 and the file you are looking for is from GCC version 9. The only way you can get this error would be if you had correctly run the cmake configuration with Ubuntu 20.04LTS and then upgraded your operating system.

If the problem is the former kind, you can search for which packages contain which file on Ubuntu with apt-file (How do I find the package that provides a file? - Ask Ubuntu) or online at: https://packages.ubuntu.com/
I am providing the URLs to demonstrate that a web search - if done properly - will provide useful information. Your mistake was to assume that this is a LAMMPS specific error. In general, this file (or the Ubuntu/GCC version specific variant of that file) should be includeded when installing the “build-essentials” meta-package which includes several packages that provide essential component required to build software from source code.

If the problem is the latter kind, you need delete your build folder and start CMake configuration from scratch. It caches many system dependent information so that when you upgrade your OS details change and thus your will get errors. While it is technically possible to delete those wrong paths from the cmake cache file, it is generally safer to start over.

1 Like

Thanks for the swift response. I see the problem now, my Ubuntu 22.04 is a fresh install, but the LAMMPS itself is on a hard disk “transplanted” wholesale. I have now nuked the build folder and downloaded fresh CMakeLists.txt from git.