Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mosaic-group/openfpm
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhii Yaskovets committed Jun 14, 2024
2 parents c454d54 + 1c9ed20 commit 761d15a
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 128 deletions.
204 changes: 77 additions & 127 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,138 +1,88 @@
name: OpenFPM_CI

on:
pull_request:
push:
branches:
- master
- fix/github-action
release:

pull_request:
branches:
- master
jobs:
build_almalinux:
runs-on: ubuntu-latest
container: almalinux:8.5
steps:
- name: Install dependencies
run: |
dnf -y --refresh update
yum install -y openssh-clients cmake wget git gcc-c++ gcc-gfortran python39 bzip2 diffutils zlib-devel rpm-build
ln -s /usr/bin/python3 /usr/bin/python
- uses: actions/checkout@v3
with:
submodules: true
- name: Restore Cache dependencies
uses: actions/cache/restore@v3
with:
path: ~/openfpm_dependencies/
key: almalinux-dep-${{ github.ref }}
- name: Setup Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar -xvf ccache-4.8-linux-x86_64.tar.xz -C $HOME
echo "$HOME/ccache-4.8-linux-x86_64/" >> $GITHUB_PATH
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
append-timestamp: false
- name: Build and Pack
run: |
export PATH="~/ccache-4.8-linux-x86_64/:$PATH"
git config --global safe.directory '*'
./build.sh $(pwd) unused pdata 0 ${{ github.ref }}
cp $HOME/openfpm_vars $HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
cp $HOME/.openfpm.mk $HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
export DEP_PACKING=$HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
ln -s ./LICENSE.md LICENSE.txt
ln -s ./README.md README.txt
cd build
printf " -DCPACK_RUN_INSTALL_DEPENDENCIES=ON" >> cmake_build_options;
bash cmake_build_options;
echo "Calling CPACK"
cpack -G RPM centos
if [ $? -ne 0 ]; then
echo "Error creating package"
exit 1
fi
mv openfpm_pdata-*-Linux.rpm openfpm-nightly-Linux-x86_64.rpm
- uses: actions/cache/save@v3
if: always()
with:
path: ~/openfpm_dependencies/
key: almalinux-dep-${{ github.ref }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: openfpm_nightly_builds
path: build/openfpm-nightly-Linux-x86_64.rpm
# - name: Single-core Test
# run: |
# source $HOME/openfpm_vars
# export OMP_NUM_THREADS=1
# mpirun --allow-run-as-root -np 2 ./build/src/pdata
# echo "RUN numerics test"
# cd openfpm_numerics
# mpirun --allow-run-as-root -np 2 ../build/openfpm_numerics/src/numerics
# - name: Multi-core Test
# run: |
# source $HOME/openfpm_vars
# export OMP_NUM_THREADS=1
# mpirun --allow-run-as-root -np 2 ./build/src/pdata
# echo "RUN numerics test"
# cd openfpm_numerics
# mpirun --allow-run-as-root -np 2 ../build/openfpm_numerics/src/numerics
test_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false

build_macos:
runs-on: macos-latest
steps:
- name: Setup GNU Fortran
uses: modflowpy/install-gfortran-action@v1
- name: Install dependencies
run: |
brew install cmake wget gcc gnu-sed
- uses: actions/checkout@v3
with:
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
append-timestamp: false
- name: Restore Cache dependencies
uses: actions/cache/restore@v3
with:
path: ~/openfpm_dependencies/
key: macos-dep-${{ github.ref }}
- name: Build & Pack
run: |
export CC=gcc-12
export CXX=g++-12
./build.sh $(pwd) unused pdata 0 ${{ github.ref }}
cp $HOME/openfpm_vars $HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
cp $HOME/.openfpm.mk $HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
export DEP_PACKING=$HOME/openfpm_dependencies/openfpm_pdata/${{ github.ref }}
ln -s ./LICENSE.md LICENSE.txt
ln -s ./README.md README.txt
cd build
printf " -DCPACK_RUN_INSTALL_DEPENDENCIES=ON" >> cmake_build_options;
bash cmake_build_options;
echo "Calling CPACK"
cpack -G productbuild osx
if [ $? -ne 0 ]; then
echo "Error creating package"
exit 1
fi
mv openfpm_pdata-*-Darwin.pkg openfpm-nightly-Darwin-x86_64.pkg
- uses: actions/cache/save@v3
if: always()
with:
path: ~/openfpm_dependencies/
key: macos-dep-${{ github.ref }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: openfpm_nightly_builds
path: build/openfpm-nightly-Darwin-x86_64.pkg
# - name: Single-core Test
- name: Check out code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew dependencies
uses: actions/cache@v2
with:
path: |
~/Library/Caches/Homebrew
/home/linuxbrew/.cache/Homebrew
$HOME/.ccache
key: ${{ runner.os }}-homebrew-${{ hashFiles('**/*.rb') }}
restore-keys: |
${{ runner.os }}-homebrew-
- name: Install dependencies
run: |
brew install cmake ccache petsc boost vc eigen hdf5-mpi
brew install abhinavsns/homebrew-openfpm/parmetis
brew install -s abhinavsns/homebrew-openfpm/libhilbert
brew install -s abhinavsns/homebrew-openfpm/blitz
brew install -s abhinavsns/homebrew-openfpm/algoim
export CCACHE_DIR="$HOME/.ccache"
mkdir -p "$CCACHE_DIR"
mkdir -p build
cd build
export CXX=mpic++
cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix) \
-DCMAKE_CXX_COMPILER=mpic++ \
-DLIBHILBERT_ROOT=$(brew --prefix abhinavsns/homebrew-openfpm/libhilbert) \
-DLD_FLAGS='-Wl,-ld_classic' \
-DDYLD_LIBRARY_PATH=$(brew --prefix suitesparse)/lib:$(brew --prefix metis)/lib \
-DCMAKE_INSTALL_PREFIX=$HOME/install5 \
-DCMAKE_BUILD_TYPE=RELEASE \
-DSE_CLASS1=OFF \
-DSE_CLASS2=OFF \
-DSE_CLASS3=OFF \
-DTEST_COVERAGE=OFF \
-DSCAN_COVERTY=OFF \
-DTEST_PERFORMANCE=OFF \
-DENABLE_ASAN=OFF \
-DENABLE_NUMERICS=ON \
-DENABLE_GARBAGE_INJECTOR=OFF \
-DENABLE_VCLUSTER_GARBAGE_INJECTOR=OFF \
-DCUDA_ON_BACKEND=NONE \
-DMPI_ROOT=$(brew --prefix open-mpi) \
-DPETSC_ROOT=$(brew --prefix petsc) \
-DBOOST_ROOT=$(brew --prefix boost) \
-DBoost_NO_BOOST_CMAKE=ON \
-DHDF5_ROOT=$(brew --prefix hdf5-mpi) \
-DBLITZ_ROOT=$(brew --prefix abhinavsns/homebrew-openfpm/blitz) \
-DALGOIM_ROOT=$(brew --prefix abhinavsns/homebrew-openfpm/algoim) \
-DPARMETIS_ROOT=$(brew --prefix abhinavsns/homebrew-openfpm/parmetis) \
-DMETIS_ROOT=$(brew --prefix metis) \
-DOPENBLAS_ROOT=$(brew --prefix openblas) \
-DSUITESPARSE_ROOT=$(brew --prefix suite-sparse) \
-DEIGEN3_ROOT=$(brew --prefix eigen) \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache
- name: Build and install
run: make install

# - name: Single-core Test
# run: |
# export CC=gcc-12
# export CXX=g++-12
Expand All @@ -150,4 +100,4 @@ jobs:
# mpirun --allow-run-as-root -np 2 ./build/src/pdata
# echo "RUN numerics test"
# cd openfpm_numerics
# mpirun --allow-run-as-root -np 2 ../build/openfpm_numerics/src/numerics
# mpirun --allow-run-as-root -np 2 ../build/openfpm_numerics/src/numerics
2 changes: 1 addition & 1 deletion openfpm_pdata

0 comments on commit 761d15a

Please sign in to comment.