Skip to content

Commit

Permalink
Update cis. Fix uninstall.
Browse files Browse the repository at this point in the history
  • Loading branch information
vehre committed Feb 11, 2025
1 parent e17151c commit a32e5fd
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 10 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,29 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
mpi: [ 'openmpi', 'impi' ]
# mpi: [ 'mpich', 'openmpi', 'impi' ]
# mpich is borken on ubuntu-24.04LTS and 24.10 see https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338

env:
FC: gfortran
GCC_V: 11
GCC_V: 13

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Dependencies
run: |
sudo apt install -y gfortran-${GCC_V} cmake mpich
sudo apt install -y gfortran-${GCC_V} cmake
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} 100
- name: Setup MPI ${{ matrix.mpi }}
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}

- name: Build and Test
run: |
mkdir build
Expand All @@ -30,3 +39,4 @@ jobs:
ctest --test-dir build --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200
cd build
make uninstall
echo "Ran with mpi: ${{ matrix.mpi }}"
16 changes: 14 additions & 2 deletions .github/workflows/win-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,23 @@ jobs:
ls "${I_MPI_ROOT}/bin"
ls "${I_MPI_ROOT}"
ls "${I_MPI_ROOT}/lib"
mpifc.bat -show
mpicc.bat -show
ls "${I_MPI_ROOT}/env"
# cat "${I_MPI_ROOT}/bin/mpifc.bat"
# mpifc.bat -show
# mpicc.bat -show
mpifc.bat -version || echo "ifort not installed"
mpicc.bat -version || echo "icc not installed"
set +o verbose
# echo The following environment variables are used:
# echo CMPLR_ROOT Intel^(R^) Compiler installation directory path
# echo I_MPI_ROOT Intel^(R^) MPI Library installation directory path
# echo I_MPI_{FC,F77,F90} or MPICH_{FC,F77,F90}
# echo the path/name of the underlying compiler to be used.
# echo I_MPI_{FC,F77,F90}_PROFILE or MPI{FC,F77,F90}_PROFILE
# echo name of profile file ^(without extension^)
# echo I_MPI_COMPILER_CONFIG_DIR
# echo folder which contains configuration files *.conf
# echo VT_ROOT Intel^(R^) Trace Collector installation directory path
- name: Build and Test
run: |
Expand Down
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,18 +734,21 @@ function(add_caf_test name num_caf_img test_target)
endif()
# Add a host file for OMPI
get_property(openmpi GLOBAL PROPERTY openmpi)
get_property(N_CPU GLOBAL PROPERTY N_CPU)
if ( openmpi )
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile)
# OpenMPIs decision when a host is oversubscribed in ctest is indeterministic
# Therefore always add --oversubscribe to prevent test failures.
set(test_parameters --hostfile ${CMAKE_BINARY_DIR}/hostfile --oversubscribe)
endif()
if ( ((N_CPU LESS num_caf_img) OR (N_CPU EQUAL 0)) )
if ( ( N_CPU LESS_EQUAL num_caf_img ) OR ( N_CPU EQUAL 0 ) )
message(STATUS "Test ${name} is oversubscribed: ${num_caf_img} CAF images requested with ${N_CPU} system processor available.")
if ( openmpi )
if (min_test_imgs)
set( num_caf_img ${min_test_imgs} )
elseif ( N_CPU LESS 2 )
set( num_caf_img 2 )
endif()
set (test_parameters ${test_parameters} --oversubscribe)
# set (test_parameters ${test_parameters} --oversubscribe)
message( STATUS "Open-MPI back end detected, passing --oversubscribe for oversubscribed test, ${name}, with ${num_caf_img} ranks/images." )
endif()
endif()
Expand Down
6 changes: 3 additions & 3 deletions cmake/uninstall.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ endforeach()
foreach(file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program(
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\"
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
RESULT_VARIABLE rm_retval
)
if(NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
Expand Down

0 comments on commit a32e5fd

Please sign in to comment.