Skip to content

Commit

Permalink
MacOS ARM64 conda build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiker committed Nov 5, 2023
1 parent 0359847 commit c44e3c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ C_BUILD_DIR:=$(CURDIR)/$(BUILD_DIR)
# Native Platform specific include

UNAME=$(shell uname -s)
BUILD_ARCH=$(shell uname -o).$(shell uname -m)
BUILD_ARCH:=$(subst /,_,$(BUILD_ARCH))

$(info Host architecture is $(BUILD_ARCH))

# Sub-Makes will need to access these directories
export PREFIX
Expand All @@ -69,8 +72,8 @@ export C_BUILD_DIR
export C_HDR_DIR

# Hook for separate makefiles on Apple
ifeq ($(UNAME), Darwin)
ifeq ($(N_ARCH), Darwin.arm64)
ifeq ($(UNAME),Darwin)
ifeq ($(BUILD_ARCH),Darwin.arm64)
$(info Building for arm64 "M1" MacOS)
include buildfiles/Darwin.arm64.mak
else
Expand Down
18 changes: 11 additions & 7 deletions buildfiles/conda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,32 @@ Get the build and upload tools:
(base) $ conda install anaconda-client
```

Special extra hassles for MacOS, download the SDK matching your version of MacOS
and unzip it to /opt (just like the Anaconda default):

Special extra hassles for **Intel** MacOS. Note do **not** do this for M1/M2 etc.!


Download the SDK matching your version of MacOS and unzip it to /opt
(just like the Anaconda default):
```bash
# General page at: https://github.com/phracker/MacOSX-SDKs/releases
cd ~/
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.13.sdk.tar.xz
xz -d MacOSX10.13.sdk.tar.xz
xz -d MacOSX10.10.sdk.tar.xz
cd /opt
sudo tar -xvf $HOME/MacOSX10.13.sdk.tar.xz
sudo tar -xvf $HOME/MacOSX10.10.sdk.tar.xz
```
Next for MacOS, setup a `$HOME/conda_build_config.yaml` file with the following contents.
Again, your MacOS version may vary:
```yaml
CONDA_BUILD_SYSROOT:
- /opt/MacOSX10.13.sdk # [osx]
- /opt/MacOSX10.10.sdk # [osx]
```
Get this directory:
Change to this directory:
```bash
(base) $ git clone https://github.com/das-developers/das2C.git
(base) $ cd das2C/makefiles
(base) $ cd das2C/buildfiles
```

Run conda build:
Expand Down
2 changes: 2 additions & 0 deletions buildfiles/conda/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# Don't differentiate output & install directories manually. This does
# not affect which makefiles are selected only build and install directories.
N_ARCH=/

export N_ARCH
Expand Down
4 changes: 2 additions & 2 deletions buildfiles/rpm/das2C.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: das2C
Version: 2.3~pre4
%global tagver 2.3-pre4
Version: 2.3
%global tagver 2.3

Release: 1%{?dist}
Summary: das2 stream utilities and catalog client in C
Expand Down

0 comments on commit c44e3c5

Please sign in to comment.