Skip to content

Commit

Permalink
Merge pull request #621 from SuperDARN/macos_comp_tests
Browse files Browse the repository at this point in the history
MacOS Comp Tests
  • Loading branch information
mtwalach authored Oct 23, 2024
2 parents 375b183 + ba10732 commit 650344e
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/test_profiles/base.bash.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# base.bash
# =========

#####################################################################
# #
# Compilation directives #
# #
#####################################################################

export XPATH="/usr/X11R6"

# Compile netCDF software

export NETCDF_PATH="/opt/homebrew/"

# pathname for the CDF software

export CDF_PATH="/usr/local/cdf/"

# SVG library

export SVGLIB="rsvg.1"

#####################################################################
# #
# Font Data Tables #
# #
#####################################################################

export FONTPATH=${RSTPATH}"/tables/base/fonts"
export FONTDB=${RSTPATH}"/tables/base/fonts/fontdb.xml"

60 changes: 60 additions & 0 deletions .github/test_profiles/makelib.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Makefile for the libraries
# =======================================
# by R.J.Barnes
#
#

# Linux (GCC)
#

CFLAGS = -Wall -pedantic -O3 -D_GNU_SOURCE -D_DARWIN -I/opt/homebrew/include $(INCLUDE)
SUF=so

VSTR=$(shell get.version ${CURDIR}/..)

# By default statically link the all programs

.c.o:
$(CC) $(CFLAGS) -c $<

ifdef OUTPUT

$(OUTPUT): version hdr $(OBJS)
mkdir -p ${DSTPATH}
libtool -static -o $(DSTPATH)/lib$(OUTPUT).$(VSTR).a $(OBJS)
gcc -Wl,-install_name,@rpath/lib$(OUTPUT).$(VSTR).dylib \
-dynamiclib -all_load -flat_namespace -undefined suppress \
-single_module -o $(DSTPATH)/lib$(OUTPUT).$(VSTR).dylib \
$(DSTPATH)/lib$(OUTPUT).$(VSTR).a \
-L$(LIBPATH) $(SLIB)
cd $(DSTPATH); ln -sf lib$(OUTPUT).$(VSTR).a \
lib$(OUTPUT).$(LINK).a
cd $(DSTPATH); ln -sf lib$(OUTPUT).$(VSTR).dylib \
lib$(OUTPUT).$(LINK).dylib
else
dummy: hdr

endif

hdr:
make.hdr $(CURDIR)/../include ${INC}


version:
make.version $(CURDIR)/..



clean:
rm -f *.o











16 changes: 16 additions & 0 deletions .github/test_profiles/profile.bash.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .profile.bash
# =============

export OSTYPE="darwin"
export SYSTEM="darwin"
export VISUAL="vim"
export EDITOR="$VISUAL"
export PATH="${PATH}:/opt/homebrew/bin:/opt/local/bin:/usr/bin/:/usr/local/bin:${HOME}/bin:${HOME}/script"

. $RSTPATH/.profile/rst.bash
. $RSTPATH/.profile/base.bash
. $RSTPATH/.profile/general.bash
. $RSTPATH/.profile/superdarn.bash

. $RSTPATH/.profile/idl.bash

29 changes: 26 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
os: ["ubuntu-latest", "macos-latest"]
cc: ["gcc-default"]
cdf: ["39_0"]

Expand All @@ -32,15 +32,38 @@ jobs:
make test
sudo make INSTALLDIR=/usr/local/cdf install
- name: Build and make code
- name: Install MacOS dependencies
if: startsWith(matrix.os, 'mac')
run: |
brew update-reset
xargs brew install < build/.requirements.darwin
echo "Get and install NASA CDF"
brew install wget
wget https://spdf.gsfc.nasa.gov/pub/software/cdf/dist/latest/linux/cdf${{ matrix.cdf }}-dist-cdf.tar.gz
tar -xzvf cdf${{ matrix.cdf }}-dist-cdf.tar.gz
cd cdf${{ matrix.cdf }}-dist
make OS=macosx ENV=arm all
make test
sudo make INSTALLDIR=/usr/local/cdf install
brew install --cask xquartz
- name: Build and make Linux code
if: startsWith(matrix.os, 'ubuntu')
run: |
export RSTPATH=$(pwd)
source .profile.bash
build/script/make.build
build/script/make.code
build/script/make.doc
- name: Build and make docs
- name: Build and make MacOS code
if: startsWith(matrix.os, 'mac')
run: |
export RSTPATH=$(pwd)
cp .github/test_profiles/profile.bash.darwin .profile.bash
cp .github/test_profiles/base.bash.darwin .profile/base.bash
cp .github/test_profiles/makelib.darwin build/make/makelib.darwin
source .profile.bash
build/script/make.build
build/script/make.code
build/script/make.doc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.so
*.o
*~
.DS_Store

bin
/build/include
Expand Down
5 changes: 5 additions & 0 deletions build/.requirements.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hdf5
netcdf
ncurses
libpng
netpbm

0 comments on commit 650344e

Please sign in to comment.