From f49afa00f45ab452b1f06e5f6677640690f37dd7 Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Mon, 2 Dec 2024 11:09:46 -0800 Subject: [PATCH] fix: Do not use `libgit2` for MacOS static builds There is no static `libgit2` available, so the binaries will fail on any system that does not have `libgit2` installed --- .github/workflows/cicd.yml | 12 ++++++------ Makefile | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 2ed21de12a..4c12790f42 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -421,7 +421,7 @@ jobs: - name: Build Galacticus run: | set -o pipefail - make -j`sysctl -n hw.activecpu` Galacticus.exe tests.hashes.cryptographic.exe 2>&1 | tee build.log + make -j`sysctl -n hw.activecpu` USEGIT2=no Galacticus.exe tests.hashes.cryptographic.exe 2>&1 | tee build.log ./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log` ./scripts/build/staticRelinker.pl `grep '\-o tests.hashes.cryptographic.exe' build.log` dsymutil -o Galacticus.exe.dSYM Galacticus.exe @@ -457,7 +457,7 @@ jobs: - name: Build Galacticus run: | set -o pipefail - make -j`sysctl -n hw.activecpu` Galacticus.exe 2>&1 | tee build.log + make -j`sysctl -n hw.activecpu` USEGIT2=no Galacticus.exe 2>&1 | tee build.log ./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log` dsymutil -o Galacticus.exe.dSYM Galacticus.exe zip -r debugSymbolsMacOS-M1.zip Galacticus.exe.dSYM @@ -486,7 +486,7 @@ jobs: uses: ./.github/actions/buildMacOS - name: Build Galacticus run: | - make -j`sysctl -n hw.activecpu` GALACTICUS_BUILD_OPTION=lib libgalacticus.so + make -j`sysctl -n hw.activecpu` USEGIT2=no GALACTICUS_BUILD_OPTION=lib libgalacticus.so - name: Package the code run: | cd $GALACTICUS_EXEC_PATH @@ -523,7 +523,7 @@ jobs: uses: ./.github/actions/buildMacOS - name: Build Galacticus run: | - make -j`sysctl -n hw.activecpu` Galacticus.exe + make -j`sysctl -n hw.activecpu` USEGIT2=no Galacticus.exe - name: Build tools run: | export GALACTICUS_EXEC_PATH=`pwd` @@ -599,7 +599,7 @@ jobs: uses: ./.github/actions/buildMacOS - name: Build Galacticus run: | - make -j`sysctl -n hw.activecpu` Galacticus.exe 2>&1 | tee build.log + make -j`sysctl -n hw.activecpu` USEGIT2=no Galacticus.exe 2>&1 | tee build.log ./scripts/build/staticRelinker.pl `grep '\-o Galacticus.exe' build.log` - name: Build tools run: | @@ -1380,7 +1380,7 @@ jobs: sudo port select --set python3 python312 - name: Build Galacticus run: | - make -j`sysctl -n hw.activecpu` GALACTICUS_BUILD_OPTION=lib libgalacticus.so + make -j`sysctl -n hw.activecpu` USEGIT2=no GALACTICUS_BUILD_OPTION=lib libgalacticus.so mkdir galacticus mkdir galacticus/lib mkdir galacticus/python diff --git a/Makefile b/Makefile index d3268a831d..6d6bc9a09e 100755 --- a/Makefile +++ b/Makefile @@ -290,6 +290,12 @@ $(BUILDPATH)/Makefile_Config_MathEval: source/libmatheval_config.cpp # line. -include $(BUILDPATH)/Makefile_Config_Git2 ifeq '${STATIC}' '-static' +$(BUILDPATH)/Makefile_Config_Git2: + @mkdir -p $(BUILDPATH) + echo "FCFLAGS += -DGIT2UNAVAIL" > $(BUILDPATH)/Makefile_Config_Git2 + echo "CFLAGS += -DGIT2UNAVAIL" > $(BUILDPATH)/Makefile_Config_Git2 + echo "CPPFLAGS += -DGIT2UNAVAIL" >> $(BUILDPATH)/Makefile_Config_Git2 +else ifeq '${USEGIT2}' 'no' $(BUILDPATH)/Makefile_Config_Git2: @mkdir -p $(BUILDPATH) echo "FCFLAGS += -DGIT2UNAVAIL" > $(BUILDPATH)/Makefile_Config_Git2