Skip to content

add env

add env #31

name: Build Corsika8
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
fmt_version: 10.2.1
spdlog_version: 1.14.1
cubic_version: 0.1.5
proposal_version: 7.6.2
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install prerequisites
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y python3 python3-pip cmake g++ gfortran git doxygen graphviz \
libboost-all-dev libcli11-dev libeigen3-dev libyaml-cpp-dev \
libre2-dev libzstd-dev liblz4-dev catch2 zlib1g-dev libprotobuf-dev \
nlohmann-json3-dev ca-certificates lsb-release wget
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt install -y ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb
sudo apt update -y
sudo apt install -y -V libarrow-dev libarrow-dataset-dev libparquet-dev
pip install pyarrow
- name: Build pre-installation file list
shell: bash
run: sudo find /usr -print > filelist_before.txt
- name: Install fmt library
shell: bash
run: |
mkdir fmt
cd fmt
wget https://github.com/fmtlib/fmt/archive/refs/tags/${{ env.fmt_version }}.tar.gz
tar zxf ${{ env.fmt_version }}.tar.gz
cd fmt-${{ env.fmt_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install spdlog library
shell: bash
run: |
mkdir spdlog
cd spdlog
wget https://github.com/gabime/spdlog/archive/refs/tags/v${{ env.spdlog_version }}.tar.gz
tar zxf v${{ env.spdlog_version }}.tar.gz
cd spdlog-${{ env.spdlog_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install Cubic Interpolation
shell: bash
run: |
mkdir cubic_interpolation
cd cubic_interpolation
wget https://github.com/tudo-astroparticlephysics/cubic_interpolation/archive/refs/tags/v${{ env.cubic_version }}.tar.gz
tar zxf v${{ env.cubic_version }}.tar.gz
cd cubic_interpolation-${{ env.cubic_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
- name: Install PROPOSAL
shell: bash
run: |
mkdir proposal
cd proposal
wget https://github.com/tudo-astroparticlephysics/PROPOSAL/archive/refs/tags/${{ env.proposal_version }}.tar.gz
tar zxf ${{ env.proposal_version }}.tar.gz
cd PROPOSAL-${{ env.proposal_version }}
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr
make -j4
sudo make install
sudo sed -i -e '/PROPOSAL_INCLUDE_DIR/s/\/include/\/usr\/include/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
sudo sed -i -e '/PROPOSAL_LIBRARIES/s/\/lib/\/usr\/lib/' /usr/lib/x86_64-linux-gnu/cmake/PROPOSAL/PROPOSALConfig.cmake
- name: Install Corsika 8
continue-on-error: true
shell: bash
run: |
git clone --recursive https://gitlab.iap.kit.edu/AirShowerPhysics/corsika.git
sed -i -e 's/yaml-cpp::yaml-cpp/${yaml-cpp_LIBRARY}/' corsika/CMakeLists.txt
sed -i -e '/^find_package(Arrow/s/$/\nfind_package(Parquet REQUIRED)/' corsika/CMakeLists.txt
mkdir corsika/build
cd corsika/build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=x86_64-linux-gnu \
-DCMAKE_PREFIX_PATH=/usr \
..
make -j4
sudo make install
- name: Build post-installation file list
shell: bash
run: sudo find /usr -print > filelist_after.txt
- name: Package Corsika 8 in TGZ file
shell: bash
run: |
cat filelist_before.txt filelist_after.txt | sort | uniq -u > filelist_diff.txt
tar -zcvf corsika8_installed.tgz -C / -T filelist_diff.txt
ls -l corsika8_installed.tgz
- uses: actions/upload-artifact@v4
with:
name: Filelist
path: filelist_after.txt
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ matrix.os }}"
prerelease: true
title: "Build of Corsika8 on ${{ matrix.os }}"
files: |
corsika8_installed.tgz