-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* order * static * finding static dependencies * end --------- Co-authored-by: fdobad <[email protected]>
- Loading branch information
Showing
12 changed files
with
192 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: build macos all | ||
|
||
on: | ||
# pull_request: | ||
# branches: | ||
# - main | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
runner: ["macOS-12", "macOS-13", "macOS-14"] | ||
runs-on: ${{ matrix.runner }} | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check Runner | ||
run: | | ||
# arch | ||
# echo "runner: ${{ matrix.runner }}.$(arch).$(uname -m)" | ||
# mayor version: sw_vers -productVersion | cut -d '.' -f 1 | ||
# Darwin : uname -s | ||
echo "suffix="$(uname -s).${{ matrix.runner }}.$(arch)"" >> $GITHUB_ENV | ||
brew config | ||
- name: Install Dependencies | ||
run: | | ||
brew install gcc@12 libomp eigen boost libtiff # llvm ? | ||
- name: Build | ||
run: | | ||
cd Cell2Fire | ||
make clean | ||
make -f makefile.macos | ||
otool -L Cell2Fire > otool_${{ env.suffix }}.txt | ||
mv Cell2Fire Cell2Fire_${{ env.suffix }} | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries_${{ env.suffix }} | ||
path: | | ||
Cell2Fire/otool_${{ env.suffix }}.txt | ||
Cell2Fire/Cell2Fire_${{ env.suffix }} | ||
- name: Install Static Dependencies | ||
run: | | ||
brew install gcc@12 libomp eigen boost libtiff jpeg-turbo xz zstd zlib | ||
- name: Build Static | ||
run: | | ||
cd Cell2Fire | ||
make clean | ||
make -f makefile.macos-static | ||
otool -L Cell2Fire > otool_${{ env.suffix }}-static.txt | ||
mv Cell2Fire Cell2Fire_${{ env.suffix }}-static | ||
- name: Upload Static | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries_${{ env.suffix }}-static | ||
path: | | ||
Cell2Fire/otool_${{ env.suffix }}-static.txt | ||
Cell2Fire/Cell2Fire_${{ env.suffix }}-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,52 @@ | ||
LDFLAGS="-L/opt/homebrew/opt/llvm/lib" | ||
CPPFLAGS="-I/opt/homebrew/opt/llvm/include" | ||
CC = /opt/homebrew/bin/g++-12 | ||
CFLAGS = -std=c++14 -O3 -I /opt/homebrew/include -I /opt/homebrew/include/eigen3 -fopenmp | ||
LIBS = -m64 -fPIC -fno-strict-aliasing -fexceptions -fopenmp -DNDEBUG -DIL_STD -lm -lpthread -ldl | ||
TARGETS = Cell2Fire | ||
all: $(TARGETS) | ||
Cell2Fire: Cell2Fire.o Cells.o FuelModelSpain.o FuelModelKitral.o FuelModelFBP.o Spotting.o ReadCSV.o ReadArgs.o Lightning.o WriteCSV.o Ellipse.o DataGenerator.o | ||
$(CC) -o $@ $(LIBS) Cell2Fire.o Cells.o FuelModelSpain.o FuelModelKitral.o FuelModelFBP.o Spotting.o ReadCSV.o ReadArgs.o Lightning.o WriteCSV.o Ellipse.o DataGenerator.o | ||
Cell2Fire.o: Cell2Fire.cpp Cells.o FuelModelSpain.o FuelModelKitral.o FuelModelFBP.o Spotting.o ReadCSV.o ReadArgs.o WriteCSV.o DataGenerator.o | ||
$(CC) -c $(CFLAGS) Cell2Fire.cpp | ||
Spotting.o: Spotting.cpp Spotting.h Cells.h | ||
$(CC) -c $(CFLAGS) Spotting.cpp | ||
Cells.o: Cells.cpp Cells.h FuelModelSpain.o FuelModelKitral.o FuelModelFBP.o | ||
$(CC) -c $(CFLAGS) Cells.cpp | ||
ReadCSV.o: ReadCSV.cpp ReadCSV.h | ||
$(CC) -c $(CFLAGS) ReadCSV.cpp | ||
ReadArgs.o: ReadArgs.cpp ReadArgs.h | ||
$(CC) -c $(CFLAGS) ReadArgs.cpp | ||
Lightning.o: Lightning.cpp Lightning.h | ||
$(CC) -c $(CFLAGS) Lightning.cpp | ||
Forest.o: Forest.cpp Forest.h | ||
$(CC) -c $(CFLAGS) Forest.cpp | ||
WriteCSV.o: WriteCSV.cpp WriteCSV.h | ||
$(CC) -c $(CFLAGS) WriteCSV.cpp | ||
Ellipse.o: Ellipse.cpp Ellipse.h | ||
$(CC) -c $(LIBS) $(CFLAGS) Ellipse.cpp | ||
FuelModelSpain.o: FuelModelSpain.cpp FuelModelSpain.h Cells.h | ||
$(CC) -c $(LIBS) $(CFLAGS) FuelModelSpain.cpp | ||
FuelModelKitral.o: FuelModelKitral.cpp FuelModelKitral.h Cells.h | ||
$(CC) -c $(LIBS) $(CFLAGS) FuelModelKitral.cpp | ||
FuelModelFBP.o: FuelModelFBP.cpp FuelModelFBP.h Cells.h | ||
$(CC) -c $(LIBS) $(CFLAGS) FuelModelFBP.cpp | ||
DataGenerator.o: DataGenerator.cpp DataGenerator.h | ||
$(CC) -c $(LIBS) $(CFLAGS) DataGenerator.cpp | ||
# Development dependencies | ||
CXX = g++-12 | ||
|
||
# NOT WORKING | ||
# Capture the value of the environment variable HOMEBREW_PREFIX | ||
# HOMEBREW_PREFIX := $(shell echo $$HOMEBREW_PREFIX) | ||
# HOMEBREW_PREFIX := $(shell echo $(brew --prefix)) | ||
|
||
# Capture the output of the `arch` command | ||
ARCH := $(shell arch) | ||
|
||
# Set HOMEBREW_PREFIX based on the architecture | ||
ifeq ($(ARCH), arm64) | ||
HOMEBREW_PREFIX := /opt/homebrew | ||
else | ||
HOMEBREW_PREFIX := /usr/local | ||
endif | ||
|
||
INCLUDE := $(HOMEBREW_PREFIX)/include | ||
OPT := $(HOMEBREW_PREFIX)/opt | ||
|
||
# Compiler and linker flags | ||
CXXFLAGS = -m64 -fPIC -fno-strict-aliasing -fexceptions -fopenmp -DNDEBUG -DIL_STD -std=c++14 -O3 -I $(INCLUDE) -I $(INCLUDE)/eigen3 -I $(INCLUDE)/boost | ||
LDFLAGS = -m64 -fPIC -fno-strict-aliasing -fexceptions -fopenmp -DNDEBUG -DIL_STD -lm -lpthread -ltiff -L$(OPT)/libtiff/lib | ||
|
||
# Source files | ||
SRCS = Cell2Fire.cpp Cells.cpp FuelModelSpain.cpp FuelModelKitral.cpp FuelModelFBP.cpp Spotting.cpp ReadCSV.cpp ReadArgs.cpp Lightning.cpp WriteCSV.cpp Ellipse.cpp DataGenerator.cpp | ||
|
||
# Object files | ||
OBJS = $(SRCS:.cpp=.o) | ||
|
||
# Target executable | ||
TARGET = Cell2Fire | ||
|
||
# Build rules | ||
|
||
all: $(TARGET) | ||
|
||
$(TARGET): $(OBJS) | ||
$(CXX) -o $(TARGET) $(OBJS) $(LDFLAGS) | ||
|
||
%.o: %.cpp | ||
$(CXX) $(CXXFLAGS) -c $< -o $@ | ||
|
||
clean: | ||
rm -f Lightning.o ReadArgs.o ReadCSV.o Cell2Fire.o Cells.o Cell2Fire Spotting.o WriteCSV.o Ellipse.o FuelModelFBP.o FuelModelKitral.o FuelModelSpain.o DataGenerator.o *.gch | ||
rm -f $(OBJS) $(TARGET) | ||
|
||
DESTDIR = /usr/local/bin | ||
install: all | ||
cp $(TARGETS) $(DESTDIR) | ||
uninstall: all | ||
rm -rf $(DESTDIR)/$(TARGETS) | ||
|
||
rm $(DESTDIR)/$(TARGETS) |
Oops, something went wrong.