afernandezody
afernandezody

Reputation: 131

How to run spack without OpenMP?

The compilation of LLVM with spack ($spack install llvm) fails towards the end with the following error message:

==> Installing llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6
==> No binary for llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6 found: installing from source
==> Using cached archive: /opt/mundi/spack/var/spack/cache/_source-cache/archive/42/42a0088f148edcf6c770dfc780a7273014a9a89b66f357c761b4ca7c8dfa10ba.tar.gz
==> Applied patch /opt/mundi/spack/var/spack/repos/builtin/packages/llvm/llvm15-thread.patch
==> llvm: Executing phase: 'cmake'
==> llvm: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 1:
    '/opt/mundi/terra/linux-ubuntu22.04-neoverse_v1/gcc-11.3.0/ninja-1.11.1-ses2sa2mnuu652hdjd7k4cm2qrruurac/bin/ninja' '-j1' '-v'

3 errors found in build log:
     20276    [960/1546] Copying compiler-rt's xray/xray_interface.h...
     20277    [961/1546] Copying compiler-rt's xray/xray_log_interface.h...
     20278    [962/1546] Copying compiler-rt's xray/xray_records.h...
     20279    [963/1546] Generating kmp_i18n_default.inc
     20280    [964/1546] Generating kmp_i18n_id.inc
     20281    [965/1546] Building CXX object openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o
  >> 20282    FAILED: openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o
     20283    /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-build-cvmhmn4/./bin/clang++ --target=aarch64-unknown-linux-gn
              u -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Domp_EXPORTS -I/tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6
              wxbsjmmxmz7euob5eim6/spack-build-cvmhmn4/runtimes/runtimes-bins/openmp/runtime/src -I/tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxb
              sjmmxmz7euob5eim6/spack-src/openmp/runtime/src -I/tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/r
              untime/src/i18n -I/tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/runtime/src/include -I/tmp/root/
              spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/runtime/src/thirdparty/ittnotify -I/opt/mundi/terra/linux-ub
              untu22.04-neoverse_v1/gcc-11.3.0/hwloc-2.9.0-sqtkwcz4472mwbifxyvxx7jesmvtxaf3/include -std=c++11 -fPIC -fno-semantic-interposition -fvisibility-in
              lines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-
              initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -W
              no-comment -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -Wcast-qual -Wformat-pedanti
              c -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -std=c++14 -O3 -DNDEBUG -fPIC   -D _GNU_SOURCE -D _REENTRANT -fno-exceptions -fno
              -rtti -Wno-covered-switch-default -Wno-frame-address -Wno-strict-aliasing -Wno-switch -Wno-uninitialized -Wno-unused-but-set-variable -Wno-return-
              type-c-linkage -Wno-cast-qual -Wno-int-to-void-pointer-cast -MD -MT openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o -MF openmp/runtime/src/C
              MakeFiles/omp.dir/kmp_alloc.cpp.o.d -o openmp/runtime/src/CMakeFiles/omp.dir/kmp_alloc.cpp.o -c /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmh
              mn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/runtime/src/kmp_alloc.cpp
     20284    In file included from /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/runtime/src/kmp_alloc.cpp:13
              :
  >> 20285    /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-src/openmp/runtime/src/kmp.h:69:10: fatal error: 'limits' fil
              e not found
     20286    #include <limits>
     20287             ^~~~~~~~
     20288    1 error generated.
     20289    [966/1546] Building CXX object libcxx/src/CMakeFiles/cxx_experimental.dir/format.cpp.o
     20290    ninja: build stopped: subcommand failed.
  >> 20291    FAILED: runtimes/runtimes-stamps/runtimes-build /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-build-cvmhmn4
              /runtimes/runtimes-stamps/runtimes-build
     20292    cd /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-build-cvmhmn4/runtimes/runtimes-bins && /opt/mundi/terra/l
              inux-ubuntu22.04-neoverse_v1/gcc-11.3.0/cmake-3.25.2-fnn6pmj4isv3bthms7z3vdxiedg7nw3y/bin/cmake --build .
     20293    ninja: build stopped: subcommand failed.

See build log for details:
  /tmp/root/spack-stage/spack-stage-llvm-15.0.7-cvmhmn4maer6wxbsjmmxmz7euob5eim6/spack-build-out.txt

This is an aarch64 system running Ubuntu22.04 and GCC is 11.3.0. I think that the issue might be related to the lack of OpenMP support because of the aarch64 architecture. My question is twofold: Is the root of the problem OpenMP or am I missing anything? If so, is there any workaround to tell Spack to build everything without OpenMP? I don't see how to do so in the config file.

Upvotes: 0

Views: 174

Answers (1)

pjstack
pjstack

Reputation: 91

My first suggestion is to try and update spack. Not finding the <limits> header seems fairly suspect and bug fixes are going in all the time for packages.

I'm not a LLVM expert but spack info llvm shows a few OpenMP variants. If you really want to build without OpenMP you could try llvm~libomptarget and see if that helps? Otherwise we may need to add additional variants for llvm.

Upvotes: 0

Related Questions