Skip to content

Commit

Permalink
[pypi] split archs for macosx
Browse files Browse the repository at this point in the history
  • Loading branch information
fradav committed Jun 11, 2024
1 parent d1996d5 commit f3fdfba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
shortos: [windows, macos-x64, macos-arm64, linux]
include:
- os: windows-latest
shortos: windows
- shortos: windows
os: windows-latest
cmakeargs: -DTEST:BOOL=FALSE -DUSE_MKL:BOOL=FALSE -DMAKE_STATIC_EXE:BOOL=TRUE -DVCPKG_TARGET_TRIPLET:STRING=x64-windows-static -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja
- os: ubuntu-latest
shortos: linux
- shortos: linux
os: ubuntu-latest
cmakeargs: "-DTEST:BOOL=FALSE -DUSE_MKL:BOOL=TRUE -DMAKE_STATIC_EXE:BOOL=TRUE -DLAPACK_ROOT:STRING=/opt/intel/oneapi/mkl/latest/lib '-DLAPACK_LIBRARIES:STRING=-Wl,--start-group /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_tbb_thread.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.a -Wl,--end-group;pthread;m;dl' '-DBLAS_LIBRARIES:STRING=-Wl,--start-group /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_tbb_thread.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.a -Wl,--end-group;pthread;m;dl' -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja"
- os: macos-latest
shortos: macos-x64
- shortos: macos-x64
os: macos-latest
cmakeargs: -DTEST:BOOL=FALSE -DCMAKE_OSX_ARCHITECTURES:STRING=x86_64 -DVCPKG_TARGET_TRIPLET:STRING=x64-osx -DUSE_MKL:BOOL=FALSE -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja
- os: macos-latest
shortos: macos-arm64
- shortos: macos-arm64
os: macos-latest
cmakeargs: -DTEST:BOOL=FALSE -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DVCPKG_TARGET_TRIPLET:STRING=arm64-osx -DUSE_MKL:BOOL=FALSE -DCMAKE_BUILD_TYPE:STRING=Release -G Ninja
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -112,10 +112,18 @@ jobs:
brew install ninja
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
if [ "${{ matrix.shortos }}" == "macos-arm64" ]; then
echo "OSARCH=arm" >> $GITHUB_ENV
else
echo "OSARCH=x86" >> $GITHUB_ENV
fi
# echo "CC=gcc-14" >> $GITHUB_ENV
# echo "CXX=g++-14" >> $GITHUB_ENV
# echo "CXXFLAGS=-static-libstdc++ -static-libgcc" >> $GITHUB_ENV
if: matrix.os == 'macos-latest'
- name: setup MacOS arch
run: |
if: matrix.os == 'macos-latest'
- name: Configure MSVC console (Windows)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from cmaketools import setup
import sys
import platform
from os import path
from os import path, getenv

this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
Expand All @@ -15,7 +15,7 @@
elif sys.platform == "linux":
configure_opts = ["-DPython_EXECUTABLE="+sys.executable,"-DPYABCRANGER=TRUE","-DUSE_MKL:BOOL=TRUE","-DMAKE_STATIC_EXE:BOOL=TRUE","-DLAPACK_ROOT:STRING=/opt/intel/oneapi/mkl/latest/lib","-DLAPACK_LIBRARIES:STRING=-Wl,--start-group /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_tbb_thread.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.a -Wl,--end-group;pthread;m;dl","-DBLAS_LIBRARIES:STRING=-Wl,--start-group /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_intel_lp64.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_tbb_thread.a /opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_core.a -Wl,--end-group;pthread;m;dl"]
elif sys.platform == "darwin":
if platform.processor == "arm":
if getenv("OSARCH") == "arm":
configure_opts = ["-DPython_EXECUTABLE="+sys.executable,"-DVCPKG_TRIPLET:STRING=arm64-osx","-DCMAKE_OSX_ARCHITECTURES:STRING=arm64","-DPYABCRANGER=TRUE","-DUSE_MKL:BOOL=FALSE","-DCMAKE_BUILD_TYPE:STRING=Release"]
else:
configure_opts = ["-DPython_EXECUTABLE="+sys.executable,"-DVCPKG_TRIPLET:STRING=x64-osx","-DCMAKE_OSX_ARCHITECTURES:STRING=x64","-DPYABCRANGER=TRUE","-DUSE_MKL:BOOL=FALSE","-DCMAKE_BUILD_TYPE:STRING=Release"]
Expand Down

0 comments on commit f3fdfba

Please sign in to comment.