Skip to content

Add CI: Linux/macOS/Windows #3

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

Merged
merged 1 commit into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions .github/workflows/dependencies/dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

set -eu -o pipefail

sudo apt-get update

sudo apt-get install -y --no-install-recommends\
build-essential \
g++ gfortran \
libopenmpi-dev \
openmpi-bin
14 changes: 14 additions & 0 deletions .github/workflows/dependencies/dependencies_clang6.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

set -eu -o pipefail

sudo apt-get update

sudo apt-get install -y \
build-essential \
clang gfortran
24 changes: 24 additions & 0 deletions .github/workflows/dependencies/dependencies_dpcpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

set -eu -o pipefail

# Ref.: https://github.com/rscohn2/oneapi-ci
# intel-basekit intel-hpckit are too large in size
wget -q -O - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB \
| sudo apt-key add -
echo "deb https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list

sudo apt-get update

sudo apt-get install -y --no-install-recommends \
build-essential \
intel-oneapi-dpcpp-cpp-compiler intel-oneapi-mkl-devel \
g++ gfortran \
libopenmpi-dev \
openmpi-bin
17 changes: 17 additions & 0 deletions .github/workflows/dependencies/dependencies_gcc10.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

set -eu -o pipefail

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

sudo apt-get install -y --no-install-recommends \
build-essential \
g++-10 gfortran-10 \
libopenmpi-dev \
openmpi-bin
48 changes: 48 additions & 0 deletions .github/workflows/dependencies/dependencies_hip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

# search recursive inside a folder if a file contains tabs
#
# @result 0 if no files are found, else 1
#

set -eu -o pipefail

# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
wget -q -O - http://repo.radeon.com/rocm/rocm.gpg.key \
| sudo apt-key add -
echo 'deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main' \
| sudo tee /etc/apt/sources.list.d/rocm.list

echo 'export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin' \
| sudo tee -a /etc/profile.d/rocm.sh
# we should not need to export HIP_PATH=/opt/rocm/hip with those installs

sudo apt-get update

# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
# meta-package: rocm-dkms
# OpenCL: rocm-opencl
# other: rocm-dev rocm-utils
sudo apt-get install -y --no-install-recommends \
build-essential \
gfortran \
libnuma-dev \
libopenmpi-dev \
openmpi-bin \
rocm-dev rocrand

# activate
#
source /etc/profile.d/rocm.sh
hipcc --version

# cmake-easyinstall
#
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
sudo chmod a+x /usr/local/bin/cmake-easyinstall
export CEI_SUDO="sudo"
13 changes: 13 additions & 0 deletions .github/workflows/dependencies/dependencies_mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

set -eu -o pipefail

brew update
brew install gfortran || true
brew install libomp || true
brew install open-mpi || true
20 changes: 20 additions & 0 deletions .github/workflows/dependencies/dependencies_nofortran.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Copyright 2020 Axel Huebl
#
# License: BSD-3-Clause-LBNL

# search recursive inside a folder if a file contains tabs
#
# @result 0 if no files are found, else 1
#

set -eu -o pipefail

sudo apt-get update

sudo apt-get install -y --no-install-recommends\
build-essential \
g++ \
libopenmpi-dev \
openmpi-bin
41 changes: 41 additions & 0 deletions .github/workflows/dependencies/dependencies_nvcc11.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash
#
# Copyright 2020 Axel Huebl
#
# License: BSD-3-Clause-LBNL

# search recursive inside a folder if a file contains tabs
#
# @result 0 if no files are found, else 1
#

set -eu -o pipefail

sudo apt-get -qqq update
sudo apt-get install -y \
build-essential \
ca-certificates \
cmake \
g++ \
gfortran \
gnupg \
libopenmpi-dev \
openmpi-bin \
pkg-config \
wget

sudo wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-key add 7fa2af80.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" \
| sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt-get update
sudo apt-get install -y \
cuda-command-line-tools-11-2 \
cuda-compiler-11-2 \
cuda-cupti-dev-11-2 \
cuda-minimal-build-11-2 \
cuda-nvml-dev-11-2 \
cuda-nvtx-11-2 \
libcurand-dev-11-2
sudo ln -s cuda-11.2 /usr/local/cuda

20 changes: 20 additions & 0 deletions .github/workflows/dependencies/documentation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Andrew Myers

set -eu -o pipefail

sudo apt-get update

sudo apt-get install -y --no-install-recommends\
build-essential \
pandoc \
doxygen \
texlive \
texlive-latex-extra \
texlive-lang-cjk \
latexmk

