Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic creation of .deb packages #72

Merged
merged 34 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3f3f228
Updates makefile for CalculiX v2.17
KyleDavisSA Nov 10, 2020
d40944d
Adds adpater files for CalculiX v2.17
KyleDavisSA Nov 10, 2020
22367df
Updates README
KyleDavisSA Nov 10, 2020
7ce9478
Fixes reading preCICE arguments
KyleDavisSA Nov 10, 2020
7ad9d6c
Updates ccx_2.17
KyleDavisSA Nov 10, 2020
2779beb
Added Debian Packaging, updated Makefile
boris-martin Oct 21, 2021
94e1ef4
Updated action to pull the correct branch
boris-martin Oct 21, 2021
f6c0dac
Updated manpage
boris-martin Oct 21, 2021
8042b73
update manpage
boris-martin Oct 21, 2021
c84d066
Fixed bad formatting
boris-martin Oct 21, 2021
5c600b9
Switch to newest non-LTS Ubuntu.
boris-martin Nov 10, 2021
47e5586
Added preCICE version in Github Action
boris-martin Nov 10, 2021
cfc9b25
Update .github/workflows/ubuntu_build.yml
boris-martin Nov 10, 2021
bf53326
Update .github/workflows/ubuntu_build.yml
boris-martin Nov 10, 2021
e6ce2b3
Consistency
boris-martin Nov 10, 2021
42db163
Update packaging/manpage.md
boris-martin Nov 10, 2021
086d97c
--best compression
boris-martin Nov 10, 2021
01db6a6
Updated Copyright notice of the .deb (GPL3)
boris-martin Nov 20, 2021
cbf5519
(Theoretical) compatibility with all versions of preCICE 2.x
boris-martin Nov 20, 2021
2b38dec
Added SHA256 checksum automation
boris-martin Nov 20, 2021
3137b4b
Cleanup (first part)
boris-martin Nov 20, 2021
fb2b9ed
Update manpage.md
boris-martin Nov 21, 2021
eda773a
Improved worfklow flexibility, renamed package
boris-martin Nov 21, 2021
630491e
Update packaging/README.md
boris-martin Nov 21, 2021
6d96c6e
Update README.md
boris-martin Nov 21, 2021
8d733cf
Typo
boris-martin Nov 22, 2021
d65282b
Update README.md
boris-martin Nov 22, 2021
2e0f961
various refromulations
boris-martin Dec 5, 2021
0f7b24a
Workflow cleanup
boris-martin Dec 5, 2021
8c1cbd3
Update manpage
boris-martin Dec 5, 2021
f65ab77
update copyright
boris-martin Dec 5, 2021
6595587
Update packaging/manpage.md
boris-martin Dec 8, 2021
fd179a8
Merge branch 'v2.17' into debian_packaging_PR
MakisH Dec 13, 2021
3f9f2d1
Update package description
boris-martin Dec 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/ubuntu_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Calculix 2.17 with preCICE adapter test build

on: [push, pull_request]

jobs:
build:

strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
include:
- os: ubuntu-18.04
name: bionic
- os: ubuntu-20.04
name: focal
runs-on: ${{matrix.os}}
continue-on-error: true
env: # Versioning is "calculix-preciceX_2.YY-Z[...]" with X the major preCICE version, YY the minor CCX version and Z the package version
PACKAGE_NAME: "calculix-precice2_2.17-1_amd64"

