aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.github/workflows/ubuntu.yml21
-rw-r--r--CMakeLists.txt76
-rw-r--r--Source/FieldSolver/SpectralSolver/CMakeLists.txt6
-rw-r--r--Source/Utils/CMakeLists.txt6
-rw-r--r--cmake/WarpXFunctions.cmake2
-rw-r--r--cmake/dependencies/FFT.cmake8
6 files changed, 78 insertions, 41 deletions
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index bc7505c5d..d640f1bc7 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -34,6 +34,27 @@ jobs:
-DWarpX_QED=OFF
cmake --build build_RZ -j 2
+ build_gcc_ablastr:
+ name: GCC ABLASTR w/o MPI
+ runs-on: ubuntu-20.04
+ if: github.event.pull_request.draft == false
+ env:
+ CMAKE_GENERATOR: Ninja
+ CXXFLAGS: "-Werror"
+ steps:
+ - uses: actions/checkout@v2
+ - name: install dependencies
+ run: |
+ .github/workflows/dependencies/gcc.sh
+ sudo apt-get install -y libopenmpi-dev openmpi-bin
+ - name: build WarpX
+ run: |
+ cmake -S . -B build \
+ -DCMAKE_VERBOSE_MAKEFILE=ON \
+ -DWarpX_APP=OFF \
+ -DWarpX_LIB=OFF
+ cmake --build build -j 2
+
build_pyfull:
name: Clang pywarpx
runs-on: ubuntu-20.04
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3922dbdcb..489eb9acc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,7 +116,7 @@ option(WarpX_IPO "Compile WarpX with interprocedu
# builds AMReX from source (default) or finds an existing install
include(${WarpX_SOURCE_DIR}/cmake/dependencies/AMReX.cmake)
# suppress warnings in AMReX headers (use -isystem instead of -I)
-make_third_party_includes_system(AMReX::amrex AMReX)
+warpx_make_third_party_includes_system(AMReX::amrex AMReX)
# PICSAR
# builds PICSAR from source
@@ -140,14 +140,14 @@ endif()
# Targets #####################################################################
#
-if(NOT WarpX_APP AND NOT WarpX_LIB)
- message(FATAL_ERROR "Need to build at least WarpX app or "
- "library/Python bindings")
-endif()
-
# collect all objects for compilation
add_library(WarpX OBJECT)
-set(_ALL_TARGETS WarpX)
+add_library(ablastr OBJECT)
+
+# ABLASTR library
+set(_BUILDINFO_SRC ablastr)
+set(_ALL_TARGETS WarpX ablastr)
+add_library(WarpX::ablastr ALIAS ablastr)
# executable application
# note: we currently avoid a dependency on a core library
@@ -155,7 +155,7 @@ set(_ALL_TARGETS WarpX)
if(WarpX_APP)
add_executable(app)
add_executable(WarpX::app ALIAS app)
- target_link_libraries(app PRIVATE WarpX)
+ target_link_libraries(app PRIVATE WarpX ablastr)
set(_BUILDINFO_SRC app)
list(APPEND _ALL_TARGETS app)
endif()
@@ -164,11 +164,11 @@ endif()
if(WarpX_LIB)
add_library(shared MODULE)
add_library(WarpX::shared ALIAS shared)
- target_link_libraries(shared PUBLIC WarpX)
+ target_link_libraries(shared PUBLIC WarpX ablastr)
set(_BUILDINFO_SRC shared)
list(APPEND _ALL_TARGETS shared)
- set_target_properties(WarpX shared PROPERTIES
+ set_target_properties(WarpX ablastr shared PROPERTIES
POSITION_INDEPENDENT_CODE ON
WINDOWS_EXPORT_ALL_SYMBOLS ON
)
@@ -178,6 +178,10 @@ endif()
target_include_directories(WarpX PUBLIC
$<BUILD_INTERFACE:${WarpX_SOURCE_DIR}/Source>
)
+target_include_directories(ablastr PUBLIC
+ # future: own directory root
+ $<BUILD_INTERFACE:${WarpX_SOURCE_DIR}/Source>
+)
# if we include <AMReX_buildInfo.H> we will need to call:
include(AMReXBuildInfo)
@@ -219,32 +223,32 @@ if(WarpX_IPO)
endif()
# link dependencies
-target_link_libraries(WarpX PUBLIC WarpX::thirdparty::AMReX)
+target_link_libraries(ablastr PUBLIC WarpX::thirdparty::AMReX)
+target_link_libraries(WarpX PUBLIC ablastr)
if(WarpX_PSATD)
- target_link_libraries(WarpX PUBLIC WarpX::thirdparty::FFT)
+ target_link_libraries(ablastr PUBLIC WarpX::thirdparty::FFT)
if(WarpX_DIMS STREQUAL RZ)
- target_link_libraries(WarpX PUBLIC blaspp)
- target_link_libraries(WarpX PUBLIC lapackpp)
+ target_link_libraries(ablastr PUBLIC blaspp)
+ target_link_libraries(ablastr PUBLIC lapackpp)
endif()
endif()
if(WarpX_OPENPMD)
- target_compile_definitions(WarpX PUBLIC WARPX_USE_OPENPMD)
- target_link_libraries(WarpX PUBLIC openPMD::openPMD)
+ target_compile_definitions(ablastr PUBLIC WARPX_USE_OPENPMD)
+ target_link_libraries(ablastr PUBLIC openPMD::openPMD)
endif()
if(WarpX_QED)
- target_compile_definitions(WarpX PUBLIC WARPX_QED)
+ target_compile_definitions(ablastr PUBLIC WARPX_QED)
if(WarpX_QED_TABLE_GEN)
- target_compile_definitions(WarpX PUBLIC WARPX_QED_TABLE_GEN)
+ target_compile_definitions(ablastr PUBLIC WARPX_QED_TABLE_GEN)
endif()
- target_link_libraries(WarpX PUBLIC PXRMP_QED::PXRMP_QED)
+ target_link_libraries(ablastr PUBLIC PXRMP_QED::PXRMP_QED)
endif()
# AMReX helper function: propagate CUDA specific target & source properties
if(WarpX_COMPUTE STREQUAL CUDA)
- setup_target_for_cuda_compilation(WarpX)
foreach(warpx_tgt IN LISTS _ALL_TARGETS)
setup_target_for_cuda_compilation(${warpx_tgt})
endforeach()
@@ -257,6 +261,14 @@ if(WarpX_COMPUTE STREQUAL CUDA)
)
endif()
+# avoid building all object files if we are only used as ABLASTR library
+if(NOT WarpX_APP AND NOT WarpX_LIB)
+ set_target_properties(WarpX PROPERTIES
+ EXCLUDE_FROM_ALL 1
+ EXCLUDE_FROM_DEFAULT_BUILD 1
+ )
+endif()
+
# fancy binary name for build variants
set_warpx_binary_name()
@@ -264,43 +276,43 @@ set_warpx_binary_name()
# Defines #####################################################################
#
get_source_version(WarpX ${CMAKE_CURRENT_SOURCE_DIR})
-target_compile_definitions(WarpX PUBLIC WARPX_GIT_VERSION="${WarpX_GIT_VERSION}")
+target_compile_definitions(ablastr PUBLIC WARPX_GIT_VERSION="${WarpX_GIT_VERSION}")
if(WarpX_QED)
- target_compile_definitions(WarpX PUBLIC PICSAR_GIT_VERSION="${PXRMP_QED_GIT_VERSION}")
+ target_compile_definitions(ablastr PUBLIC PICSAR_GIT_VERSION="${PXRMP_QED_GIT_VERSION}")
endif()
if(WarpX_DIMS STREQUAL 3)
- target_compile_definitions(WarpX PUBLIC WARPX_DIM_3D WARPX_ZINDEX=2)
+ target_compile_definitions(ablastr PUBLIC WARPX_DIM_3D WARPX_ZINDEX=2)
elseif(WarpX_DIMS STREQUAL 2)
- target_compile_definitions(WarpX PUBLIC WARPX_DIM_XZ WARPX_ZINDEX=1)
+ target_compile_definitions(ablastr PUBLIC WARPX_DIM_XZ WARPX_ZINDEX=1)
elseif(WarpX_DIMS STREQUAL 1)
- target_compile_definitions(WarpX PUBLIC WARPX_DIM_1D_Z WARPX_ZINDEX=0)
+ target_compile_definitions(ablastr PUBLIC WARPX_DIM_1D_Z WARPX_ZINDEX=0)
elseif(WarpX_DIMS STREQUAL RZ)
- target_compile_definitions(WarpX PUBLIC WARPX_DIM_RZ WARPX_ZINDEX=1)
+ target_compile_definitions(ablastr PUBLIC WARPX_DIM_RZ WARPX_ZINDEX=1)
endif()
if(WarpX_GPUCLOCK)
- target_compile_definitions(WarpX PUBLIC WARPX_USE_GPUCLOCK)
+ target_compile_definitions(ablastr PUBLIC WARPX_USE_GPUCLOCK)
endif()
if(WarpX_OPENPMD)
- target_compile_definitions(WarpX PUBLIC WARPX_USE_OPENPMD)
+ target_compile_definitions(ablastr PUBLIC WARPX_USE_OPENPMD)
endif()
if(WarpX_QED)
- target_compile_definitions(WarpX PUBLIC WARPX_QED)
+ target_compile_definitions(ablastr PUBLIC WARPX_QED)
if(WarpX_QED_TABLE_GEN)
- target_compile_definitions(WarpX PUBLIC WarpX_QED_TABLE_GEN)
+ target_compile_definitions(ablastr PUBLIC WarpX_QED_TABLE_GEN)
endif()
endif()
if(WarpX_PSATD)
- target_compile_definitions(WarpX PUBLIC WARPX_USE_PSATD)
+ target_compile_definitions(ablastr PUBLIC WARPX_USE_PSATD)
endif()
# <cmath>: M_PI
if(WIN32)
- target_compile_definitions(WarpX PRIVATE _USE_MATH_DEFINES)
+ target_compile_definitions(ablastr PUBLIC _USE_MATH_DEFINES)
endif()
diff --git a/Source/FieldSolver/SpectralSolver/CMakeLists.txt b/Source/FieldSolver/SpectralSolver/CMakeLists.txt
index ab66d5d7e..39e8e86a4 100644
--- a/Source/FieldSolver/SpectralSolver/CMakeLists.txt
+++ b/Source/FieldSolver/SpectralSolver/CMakeLists.txt
@@ -6,11 +6,11 @@ target_sources(WarpX
)
if(WarpX_COMPUTE STREQUAL CUDA)
- target_sources(WarpX PRIVATE WrapCuFFT.cpp)
+ target_sources(ablastr PRIVATE WrapCuFFT.cpp)
elseif(WarpX_COMPUTE STREQUAL HIP)
- target_sources(WarpX PRIVATE WrapRocFFT.cpp)
+ target_sources(ablastr PRIVATE WrapRocFFT.cpp)
else()
- target_sources(WarpX PRIVATE WrapFFTW.cpp)
+ target_sources(ablastr PRIVATE WrapFFTW.cpp)
endif()
if(WarpX_DIMS STREQUAL RZ)
diff --git a/Source/Utils/CMakeLists.txt b/Source/Utils/CMakeLists.txt
index 26982fb91..3f5c46411 100644
--- a/Source/Utils/CMakeLists.txt
+++ b/Source/Utils/CMakeLists.txt
@@ -4,7 +4,6 @@ target_sources(WarpX
CoarsenMR.cpp
Interpolate.cpp
IntervalsParser.cpp
- MPIInitHelpers.cpp
ParticleUtils.cpp
RelativeCellPosition.cpp
WarnManager.cpp
@@ -15,3 +14,8 @@ target_sources(WarpX
)
add_subdirectory(MsgLogger)
+
+target_sources(ablastr
+ PRIVATE
+ MPIInitHelpers.cpp
+)
diff --git a/cmake/WarpXFunctions.cmake b/cmake/WarpXFunctions.cmake
index bbf7fb86e..7db6c3bda 100644
--- a/cmake/WarpXFunctions.cmake
+++ b/cmake/WarpXFunctions.cmake
@@ -158,7 +158,7 @@ endfunction()
# Take an <imported_target> and expose it as INTERFACE target with
# WarpX::thirdparty::<propagated_name> naming and SYSTEM includes.
#
-function(make_third_party_includes_system imported_target propagated_name)
+function(warpx_make_third_party_includes_system imported_target propagated_name)
add_library(WarpX::thirdparty::${propagated_name} INTERFACE IMPORTED)
target_link_libraries(WarpX::thirdparty::${propagated_name} INTERFACE ${imported_target})
diff --git a/cmake/dependencies/FFT.cmake b/cmake/dependencies/FFT.cmake
index 404a3f011..56dc396b3 100644
--- a/cmake/dependencies/FFT.cmake
+++ b/cmake/dependencies/FFT.cmake
@@ -103,14 +103,14 @@ if(WarpX_PSATD)
# create an IMPORTED target: WarpX::thirdparty::FFT
if(WarpX_COMPUTE STREQUAL CUDA)
# CUDA_ADD_CUFFT_TO_TARGET(WarpX::thirdparty::FFT)
- make_third_party_includes_system(cufft FFT)
+ warpx_make_third_party_includes_system(cufft FFT)
elseif(WarpX_COMPUTE STREQUAL HIP)
- make_third_party_includes_system(roc::rocfft FFT)
+ warpx_make_third_party_includes_system(roc::rocfft FFT)
else()
if(WarpX_FFTW_SEARCH STREQUAL CMAKE)
- make_third_party_includes_system(FFTW3::fftw3${HFFTWp} FFT)
+ warpx_make_third_party_includes_system(FFTW3::fftw3${HFFTWp} FFT)
else()
- make_third_party_includes_system(PkgConfig::fftw3${HFFTWp} FFT)
+ warpx_make_third_party_includes_system(PkgConfig::fftw3${HFFTWp} FFT)
endif()
if(WarpX_COMPUTE STREQUAL OMP)
if(WarpX_FFTW_IGNORE_OMP)