130 changes: 130 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: linux

on: [push, pull_request]

jobs:
# Build and install libamrex as AMReX CMake project
gcc7:
name: GNU@7.5
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: .github/workflows/dependencies/dependencies.sh
- name: Build & Install
run: |
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build -j 2

gcc10:
name: GNU@10.1
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wno-error=deprecated-declarations -Wshadow -Woverloaded-virtual -Wunreachable-code -fno-operator-names"}
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: .github/workflows/dependencies/dependencies_gcc10.sh
- name: Build & Install
run: |
export CC=$(which gcc-10)
export CXX=$(which g++-10)
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON
cmake --build build -j 2

clang6:
name: Clang@6.0 w/o MPI
runs-on: ubuntu-18.04
env: {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed"}
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: .github/workflows/dependencies/dependencies_clang6.sh
- name: Build & Install
run: |
export CC=$(which clang)
export CXX=$(which clang++)
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_MPI=OFF
cmake --build build -j 2

# TODO: target_compile_features no known features for CUDA compiler "" version .
# nvcc11:
# name: CUDA@11.2 GNU@9.3.0
# runs-on: ubuntu-20.04
# env: {CXXFLAGS: "-fno-operator-names"}
# steps:
# - uses: actions/checkout@v2
# - name: Dependencies
# run: .github/workflows/dependencies/dependencies_nvcc11.sh
# - name: Build & Install
# run: |
# export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
# export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
# which nvcc || echo "nvcc not in PATH!"
#
# export CC=$(which gcc)
# export CXX=$(which g++)
# export CUDAHOSTCXX=$(which g++)
#
# cmake -S . -B build \
# -DCMAKE_VERBOSE_MAKEFILE=ON \
# -DAMReX_GPU_BACKEND=CUDA \
# -DCMAKE_CUDA_STANDARD=17 \
# -DCMAKE_CXX_STANDARD=17 \
# -DAMReX_CUDA_ARCH=8.0 \
# -DAMReX_CUDA_ERROR_CROSS_EXECUTION_SPACE_CALL=ON \
# -DAMReX_CUDA_ERROR_CAPTURE_THIS=ON
# cmake --build build -j 2

# TODO: in pybind11
# multiple definition of `scalblnl`, `sinhl', `tanhl`, `tanl`, ...
# dpcpp:
# name: DPCPP GFortran@7.5
# runs-on: ubuntu-20.04
# env: {CXXFLAGS: "-fno-operator-names"}
# steps:
# - uses: actions/checkout@v2
# - name: Dependencies
# run: .github/workflows/dependencies/dependencies_dpcpp.sh
# - name: Build & Install
# run: |
# set +e
# source /opt/intel/oneapi/setvars.sh
# set -e
# cmake -S . -B build \
# -DCMAKE_VERBOSE_MAKEFILE=ON \
# -DCMAKE_CXX_COMPILER_ID="Clang" \
# -DCMAKE_CXX_COMPILER_VERSION=12.0 \
# -DCMAKE_CXX_STANDARD_COMPUTED_DEFAULT="17" \
# -DAMReX_GPU_BACKEND=SYCL \
# -DCMAKE_C_COMPILER=$(which clang) \
# -DCMAKE_CXX_COMPILER=$(which dpcpp)
# cmake --build build -j 2
# note: setting the CXX compiler ID is a work-around for
# the 2021.1 DPC++ release / CMake 3.19.0-3.19.1
# https://gitlab.kitware.com/cmake/cmake/-/issues/21551#note_869580

hip:
name: HIP ROCm@3.8 GFortran@9.3
runs-on: ubuntu-20.04
env: {CXXFLAGS: "-fno-operator-names"}
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: .github/workflows/dependencies/dependencies_hip.sh
- name: Build & Install
run: |
source /etc/profile.d/rocm.sh
hipcc --version

cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_GPU_BACKEND=HIP \
-DAMReX_AMD_ARCH=gfx900 \
-DCMAKE_C_COMPILER=$(which hipcc) \
-DCMAKE_CXX_COMPILER=$(which hipcc)
cmake --build build -j 2
23 changes: 23 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: macos

on: [push, pull_request]

env:
CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wextra-semi -Wunreachable-code -fno-operator-names -Wno-pass-failed"

jobs:
appleclang:
name: AppleClang@12.0 w/o MPI
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Dependencies
run: .github/workflows/dependencies/dependencies_mac.sh
- name: Build & Install
run: |
cmake -S . -B build \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_MPI=OFF
cmake --build build -j 2

# TODO: AppleClang w/ MPI
Loading