From 12c65af6c202e42ffc3b5bcf8dcd674b0633deed Mon Sep 17 00:00:00 2001 From: jcschaff Date: Sun, 2 Jun 2024 22:58:45 -0400 Subject: [PATCH] WIP: pip and wheels config --- .github/workflows/pip.yml | 35 +++++++++++++++-------------------- .github/workflows/wheels.yml | 11 +---------- CMakeLists.txt | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index 0d1b3d54..6ce96cde 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -38,9 +38,6 @@ jobs: cmake --version brew info boost brew info hdf5 - - echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV - echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV - name: Install ARM MacOS dependencies @@ -60,9 +57,6 @@ jobs: cmake --version brew info boost brew info hdf5 - - echo "CC=/opt/homebrew/opt/llvm/bin/clang" >> $GITHUB_ENV - echo "CXX=/opt/homebrew/opt/llvm/bin/clang++" >> $GITHUB_ENV - name: Install Windows Dependencies @@ -83,10 +77,6 @@ jobs: mingw-w64-clang-x86_64-libzip mingw-w64-clang-x86_64-zlib mingw-w64-clang-x86_64-libaec - - if: matrix.os == 'windows-latest' - run: | - echo "CC=/c/Program Files/LLVM/bin/clang.exe" >> $GITHUB_ENV - echo "CXX=/c/Program Files/LLVM/bin/clang++.exe" >> $GITHUB_ENV - name: Install Linux Dependencies @@ -103,30 +93,35 @@ jobs: dpkg -s libboost-all-dev dpkg -s libhdf5-dev + - uses: actions/setup-python@v5 with: python-version: "${{ matrix.python-version }}" - name: Build and install macos-13 - run: pip install --verbose . + run: | + PATH="/usr/local/opt/llvm/bin:$PATH" + pip install --verbose . if: matrix.platform == 'macos-13' - env: - PATH: "/usr/local/opt/llvm/bin:${{ env.PATH }}" - name: Build and install macos-14 - run: pip install --verbose . + run: | + PATH="/opt/homebrew/opt/llvm/bin:$PATH" + pip install --verbose . if: matrix.platform == 'macos-14' - env: - PATH: "/opt/homebrew/opt/llvm/bin:${{ env.PATH }}" - name: Build and install windows-latest - run: pip install --verbose . + shell: msys2 {0} + run: | + platform=windows + PATH="/c/Program\ Files/LLVM/bin:$PATH" + pip install --verbose . if: matrix.platform == 'windows-latest' - env: - PATH: "/c/Program Files/LLVM/bin:${{ env.PATH }}" - name: Build and install ubuntu-latest - run: pip install --verbose . + run: | + platform=linux + pip install --verbose . if: matrix.platform == 'ubuntu-latest' - name: Test diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b7fc26bf..985437db 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -69,9 +69,6 @@ jobs: cmake --version brew info boost brew info hdf5 - - echo "CC=/usr/local/opt/llvm/bin/clang" >> $GITHUB_ENV - echo "CXX=/usr/local/opt/llvm/bin/clang++" >> $GITHUB_ENV - name: Install ARM MacOS dependencies @@ -91,9 +88,6 @@ jobs: cmake --version brew info boost brew info hdf5 - - echo "CC=/opt/homebrew/opt/llvm/bin/clang" >> $GITHUB_ENV - echo "CXX=/opt/homebrew/opt/llvm/bin/clang++" >> $GITHUB_ENV - name: Install Windows Dependencies if: matrix.os == 'windows-latest' @@ -113,10 +107,6 @@ jobs: mingw-w64-clang-x86_64-libzip mingw-w64-clang-x86_64-zlib mingw-w64-clang-x86_64-libaec - - if: matrix.os == 'windows-latest' - run: | - echo "CC=/c/Program Files/LLVM/bin/clang.exe" >> $GITHUB_ENV - echo "CXX=/c/Program Files/LLVM/bin/clang++.exe" >> $GITHUB_ENV - name: Install Linux Dependencies @@ -133,6 +123,7 @@ jobs: dpkg -s libboost-all-dev dpkg -s libhdf5-dev + - name: build wheel uses: pypa/cibuildwheel@v2.17 env: diff --git a/CMakeLists.txt b/CMakeLists.txt index c1a5117e..00d02ecb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,13 @@ if (APPLE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__x86_64__") set(CMAKE_OSX_ARCHITECTURES "x86_64") endif() + if(NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER "clang") + endif() + if(NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER "clang++") + endif() + elseif (LINUX) option(LINUX_32bit_BINARIES "Build 32bit Linux BINARIES" OFF) option(LINUX_64bit_BINARIES "Build 64bit Linux BINARIES" ON) @@ -97,6 +104,13 @@ elseif (LINUX) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64") endif() + if(NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER "clang") + endif() + if(NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER "clang++") + endif() + elseif (MINGW) if(NOT DEFINED CMAKE_C_COMPILER) set(CMAKE_C_COMPILER "clang.exe") @@ -104,6 +118,7 @@ elseif (MINGW) if(NOT DEFINED CMAKE_CXX_COMPILER) set(CMAKE_CXX_COMPILER "clang++.exe") endif() + endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")