steps:
- name: Update system
run: sudo apt update && sudo apt upgrade -y
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get preCICE v2.3.0
run: wget https://github.com/precice/precice/releases/download/v2.3.0/libprecice2_2.3.0_${{matrix.name}}.deb &&
sudo apt install ./libprecice2_2.3.0_${{matrix.name}}.deb -y
- name: install dependencies
run: sudo apt install libarpack2-dev libspooles-dev libyaml-cpp-dev -y
- name: Download CalculiX
run: wget http://www.dhondt.de/ccx_2.17.src.tar.bz2
- name: Unpack Calculix
run: tar -xjf ccx_2.17.src.tar.bz2
- run: echo "CCX=$(pwd)/CalculiX/ccx_2.17/src" >> $GITHUB_ENV
boris-martin marked this conversation as resolved.
Show resolved Hide resolved
- name: Show paths
run: echo "${{env.CCX}}" && ls "${{env.CCX}}"
- name: make
run: make -j 4 CCX="./CalculiX/ccx_2.17/src"
- name: Test run
run: ./bin/ccx_preCICE -h
- name: Download tools for packaging
run: sudo apt install lintian pandoc -y
- name: Create Debian Package
run: |
mkdir -p "packaging/calculix-precice2_2.17-1_amd64/usr/bin" &&
cp ./bin/ccx_preCICE ./packaging/calculix-precice2_2.17-1_amd64/usr/bin/ccx_preCICE &&
cd packaging && pwd && bash ./make_deb.sh ${{matrix.name}}
- name: Store Debian package artifact
uses: actions/upload-artifact@v2
with:
name: "${{env.PACKAGE_NAME}}_${{matrix.name}}.deb"
path: "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb"
- name: Compute SHA256 checksum
run: sha256sum "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb" > "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
- name: Store SHA256 checksum as artifact
uses: actions/upload-artifact@v2
with:
name: "${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
path: "packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb.sha256"
- name: Inspect package with lintian
run: sudo apt install lintian -y && lintian ./packaging/${{env.PACKAGE_NAME}}_${{matrix.name}}.deb
1,894 changes: 1,294 additions & 600 deletions CalculiX.h

Large diffs are not rendered by default.

59 changes: 32 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
# https://github.com/precice/calculix-adapter/wiki/Installation-instructions-for-CalculiX
# Set the following variables before building:
# Path to original CalculiX source (e.g. $(HOME)/ccx_2.16/src )
CCX = $(HOME)/PathTo/CalculiX/ccx_2.16/src
# Path to SPOOLES main directory (e.g. $(HOME)/SPOOLES.2.2 )
SPOOLES = $(HOME)/PathTo/SPOOLES
# Path to ARPACK main directory (e.g. $(HOME)/ARPACK )
ARPACK = $(HOME)/PathTo/ARPACK
# Path to yaml-cpp prefix (e.g. $(HOME)/yaml-cpp, should contain "include" and "build")
YAML = $(HOME)/PathTo/yaml-cpp
CCX = $(HOME)/CalculiX/ccx_2.17/src

### Change these if you built SPOOLES, ARPACK, or yaml-cpp from source ###
# SPOOLES include flags (e.g. -I$(HOME)/SPOOLES.2.2 )
SPOOLES_INCLUDE = -I/usr/include/spooles/
# SPOOLES library flags (e.g. $(HOME)/SPOOLES.2.2/spooles.a)
SPOOLES_LIBS = -lspooles
#
# ARPACK include flags (e.g. -I$(HOME)/ARPACK)
ARPACK_INCLUDE =
# ARPACK library flags (e.g. $(HOME)/ARPACK/libarpack_INTEL.a)
ARPACK_LIBS = -larpack -llapack -lblas
#
# yaml-cpp include flags (e.g. -I$(HOME)/yaml-cpp/include)
YAML_INCLUDE = -I/usr/include/
# yaml-cpp library flags (e.g. -L$(HOME)/yaml-cpp/build -lyaml-cpp)
YAML_LIBS = -lyaml-cpp

# Get the CFLAGS and LIBS from pkg-config (preCICE version >= 1.4.0).
# If pkg-config cannot find the libprecice.pc meta-file, you may need to set the
Expand All @@ -24,25 +34,18 @@ INCLUDES = \
-I./ \
-I./adapter \
-I$(CCX) \
-I$(SPOOLES) \
$(SPOOLES_INCLUDE) \
$(PKGCONF_CFLAGS) \
-I$(ARPACK) \
-I$(YAML)/include
$(ARPACK_INCLUDE) \
$(YAML_INCLUDE)

LIBS = \
$(SPOOLES)/spooles.a \
$(SPOOLES_LIBS) \
$(PKGCONF_LIBS) \
-lstdc++ \
-L$(YAML)/build -lyaml-cpp \

