Skip to content

Commit

Permalink
Merge pull request #2604 from boutproject/v5.0.0-rc
Browse files Browse the repository at this point in the history
BOUT++ v5.0.0 release candidate
  • Loading branch information
ZedThree authored Feb 8, 2023
2 parents ea1f962 + 779ed3c commit d935fa1
Show file tree
Hide file tree
Showing 1,476 changed files with 109,016 additions and 107,948 deletions.
File renamed without changes.
64 changes: 64 additions & 0 deletions .ci_fedora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/sh
## Copied script from arpack-ng. Please submit fixes also to
## arpack-ng (if applicable)
## -e : Make sure all errors cause the script to fail
## -x be verbose; write what we are doing, as we do it
set -ex
## Should we init a container?
if [ ".$1" = .setup ] || [ ".$1" = .podman ]
then
# fedora
# note: when you PR, docker-cp provides, in the container, the branch associated with the PR (not master where there's nothing new)
# 1. docker create --name mobydick IMAGE CMD <=> create a container (= instance of image) but container is NOT yet started
# 2. docker cp -a ${TRAVIS_BUILD_DIR} mobydick:/tmp <=> copy git repository (CI worker, checkout-ed on PR branch) into the container
# note: docker-cp works only if copy from/to containers (not images)
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
if test $1 = podman ; then
cmd=podman
else
cmd="sudo docker"
fi
test . != ".$2" && mpi="$2" || mpi=openmpi
test . != ".$3" && version="$3" || version=latest
time $cmd pull registry.fedoraproject.org/fedora:$version
time $cmd create --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--name mobydick registry.fedoraproject.org/fedora:$version \
/tmp/BOUT-dev/.ci_fedora.sh $mpi
time $cmd cp ${TRAVIS_BUILD_DIR} mobydick:/tmp
time $cmd start -a mobydick
exit 0
fi

test . != ".$1" && mpi="$1" || mpi=openmpi

## If we are called as root, setup everything
if [ $UID -eq 0 ]
then
cat /etc/os-release
# Ignore weak depencies
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf
time dnf -y install dnf-plugins-core python3-pip cmake
# Allow to override packages - see #2073
time dnf copr enable -y davidsch/fixes4bout || :
time dnf -y upgrade
time dnf -y builddep bout++
useradd test
cp -a /tmp/BOUT-dev /home/test/
chown -R test /home/test
chmod u+rwX /home/test -R
sudo -u test ${0/\/tmp/\/home\/test} $mpi
## If we are called as normal user, run test
else
pip install --user zoidberg
. /etc/profile.d/modules.sh
module load mpi/${1}-x86_64
export OMPI_MCA_rmaps_base_oversubscribe=yes
export TRAVIS=true
export FLEXIBLAS=NETLIB
cd
cd BOUT-dev
echo "starting configure"
time cmake -DBOUT_USE_PETSC=ON -S . -B build
time make -C build build-check -j 2
time make -C build check
fi
15 changes: 7 additions & 8 deletions .travis_script.sh → .ci_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MMS=0
TESTS=0
MAIN_TARGET=
UPDATE_SCRIPT=0
CONFIGURE_SHELL=

usage() {
echo "$0 options are: "
Expand All @@ -19,7 +20,7 @@ usage() {
}

#Handle input flags
while getopts "cuimt:5" arg;
while getopts "cuimt:5s:" arg;
do
case $arg in
c) ### Run the coverage-post job tasks
Expand All @@ -43,13 +44,16 @@ do
5) ### Run the update to version 5 script
UPDATE_SCRIPT=1
;;
s) ### Use specific shell to configure
CONFIGURE_SHELL="$OPTARG"
;;
*) ### Show usage message
usage
;;
esac
done

./.build_sundials_for_travis.sh
./.build_sundials_for_ci.sh

