Allow builds without MPI with -DUSE_MPI=OFF
This commit is contained in:
parent
6eead7e28e
commit
171e439bd4
@ -21,6 +21,13 @@ build:rt-tests:
|
||||
script:
|
||||
- nix build -L --tarball-ttl 0 --file nix/rt.nix bsc.ovni-rt
|
||||
|
||||
build:no-mpi:
|
||||
stage: build
|
||||
tags:
|
||||
- nix
|
||||
script:
|
||||
- nix build -L --tarball-ttl 0 --file nix/rt.nix bsc.ovni-nompi
|
||||
|
||||
build:old-gcc:
|
||||
stage: build
|
||||
tags:
|
||||
|
@ -155,6 +155,12 @@ let
|
||||
export NODES_HOME="${last.nodes}"
|
||||
'';
|
||||
});
|
||||
|
||||
ovni-nompi = last.ovni.overrideAttrs (old: {
|
||||
buildInputs = pkgs.lib.filter (x: x != last.mpi ) old.buildInputs;
|
||||
cmakeFlags = old.cmakeFlags ++ [ "-DUSE_MPI=OFF" ];
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
in
|
||||
|
@ -66,14 +66,19 @@ target_link_libraries(ovnidump emu parson-static ovni-static)
|
||||
add_executable(ovnisort ovnisort.c)
|
||||
target_link_libraries(ovnisort emu parson-static ovni-static)
|
||||
|
||||
set(USE_MPI ON CACHE BOOL "Use MPI (required by ovnisync)")
|
||||
if(USE_MPI)
|
||||
# Use <PackageName>_ROOT variables if available, commonly used by MPI
|
||||
# installations
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW)
|
||||
endif()
|
||||
|
||||
find_package(MPI REQUIRED)
|
||||
add_executable(ovnisync ovnisync.c)
|
||||
target_link_libraries(ovnisync m MPI::MPI_C)
|
||||
install(TARGETS ovnisync RUNTIME DESTINATION bin)
|
||||
else()
|
||||
message(STATUS "Disabling ovnisync as MPI is disabled")
|
||||
endif()
|
||||
|
||||
install(TARGETS ovniemu ovnidump ovnisync ovnisort RUNTIME DESTINATION bin)
|
||||
install(TARGETS ovniemu ovnidump ovnisort RUNTIME DESTINATION bin)
|
||||
|
Loading…
Reference in New Issue
Block a user