Skip to content

Commit

Permalink
Merge pull request svenreiche#184 from ZeugAusHH/cl_20240706__version…
Browse files Browse the repository at this point in the history
…infos2

debug switch --dbg-versions now also displays used version of FFTW library
  • Loading branch information
svenreiche authored Jul 15, 2024
2 parents dd9c831 + c836d58 commit dd30e5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:$ENV{FFTW_ROOT}/lib/pkgconfig/")
pkg_check_modules(FFTW QUIET fftw3 IMPORTED_TARGET)
if (TARGET PkgConfig::FFTW)
message(STATUS "FFTW found")
message(STATUS "Version: ${FFTW_VERSION}")
list(APPEND _libraries PkgConfig::FFTW)
include_directories(PkgConfig::FFTW)
else()
Expand Down Expand Up @@ -181,12 +182,6 @@ target_include_directories(genesis13
)


# add optional macro definitions
if (TARGET PkgConfig::FFTW)
message(STATUS "Defining the macro FFTW in the source code")
target_compile_definitions(genesis13 PRIVATE FFTW=1)
endif()

if(USE_DPI)
target_compile_definitions(genesis13 PRIVATE USE_DPI)
endif()
Expand All @@ -198,6 +193,13 @@ add_executable(genesis4 src/Main/mainwrap.cpp)

target_link_libraries(genesis4 genesis13 ${_libraries})

# add optional macro definitions
if (TARGET PkgConfig::FFTW)
message(STATUS "Defining the macro FFTW in the source code")
target_compile_definitions(genesis13 PRIVATE FFTW=1)
target_compile_definitions(genesis4 PRIVATE FFTW=1)
endif()

# Compilation of plugin testbench only when plugin system is requested
if(USE_DPI)
add_subdirectory(misc/plugin_testbench)
Expand Down
7 changes: 7 additions & 0 deletions src/Main/mainwrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <getopt.h>
#include <mpi.h>
#include <hdf5.h>
#ifdef FFTW
#include <fftw3.h> // for 'fftw_version'
#endif

#include "genesis.h"
#include "version.h"
Expand Down Expand Up @@ -75,6 +78,10 @@ void G4_report_lib_versions(void)


// FFTW3: is there a function that gives the version at runtime? I didn't find one ...
// But there is char fftw_version[] (checked for FFTW v3.3.8)
#ifdef FFTW
cout << "FFTW version string: " << fftw_version << endl;
#endif
}

int main (int argc, char *argv[])
Expand Down

0 comments on commit dd30e5a

Please sign in to comment.