diff --git a/.github/scripts/before_windows_build.ps1 b/.github/scripts/before_windows_build.ps1 index cf9e496a..884c6a32 100644 --- a/.github/scripts/before_windows_build.ps1 +++ b/.github/scripts/before_windows_build.ps1 @@ -1,15 +1,15 @@ #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 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 ---" diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index d0566c7d..fb4689f9 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 @@ -57,9 +62,9 @@ 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 - + + CIBW_BEFORE_BUILD_WINDOWS: powershell -ExecutionPolicy Bypass -File .github/scripts/before_windows_build.ps1 ${{ matrix.tp_version }} + CIBW_BEFORE_BUILD: | ${{ env.gfortran }} --version export FC=${{ env.gfortran }} @@ -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/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 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 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})