diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 07d9d899ae..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,193 +0,0 @@ -# .travis.yml -# Defines build matrix and regression tests for Travis CI -language: cpp -branches: - only: - - master - - dust - - mhd4_3D -# Default build matrix is 4x Ubuntu builds (inherit the default stage name "test"): -os: - - linux -dist: trusty -sudo: false # use faster container-based build -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-trusty-5.0 - packages: - - "python3" - - "python3-pip" - - "g++-7" # Ubuntu 14.04.05 ships with GCC 4.8.4 (not 4.8.2) as of 2018-12-11 - - "clang-5.0" # Ubuntu 14.04.05 ships with Clang 3.5.0 as of 2018-10-29 -# OpenMPI and MPICH implementations: -env: - matrix: - - MPI_CHOICE=mpich - - MPI_CHOICE=openmpi -compiler: - - g++ - - clang++ -# Define Ubuntu build caches (cache ignored inside "include:" matrix) -cache: - pip: true # Caching NumPy for regression test script - directories: # TODO(felker): sync "version_str=" lines in install scripts with cache dir names - # For caching Linux source directories: - - openmpi-3.0.2 - - mpich-3.2.1 - # Caching Linux install directories: - - openmpi - - mpich - - fftw - - fftw-3.3.8 - - hdf5 - - hdf5-1.10.4 - -# Explicitly includilng the 2x macOS jobs in build matrix (inherit the default stage name "test") -# Must specify complete build details, or the jobs will inherit -# the first value in the above arrays. Could encapsulate in script -# -------------- -# TODO(felker): improve syncing of osx "softwareupdate" cmd xcode version argument in -# tst/ci/travis/ install_mpich.sh, install_openmpi.sh (workaround for Homebrew GCC) -matrix: - include: - - os: osx - osx_image: xcode11.2 - compiler: clang++ - addons: - homebrew: - packages: - - python3 - env: - - MPI_CHOICE=mpich - # Override Linux cache mapping - cache: - pip: true - directories: - - "/usr/local/Cellar/mpich/" - - "/usr/local/Cellar/open-mpi/" - - "/usr/local/Cellar/libevent/" - - "/usr/local/Cellar/szip/" - - "/usr/local/Cellar/hwloc/" - # Cached Homebrew install of OpenMPI needs libevent 2.* symlink: - #- "/usr/local/opt/libevent" # Travis CI won't cache symlink - # For caching macOS Homebrew installation symlinks: - - openmpi - - mpich - - fftw - - "/usr/local/Cellar/fftw/" - - hdf5 - - "/usr/local/Cellar/hdf5/" - - os: osx - osx_image: xcode11.2 - compiler: clang++ - addons: - homebrew: - packages: - - python3 - env: - - MPI_CHOICE=openmpi - - TMPDIR=/tmp - # Cache is shared with other osx build with MPICH - cache: - pip: true - directories: - - "/usr/local/Cellar/mpich/" - - "/usr/local/Cellar/open-mpi/" - - "/usr/local/Cellar/libevent/" - - "/usr/local/Cellar/szip/" - - "/usr/local/Cellar/hwloc/" - - openmpi - - mpich - - fftw - - "/usr/local/Cellar/fftw/" - - hdf5 - - "/usr/local/Cellar/hdf5/" - # Run style checks only once: inherits first value of each Build Matrix dimension - # (Ubuntu, GCC, MPICH). 'job: include:' is an alias for 'matrix: include:' - # Test PEP 8 style compliance for .py files: - - stage: python linter - before_install: skip - install: skip - addons: - apt: - packages: - - "python3" - - "python3-pip" - env: - compiler: - script: python3 -m flake8 --exclude=cpplint.py,openmpi-* && echo "Finished linting Python files with flake8" - # Test Google C++ Style Guide adherence for .cpp, .hpp files: - - stage: c++ linter - before_install: skip - install: skip - before_script: skip - addons: - env: - compiler: - # "python" must point to Py2 distro, otherwise cpplint.py will silently quit while checking 1st file - script: cd tst/style/ && ./check_athena_cpp_style.sh - -# Recommended by Travis CI documentation to unset CC, CXX env. vars for MPI builds to prevent conflicts -before_install: - # Specify upgraded compilers on Ubuntu image builds: - # /usr/local/clang-5.0.0/bin (tags/RELEASE_500/final) as of 2018-12-12 - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "clang++" ]]; then eval "CC=clang && CXX=clang++"; fi - # /usr/bin/, clang 5.0.2-svn... : won't take /usr/local/clang/lib/libomp.so workaround in run_tests_travis.sh - # Could try /usr/local/clang-5.0/lib/libomp.so - #- if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "clang++" ]]; then eval "CC=clang-5.0 && CXX=clang++-5.0"; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX_FOR_BUILD" == "g++" ]]; then eval "CC=gcc-7 && CXX=g++-7"; fi - - test -n $CC && unset CC - # Cache general 'compiler' choice (g++ vs. clang++) from Travis CI Build Matrix before unsetting - - export TEMP_CXX=$CXX_FOR_BUILD - - export TEMP_CCMD=$CXX - - test -n $CXX && unset CXX - # Dump default system and (possibly upgraded) selected C++ compiler versions - - g++ --version - - clang++ --version - - ${TEMP_CCMD} --version -# Install OpenMPI, MPICH, and FFTW -install: - - travis_wait 45 bash ./tst/ci/travis/install_mpich.sh - - travis_wait 45 bash ./tst/ci/travis/install_openmpi.sh - - bash ./tst/ci/travis/install_fftw.sh - - bash ./tst/ci/travis/install_hdf5.sh - - export PATH=$TRAVIS_BUILD_DIR/fftw/bin/:$TRAVIS_BUILD_DIR/hdf5/bin/:$PATH - - export CPATH=$TRAVIS_BUILD_DIR/fftw/include/:$TRAVIS_BUILD_DIR/hdf5/include/$CPATH - - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/fftw/share/:$TRAVIS_BUILD_DIR/hdf5/lib/:$LD_LIBRARY_PATH - - export LIBRARY_PATH=$TRAVIS_BUILD_DIR/fftw/lib/:$TRAVIS_BUILD_DIR/hdf5/lib/:$LIBRARY_PATH - # Check fix for OpenMPI version > 2.0 and macOS version > Sierra tmpdir length issue - - echo $TMPDIR || true -# Install Python module dependencies for run_tests.py, utils/athena.py -before_script: - # - if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew upgrade python3 || true; fi - - if [ "$TRAVIS_OS_NAME" == "linux" ]; then pyenv global 3.6; fi - - python3 -m pip install --upgrade --user pip # --user is necessary on C++ builds, since no virtualenv, sudo - - python3 --version; pip3 --version - - "pip3 install --user --only-binary=:all: --no-binary=termcolor numpy flake8 h5py scipy colorama termcolor matplotlib || true" - # h5py needed for outputs/all_outputs.py, pgen/hdf5*, eos/eos_hdf5_table.py tests - # scipy needed in scripts/utils/ for eos/ tests -# Above Build Matrix expansion is assigned to default stage name "test"; -# Run subset of regression test suite on all build environments -script: ./tst/ci/travis/run_tests_travis.sh - -# Specify order of stages; build matrix of regression tests will only run if linters pass -stages: - - python linter - - c++ linter - - test - -# Codecov coverage analysis: (Currently, Travis CI builds do not perform any code coverage analysis) -# Could completely disable this step, since Codecov detects CI status via GitHub Commit Status API, not Bash uploader. Disabled searching for coverage reports. -after_success: - - bash <(curl -s https://codecov.io/bash) -X gcov -X search || echo "Codecov did not collect coverage reports" -notifications: - email: - on_success: change - on_failure: always - slack: - rooms: - secure: lQpuacMeYX8RWntTWyNbcaKfLw6gFIwkWfvnqfdpC/PDqB96R3BmfH2Yi6ZQyUOq+dD/QFGpmqJ0YEGD91hwPCaR9P5LMqhhbAbUC3ON23E3vhm33eynGjq7Y492UrQ1vFMUMAzl6mEi+OoSaKpMNi6OSXBEYs2KfxDlwTMWKbw+9pvGS8ydt8RFcsjofeQOeKWH/x09vTwHqsbwaNB0+GzotcbZQ8PQuT9Lot9OER1qiO1JXWzSce9PrJI1mPBWN094cDK3Na8fzUHq6qsY+G+dgTW45/gJjgO3nRawZd/XrY5iZsDKJ1t8XbC8GbHVxZzMcd+g0VEfaV5c4O8U20xBiWwdw8NmbgZB2sSxVi7wLhqDc6a/8brXx92gIP64AA+UTYXVYykU4/IlQqJs74EgAemTQOEHLO3j8ylK832+XS7JHmio9rjRb3y0meF+uWP5xZ71xBSLQcmvEVAJo5fsrK5SxXHkfvNb2ydjp2i+cUiUPlBXtY1HV7JCTnziqFwQvToA7/Z8/Bw/jaV1p2yQHMXTq0LzqiqNOq8aRiMPkMTwI4Hc6wIHkapfInqHGaqoYRbm9qqbbp6VcHmUjwRdVh0xv87PbHiLtgucV8Lq58isqXaZ42Xr5jJc3dKBx9XbDWWYBTMZgJti5Ye0BI4JR7AMjA67Td2FesG60W0= - on_success: always - on_failure: always diff --git a/README.md b/README.md index d8853eb4af..dd0a45231a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ athena [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4455880.svg)](https://doi.org/10.5281/zenodo.4455880) -[![Travis CI Build Status](https://travis-ci.com/PrincetonUniversity/athena.svg?token=Ejzw3yndG1Fqub679gCB&branch=master)](https://travis-ci.com/PrincetonUniversity/athena) [![codecov](https://codecov.io/gh/PrincetonUniversity/athena/branch/master/graph/badge.svg?token=ZzniY084kP)](https://codecov.io/gh/PrincetonUniversity/athena) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md) diff --git a/tst/ci/travis/install_fftw.sh b/tst/ci/container/install_fftw.sh similarity index 90% rename from tst/ci/travis/install_fftw.sh rename to tst/ci/container/install_fftw.sh index c3967e0940..27bc4f36c9 100755 --- a/tst/ci/travis/install_fftw.sh +++ b/tst/ci/container/install_fftw.sh @@ -4,7 +4,7 @@ # FFTW 3.3.7 = released 2017-10-29 version_str=3.3.8 # for macOS builds, install FFTW from Homebrew -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$OS_NAME" == "osx" ]; then export HOMEBREW_NO_AUTO_UPDATE=1 cd fftw brew link fftw || true @@ -13,7 +13,7 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Using cached FFTW" else echo "Installing FFTW with Homebrew" - HOMEBREW_TEMP=$TRAVIS_BUILD_DIR/fftw + HOMEBREW_TEMP=$BUILD_DIR/fftw # brew update brew install fftw brew unlink fftw @@ -37,7 +37,7 @@ else cd fftw-${version_str} echo "Configuring and building FFTW" # --enable-mpi: not needed, since Plimpton's FFT library is used in Athena++ for MPI+FFT grav - ./configure --prefix=$TRAVIS_BUILD_DIR/fftw &> fftw.configure + ./configure --prefix=$BUILD_DIR/fftw &> fftw.configure # make -j4 &> fftw.make make &> fftw.make make install &> fftw.install diff --git a/tst/ci/travis/install_hdf5.sh b/tst/ci/container/install_hdf5.sh similarity index 92% rename from tst/ci/travis/install_hdf5.sh rename to tst/ci/container/install_hdf5.sh index 3f902a2642..e6bf853a77 100755 --- a/tst/ci/travis/install_hdf5.sh +++ b/tst/ci/container/install_hdf5.sh @@ -6,7 +6,7 @@ # HDF5 1.10.1 = released 2018-08-22 version_str=1.10.4 # for macOS builds, install HDF5 from Homebrew -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$OS_NAME" == "osx" ]; then export HOMEBREW_NO_AUTO_UPDATE=1 cd hdf5 # HDF5 dependencies @@ -18,7 +18,7 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Using cached HDF5" else echo "Installing HDF5 with Homebrew" - HOMEBREW_TEMP=$TRAVIS_BUILD_DIR/hdf5 + HOMEBREW_TEMP=$BUILD_DIR/hdf5 # brew update brew install hdf5 # --with-mpi brew unlink hdf5 @@ -41,7 +41,7 @@ else tar zxf hdf5-${version_str}.tar.gz cd hdf5-${version_str} echo "Configuring and building HDF5" - ./configure --prefix=$TRAVIS_BUILD_DIR/hdf5 &> hdf5.configure + ./configure --prefix=$BUILD_DIR/hdf5 &> hdf5.configure # For parallel MPI build of HDF5 library: # CC=/Users/kfelker/mpich-install/bin/mpicc ./configure --enable-parallel make -j4 &> hdf5.make diff --git a/tst/ci/travis/install_mpich.sh b/tst/ci/container/install_mpich.sh similarity index 97% rename from tst/ci/travis/install_mpich.sh rename to tst/ci/container/install_mpich.sh index d957982c6d..274f69d0b2 100755 --- a/tst/ci/travis/install_mpich.sh +++ b/tst/ci/container/install_mpich.sh @@ -3,7 +3,7 @@ # MPICH 3.2.1 = released 2017-11-10 version_str=3.2.1 # for macOS builds, install MPICH from Homebrew -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$OS_NAME" == "osx" ]; then export HOMEBREW_NO_AUTO_UPDATE=1 cd mpich brew unlink open-mpi || true @@ -21,7 +21,7 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Using cached MPICH" else echo "Installing MPICH with Homebrew" - HOMEBREW_TEMP=$TRAVIS_BUILD_DIR/mpich + HOMEBREW_TEMP=$BUILD_DIR/mpich # There is no libtoolize in macOS system. Homebrew uses "g" prefix ln -s `which glibtoolize` /usr/local/opt/libtool/bin/libtoolize brew install mpich # --HEAD diff --git a/tst/ci/travis/install_openmpi.sh b/tst/ci/container/install_openmpi.sh similarity index 91% rename from tst/ci/travis/install_openmpi.sh rename to tst/ci/container/install_openmpi.sh index e465f7c2b4..3b20ab5c4d 100755 --- a/tst/ci/travis/install_openmpi.sh +++ b/tst/ci/container/install_openmpi.sh @@ -4,7 +4,7 @@ # will need to manually adjust below URL after major version 3.0 version_str=3.0.2 # for macOS builds, install OpenMPI from Homebrew: -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$OS_NAME" == "osx" ]; then export HOMEBREW_NO_AUTO_UPDATE=1 cd openmpi brew unlink mpich || true @@ -23,7 +23,7 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then echo "Using cached OpenMPI" else echo "Installing OpenMPI with Homebrew" - HOMEBREW_TEMP=$TRAVIS_BUILD_DIR/openmpi + HOMEBREW_TEMP=$BUILD_DIR/openmpi # brew update brew install open-mpi #--cc=gcc-7 --build-from-source --without-fortran brew unlink open-mpi @@ -48,7 +48,7 @@ else cd openmpi-${version_str} echo "Configuring and building OpenMPI" # The configure output is not printed to the Travis CI log due to the redirect - ./configure --prefix=$TRAVIS_BUILD_DIR/openmpi &> openmpi.configure # CC=$C_COMPILER CXX=$CXX_COMPILER --without-fortran + ./configure --prefix=$BUILD_DIR/openmpi &> openmpi.configure # CC=$C_COMPILER CXX=$CXX_COMPILER --without-fortran make -j4 &> openmpi.make make install &> openmpi.install cd .. diff --git a/tst/ci/travis/run_tests_travis.sh b/tst/ci/container/run_tests_container.sh similarity index 81% rename from tst/ci/travis/run_tests_travis.sh rename to tst/ci/container/run_tests_container.sh index c14a9ecb93..42b32ed2b6 100755 --- a/tst/ci/travis/run_tests_travis.sh +++ b/tst/ci/container/run_tests_container.sh @@ -1,9 +1,14 @@ #!/bin/bash +# Script originally used for testing on Travis CI osx and Ubuntu containers; +# could be modified to be useful for Docker, Apptainer, etc. containers for testing +OS_NAME=osx #linux, ubuntu +BUILD_DIR=$HOME/build + # Terminate script at first cmd w/ non-zero exit status & echo commands before executing (-v) as lines are read set -ev # -x # for tracing/debugging commands after variable expansion # Do not use "python run_tests.py" to run all tests, so that: -# - Each set/directory of tests are timed separately (although entire script is timed as one unit in Travis CI) +# - Each set/directory of tests are timed separately # - Script fails after first broken set of tests # (Could alternatively group sets of tests with && operator) @@ -11,12 +16,12 @@ set -ev # -x # for tracing/debugging commands after variable expansion cd tst/regression/ if [ "$MPI_CHOICE" == "openmpi" ]; then - PATH=$TRAVIS_BUILD_DIR/openmpi/bin/:$PATH + PATH=$BUILD_DIR/openmpi/bin/:$PATH MPI_OPTS=--oversubscribe # Disable OpenMPI 3.1 vader CMA due to namespace permission issues on Travis CI / Docker containers export OMPI_MCA_btl_vader_single_copy_mechanism=none else - PATH=$TRAVIS_BUILD_DIR/mpich/bin/:$PATH + PATH=$BUILD_DIR/mpich/bin/:$PATH fi # --silent option refers only to stdout of Makefile calls for condensed build logs. Don't use with pgen_compile.py @@ -25,17 +30,18 @@ time python3 run_tests.py pgen/pgen_compile --config=--cxx=$TEMP_CXX -c=--ccmd=$ time python3 run_tests.py pgen/hdf5_reader_serial --config=--cxx=$TEMP_CXX -c=--ccmd=$TEMP_CCMD -v # need to switch serial compiler to Homebrew's GCC instead of /usr/bin/gcc -> Apple Clang for OpenMP functionality -if [ "$TRAVIS_OS_NAME" == "osx" ]; then +if [ "$OS_NAME" == "osx" ]; then time python3 run_tests.py mpi --config=--cxx=$TEMP_CXX -c=--ccmd=$TEMP_CCMD --mpirun_opts=$MPI_OPTS --silent - # TODO(felker): improve selection of 'gcc-9' so when 'brew install gcc' formula instead installs gcc-10, this won't break - export OMPI_CC=/usr/local/bin/gcc-9 - export OMPI_CXX=/usr/local/bin/g++-9 - export MPICH_CC=/usr/local/bin/gcc-9 - export MPICH_CXX=/usr/local/bin/g++-9 - time python3 run_tests.py hybrid --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-9 \ + # TODO(felker): improve selection of 'gcc-14' so when 'brew install gcc' formula instead installs gcc-10, this won't break + # TODO(felker): note, these hardcoded paths were only true for x86_64 macOS systems; arm64 uses /opt/homebrew/bin/gcc-14 + export OMPI_CC=/usr/local/bin/gcc-14 + export OMPI_CXX=/usr/local/bin/g++-14 + export MPICH_CC=/usr/local/bin/gcc-14 + export MPICH_CXX=/usr/local/bin/g++-14 + time python3 run_tests.py hybrid --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-14 \ --config=--mpiccmd='mpicxx -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX' --mpirun_opts=$MPI_OPTS --silent - time python3 run_tests.py omp --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-9 --silent - time python3 run_tests.py grav --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-9 \ + time python3 run_tests.py omp --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-14 --silent + time python3 run_tests.py grav --config=--cxx=g++ --config=--ccmd=/usr/local/bin/g++-14 \ --config=--mpiccmd='mpicxx -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX' --mpirun_opts=$MPI_OPTS --silent # requires FFTW library else export OMPI_CC=$TEMP_CCMD