Skip to content

Commit

Permalink
CMAKE: avoid CUDA the false negative err
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Aug 30, 2022
1 parent d3a3e01 commit d519765
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
path: source
- name: Setup
run: gha/scripts/ci/gh-actions/linux-setup.sh
run: |
echo "${GITHUB_WORKSPACE}/../.local/bin" >> $GITHUB_PATH
gha/scripts/ci/gh-actions/linux-setup.sh
- name: Update
run: gha/scripts/ci/gh-actions/run.sh update
- name: Configure
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/cmake-v2/ci-common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(NOT CTEST_BUILD_FLAGS)
if(CTEST_CMAKE_GENERATOR STREQUAL "Unix Makefiles")
set(CTEST_BUILD_FLAGS "-k -j${N2CPUS}")
elseif(CTEST_CMAKE_GENERATOR STREQUAL "Ninja")
set(CTEST_BUILD_FLAGS "-k0 -j${N2CPUS}")
set(CTEST_BUILD_FLAGS "-j${N2CPUS}")
endif()
endif()
if(NOT PARALLEL_LEVEL IN_LIST CTEST_TEST_ARGS)
Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/cmake-v2/ci-el8-cuda-serial.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

include(ProcessorCount)
ProcessorCount(NCPUS)
math(EXPR N2CPUS "${NCPUS}*2")
math(EXPR N2CPUS "${NCPUS}*4")

set(ENV{CC} gcc)
set(ENV{CXX} g++)
Expand All @@ -25,6 +25,6 @@ CMAKE_Fortran_FLAGS:STRING=-Wall
")

set(CTEST_TEST_ARGS PARALLEL_LEVEL ${NCPUS})
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_CMAKE_GENERATOR "Ninja")
list(APPEND CTEST_UPDATE_NOTES_FILES "${CMAKE_CURRENT_LIST_FILE}")
include(${CMAKE_CURRENT_LIST_DIR}/ci-common.cmake)
34 changes: 34 additions & 0 deletions scripts/ci/gh-actions/config/ninja.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)

set(version 1.11.0)

if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(sha256sum 9726e730d5b8599f82654dc80265e64a10a8a817552c34153361ed0c017f9f02)
set(platform linux)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(sha256sum 21915277db59756bfc61f6f281c1f5e3897760b63776fd3d360f77dd7364137f)
set(platform mac)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(sha256sum d0ee3da143211aa447e750085876c9b9d7bcdd637ab5b2c5b41349c617f22f3b)
set(platform win)
else()
message(FATAL_ERROR "Unrecognized platform ${CMAKE_HOST_SYSTEM_NAME}")
endif()

set(tarball "ninja-${platform}.zip")

file(DOWNLOAD
"https://github.com/ninja-build/ninja/releases/download/v${version}/${tarball}" $ENV{CI_ROOT_DIR}/.local/bin/${tarball}
EXPECTED_HASH SHA256=${sha256sum}
SHOW_PROGRESS
)

execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xf ${tarball}
WORKING_DIRECTORY $ENV{CI_ROOT_DIR}/.local/bin
RESULT_VARIABLE extract_results
)

if(extract_results)
message(FATAL_ERROR "Extracting `${tarball}` failed: ${extract_results}.")
endif()
11 changes: 9 additions & 2 deletions scripts/ci/gh-actions/linux-setup.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/bash
#!/bin/bash --login

set -e
set -ex

export CI_ROOT_DIR="${GITHUB_WORKSPACE}/.."
export CI_SOURCE_DIR="${GITHUB_WORKSPACE}"

echo "**********Install dependencies Begin**********"
[ -d ${CI_ROOT_DIR}/.local/bin ] || mkdir -p ${CI_ROOT_DIR}/.local/bin

find ${CI_SOURCE_DIR}/gha/scripts/ci/gh-actions/config/ -type f -iname '*.sh ' -perm /a=x -exec ./{} \;
find ${CI_SOURCE_DIR}/gha/scripts/ci/gh-actions/config/ -type f -iname '*.cmake' -exec cmake --trace -VV -P {} \;
echo "**********Install dependencies End**********"

SETUP_SCRIPT=${CI_SOURCE_DIR}/scripts/ci/setup/ci-${GH_YML_JOBNAME}.sh

if [ -x "${SETUP_SCRIPT}" ]
Expand Down

0 comments on commit d519765

Please sign in to comment.