diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29288c41..835133a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: env: FC: gfortran - GCC_V: 10 + GCC_V: 11 steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Dependencies run: | @@ -24,9 +24,9 @@ jobs: - name: Build and Test run: | mkdir build + cmake -S . -B build -Wdev -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug" .. + cmake --build build -j $(nproc) + cmake --build build -t install -j $(nproc) || echo "installation failed" + ctest --test-dir build --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200 cd build - cmake -Wdev -DCMAKE_INSTALL_PREFIX:PATH="${HOME}/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug" .. - make -j $(nproc) - ctest --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200 - make install make uninstall diff --git a/.github/workflows/win-ci.yml b/.github/workflows/win-ci.yml new file mode 100644 index 00000000..1741e922 --- /dev/null +++ b/.github/workflows/win-ci.yml @@ -0,0 +1,67 @@ +name: Windows CI + +on: [push, pull_request] + +jobs: + Build: + runs-on: windows-latest + strategy: + fail-fast: true + defaults: + run: + shell: msys2 {0} + + env: + FC: gfortran + CC: gcc + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install Dependencies + uses: msys2/setup-msys2@v2 + with: + update: true + path-type: inherit + install: >- + mingw-w64-x86_64-gcc-fortran mingw-w64-x86_64-gcc + + - name: setup-mpi + id: setup-mpi + uses: mpi4py/setup-mpi@v1 + with: + mpi: intelmpi + + - name: MPI info + run: | + echo "${{ steps.setup-mpi.outputs.mpi }}" + set -o verbose + # mpiexec -help + type mpiexec + ls "${I_MPI_ROOT}/bin" + ls "${I_MPI_ROOT}" + ls "${I_MPI_ROOT}/lib" + mpifc.bat -show + mpicc.bat -show + mpifc.bat -version || echo "ifort not installed" + mpicc.bat -version || echo "icc not installed" + set +o verbose + + - name: Build and Test + run: | + mkdir build + cmake -Wdev -G "Unix Makefiles" -S . -B build -DCMAKE_INSTALL_PREFIX="${HOME}/apps/OpenCoarrays" -DCMAKE_BUILD_TYPE:STRING="Debug" + cmake --build build -j + cmake --build build -t install -j || echo "installation failed" + ctest --test-dir build --output-on-failure --schedule-random --repeat-until-fail 1 --timeout 200 + echo "${HOME}/apps/OpenCoarrays/bin" >> $GITHUB_PATH + export PATH="${HOME}/apps/OpenCoarrays/bin:${PATH}" + which caf || true + which cafrun || true + cafrun --show || true + caf --show || true + cafrun --version || true + caf --version || true + cd build + make uninstall diff --git a/CMakeLists.txt b/CMakeLists.txt index 84493f97..226c3603 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,12 +281,15 @@ if(WIN32) # Only support building with GCC & GFortran using Intel MPI (OneAPI) set( MPI_ASSUME_NO_BUILTIN_MPI TRUE ) set( MPI_CXX_SKIP_MPICXX TRUE ) cmake_path(SET MPI_ROOT NORMALIZE "$ENV{I_MPI_ROOT}") - set (IMPI_LIB_DIR "${MPI_ROOT}/lib/${IMPI_BUILD}") - set (IMPI_DLL_DIR "${MPI_ROOT}/bin/${IMPI_BUILD}") + set (IMPI_LIB_DIR "${MPI_ROOT}/lib") + set (IMPI_DLL_DIR "${MPI_ROOT}/bin") + message(STATUS "Looking in IMPI_LIB_DIR=${IMPI_LIB_DIR}") + message(STATUS "Looking in IMPI_DLL_DIR=${IMPI_DLL_DIR}") find_library(IMPI_LIB "impi.lib" HINTS "${IMPI_LIB_DIR}" + PATH_SUFFIXES "${IMPI_BUILD}" DOC "Location of the Intel MPI impi.lib file" REQUIRED NO_DEFAULT_PATH) @@ -294,6 +297,7 @@ if(WIN32) # Only support building with GCC & GFortran using Intel MPI (OneAPI) find_file(IMPI_DLL "impi.dll" HINTS "${IMPI_DLL_DIR}" + PATH_SUFFIXES "${IMPI_BUILD}" DOC "Location of the Intel MPI impi.dll file" REQUIRED NO_DEFAULT_PATH) diff --git a/src/script-templates/caf.in b/src/script-templates/caf.in index 6bbc6b13..be64c827 100755 --- a/src/script-templates/caf.in +++ b/src/script-templates/caf.in @@ -150,11 +150,12 @@ cd "${current_dir}" || exit 5 # Error tracing # requires `set -o errtrace` +# shellcheck disable=SC2317 __caf_err_report() { local error_code - error_code=${?} + error_code="${?}" echo "Error in ${__file} in function ${1} on line ${2}. Please report this error at http://bit.ly/OpenCoarrays-new-issue" >&2 - exit ${error_code} + exit "${error_code}" } # Always provide an error backtrace trap '__caf_err_report "${FUNCNAME:-.}" ${LINENO}' ERR