Skip to content
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
25 changes: 15 additions & 10 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
cibw_archs: arm64
AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON
AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=ON
UDA_REF: "2.9.3"

- os: macos-14
Expand All @@ -97,7 +97,7 @@ jobs:
cibw_archs: arm64
AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON
AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=ON
UDA_REF: "2.9.3"

- os: macos-14
Expand All @@ -108,7 +108,7 @@ jobs:
cibw_archs: arm64
AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON
AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=ON
UDA_REF: "2.9.3"

- os: macos-14
Expand All @@ -119,7 +119,7 @@ jobs:
cibw_archs: arm64
AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON
AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=ON
UDA_REF: "2.9.3"

- os: macos-14
Expand All @@ -130,7 +130,7 @@ jobs:
cibw_archs: arm64
AL_BACKEND_HDF5: AL_BACKEND_HDF5=ON
AL_BACKEND_MDSPLUS: AL_BACKEND_MDSPLUS=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=OFF
AL_BACKEND_UDA: AL_BACKEND_UDA=ON
UDA_REF: "2.9.3"

- os: windows-2022
Expand Down Expand Up @@ -347,10 +347,15 @@ jobs:
cmake.define.${{ matrix.AL_BACKEND_MDSPLUS }}
cmake.define.${{ matrix.AL_BACKEND_UDA }}

# Dependency installationinto /tmp
# Dependency installation into /tmp/imas-core-install
CIBW_BEFORE_ALL_MACOS: >
brew update >&2;
brew install cmake pkg-config boost hdf5 libomp ninja fmt spdlog libxml2 openssl capnp libmemcached >&2;
brew install cmake pkg-config boost hdf5 libomp ninja fmt spdlog libxml2 openssl libmemcached >&2;
git clone -b master https://github.com/capnproto/capnproto.git >&2 &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The master branch is not the same as the latest release. Is this what we want to do? What was wrong with the homebrew install? (https://formulae.brew.sh/formula/capnp).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to remove the homebrew dependencies from the wheel. The other libs worked fine, but capnp had some deps left over after delocate, that make the wheel fail. I can revisit this again...

Copy link
Copy Markdown
Contributor Author

@paulotex paulotex Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried again using capnp from brew, the error I get when trying to delocate is:

ERROR:delocate.libsana:
@rpath/libkj.1.3.0.dylib not found:
  Needed by: /private/var/folders/7n/qzhf5d250mdck5bq8wmqy_fh0000gn/T/tmp1x_w1hep/wheel/imas_core.libs/libcapnp.1.3.0.dylib
  Search path:

So somehow the brew libs used by capnp could not be delocated properly. There are probably ways to fix this, but compiling capnp from scratch takes one sec, so I went that route.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then let's not spend more time on this at the moment.

cd capnproto >&2;
cmake -B build . \
-DCMAKE_INSTALL_PREFIX=/tmp/imas-core-install >&2 &&
cmake --build build --target install -j >&2;
git clone --depth 1 --branch ${{ matrix.UDA_REF }} https://github.com/ukaea/UDA.git >&2 &&
cd UDA >&2;
cmake -G Ninja -B build . \
Expand All @@ -359,14 +364,14 @@ jobs:
-DCLIENT_ONLY=ON \
-DENABLE_CAPNP=ON \
-DMACOSX_DEPLOYMENT_TARGET=14.0 \
-DCMAKE_INSTALL_PREFIX=/tmp/uda-install >&2 &&
-DCMAKE_INSTALL_PREFIX=/tmp/imas-core-install >&2 &&
cmake --build build --target install -j >&2;

# Where to find the dependencies
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=14.0
CMAKE_PREFIX_PATH="/tmp/uda-install:/opt/homebrew:/usr/local"
PKG_CONFIG_PATH="/tmp/uda-install/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig"
CMAKE_PREFIX_PATH="/tmp/imas-core-install:/opt/homebrew:/usr/local"
PKG_CONFIG_PATH="/tmp/imas-core-install/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig"

with:
package-dir: .
Expand Down
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ if(NOT PROJECT_VERSION_TWEAK EQUAL 0)
message("Building a development version of the Access Layer core")
endif()

if(APPLE)
if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
# Disable MDSPlus:
message(STATUS "Disabling MDSPlus backend on macOS")
set(AL_BACKEND_MDSPLUS OFF CACHE BOOL "MDSPlus backend" FORCE)
# Disable UDA:
message(STATUS "Disabling UDA backend on macOS")
set(AL_BACKEND_UDA OFF CACHE BOOL "UDA backend" FORCE)
endif()


Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ before-build = "bash ./ci/wheels/cibw_before_build_win.sh"
repair-wheel-command = "bash ./ci/wheels/repair_windows.sh {wheel} {dest_dir}"

[tool.cibuildwheel.macos.environment]
CMAKE_PREFIX_PATH = "/opt/homebrew;/usr/local"
PKG_CONFIG_PATH = "/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig"
CMAKE_PREFIX_PATH = "/tmp/imas-core-install:/opt/homebrew:/usr/local"
PKG_CONFIG_PATH = "/tmp/imas-core-install/lib/pkgconfig:/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig"
MACOSX_DEPLOYMENT_TARGET = "14.0"
AL_BACKEND_HDF5 = { env = "AL_BACKEND_HDF5", default = "ON" }
AL_BACKEND_UDA = { env = "AL_BACKEND_UDA", default = "ON" }
AL_BACKEND_MDSPLUS = { env = "AL_BACKEND_MDSPLUS", default = "OFF" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are MDSplus packages for Macs running on Intel silicon: https://www.mdsplus.org/index.php/Latest_Macintosh_Distributions
Could these easily be dropped in?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It says that the apple silicon port is not complete, so I left it out for now.

AL_BUILD_MDSPLUS_MODELS = { env = "AL_BUILD_MDSPLUS_MODELS", default = "OFF" }
AL_PYTHON_BINDINGS = "ON"

[tool.cibuildwheel.macos]
archs = ["arm64"]
Expand Down
Loading