Skip to content

Commit

Permalink
Refix openmp on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
HGuillemet committed Jun 29, 2024
1 parent 9070826 commit 6d718ad
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/cpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ jobs:
macosx-x86_64:
runs-on: macos-12
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-macosx@actions
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@apteryx_pytorch
macosx-arm64:
runs-on: macos-14
steps:
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@cpython-macosx-arm64
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@apteryx_pytorch
# windows-x86:
# runs-on: windows-2019
# steps:
# - uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
windows-x86_64:
runs-on: windows-2019
steps:
- uses: bytedeco/javacpp-presets/.github/actions/deploy-windows@actions
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-windows@apteryx_pytorch
redeploy:
needs: [linux-x86_64, macosx-arm64, macosx-x86_64, windows-x86_64]
# needs: [linux-armhf, linux-arm64, linux-ppc64le, linux-x86, linux-x86_64, macosx-x86_64, windows-x86, windows-x86_64]
runs-on: ubuntu-20.04
steps:
- uses: bytedeco/javacpp-presets/.github/actions/redeploy@actions
- uses: HGuillemet/javacpp-presets/.github/actions/redeploy@apteryx_pytorch
2 changes: 1 addition & 1 deletion .github/workflows/pytorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-ubuntu@apteryx_pytorch
timeout-minutes: 350
macosx-arm64:
runs-on: macos-12
runs-on: macos-14
steps:
- uses: HGuillemet/javacpp-presets/.github/actions/deploy-macosx@apteryx_pytorch
windows-x86_64:
Expand Down
2 changes: 1 addition & 1 deletion cpython/platform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<relativePath>../../</relativePath>
</parent>

<groupId>org.bytedeco</groupId>
<groupId>fr.apteryx</groupId>
<artifactId>cpython-platform</artifactId>
<version>3.12.4-${project.parent.version}</version>
<name>JavaCPP Presets Platform for CPython</name>
Expand Down
2 changes: 1 addition & 1 deletion cpython/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>1.5.11-SNAPSHOT</version>
</parent>

<groupId>org.bytedeco</groupId>
<groupId>fr.apteryx</groupId>
<artifactId>cpython</artifactId>
<version>3.12.4-${project.parent.version}</version>
<name>JavaCPP Presets for CPython</name>
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,6 @@
<module>tesseract</module>
<module>pytorch</module>
<module>sentencepiece</module>
<module>cpython</module>
</modules>
<properties>
<javacpp.platform.android-arm></javacpp.platform.android-arm>
Expand Down
20 changes: 10 additions & 10 deletions pytorch/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ case $PLATFORM in
export CC="clang"
export CXX="clang++"
export PATH=$(brew --prefix llvm@18)/bin:$PATH # Use brew LLVM 15 instead of Xcode LLVM 14
export CMAKE_OSX_ARCHITECTURES=arm64 # enable cross-compilation on a x86_64 host machine
# export CMAKE_OSX_ARCHITECTURES=arm64 # enable cross-compilation on a x86_64 host machine
export USE_MKLDNN=OFF
export USE_QNNPACK=OFF # not compatible with arm64 as of PyTorch 2.1.2
export CMAKE_OSX_DEPLOYMENT_TARGET=11.00 # minimum needed for arm64 support
Expand Down Expand Up @@ -213,10 +213,10 @@ sedinplace 's/const std::string& interface)/const std::string\& interface_name)/
# and see if choosing experimental works. See Issue #1503.
# On Linux, pytorch FindOpenMP.cmake picks llvm libomp over libgomp. See Issue #1504.
# Keep it on MacOS since it appends the correct -Xpreprocessor -fopenmp -I/usr/local/include flags
if [[ ! $PLATFORM == macosx-* ]]; then
#if [[ ! $PLATFORM == macosx-* ]]; then
rm cmake/Modules/FindOpenMP.cmake
sedinplace 's/include(${CMAKE_CURRENT_LIST_DIR}\/Modules\/FindOpenMP.cmake)/find_package(OpenMP)/g' cmake/Dependencies.cmake
fi
#fi
if [[ $PLATFORM == macosx-* ]]; then
brew ls libomp
#export CMAKE_INCLUDE_PATH=/usr/local/Cellar/libomp/18.1.7/include
Expand All @@ -229,13 +229,13 @@ if [[ $PLATFORM == macosx-* ]]; then
export CMAKE_LIBRARY_PATH=/usr/local/lib
#echo Setting CMAKE_INCLUDE_PATH=$CMAKE_INCLUDE_PATH
#echo Setting CMAKE_LIBRARY_PATH=$CMAKE_LIBRARY_PATH
export LD_LIBRARY_PATH=$CMAKE_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$CMAKE_LIBRARY_PATH
export OpenMP_C_INCLUDE_DIR=$CMAKE_INCLUDE_PATH
export OpenMP_CXX_INCLUDE_DIR=$CMAKE_INCLUDE_PATH
export CXXFLAGS="-I$CMAKE_INCLUDE_PATH ${CXXFLAGS:-}"
export CFLAGS="-I$CMAKE_INCLUDE_PATH ${CFLAGS:-}"
export LDFLAGS="-L$CMAKE_LIBRARY_PATH ${LDFLAGS:-}"
#export LD_LIBRARY_PATH=$CMAKE_LIBRARY_PATH
#export DYLD_LIBRARY_PATH=$CMAKE_LIBRARY_PATH
#export OpenMP_C_INCLUDE_DIR=$CMAKE_INCLUDE_PATH
#export OpenMP_CXX_INCLUDE_DIR=$CMAKE_INCLUDE_PATH
#export CXXFLAGS="-I$CMAKE_INCLUDE_PATH ${CXXFLAGS:-}"
#export CFLAGS="-I$CMAKE_INCLUDE_PATH ${CFLAGS:-}"
#export LDFLAGS="-L$CMAKE_LIBRARY_PATH ${LDFLAGS:-}"
#echo Setting CFLAGS=$CFLAGS
#echo Setting CXXFLAGS=$CXXFLAGS

Expand Down

0 comments on commit 6d718ad

Please sign in to comment.