Error when installing lammps in an university cluster

Hello,

When I try to install lammps in a cluster of an university I encounter errors when I try to build it. I am installing the 4May2022 version, but I also tried with the stable version. First, this is the output of the cmake.

$ cmake …/cmake
– Appending /home/XX/.guix-profile//lib:/home/XX/.guix-profile//lib to CMAKE_LIBRARY_PATH: /home/XX/.guix-profile//lib:/home/XX/.guix-profile//lib
– Running check for auto-generated files from make-based build system
– Generating style headers…
– Generating package headers…
– Generating lmpinstalledpkgs.h…
– Could NOT find ClangFormat (missing: ClangFormat_EXECUTABLE) (Required is at least version “8.0”)
– The following tools and libraries have been found and configured:

  • Git
  • MPI
  • OpenMP

– <<< Build configuration >>>
LAMMPS Version: 20220504
Operating System: Linux Debian GNU/Linux 11
Build type: RelWithDebInfo
Install path: /home/XX/.local
Generator: Unix Makefiles using /usr/bin/gmake
– Enabled packages:
– <<< Compilers and Flags: >>>
– C++ Compiler: /home/XX/.guix-profile/bin/c++
Type: GNU
Version: 10.5.0
C++ Flags: -O2 -g -DNDEBUG
Defines: LAMMPS_SMALLBIG;LAMMPS_MEMALIGN=64;LAMMPS_OMP_COMPAT=4;LAMMPS_GZIP;LAMMPS_FFMPEG
– <<< Linker flags: >>>
– Executable name: lmp
– Static library flags:
– <<< MPI flags >>>
– MPI_defines: MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;_MPICC_H
– MPI includes: /gnu/store/gxcana1la2k5kypnwb8y2sbi3snk5iap-openmpi-4.1.6/include;/home/XX/.guix-profile/include
– MPI libraries: /home/XX/.guix-profile/lib/libmpi.so;
– Configuring done
– Generating done
– Build files have been written to: /home/XX/lammps-4May2022/build

These are the errors that pop up when I build it.