# OS-specific options
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
LIBS += $(ARPACK)/libarpack_MAC.a
else
LIBS += $(ARPACK)/libarpack_INTEL.a
LIBS += -lpthread -lm -lc
endif
$(YAML_LIBS) \
$(ARPACK_LIBS) \
-lpthread -lm -lc

# Compilers and flags
#CFLAGS = -g -Wall -std=c++11 -O0 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE
Expand All @@ -51,20 +54,22 @@ endif
CFLAGS = -Wall -O3 -fopenmp $(INCLUDES) -DARCH="Linux" -DSPOOLES -DARPACK -DMATRIXSTORAGE

# OS-specific options
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
CC = /usr/local/bin/gcc
else
CC = mpicc
endif

FFLAGS = -Wall -O3 -fopenmp $(INCLUDES)
# Note for GCC 10 or newer: add -fallow-argument-mismatch in the above flags
FC = mpifort
# FC = mpif90
# FC = gfortran

# Include a list of all the source files
include $(CCX)/Makefile.inc
SCCXMAIN = ccx_2.16.c
SCCXMAIN = ccx_2.17.c

# Append additional sources
SCCXC += nonlingeo_precice.c CCXHelpers.c PreciceInterface.c
Expand All @@ -80,7 +85,7 @@ $(OBJDIR)/%.o : %.f
$(OBJDIR)/%.o : adapter/%.c
$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/%.o : adapter/%.cpp
g++ -std=c++11 -I$(YAML)/include -c $< -o $@ $(LIBS)
g++ -std=c++11 $(YAML_INCLUDE) -c $< -o $@ $(LIBS)
#$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ $(LIBS)

# Source files in the $(CCX) folder
Expand All @@ -97,14 +102,14 @@ OCCXC += $(OBJDIR)/ConfigReader.o



$(OBJDIR)/ccx_preCICE: $(OBJDIR) $(OCCXMAIN) $(OBJDIR)/ccx_2.16.a
$(FC) -fopenmp -Wall -O3 -o $@ $(OCCXMAIN) $(OBJDIR)/ccx_2.16.a $(LIBS)
$(OBJDIR)/ccx_preCICE: $(OBJDIR) $(OCCXMAIN) $(OBJDIR)/ccx_2.17.a
$(FC) -fopenmp -Wall -O3 -o $@ $(OCCXMAIN) $(OBJDIR)/ccx_2.17.a $(LIBS)

$(OBJDIR)/ccx_2.16.a: $(OCCXF) $(OCCXC)
$(OBJDIR)/ccx_2.17.a: $(OCCXF) $(OCCXC)
ar vr $@ $?

$(OBJDIR):
mkdir -p $(OBJDIR)

clean:
rm -f $(OBJDIR)/*.o $(OBJDIR)/ccx_2.16.a $(OBJDIR)/ccx_preCICE
rm -f $(OBJDIR)/*.o $(OBJDIR)/ccx_2.17.a $(OBJDIR)/ccx_preCICE
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

The adapter was initially developed for conjugate heat transfer (CHT) simulations via preCICE by Lucia Cheung in the scope of her master’s thesis [[1]](https://www5.in.tum.de/pub/Cheung2016_Thesis.pdf) in cooperation with [SimScale](https://www.simscale.com/). For running the adapter for CHT simulations refer to this thesis. The adapter was extended to fluid-structure interaction by Alexander Rusch [[2]](https://www.gacm2017.uni-stuttgart.de/registration/Upload/ExtendedAbstracts/ExtendedAbstract_0138.pdf).

This adapter was developed for **CalculiX version 2.16.** Other versions may be compatible, yet they have not been tested. Please let us know if you want to use a different version.
This adapter was developed for **CalculiX version 2.17.** Other versions may be compatible, yet they have not been tested. Please let us know if you want to use a different version.

Adapters for other versions of CalculiX and preCICE are available in various branches. Branches compatible with **preCICE v2.x:**
- master
- master (currently still for CalculiX v2.16)
- v2.15_preCICE2.x

All other branches are compatible with **preCICE v1.x**.
Expand Down
Loading