Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for osx #29

Merged
merged 6 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .azure-pipelines/azure-pipelines-osx.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.13'
c_compiler:
- clang
c_compiler_version:
- '17'
channel_sources:
- conda-forge/label/llvm_rc,conda-forge
channel_targets:
- conda-forge llvm_rc
cxx_compiler:
- clangxx
cxx_compiler_version:
- '17'
macos_machine:
- x86_64-apple-darwin13.4.0
target_platform:
- osx-64
zip_keys:
- - c_compiler_version
- cxx_compiler_version
zlib:
- '1.2'
90 changes: 90 additions & 0 deletions .scripts/run_osx_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion azure-pipelines.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions conda-forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ azure:
settings_win:
variables:
SET_PAGEFILE: "True"
# necessary for osx during rc-phase
channel_priority: flexible
conda_forge_output_validation: true
github:
branch_name: main
Expand Down
11 changes: 10 additions & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_CONFIG_PATH=$BUILD_PREFIX/bin/llvm-config -DMLIR_TABLEGEN_EXE=$BUILD_PREFIX/bin/mlir-tblgen"
fi

if [[ "${target_platform}" == linux-* ]]; then
CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=ON"
else
# unclear segfaults with shared builds on osx
CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF"
# clang on osx still picks up libstdcxx by default for some reason (unless LLVM_ENABLE_LIBCXX), see
# https://github.com/llvm/llvm-project/blob/llvmorg-17.0.0-rc4/llvm/cmake/modules/CheckCompilerVersion.cmake#L66-L88
CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_LIBCXX=ON"
fi

cmake -G Ninja \
${CMAKE_ARGS} \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
Expand Down
7 changes: 7 additions & 0 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
c_compiler_version: # [osx]
- 17 # [osx]
cxx_compiler_version: # [osx]
- 17 # [osx]
MACOSX_DEPLOYMENT_TARGET: # [osx and x86_64]
- "10.13" # [osx and x86_64]

channel_targets:
- conda-forge llvm_rc

Expand Down
6 changes: 4 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ source:

build:
number: 0
# intentionally only windows (main target) & linux (debuggability)
skip: true # [osx]
# intentionally only x64 builds; win (main target), linux (debuggability)
# plus osx to be able to test a consistent llvm stack not just on windows.
track_features:
- flang

Expand Down Expand Up @@ -64,6 +64,8 @@ outputs:
commands:
# shared lib on linux
- test -f $PREFIX/lib/libFortranRuntime.so # [linux]
# static lib on osx (segfaults with shared ones)
- test -f $PREFIX/lib/libFortranRuntime.a # [osx]
# static lib on win (fails to export symbols for shared build)
- if not exist %LIBRARY_LIB%\FortranRuntime.lib exit 1 # [win]

Expand Down