From 31f1ae2aefb0873414eaf80242a6884d369eb6e2 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 10:41:31 +0200 Subject: [PATCH 1/8] Use GHA for Windows testing too --- .github/workflows/build-test.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d8d852aa..e7cd2d60 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -20,7 +20,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] python-version: [3.6, 3.7, 3.8, 3.9] steps: @@ -37,16 +37,18 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: - auto-update-conda: true - auto-activate-base: false - activate-environment: xcfun-gha - environment-file: .github/xcfun-gha.yml - channel-priority: true - python-version: ${{ matrix.python-version }} - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + auto-update-conda: true + auto-activate-base: false + activate-environment: xcfun-gha + environment-file: .github/xcfun-gha.yml + channel-priority: true + python-version: ${{ matrix.python-version }} + use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - name: Configure shell: bash -l {0} + env: + CXXFLAGS: "" # clean up CXXFLAGS from the conda environment run: | cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/Software/xcfun -DXCFUN_PYTHON_INTERFACE=ON @@ -81,6 +83,7 @@ jobs: cmake --build build_C_host --target test - name: Test the Fortran example + if: "!contains(matrix.os, 'windows')" shell: bash -l {0} run: | cmake -H./examples/Fortran_host -Bbuild_Fortran_host -GNinja -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun From 3604f2ce3dce6567b5271a110575d06f81134b82 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:13:08 +0200 Subject: [PATCH 2/8] Update build-test.yml --- .github/workflows/build-test.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index e7cd2d60..75ac282e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -44,13 +44,22 @@ jobs: channel-priority: true python-version: ${{ matrix.python-version }} use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - + + - name: Select CMake CLI options + shell: bash -l {0} + run: | + if [ "${{ matrix.os }}" != "windows-latest" ]; then + echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV + else + echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV + fi + - name: Configure shell: bash -l {0} env: CXXFLAGS: "" # clean up CXXFLAGS from the conda environment run: | - cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/Software/xcfun -DXCFUN_PYTHON_INTERFACE=ON + cmake -H. -Bbuild "$CONF_OPTS" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/Software/xcfun -DXCFUN_PYTHON_INTERFACE=ON - name: Build shell: bash -l {0} @@ -71,14 +80,14 @@ jobs: - name: Test the C++ example shell: bash -l {0} run: | - cmake -H./examples/CXX_host -Bbuild_CXX_host -GNinja -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun + cmake -H./examples/CXX_host -Bbuild_CXX_host "$CONF_OPTS" -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun cmake --build build_CXX_host -- -v -d stats cmake --build build_CXX_host --target test - name: Test the C example shell: bash -l {0} run: | - cmake -H./examples/C_host -Bbuild_C_host -GNinja -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun + cmake -H./examples/C_host -Bbuild_C_host "$CONF_OPTS" -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun cmake --build build_C_host -- -v -d stats cmake --build build_C_host --target test From 862e994de5243b6013c69bb04e245e5e7cce0035 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:22:41 +0200 Subject: [PATCH 3/8] Add BUILD_OPTS --- .github/workflows/build-test.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 75ac282e..8a611637 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,8 +50,10 @@ jobs: run: | if [ "${{ matrix.os }}" != "windows-latest" ]; then echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV + echo "BUILD_OPTS=\"-v -d stats\"" >> $GITHUB_ENV else echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV + echo "BUILD_OPTS=\"-verbosity:normal\"" >> $GITHUB_ENV fi - name: Configure @@ -64,7 +66,7 @@ jobs: - name: Build shell: bash -l {0} run: | - cmake --build build --config $BUILD_TYPE --target install -- -v -d stats + cmake --build build --config $BUILD_TYPE --target install -- "$BUILD_OPTS" - name: Test XCFun shell: bash -l {0} @@ -81,14 +83,14 @@ jobs: shell: bash -l {0} run: | cmake -H./examples/CXX_host -Bbuild_CXX_host "$CONF_OPTS" -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun - cmake --build build_CXX_host -- -v -d stats + cmake --build build_CXX_host -- "$BUILD_OPTS" cmake --build build_CXX_host --target test - name: Test the C example shell: bash -l {0} run: | cmake -H./examples/C_host -Bbuild_C_host "$CONF_OPTS" -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun - cmake --build build_C_host -- -v -d stats + cmake --build build_C_host -- "$BUILD_OPTS" cmake --build build_C_host --target test - name: Test the Fortran example @@ -96,5 +98,5 @@ jobs: shell: bash -l {0} run: | cmake -H./examples/Fortran_host -Bbuild_Fortran_host -GNinja -DXCFun_DIR=$GITHUB_WORKSPACE/Software/xcfun/share/cmake/XCFun - cmake --build build_Fortran_host -- -v -d stats + cmake --build build_Fortran_host -- "$BUILD_OPTS" cmake --build build_Fortran_host --target test From 0f6d8362906d82cfe4e96971844460c867a00f67 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:25:45 +0200 Subject: [PATCH 4/8] Quote silliness --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8a611637..9bcc4a15 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,10 +50,10 @@ jobs: run: | if [ "${{ matrix.os }}" != "windows-latest" ]; then echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV - echo "BUILD_OPTS=\"-v -d stats\"" >> $GITHUB_ENV + echo "BUILD_OPTS="-v -d stats"" >> $GITHUB_ENV else echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV - echo "BUILD_OPTS=\"-verbosity:normal\"" >> $GITHUB_ENV + echo "BUILD_OPTS="-verbosity:normal"" >> $GITHUB_ENV fi - name: Configure From 250485442cf5d6c7300686c8579edc9ddf4b56cf Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:28:57 +0200 Subject: [PATCH 5/8] quotes --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 9bcc4a15..6c973b2c 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,10 +50,10 @@ jobs: run: | if [ "${{ matrix.os }}" != "windows-latest" ]; then echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV - echo "BUILD_OPTS="-v -d stats"" >> $GITHUB_ENV + echo "BUILD_OPTS='-v -d stats'" >> $GITHUB_ENV else echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV - echo "BUILD_OPTS="-verbosity:normal"" >> $GITHUB_ENV + echo "BUILD_OPTS='-verbosity:normal'" >> $GITHUB_ENV fi - name: Configure From 3c45bb4b40e298a1fb53a51ff9147c66cf61282c Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:33:24 +0200 Subject: [PATCH 6/8] no quotes --- .github/workflows/build-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 6c973b2c..a1f5783e 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,10 +50,10 @@ jobs: run: | if [ "${{ matrix.os }}" != "windows-latest" ]; then echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV - echo "BUILD_OPTS='-v -d stats'" >> $GITHUB_ENV + echo "BUILD_OPTS=-v -d stats" >> $GITHUB_ENV else echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV - echo "BUILD_OPTS='-verbosity:normal'" >> $GITHUB_ENV + echo "BUILD_OPTS=-verbosity:normal" >> $GITHUB_ENV fi - name: Configure From 883789001e4e3dc37bc3e05829161dce6cb1460a Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:38:51 +0200 Subject: [PATCH 7/8] build opts --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index a1f5783e..7c748f22 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -50,7 +50,7 @@ jobs: run: | if [ "${{ matrix.os }}" != "windows-latest" ]; then echo "CONF_OPTS=-GNinja" >> $GITHUB_ENV - echo "BUILD_OPTS=-v -d stats" >> $GITHUB_ENV + echo "BUILD_OPTS=-v" >> $GITHUB_ENV else echo "CONF_OPTS=-Ax64" >> $GITHUB_ENV echo "BUILD_OPTS=-verbosity:normal" >> $GITHUB_ENV From 3875dc2f81ce69a115bc39d893f1651508b24ac8 Mon Sep 17 00:00:00 2001 From: Roberto Di Remigio Date: Wed, 8 Sep 2021 14:51:50 +0200 Subject: [PATCH 8/8] Fix static_assert on Windows --- src/functionals/brx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functionals/brx.cpp b/src/functionals/brx.cpp index acaaafc8..4ffcb5ce 100644 --- a/src/functionals/brx.cpp +++ b/src/functionals/brx.cpp @@ -51,7 +51,7 @@ static double BR(double z) { // inverse of BR_y. Use linear method for simplicity. template taylor BR_taylor(const T & z0) { - static_assert(Ndeg >= 3); + static_assert(Ndeg >= 3, "Must be used with Ndeg >= 3"); taylor t; t = 0;