spack/var/spack/repos/builtin/packages/libsplash/root_cmake_1.7.0.patch
Axel Huebl c7a8c4a44c libSplash 1.7.0: Root Fix (#7368)
Fix installs as "root" user for the last libSplash release.
Missing quoting of string compares resulted in a CMake error
when run as root (e.g. in a Docker build).
2018-03-06 09:38:40 +01:00

16 lines
534 B
Diff

diff --git CMakeLists.txt CMakeLists.txt
index 4846ff7..5e102ce 100644
--- libSplash-1.7.0/CMakeLists.txt
+++ libSplash-1.7.0/CMakeLists.txt
@@ -392,7 +392,8 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tools/splash2xdmf.py DESTINATION bin)
#
enable_testing()
-if($ENV{USER} STREQUAL root)
+# OpenMPI root guard: https://github.com/open-mpi/ompi/issues/4451
+if("$ENV{USER}" STREQUAL "root")
set(MPI_ALLOW_ROOT --allow-run-as-root)
endif()
set(MPI_TEST_EXE ${MPIEXEC_EXECUTABLE} ${MPI_ALLOW_ROOT} ${MPIEXEC_NUMPROC_FLAG})