$make -j4
make[2]: *** [CMakeFiles/lammps.dir/build.make:90: CMakeFiles/lammps.dir/home/XX/lammps-4May2022/src/angle_deprecated.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: *** [CMakeFiles/lammps.dir/build.make:118: CMakeFiles/lammps.dir/home/XX/lammps-4May2022/src/angle_zero.cpp.o] Error 1
make[2]: *** [CMakeFiles/lammps.dir/build.make:76: CMakeFiles/lammps.dir/home/XX/lammps-4May2022/src/angle.cpp.o] Error 1
make[2]: *** [CMakeFiles/lammps.dir/build.make:104: CMakeFiles/lammps.dir/home/XX/lammps-4May2022/src/angle_hybrid.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:161: CMakeFiles/lammps.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

These are the packages I have installed by the package manager guix

$ guix package -I
glibc-locales 2.35 out /gnu/store/03v1svhv6wj9pd6awpdi5zn4wd31b23f-glibc-locales-2.35
python 3.10.7 out /gnu/store/1w5v338qk5m8khcazwclprs3znqp6f7f-python-3.10.7
fftw 3.3.10 out /gnu/store/8asi8xi3mls4zbgmy544ai3lhvwvk2ma-fftw-3.3.10
openmpi 4.1.6 out /gnu/store/gxcana1la2k5kypnwb8y2sbi3snk5iap-openmpi-4.1.6
gcc-toolchain 10.5.0 out /gnu/store/qf9zy724k22dwanx2nam1jqp7g1wvq86-gcc-toolchain-10.5.0
gfortran-toolchain 11.3.0 out /gnu/store/ssp4s8rag7aa0hffd15sv85nr626qjzm-gfortran-toolchain-11.3.0
hdf5 1.14.0 out /gnu/store/za521236vgridnz70frj1ddvds10jpnj-hdf5-1.14.0
python-mpi4py 3.1.4 out /gnu/store/4x6kn1h1lvnnxn06vg16ihmji5xm5my7-python-mpi4py-3.1.4
cmake 3.25.1 out /gnu/store/hckqpjba8nrf0x61pw3ma77ci53dk3rx-cmake-3.25.1
ffmpeg 6.1.1 out /gnu/store/81axfd19z9wqilc4jp6vy6zk7z7v96w7-ffmpeg-6.1.1
emacs-clang-format 13.0.1 out /gnu/store/cgv4a4vx4j0d6fnsk5851xirhcvdr810-emacs-clang-format-13.0.1
emacs 29.3 out /gnu/store/bpalqnfh1y0hy1921lpxx5a6yr6b5ksi-emacs-29.3
doxygen 1.9.5 out /gnu/store/xbdcw86y4rsjlw6gnv1i9fqpc23zldf3-doxygen-1.9.5

Am I missing something? I would appreciate any assistance.

best,

What do you get when you type?

make -v
cmake --version

What happens if you go to the src folder and type?

make serial

This is what I get:

~/lammps-4May2022$ make -v
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

~/lammps-4May2022$ cmake --version
cmake version 3.25.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

This when try to use make serial in the scr folder (I am going to put the full output):

~/lammps-4May2022/src$ make serial
make[1]: Entering directory ‘/home/XX/lammps-4May2022/src/STUBS’
g++ -O -fPIC -I. -c mpi.cpp
ar rs libmpi_stubs.a mpi.o
ar: creating libmpi_stubs.a
make[1]: Leaving directory ‘/home/XX/lammps-4May2022/src/STUBS’
Gathering installed package information (may take a little while)
make[1]: Entering directory ‘/home/XX/lammps-4May2022/src’
Gathering git version information
make[1]: Leaving directory ‘/home/XX/lammps-4May2022/src’
Compiling LAMMPS for machine serial
make[1]: Entering directory ‘/home/XX/lammps-4May2022/src/Obj_serial’
cc -O -o fastdep.exe …/DEPEND/fastdep.c
Segmentation fault
make[1]: *** [Makefile:119: depend] Error 1
make[1]: Leaving directory ‘/home/XX/lammps-4May2022/src/Obj_serial’
make[1]: Entering directory ‘/home/XX/lammps-4May2022/src/Obj_serial’
g++ -g -O3 -std=c++11 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I…/STUBS -c …/main.cpp
In file included from /home/XX/.guix-profile//include/c++/bits/move.h:57,
from /home/XX/.guix-profile//include/c++/bits/stl_pair.h:59,
from /home/XX/.guix-profile//include/c++/bits/stl_algobase.h:64,
from /home/XX/.guix-profile//include/c++/bits/char_traits.h:39,
from /home/XX/.guix-profile//include/c++/string:40,
from …/pointers.h:30,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/type_traits:1017:25: error: there are no arguments to ‘__is_nothrow_constructible’ that depend on a template parameter, so a declaration of ‘__is_nothrow_constructible’ must be available [-fpermissive]
1017 | = __bool_constant<__is_nothrow_constructible(_Tp, _Args…)>;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits:1017:25: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/XX/.guix-profile//include/c++/type_traits:1017:66: error: template argument 1 is invalid
1017 | = __bool_constant<__is_nothrow_constructible(_Tp, _Args…)>;
| ^
/home/XX/.guix-profile//include/c++/type_traits:1023:45: error: expected template-name before ‘<’ token
1023 | : public __is_nothrow_constructible_impl<_Tp, _Args…>::type
| ^
/home/XX/.guix-profile//include/c++/type_traits:1023:45: error: expected ‘{’ before ‘<’ token
/home/XX/.guix-profile//include/c++/type_traits:1032:30: error: there are no arguments to ‘__is_nothrow_constructible’ that depend on a template parameter, so a declaration of ‘__is_nothrow_constructible’ must be available [-fpermissive]
1032 | : public __bool_constant<__is_nothrow_constructible(_Tp)>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits:1032:61: error: template argument 1 is invalid
1032 | : public __bool_constant<__is_nothrow_constructible(_Tp)>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1048:45: error: expected template-name before ‘<’ token
1048 | : public __is_nothrow_constructible_impl<_Tp, const _Tp&>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1048:45: error: expected ‘{’ before ‘<’ token
/home/XX/.guix-profile//include/c++/type_traits:1071:45: error: expected template-name before ‘<’ token
1071 | : public __is_nothrow_constructible_impl<_Tp, _Tp&&>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1071:45: error: expected ‘{’ before ‘<’ token
/home/XX/.guix-profile//include/c++/type_traits:1137:25: error: there are no arguments to ‘__is_nothrow_assignable’ that depend on a template parameter, so a declaration of ‘__is_nothrow_assignable’ must be available [-fpermissive]
1137 | = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits:1137:58: error: template argument 1 is invalid
1137 | = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
| ^
/home/XX/.guix-profile//include/c++/type_traits:1142:42: error: expected template-name before ‘<’ token
1142 | : public __is_nothrow_assignable_impl<_Tp, _Up>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1142:42: error: expected ‘{’ before ‘<’ token
/home/XX/.guix-profile//include/c++/type_traits:1157:42: error: expected template-name before ‘<’ token
1157 | : public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1157:42: error: expected ‘{’ before ‘<’ token
/home/XX/.guix-profile//include/c++/type_traits:1178:42: error: expected template-name before ‘<’ token
1178 | : public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
| ^
/home/XX/.guix-profile//include/c++/type_traits:1178:42: error: expected ‘{’ before ‘<’ token
In file included from /home/XX/.guix-profile//include/c++/string:41,
from …/pointers.h:30,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/bits/allocator.h:94:13: error: expected nested-name-specifier before ‘is_always_equal’
94 | using is_always_equal
| ^~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/bits/allocator.h:148:13: error: expected nested-name-specifier before ‘is_always_equal’
148 | using is_always_equal
| ^~~~~~~~~~~~~~~
In file included from /home/XX/.guix-profile//include/c++/bits/stl_function.h:1421,
from /home/XX/.guix-profile//include/c++/string:48,
from …/pointers.h:30,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/backward/binders.h:130:6: error: expected ‘;’ before ‘_GLIBCXX11_DEPRECATED_SUGGEST’
130 | } _GLIBCXX11_DEPRECATED_SUGGEST(“std::bind”);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ;
/home/XX/.guix-profile//include/c++/backward/binders.h:165:6: error: expected ‘;’ before ‘_GLIBCXX11_DEPRECATED_SUGGEST’
165 | } _GLIBCXX11_DEPRECATED_SUGGEST(“std::bind”);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ;
In file included from /home/XX/.guix-profile//include/c++/ext/concurrence.h:34,
from /home/XX/.guix-profile//include/c++/bits/shared_ptr_base.h:62,
from /home/XX/.guix-profile//include/c++/bits/shared_ptr.h:53,
from /home/XX/.guix-profile//include/c++/memory:77,
from …/fmt/format.h:39,
from …/pointers.h:32,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/exception:108:32: error: expected constructor, destructor, or type conversion before ‘(’ token
108 | _GLIBCXX17_DEPRECATED_SUGGEST(“std::uncaught_exceptions()”)
| ^
In file included from /home/XX/.guix-profile//include/c++/memory:82,
from …/fmt/format.h:39,
from …/pointers.h:32,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/backward/auto_ptr.h:54:6: error: expected ‘;’ before ‘_GLIBCXX11_DEPRECATED’
54 | } _GLIBCXX11_DEPRECATED;
| ^~~~~~~~~~~~~~~~~~~~~~
| ;
/home/XX/.guix-profile//include/c++/backward/auto_ptr.h:287:6: error: expected ‘;’ before ‘_GLIBCXX11_DEPRECATED_SUGGEST’
287 | } _GLIBCXX11_DEPRECATED_SUGGEST(“std::unique_ptr”);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ;
In file included from /home/XX/.guix-profile//include/c++/bits/move.h:57,
from /home/XX/.guix-profile//include/c++/bits/stl_pair.h:59,
from /home/XX/.guix-profile//include/c++/bits/stl_algobase.h:64,
from /home/XX/.guix-profile//include/c++/bits/char_traits.h:39,
from /home/XX/.guix-profile//include/c++/string:40,
from …/pointers.h:30,
from …/atom.h:17,
from …/accelerator_kokkos.h:38,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/type_traits: In instantiation of ‘struct std::is_nothrow_move_constructible’:
/home/XX/.guix-profile//include/c++/type_traits:152:12: required from ‘struct std::_and<std::is_nothrow_move_constructible, std::is_nothrow_move_assignable >’
/home/XX/.guix-profile//include/c++/type_traits:2684:48: required from ‘std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = unsigned char; std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > = void]’
…/fmt/format.h:322:37: required from here
/home/XX/.guix-profile//include/c++/type_traits:1077:12: error: invalid use of incomplete type ‘struct std::__is_nothrow_move_constructible_impl<unsigned char, true>’
1077 | struct is_nothrow_move_constructible
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits:1063:12: note: declaration of ‘struct std::__is_nothrow_move_constructible_impl<unsigned char, true>’
1063 | struct __is_nothrow_move_constructible_impl;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits: In instantiation of ‘struct std::_and<std::is_nothrow_move_constructible, std::is_nothrow_move_assignable >’:
/home/XX/.guix-profile//include/c++/type_traits:2684:48: required from ‘std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = unsigned char; std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > = void]’
…/fmt/format.h:322:37: required from here
/home/XX/.guix-profile//include/c++/type_traits:152:12: error: ‘value’ is not a member of ‘std::is_nothrow_move_constructible’
152 | struct _and<_B1, _B2>
| ^~~~~~~~~~~~~~~~
/home/XX/.guix-profile//include/c++/type_traits: In instantiation of ‘std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = unsigned char; std::_Require<std::_not<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > = void]’:
…/fmt/format.h:322:37: required from here
/home/XX/.guix-profile//include/c++/type_traits:2684:48: error: ‘value’ is not a member of ‘std::_and<std::is_nothrow_move_constructible, std::is_nothrow_move_assignable >’
2684 | is_nothrow_move_assignable<_Tp>>::value);
| ^~~~~
In file included from /home/XX/.guix-profile//include/c++/unordered_set:46,
from …/domain.h:21,
from …/accelerator_kokkos.h:41,
from …/main.cpp:16:
/home/XX/.guix-profile//include/c++/bits/hashtable.h: In instantiation of ‘class std::_Hashtable<LAMMPS_NS::Region*, LAMMPS_NS::Region*, std::allocator<LAMMPS_NS::Region*>, std::__detail::_Identity, std::equal_to<LAMMPS_NS::Region*>, std::hash<LAMMPS_NS::Region*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true> >’:
/home/XX/.guix-profile//include/c++/bits/unordered_set.h:100:18: required from ‘class std::unordered_set<LAMMPS_NS::Region*>’
…/domain.h:176:32: required from here
/home/XX/.guix-profile//include/c++/bits/hashtable.h:340:67: error: ‘value’ is not a member of ‘std::is_nothrow_default_constructiblestd::__detail::_Mod_range_hashing
340 | static_assert(is_nothrow_default_constructible<_RangeHash>::value,
| ^~~~~

/home/XX/.guix-profile//include/c++/bits/hashtable.h:349:68: error: ‘value’ is not a member of ‘std::is_nothrow_default_constructiblestd::__detail::_Identity
349 | static_assert(is_nothrow_default_constructible<_ExtractKey>::value,
| ^~~~~

make[1]: *** [Makefile:114: main.o] Error 1
make[1]: Leaving directory ‘/home/XX/lammps-4May2022/src/Obj_serial’
make: *** [Makefile:392: serial] Error 2

Thank you for answering :slight_smile:

There is something very broken with your compiler and C library installation.
Compiling a simple C code should not produce a segmentation fault.

Similarly, the errors when compiling with g++.

This is definitely not a LAMMPS issue.

I see. I will write to the cluster support to solve this problem. Thank you for your reply, I appreciate it.

From the CMake configuration output it looks like you installed the compiler: