Skip to content

Commit

Permalink
bond-refactoring: resolve merge conflict with python branch
Browse files Browse the repository at this point in the history
  • Loading branch information
biermanncarl committed Mar 19, 2021
2 parents 7c44435 + a20d99b commit bcefbc8
Show file tree
Hide file tree
Showing 221 changed files with 5,804 additions and 5,403 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Checks: |
clang-diagnostic-*,
clang-analyzer-*,
-clang-analyzer-core.NullDereference,
-clang-analyzer-core.uninitialized.UndefReturn,
-clang-analyzer-optin.mpi.MPI-Checker,
-clang-analyzer-security.FloatLoopCounter,
bugprone-*,
Expand Down
31 changes: 31 additions & 0 deletions .github/actions/build_and_check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'Build and check'
description: 'Build espresso and run checks'
inputs:
asan: # id of input
description: 'Whether to build with address sanitizer'
required: true
default: 'false'
ubsan:
description: 'Whether to build with undefined behavior sanitizer'
required: true
default: 'false'
check_skip_long: # id of input
description: 'Whether to skip long python tests'
required: true
default: 'false'
runs:
using: "composite"
steps:
- run: |
brew install boost boost-mpi fftw
brew install hdf5-mpi
pip3 install numpy cython h5py scipy
shell: bash
- run: |
export myconfig=maxset with_cuda=false test_timeout=600 with_asan=${{ inputs.asan }} with_ubsan=${{ inputs.ubsan }} check_skip_long=${{ inputs.check_skip_long }}
bash maintainer/CI/build_cmake.sh
shell: bash
# This is a workaround for the unfortunate interaction of MacOS and OpenMPI 4
# See https://github.com/open-mpi/ompi/issues/6518
env:
OMPI_MCA_btl: "self,tcp"
21 changes: 0 additions & 21 deletions .github/workflows/build.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/push_pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: run tests on mac

on:
push:
pull_request:
schedule:
- cron: '0 3 * * *'

jobs:
regular_check:
runs-on: macos-latest
if: github.event_name != 'schedule'
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Check without sanitizer
uses: ./.github/actions/build_and_check
with:
asan: false
ubsan: false
check_skip_long: false

