Skip to content

Commit

Permalink
Merge branch 'main' into build-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Georgia Stuart <gstuart@umass.edu>
  • Loading branch information
georgiastuart committed Sep 5, 2024
2 parents 191aa5d + 9e0e023 commit badc8b2
Show file tree
Hide file tree
Showing 245 changed files with 12,575 additions and 25,828 deletions.
122 changes: 16 additions & 106 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: "Test Builds"
name: "Build and Test"

on:
push:
branches:
- main
- '*'
pull_request:
branches:
- main
- devel
jobs:
pyexp:
exp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
cc: [gcc, mpicc]
os: [ubuntu-latest]
cc: [gcc]

name: "Test pyEXP Build"
runs-on: ${{ matrix.os }}
Expand All @@ -25,127 +26,36 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
sudo pip install numpy
- name: Setup submodule and build
run: |
git submodule update --init --recursive
mkdir -p build/install
- name: Compile pyEXP - Linux
- name: Compile EXP
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=NO
-DENABLE_NBODY=YES
-DENABLE_PYEXP=YES
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile pyEXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=NO
-DENABLE_PYEXP=YES
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
- name: Make
working-directory: ./build
run: make -j 2

# -----------------------------------------------------------------------------------

exp:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
cc: [gcc, mpicc]

name: "Test Full EXP Build"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install core dependencies - ubuntu
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential libeigen3-dev libfftw3-dev libhdf5-dev libopenmpi-dev
- name: Install core dependencies - mac
if: startsWith(matrix.os, 'mac')
run: |
brew update
brew reinstall gcc
brew install eigen fftw hdf5 open-mpi libomp
- name: Setup submodule and build
run: |
git submodule update --init --recursive
mkdir -p build/install
- name: Compile Full EXP - Linux
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=YES
-DENABLE_PYEXP=NO
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/include/eigen3/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-Wno-dev
..
# Note for future: The homebrew paths are for intel only. Once ARM macs are
# supported in here, we'll need to update to /opt/homebrew/... instead
- name: Compile Full EXP - Mac
if: startsWith(matrix.os, 'mac')
env:
CC: ${{ matrix.cc }}
LDFLAGS: -L/usr/local/opt/libomp/lib
CPPFLAGS: -I/usr/local/opt/libomp/include
working-directory: ./build
run: >-
cmake
-DENABLE_NBODY=YES
-DENABLE_PYEXP=NO
-DCMAKE_BUILD_TYPE=Release
-DEigen3_DIR=/usr/local/share/eigen3/cmake
-DCMAKE_INSTALL_PREFIX=./install
-DOpenMP_CXX_INCLUDE_DIR=/usr/local/opt/libomp/include
-DOpenMP_C_INCLUDE_DIR=/usr/local/opt/libomp/include
-Wno-dev
..
run: make -j 4

- name: Make
- name: CTest Quick
working-directory: ./build
run: make -j 2
run: ctest -L quick

#- name: CTest Long
#working-directory: ./build
#run: ctest -L long
28 changes: 18 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.21) # Needed for CUDA, MPI, and CTest features

project(
EXP
VERSION "7.7.28"
VERSION "7.7.99"
HOMEPAGE_URL https://github.com/EXP-code/EXP
LANGUAGES C CXX Fortran)

Expand Down Expand Up @@ -89,7 +89,6 @@ set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
# Package support

find_package(MPI REQUIRED COMPONENTS C CXX)
find_package(Boost COMPONENTS serialization)
find_package(OpenMP)
find_package(FFTW)
find_package(HDF5 COMPONENTS C CXX HL REQUIRED)
Expand Down Expand Up @@ -178,12 +177,6 @@ endif()
if(PNG_FOUND AND ENABLE_PNG)
set(HAVE_LIBPNGPP TRUE)
endif()
if(ENABLE_DSMC)
if(NOT BOOST_FOUND)
message(SEND_ERROR "You need Boost to compile DSMC")
endif()
set(DSMC_ENABLED 1)
endif()
if(ENABLE_CUDA_SINGLE)
add_compile_definitions(O_SINGLE=1)
endif()
Expand Down Expand Up @@ -224,6 +217,19 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Git submodule updates
execute_process(
COMMAND git submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT
)

if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init --recursive failed ${GIT_SUBMOD_RESULT}, please checkout submodules")
else()
message(STATUS "Submodules updated successfully - good")
endif()

# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git rev-parse HEAD
Expand Down Expand Up @@ -260,11 +266,12 @@ endif()
# Set options for the HighFive git submodule in extern
set(HIGHFIVE_EXAMPLES OFF CACHE BOOL "Do not build the examples")
set(HIGHFIVE_BUILD_DOCS OFF CACHE BOOL "Do not build the documentation")
set(HIGHFIVE_USE_BOOST OFF CACHE BOOL "Do not use Boost in HighFIve")
set(HIGHFIVE_USE_BOOST OFF CACHE BOOL "Do not use Boost in HighFive")
set(HIGHFIVE_UNIT_TESTS OFF CACHE BOOL "Turn off internal testing for HighFIve")
set(H5_USE_EIGEN TRUE CACHE BOOL "Eigen3 support in HighFive")

if (USE_SUBMODULES)
add_subdirectory(extern/HighFive)
add_subdirectory(extern/HighFive EXCLUDE_FROM_ALL)
else ()
find_package(HighFive REQUIRED)
endif()
Expand All @@ -273,6 +280,7 @@ endif()
if (BUILD_COMMON_LIBRARIES)
add_subdirectory(exputil)
add_subdirectory(coefs)
add_subdirectory(expui)
endif()

if (ENABLE_NBODY)
Expand Down
Loading

0 comments on commit badc8b2

Please sign in to comment.