Skip to content

Commit

Permalink
split
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Dec 29, 2023
1 parent 69c18a6 commit e049819
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
47 changes: 12 additions & 35 deletions .github/workflows/ci_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
build_type : [ Release, Debug ]
os : [ macos-latest, ubuntu-20.04]
os : [ macos-latest, ubuntu-20.04 ]
include:
- os: ubuntu-20.04
cxx: g++-10
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# fetch-depth: 0 gets git history to compute version
# fetch-depth: 0 for git history to compute version

- id: skip_check
name: Check if can skip
Expand Down Expand Up @@ -84,35 +84,6 @@ jobs:
echo "FC=/usr/bin/gfortran-10" >> $GITHUB_ENV
echo "EIGEN3_INCLUDE_DIR=/usr/include/eigen3" >> $GITHUB_ENV
- name: Install Windows prerequisites, part 1, Create Conda Environment
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ""
auto-activate-base: true
show-channel-urls: true
miniforge-variant: Mambaforge
use-mamba: true
channels: conda-forge
add-pip-as-python-dependency: true

# Note: `shell: bash -l {0}` makes Miniconda created above for Windows available to
# subsequent steps. see https://github.com/conda-incubator/setup-miniconda#usage-examples

- name: Install Windows prerequisites, part 2, Environment Information
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
shell: bash -l {0}
run: |
mamba info
mamba install ninja cmake=3.21 python mpir boost eigen ccache -c conda-forge --yes
mamba list
- name: Prepare compiler environment for Windows
if: ${{ steps.skip_check.outputs.should_skip != 'true' && matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Prepare ccache timestamp
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
id: ccache_cache_timestamp
Expand All @@ -130,15 +101,21 @@ jobs:
restore-keys: |
${{ matrix.config.name }}-ccache-
- name: Generate Libint library
- name: Generate Libint generator
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash -l {0}
shell: bash
working-directory: ${{github.workspace}}/build/compiler
run: |
ls ${{github.workspace}}
git describe --tags
cmake -S ../.. -B build $BUILD_CONFIG --log-level=DEBUG
cmake --build build --target check-libint2compiler libint-library-generate
cmake --build build --target check-libint2compiler
- name: Generate Libint library
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
shell: bash
working-directory: ${{github.workspace}}/build/compiler
run: |
cmake --build build --target libint-library-generate
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ message(STATUS "Showing option BUILD_TESTING: ${BUILD_TESTING}")
# <<< Path >>>

######################## Process & Validate Options ###########################
include(autocmake_safeguards)
include(CheckFunctionExists)
include(CheckIncludeFileCXX)
include(FeatureSummary)
Expand Down
27 changes: 27 additions & 0 deletions cmake/modules/autocmake_safeguards.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Downloaded from
# https://github.com/coderefinery/autocmake/blob/master/modules/safeguards.cmake
# * changed text of in-source message

#.rst:
#
# Provides safeguards against in-source builds and bad build types.
#
# Variables used::
#
# PROJECT_SOURCE_DIR
# PROJECT_BINARY_DIR
# CMAKE_BUILD_TYPE

if(${PROJECT_SOURCE_DIR} STREQUAL ${PROJECT_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please run CMake from top directory and specify a build directory (e.g., cmake -S. -Bbuild).")
endif()

string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
string(TOUPPER "${CMAKE_BUILD_TYPE}" cmake_build_type_toupper)

if(NOT cmake_build_type_tolower STREQUAL "debug" AND
NOT cmake_build_type_tolower STREQUAL "release" AND
NOT cmake_build_type_tolower STREQUAL "minsizerel" AND
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo")
message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, MinSizeRel, RelWithDebInfo (case-insensitive).")
endif()

0 comments on commit e049819

Please sign in to comment.