The final link step to create the executable fails due to inability to locate routines in SNAIntel, e.g.
undefined reference to `LAMMPS_NS::SNAIntel::compute_deidrj(int, ip_simd::SIMD256_int const&, ip_simd::SIMD_double*)’
This appears to be because sna_intel.cpp from the INTEL package is not getting linked into liblammps.a. We were able to resolve this issue by adding “sna_intel.cpp” to lammps/cmake/Modules/Packages/INTEL.cmake in the “collect sources” section, i.e.:
This should not be necessary, since the sna_intel.cpp file will be automatically included when also the ML-SNAP package is included which provides the sna.cpp file and with the INTEL package all files of the kind xxxx_intel.cpp will be included if there is a xxxx.cpp file in the list of sources.
When building with -D BUILD_SHARED_LIBS=yes there should be no liblammps.a, but only liblammps.so.0 and liblammps.so as a symlink to it. Perhaps you need to completely wipe out the build folder before configuring and building.
What is the OS/platform?
What is the hardware? If this is a Linux machine, please provide the output of:
grep avx /proc/cpuinfo | uniq
It looks like the snap/intel pair style is only available under very specific circumstances: Intel compiler and compiler optimization for AVX512 enabled (which requires compatible hardware with the default settings of optimizing for the local hardware). Thus for most people there will be just an empty object created and thus no reference to the undefined class/function in the sna_intel.cpp file and the omission of the file from the list of objects would have no effect. This would explain why this has not created any error reports so far and that all integration tests have succeeded. Since in very many cases one of the two requirements is not given.
Thanks for looking into this and for the fix. One question: The fix checks for PKG_ML-SNAP, but in our case we’re not installing it and also have PKG_ML-IAP=off. So would the fix resolve the issue for us?
You are using the all_on.cmake preset followed by nolib.cmake (that will enable ML-SNAP and a whole lot more). I would recommend to use most.cmake instead as that is safer.
If you run cmake . in your build folder, you should see all installed packages in the line starting with: -- Enabled packages:
Absolutely. There would be no error if ML-SNAP is not installed.