From 998a8fa5bd19c4f03e586b04419a51e1c6fa521b Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 09:41:22 +0200 Subject: [PATCH 1/7] Tweaking runs 5 (moving tweaks from dummies to real workflows) --- .github/workflows/cibuildwheel.yml | 9 +++++++-- .github/workflows/unittests.yml | 13 +++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index d0566c7d..2240273b 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -1,9 +1,14 @@ name: cibuildwheel -on: [] +on: + push: + branches: + - main + pull_request: jobs: build_wheels: + if: github.ref == 'refs/heads/main' || github.event_name != 'push' name: Build ${{ matrix.tp_version }} wheels on ${{ matrix.os }}-${{ matrix.version }} runs-on: ${{ matrix.os }}-${{ matrix.version }} timeout-minutes: 30 @@ -91,7 +96,7 @@ jobs: release_wheels: # Create or update the release tagged Latest-beta, and upload wheels to that release. name: Update prerelease - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && github.event_name == 'push' needs: build_wheels runs-on: ubuntu-latest permissions: diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 8beb8f4c..16b51da9 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,6 +1,10 @@ name: unittests -on: [] +on: + push: + branches: + - main + pull_request: jobs: run-tests: @@ -13,15 +17,8 @@ jobs: toolchain: - {compiler: gcc, version: 13} include: - # - os: ubuntu-latest - # toolchain: {nvidia-hpc, version: '23.11'} - # - os: windows-2022 - # toolchain: {compiler: intel, version: '2024.1'} - os: windows-2022 toolchain: {compiler: intel-classic, version: '2021.12'} - # exclude: - # - os: windows-latest - # toolchain: {compiler: gcc, version: 13} steps: - uses: actions/checkout@v4 From 15b8ed28e85f9946a3b14f4db5f04545b6b9d574 Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 09:47:23 +0200 Subject: [PATCH 2/7] Delete dummy workflows and build both v2 and v3 wheels for windows. --- .github/workflows/cibuildwheel.yml | 15 +++++++++++++-- .github/workflows/dummy_build.yml | 25 ------------------------- .github/workflows/dummy_test.yml | 15 --------------- 3 files changed, 13 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/dummy_build.yml delete mode 100644 .github/workflows/dummy_test.yml diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 2240273b..f990746e 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -63,8 +63,19 @@ jobs: yum install -y blas blas-devel yum install -y lapack lapack-devel - CIBW_BEFORE_BUILD_WINDOWS: powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 - + CIBW_BEFORE_BUILD_WINDOWS: | # powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 + mkdir build + cd build + cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release + echo "cmake finished ..." + cmake --build . --config=Release --target install + echo "build finished ..." + python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True + echo "--- pycThermopack contents ---" + dir ../addon/pycThermopack + echo "--- pycThermopack/thermopack contents ---" + dir ../addon/pycThermopack/thermopack + CIBW_BEFORE_BUILD: | ${{ env.gfortran }} --version export FC=${{ env.gfortran }} diff --git a/.github/workflows/dummy_build.yml b/.github/workflows/dummy_build.yml deleted file mode 100644 index dce40870..00000000 --- a/.github/workflows/dummy_build.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Dummy Build - -on: - push: - branches: - - main - pull_request: - -jobs: - build_wheels: - if: github.ref == 'refs/heads/main' || github.event_name != 'push' - name: Dummy build - runs-on: ubuntu-latest - steps: - - name: Build - run: echo "Building ... but not a PR" - - release_wheels: - name: Dummy release - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - name: Release - run: echo "Releasing ..." - diff --git a/.github/workflows/dummy_test.yml b/.github/workflows/dummy_test.yml deleted file mode 100644 index 0f0cdfc1..00000000 --- a/.github/workflows/dummy_test.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Dummy Test - -on: - push: - branches: - - main - pull_request: - -jobs: - run_tests: - name: Dummy test - runs-on: ubuntu-latest - steps: - - name: Test - run: echo "Testing ..." \ No newline at end of file From 556ed5e653a7c6f356a02c3a0c130244b5e59631 Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 09:59:09 +0200 Subject: [PATCH 3/7] Fix Windows BEFORE_BUILD. --- .github/workflows/cibuildwheel.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index f990746e..fb0ee196 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -62,19 +62,19 @@ jobs: CIBW_BEFORE_ALL_LINUX: | yum install -y blas blas-devel yum install -y lapack lapack-devel - - CIBW_BEFORE_BUILD_WINDOWS: | # powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 - mkdir build - cd build - cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release - echo "cmake finished ..." - cmake --build . --config=Release --target install - echo "build finished ..." - python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True - echo "--- pycThermopack contents ---" - dir ../addon/pycThermopack - echo "--- pycThermopack/thermopack contents ---" - dir ../addon/pycThermopack/thermopack + # powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 + CIBW_BEFORE_BUILD_WINDOWS: > + mkdir build && + cd build && + cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release && + echo "cmake finished ..." && + cmake --build . --config=Release --target install && + echo "build finished ..." && + python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True && + echo "--- pycThermopack contents ---" && + dir ../addon/pycThermopack && + echo "--- pycThermopack/thermopack contents ---" && + dir ../addon/pycThermopack/thermopack && CIBW_BEFORE_BUILD: | ${{ env.gfortran }} --version From 4a5d76237d21d06b0f2fb6c641a423305f658227 Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 10:44:40 +0200 Subject: [PATCH 4/7] Fix Windows BEFORE_BUILD. --- .github/workflows/cibuildwheel.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index fb0ee196..c73f90d8 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -63,18 +63,18 @@ jobs: yum install -y blas blas-devel yum install -y lapack lapack-devel # powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 - CIBW_BEFORE_BUILD_WINDOWS: > - mkdir build && - cd build && - cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release && - echo "cmake finished ..." && - cmake --build . --config=Release --target install && - echo "build finished ..." && - python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True && - echo "--- pycThermopack contents ---" && - dir ../addon/pycThermopack && - echo "--- pycThermopack/thermopack contents ---" && - dir ../addon/pycThermopack/thermopack && + CIBW_BEFORE_BUILD_WINDOWS: | + mkdir build + cd build + cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release + echo "cmake finished ..." + cmake --build . --config=Release --target install + echo "build finished ..." + python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True + echo "--- pycThermopack contents ---" + dir ../addon/pycThermopack + echo "--- pycThermopack/thermopack contents ---" + dir ../addon/pycThermopack/thermopack CIBW_BEFORE_BUILD: | ${{ env.gfortran }} --version From 3edead15a2424f13af76b30ba79e8046e340d2b5 Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 11:20:42 +0200 Subject: [PATCH 5/7] Fix Windows BEFORE_BUILD. --- .github/scripts/before_windows_build.ps1 | 6 +++--- .github/workflows/cibuildwheel.yml | 15 ++------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/scripts/before_windows_build.ps1 b/.github/scripts/before_windows_build.ps1 index cf9e496a..3d4edd19 100644 --- a/.github/scripts/before_windows_build.ps1 +++ b/.github/scripts/before_windows_build.ps1 @@ -1,9 +1,9 @@ #Set-PSDebug -Trace 1 -echo "Running before_build on windows ..." +$tp_version = $args[0] + +echo "Running before_build on windows for version $tp_version" mkdir build -echo "Created build dir ..." cd build -echo "Moved into build dir ..." cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release echo "cmake finished ..." cmake --build . --config=Release --target install diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index c73f90d8..fb4689f9 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -62,19 +62,8 @@ jobs: CIBW_BEFORE_ALL_LINUX: | yum install -y blas blas-devel yum install -y lapack lapack-devel - # powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 - CIBW_BEFORE_BUILD_WINDOWS: | - mkdir build - cd build - cmake .. -G Ninja -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl -DCMAKE_BUILD_TYPE=Release - echo "cmake finished ..." - cmake --build . --config=Release --target install - echo "build finished ..." - python ../addon/pycThermopack/map_platform_specifics.py --diffs=${{ matrix.tp_version }} --ifort=True - echo "--- pycThermopack contents ---" - dir ../addon/pycThermopack - echo "--- pycThermopack/thermopack contents ---" - dir ../addon/pycThermopack/thermopack + + CIBW_BEFORE_BUILD_WINDOWS: powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 ${{ matrix.tp_version }} CIBW_BEFORE_BUILD: | ${{ env.gfortran }} --version From 766db46447ba33a53f8b1be65af3ebbf026bb8ab Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 11:22:19 +0200 Subject: [PATCH 6/7] Actually passing tp_version to map_platform_specifics. --- .github/scripts/before_windows_build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/before_windows_build.ps1 b/.github/scripts/before_windows_build.ps1 index 3d4edd19..884c6a32 100644 --- a/.github/scripts/before_windows_build.ps1 +++ b/.github/scripts/before_windows_build.ps1 @@ -9,7 +9,7 @@ echo "cmake finished ..." cmake --build . --config=Release --target install echo "build finished ..." # python -c "import sys; sys.path.insert(0, '../addon/pycThermopack'); import makescript; makescript.windows_make('v3')" -python ../addon/pycThermopack/map_platform_specifics.py --diffs=v3 --ifort=True +python ../addon/pycThermopack/map_platform_specifics.py --diffs=$tp_version --ifort=True echo "--- pycThermopack contents ---" dir ../addon/pycThermopack echo "--- pycThermopack/thermopack contents ---" From 05dfc33eb1f5a7a5588c99853a208a972391b67b Mon Sep 17 00:00:00 2001 From: Vegard Gjeldvik Jervell Date: Fri, 11 Oct 2024 11:55:13 +0200 Subject: [PATCH 7/7] Use relative path for export_symbols lists. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b6b655fb..fc76abbf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,9 +32,9 @@ if(MSVC) target_link_options(thermopack PRIVATE "/NODEFAULTLIB:libmmd" "/NODEFAULTLIB:MSVCRT" "/NODEFAULTLIB:libifcoremd" "/NODEFAULTLIB:svml_dispmd") else(MSVC) if(APPLE) - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -exported_symbols_list ${CMAKE_SOURCE_DIR}/libthermopack_export.symbols") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../libthermopack_export.symbols") else(APPLE) - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/libthermopack_export.version") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/../libthermopack_export.version") endif(APPLE) add_library(thermopack SHARED $) set_target_properties(thermopack PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})