if test $UPDATE_SCRIPT -gt 0
then
Expand All @@ -71,7 +75,7 @@ echo "****************************************"
echo "Configuring with $CONFIGURE_OPTIONS"
echo "****************************************"
conf=0
time ./configure $CONFIGURE_OPTIONS MAKEFLAGS="$MAKEFLAGS" || conf=$?
time $CONFIGURE_SHELL ./configure $CONFIGURE_OPTIONS MAKEFLAGS="$MAKEFLAGS" || conf=$?
if test $conf -gt 0
then
RED_FG="\033[031m"
Expand Down Expand Up @@ -113,11 +117,6 @@ do
fi
done

if [[ ${TESTS} == 1 ]]
then
time make build-check
fi

if [[ ${UNIT} == 1 ]]
then
time make check-unit-tests
Expand Down
17 changes: 16 additions & 1 deletion .ci_with_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,23 @@ cd ../examples/make-script
PATH=../../build/bin:$PATH make
./test --help
cd -
make install -j 2
# Test bout++Config.cmake
cd ../examples/conduction
cmake . -B build -DCMAKE_PREFIX_PATH=../../build
cmake --build build
./build/conduction
cd -

make install -j 2
rm -rf build
# Test installation with plain `make`
cd ../examples/make-script
rm test
PATH=../../installed/bin:$PATH make
./test --help
cd -
# Test installation with CMake
cd ../examples/conduction
cmake . -B build -DCMAKE_PREFIX_PATH=../../installed
cmake --build build
./build/conduction
9 changes: 6 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ IndentCaseLabels: false
# IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
# requires clang-format 15+
# InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
Expand All @@ -91,7 +93,7 @@ PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
ReflowComments: false
SortIncludes: true
# SortUsingDeclarations: true
SpaceAfterCStyleCast: false
Expand All @@ -105,7 +107,8 @@ SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- BOUT_OMP
Standard: c++14
TabWidth: 8
UseTab: Never
...
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Clang-format whole repo
d8f14fdddb5ca0fbb32d8e2bf5ac2960d6ac5ce6
ed2117e6d6826a98b6988e2f18c0c34e408563b6
46 changes: 46 additions & 0 deletions .github/workflows/black-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: black

on:
push:
paths:
- '**.py'
- 'bin/**'
- '**/runtest'
- '**/run'
- 'tests/integrated/test_suite'
- 'tests/requirements/*'
- 'tools/tokamak_grids/**'

defaults:
run:
shell: bash

jobs:
black:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Install black
run: |
sudo apt update -y
sudo apt -y install python3-pip python3-setuptools python3-wheel
pip3 install black
- name: Version
run: |
python3 --version
$HOME/.local/bin/black --version
- name: Run black
run: |
pwd
ls
$HOME/.local/bin/black tests/ tools/ $(grep -EIlr '^#!.*python.*$' bin/ tests/ tools/ src/ | grep -v _boutpp_build)
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Apply black changes"
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the pull request branch, also include all history
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
paths:
- '**.cxx'
- '**.hxx'
branches-ignore:
# Release candidate branches tend to have big PRs which causes all sorts of problems
- 'v*rc'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -14,7 +17,7 @@ jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

Expand All @@ -29,13 +32,15 @@ jobs:
# the unit tests until they're fixed or ignored upstream
exclude: "tests/unit/*cxx"
cmake_command: |
git config --global --add safe.directory '*' &&
pip install cmake && \
cmake --version && \
git config --global --add safe.directory "$GITHUB_WORKSPACE" && \
cmake . -B build -DBUILD_SHARED_LIBS=ON \
-DBOUT_ENABLE_OPENMP=ON \
-DBOUT_USE_PETSC=ON \
-DBOUT_USE_SLEPC=ON \
-DBOUT_USE_SUNDIALS=ON \
-DBOUT_BUILD_EXAMPLES=ON \
-DBOUT_BUILD_DOCS=OFF \
-DBOUT_ENABLE_PYTHON=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=On
-DCMAKE_EXPORT_COMPILE_COMMANDS=On \
-DBOUT_UPDATE_GIT_SUBMODULE=OFF
Loading

0 comments on commit d935fa1

Please sign in to comment.