-
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.
- Loading branch information
fdobad
committed
Aug 28, 2024
1 parent
ac03349
commit ca146ad
Showing
3 changed files
with
122 additions
and
63 deletions.
There are no files selected for viewing
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,89 @@ | ||
name: build manylinux | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
ubuntu_build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install -y g++-12 libboost-all-dev libeigen3-dev libtiff-dev libjpeg-dev libjbig-dev liblzma-dev libzstd-dev libwebp-dev libdeflate-dev libleptonica-dev | ||
- name: Check Packages Versions | ||
run: | | ||
dpkg-query -W -f='${binary:Package} ${Version}\n' g++-12 libboost-all-dev libeigen3-dev libtiff-dev libjpeg-dev libjbig-dev liblzma-dev libzstd-dev libwebp-dev libdeflate-dev libleptonica-dev > new_pkgs_ubuntu.txt | ||
cat new_pkgs_ubuntu.txt | ||
# if [ -n "$(diff new_pkgs_ubuntu.txt pkgs_ubuntu.txt)" ]; then | ||
# echo "::warning:: apt packages versions diff! $(diff new_pkgs_ubuntu.txt pkgs_ubuntu.txt)" | ||
# diff_output=$(diff --side-by-side --suppress-common-lines new_pkgs_ubuntu.txt pkgs_ubuntu.txt || true) | ||
# echo "$diff_output" | while IFS= read -r line; do | ||
# echo "$line" | ||
# done | ||
# fi | ||
- name: Get Environment | ||
id: get_env | ||
run: | | ||
DISTRIBUTION=$( lsb_release --short --id 2>/dev/null ) | ||
CODENAME=$( lsb_release --short --codename 2>/dev/null ) | ||
MACHINE=$( uname --machine 2>/dev/null ) | ||
echo "SUFFIX=".${DISTRIBUTION}.${CODENAME}.${MACHINE}"" >> $GITHUB_ENV | ||
- name: Build | ||
run: | | ||
cd Cell2Fire | ||
make clean | ||
make | ||
ldd Cell2Fire | ||
mv Cell2Fire Cell2Fire${{ env.SUFFIX }} | ||
make clean | ||
make -f makefile.static | ||
ldd Cell2Fire | ||
- name: Test | ||
run: | | ||
cd test | ||
bash test.sh | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: binaries | ||
path: Cell2Fire/Cell2Fire* | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: binaries | ||
path: Cell2Fire | ||
|
||
- name: TestManyLinux | ||
run: | | ||
cd test | ||
bash test.sh | ||
- name: TestSuffix | ||
run: | | ||
cd test | ||
bash test.sh ${{ env.SUFFIX }} |
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,33 @@ | ||
# Compiler | ||
CXX = g++-12 | ||
|
||
# Compiler and linker flags | ||
CXXFLAGS = -m64 -fPIC -fno-strict-aliasing -fexceptions -fopenmp -DNDEBUG -DIL_STD -std=c++14 -O3 -I /usr/include -I /usr/include/eigen3 | ||
LDFLAGS = -m64 -fPIC -fno-strict-aliasing -fexceptions -fopenmp -DNDEBUG -DIL_STD -static -static-libgcc -static-libstdc++ -lm -lpthread -ltiff -ljpeg -ljbig -llzma -lzstd -lwebp -ldeflate -lz -lLerc | ||
|
||
# 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 $(OBJS) $(TARGET) | ||
|
||
DESTDIR = /usr/local/bin | ||
install: all | ||
cp $(TARGETS) $(DESTDIR) | ||
uninstall: all | ||
rm $(DESTDIR)/$(TARGETS) |