Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Features
- ADIOS2: support added (v2.4.0+) #482 #513 #530 #568
- HDF5: add ``OPENPMD_HDF5_INDEPENDENT`` for non-collective parallel I/O #576
- Python: support empty datasets via ``Record_Component.make_empty`` #538
- pkg-config: add ``static`` variable (``true``/``false``) to ``openPMD.pc`` package #580

Bug Fixes
"""""""""
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ elseif(openPMD_USE_PYTHON)
set(openPMD_HAVE_PYTHON TRUE)
message(STATUS "pybind11: Using INTERNAL version 2.3.0")
else()
find_package(pybind11 2.3.0 CONFIG REQUIRED)
find_package(pybind11 2.3.0 REQUIRED CONFIG)
set(openPMD_HAVE_PYTHON TRUE)
message(STATUS "pybind11: Found version ${pybind11_VERSION}")
endif()
Expand Down Expand Up @@ -402,7 +402,7 @@ if(BUILD_TESTING)
)
message(STATUS "Catch2: Using INTERNAL version 2.6.1")
else()
find_package(Catch2 2.6.1 CONFIG REQUIRED)
find_package(Catch2 2.6.1 REQUIRED CONFIG)
target_link_libraries(openPMD::thirdparty::Catch2
INTERFACE Catch2::Catch2)
message(STATUS "Catch2: Found version ${Catch2_VERSION}")
Expand Down Expand Up @@ -762,6 +762,11 @@ endfunction()

if(openPMD_HAVE_PKGCONFIG)
openpmdreclibs(openPMD openPMD_PC_PRIVATE_LIBS)
if(BUILD_SHARED_LIBS)
set(openPMD_PC_STATIC false)
else()
set(openPMD_PC_STATIC true)
endif()
configure_file(
${openPMD_SOURCE_DIR}/openPMD.pc.in
${openPMD_BINARY_DIR}/openPMD.pc
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export CMAKE_PREFIX_PATH=$HOME/somepath:$CMAKE_PREFIX_PATH
Use the following lines in your project's `CMakeLists.txt`:
```cmake
# supports: COMPONENTS MPI NOMPI JSON HDF5 ADIOS1 ADIOS2
find_package(openPMD 0.1.0 CONFIG)
find_package(openPMD 0.9.0 CONFIG)

if(openPMD_FOUND)
target_link_libraries(YourTarget PRIVATE openPMD::openPMD)
Expand All @@ -286,12 +286,16 @@ export PKG_CONFIG_PATH=$HOME/somepath/lib/pkgconfig:$PKG_CONFIG_PATH

Additional linker and compiler flags for your project are available via:
```bash
pkg-config --libs openPMD
# -L${HOME}/somepath/lib -lopenPMD

# if you build openPMD-api as static library with BUILD_SHARED_LIBS=OFF
pkg-config --libs --static openPMD
# -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lopenPMD -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so /usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so
# switch to check if openPMD-api was build as static library
# (via BUILD_SHARED_LIBS=OFF) or as shared library (default)
if [ "$(pkg-config --variable=static openPMD)" == "true" ]
then
pkg-config --libs --static openPMD
# -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lopenPMD -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so /usr/lib/x86_64-linux-gnu/hdf5/openmpi/libhdf5.so /usr/lib/x86_64-linux-gnu/libsz.so /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so -pthread /usr/lib/libmpi.so -pthread /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so /usr/lib/libmpi.so
else
pkg-config --libs openPMD
# -L${HOME}/somepath/lib -lopenPMD
fi

pkg-config --cflags openPMD
# -I${HOME}/somepath/include
Expand Down
1 change: 1 addition & 0 deletions openPMD.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}/@CMAKE_INSTALL_BINDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
static=@openPMD_PC_STATIC@

Name: openPMD
Description: C++ & Python API for Scientific I/O with openPMD.
Expand Down
4 changes: 4 additions & 0 deletions openPMDConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

# locate the installed FindADIOS.cmake module for ADIOS1
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/Modules")

# required dependency: mpark-variant
add_library(openPMD::thirdparty::mpark_variant INTERFACE IMPORTED)
set(openPMD_USE_INTERNAL_VARIANT @openPMD_USE_INTERNAL_VARIANT@)
if(NOT openPMD_USE_INTERNAL_VARIANT)
Expand All @@ -18,6 +20,7 @@ if(NOT openPMD_USE_INTERNAL_VARIANT)
INTERFACE mpark_variant)
endif()

# optional dependencies
set(openPMD_HAVE_MPI @openPMD_HAVE_MPI@)
if(openPMD_HAVE_MPI)
find_dependency(MPI)
Expand Down Expand Up @@ -49,6 +52,7 @@ if(openPMD_HAVE_ADIOS2)
endif()
set(openPMD_ADIOS2_FOUND ${openPMD_HAVE_ADIOS2})

# define central openPMD::openPMD target
include("${CMAKE_CURRENT_LIST_DIR}/openPMDTargets.cmake")

# check if components are fulfilled and set openPMD_<COMPONENT>_FOUND vars
Expand Down