sanitizer_check:
runs-on: macos-latest
if: github.event_name == 'schedule'
steps:
- name: Checkout
uses: actions/checkout@main
- name: Setup Python environment
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Check with sanitizer
uses: ./.github/actions/build_and_check
with:
asan: true
ubsan: true
check_skip_long: true
- name: Setting job link variable
if: ${{ failure() }}
run: |
echo "job_link=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_ENV
- uses: alialaa/issue-action@v1
if: ${{ failure() }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: Scheduled CI job has failed
body: ${{ env.job_link }}
4 changes: 3 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:e583d4b2eb8eedd10068957f952bd67008475ee5
image: docker.pkg.github.com/espressomd/docker/ubuntu-20.04:063f945eb434f6900402fd412f28a4486288c82b

stages:
- prepare
Expand Down Expand Up @@ -100,6 +100,7 @@ maxset:
with_scafacos: 'true'
with_stokesian_dynamics: 'true'
check_skip_long: 'true'
cmake_params: '-DTEST_NP=8'
script:
- bash maintainer/CI/build_cmake.sh
tags:
Expand Down Expand Up @@ -130,6 +131,7 @@ ubuntu:wo-dependencies:
variables:
myconfig: 'maxset'
with_cuda: 'false'
with_hdf5: 'false'
make_check_unit_tests: 'false'
make_check_python: 'false'
script:
Expand Down
86 changes: 30 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ include(FeatureSummary)
include(GNUInstallDirs)
project(ESPResSo)
include(option_enum)
include(option_if_available)
if(POLICY CMP0074)
# make find_package() use <PackageName>_ROOT variables
cmake_policy(SET CMP0074 NEW)
Expand Down Expand Up @@ -69,12 +68,12 @@ set(CMAKE_FIND_FRAMEWORK LAST)
# ##############################################################################

option(WITH_PYTHON "Build with Python bindings" ON)
option_if_available(WITH_GSL "Build with GSL support" ON)
option(WITH_GSL "Build with GSL support" OFF)
option(WITH_CUDA "Build with GPU support" OFF)
option_if_available(WITH_HDF5 "Build with HDF5 support" ON)
option(WITH_HDF5 "Build with HDF5 support" OFF)
option(WITH_TESTS "Enable tests" ON)
option_if_available(WITH_SCAFACOS "Build with ScaFaCoS support" OFF)
option_if_available(WITH_STOKESIAN_DYNAMICS "Build with Stokesian Dynamics" ON)
option(WITH_SCAFACOS "Build with ScaFaCoS support" OFF)
option(WITH_STOKESIAN_DYNAMICS "Build with Stokesian Dynamics" OFF)
option(WITH_BENCHMARKS "Enable benchmarks" OFF)
option(WITH_VALGRIND_INSTRUMENTATION
"Build with valgrind instrumentation markers" OFF)
Expand Down Expand Up @@ -192,25 +191,16 @@ if(WITH_HDF5)
# who are not familiar with the way hdf5 is distributed in Linux package
# repositories (libhdf5-dev is the serial version).
set(HDF5_PREFER_PARALLEL 1)
find_package(HDF5 "1.8" COMPONENTS C)
find_package(HDF5 "1.8" REQUIRED COMPONENTS C)
if(HDF5_FOUND)
if(HDF5_IS_PARALLEL)
set(H5MD 1)
add_feature_info(HDF5 ON "parallel")
else()
unset(H5MD)
set(HDF5_FOUND FALSE)
if(NOT WITH_HDF5_IS_DEFAULT_VALUE)
message(
FATAL_ERROR
"Optional dependency HDF5 explicitly requested, but parallel version not found."
)
endif()
message(FATAL_ERROR "HDF5 parallel version not found.")
endif(HDF5_IS_PARALLEL)
elseif(NOT WITH_HDF5_IS_DEFAULT_VALUE)
message(
FATAL_ERROR
"Optional dependency HDF5 explicitly requested, but not found.")
endif(HDF5_FOUND)
endif(WITH_HDF5)

Expand All @@ -231,50 +221,24 @@ if(WITH_HDF5 AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
endif()

if(WITH_SCAFACOS)
find_package(PkgConfig)
pkg_check_modules(SCAFACOS scafacos)
find_package(PkgConfig REQUIRED)
pkg_check_modules(SCAFACOS scafacos REQUIRED)
if(SCAFACOS_FOUND)
set(SCAFACOS 1)
elseif(NOT WITH_SCAFACOS_IS_DEFAULT_VALUE)
message(
FATAL_ERROR
"Optional dependency ScaFaCoS explicitly requested, but not found.")
endif(SCAFACOS_FOUND)
endif(WITH_SCAFACOS)

if(WITH_GSL)
find_package(GSL REQUIRED)
else()
find_package(GSL)
if(GSL_FOUND)
set(GSL 1)
elseif(NOT WITH_GSL_IS_DEFAULT_VALUE)
message(
FATAL_ERROR "Optional dependency GSL explicitly requested, but not found."
)
endif(GSL_FOUND)
endif(WITH_GSL)

find_package(BLAS)
if(BLAS_FOUND)
set(BLAS 1)
endif()
find_package(LAPACK)
if(LAPACK_FOUND)
set(LAPACK 1)
endif()
if(GSL_FOUND)
set(GSL 1)
endif(GSL_FOUND)

if(WITH_STOKESIAN_DYNAMICS)
if(BLAS AND LAPACK)
set(STOKESIAN_DYNAMICS 1)
endif()
if(NOT STOKESIAN_DYNAMICS AND NOT WITH_STOKESIAN_DYNAMICS_IS_DEFAULT_VALUE)
message(
FATAL_ERROR
"Optional feature Stokesian Dynamics explicitly requested, but dependencies not found."
)
endif()
endif(WITH_STOKESIAN_DYNAMICS)

if(STOKESIAN_DYNAMICS)
set(CMAKE_INSTALL_LIBDIR
"${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTDIR}/espressomd")
include(FetchContent)
Expand All @@ -283,16 +247,17 @@ if(STOKESIAN_DYNAMICS)
GIT_REPOSITORY https://github.com/hmenke/espresso-stokesian-dynamics.git
GIT_TAG c14e57655e929)
FetchContent_GetProperties(stokesian_dynamics)
set(STOKESIAN_DYNAMICS 1)
if(NOT stokesian_dynamics_POPULATED)
FetchContent_Populate(stokesian_dynamics)
add_subdirectory(${stokesian_dynamics_SOURCE_DIR}
${stokesian_dynamics_BINARY_DIR})
endif()
endif(STOKESIAN_DYNAMICS)
endif(WITH_STOKESIAN_DYNAMICS)

if(WITH_VALGRIND_INSTRUMENTATION)
find_package(PkgConfig)
pkg_check_modules(VALGRIND valgrind)
find_package(PkgConfig REQUIRED)
pkg_check_modules(VALGRIND valgrind REQUIRED)
if(VALGRIND_FOUND)
set(VALGRIND_INSTRUMENTATION 1)
message(STATUS ${VALGRIND_INCLUDE_DIRS})
Expand All @@ -306,9 +271,9 @@ endif(WITH_VALGRIND_INSTRUMENTATION)

find_package(MPI 3.0 REQUIRED)

# ##############################################################################
#
# Boost
# ##############################################################################
#

list(APPEND BOOST_COMPONENTS mpi serialization filesystem system)

Expand Down Expand Up @@ -423,6 +388,10 @@ target_compile_options(

set(CMAKE_MACOSX_RPATH TRUE)

#
# Sanitizers
#

if(WITH_ASAN AND WITH_MSAN)
message(
FATAL_ERROR
Expand All @@ -448,14 +417,18 @@ endif()
target_link_libraries(cxx_interface INTERFACE coverage_interface)

#
# Testing
# ##############################################################################
# Static analysis
#

if(WITH_CLANG_TIDY)
find_package(ClangTidy "${CMAKE_CXX_COMPILER_VERSION}" EXACT REQUIRED)
set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--extra-arg=--cuda-host-only")
endif()

#
# Testing
#

if(WITH_TESTS)
enable_testing()
add_custom_target(check)
Expand All @@ -480,6 +453,7 @@ endif(WITH_BENCHMARKS)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(libs)

#
# Feature summary
#
Expand Down
1 change: 0 additions & 1 deletion cmake/FindCUDACompilerClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ function(find_gpu_library)
endif()
endfunction(find_gpu_library)

find_gpu_library(VARNAME CUDA_LIBRARY NAMES cuda REQUIRED)
find_gpu_library(VARNAME CUDART_LIBRARY NAMES cudart REQUIRED)
find_gpu_library(VARNAME CUFFT_LIBRARY NAMES cufft REQUIRED)

Expand Down
1 change: 0 additions & 1 deletion cmake/FindCUDACompilerNVCC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ function(find_gpu_library)
endif()
endfunction(find_gpu_library)

find_gpu_library(VARNAME CUDA_LIBRARY NAMES cuda REQUIRED)
find_gpu_library(VARNAME CUDART_LIBRARY NAMES cudart REQUIRED)
find_gpu_library(VARNAME CUDA_CUFFT_LIBRARIES NAMES cufft REQUIRED)

Expand Down
41 changes: 0 additions & 41 deletions cmake/option_if_available.cmake

This file was deleted.

Loading

0 comments on commit bcefbc8

Please sign in to comment.