diff --git a/3rdParty/fftw/fftw-3.3.7/CMakeLists.txt b/3rdParty/fftw/fftw-3.3.7/CMakeLists.txt index e2155c440bacff38adb3419224dac051611c2771..7e0b4f626c39fd8fd44a29af4ba0853b579253ed 100644 --- a/3rdParty/fftw/fftw-3.3.7/CMakeLists.txt +++ b/3rdParty/fftw/fftw-3.3.7/CMakeLists.txt @@ -10,8 +10,8 @@ if (POLICY CMP0042) cmake_policy (SET CMP0042 NEW) endif () -option (BUILD_SHARED_LIBS "Build shared libraries" ON) -option (BUILD_TESTS "Build tests" OFF) +#option (BUILD_SHARED_LIBS "Build shared libraries" ON) +#option (BUILD_TESTS "Build tests" OFF) option (ENABLE_OPENMP "Use OpenMP for multithreading" OFF) option (ENABLE_THREADS "Use pthread for multithreading" OFF) @@ -335,7 +335,8 @@ if (OPENMP_FOUND) target_compile_options (${fftw3_lib}_omp PRIVATE ${OpenMP_C_FLAGS}) endif () -groupTarget(${fftw3_lib} ${thirdPartyFolder}) +groupTarget(${fftw3_lib} ${thirdFolder}) +target_include_directories(${fftw3_lib} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/api) foreach(subtarget ${subtargets}) set_target_properties (${subtarget} PROPERTIES SOVERSION 3.5.7 VERSION 3) @@ -380,30 +381,30 @@ if (BUILD_TESTS) endif () endif () -# pkgconfig file -set (prefix ${CMAKE_INSTALL_PREFIX}) -set (exec_prefix ${CMAKE_INSTALL_PREFIX}) -set (libdir ${CMAKE_INSTALL_FULL_LIBDIR}) -set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) -set (VERSION ${FFTW_VERSION}) -configure_file (fftw.pc.in fftw${PREC_SUFFIX}.pc @ONLY) -install (FILES - ${CMAKE_CURRENT_BINARY_DIR}/fftw${PREC_SUFFIX}.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig - COMPONENT Development) - -# cmake file -set (FFTW3_LIBRARIES "FFTW3::${fftw3_lib}") -configure_file (FFTW3Config.cmake.in FFTW3${PREC_SUFFIX}Config.cmake @ONLY) -configure_file (FFTW3ConfigVersion.cmake.in FFTW3${PREC_SUFFIX}ConfigVersion.cmake @ONLY) -install (FILES - ${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX} - COMPONENT Development) - -export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3LibraryDepends.cmake) -install(EXPORT FFTW3LibraryDepends - NAMESPACE FFTW3:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX} - COMPONENT Development) +## pkgconfig file +#set (prefix ${CMAKE_INSTALL_PREFIX}) +#set (exec_prefix ${CMAKE_INSTALL_PREFIX}) +#set (libdir ${CMAKE_INSTALL_FULL_LIBDIR}) +#set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +#set (VERSION ${FFTW_VERSION}) +#configure_file (fftw.pc.in fftw${PREC_SUFFIX}.pc @ONLY) +#install (FILES +# ${CMAKE_CURRENT_BINARY_DIR}/fftw${PREC_SUFFIX}.pc +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +# COMPONENT Development) +# +## cmake file +#set (FFTW3_LIBRARIES "FFTW3::${fftw3_lib}") +#configure_file (FFTW3Config.cmake.in FFTW3${PREC_SUFFIX}Config.cmake @ONLY) +#configure_file (FFTW3ConfigVersion.cmake.in FFTW3${PREC_SUFFIX}ConfigVersion.cmake @ONLY) +#install (FILES +# ${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}Config.cmake +# ${CMAKE_CURRENT_BINARY_DIR}/FFTW3${PREC_SUFFIX}ConfigVersion.cmake +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX} +# COMPONENT Development) +# +#export (TARGETS ${fftw3_lib} NAMESPACE FFTW3:: FILE ${PROJECT_BINARY_DIR}/FFTW3LibraryDepends.cmake) +#install(EXPORT FFTW3LibraryDepends +# NAMESPACE FFTW3:: +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fftw3${PREC_SUFFIX} +# COMPONENT Development) diff --git a/apps/gpu/tests/NumericalTestPostProcessing/CMakeLists.txt b/apps/gpu/tests/NumericalTestPostProcessing/CMakeLists.txt index 1ff89574c313cad237fa2196c8d6c58f1c21e9b7..137e2aa041030193afd2a8d52e3787fc845ab87d 100644 --- a/apps/gpu/tests/NumericalTestPostProcessing/CMakeLists.txt +++ b/apps/gpu/tests/NumericalTestPostProcessing/CMakeLists.txt @@ -1,14 +1,6 @@ -setTargetNameToFolderName(${CMAKE_CURRENT_LIST_DIR}) +project(NumericalTestPostProcessing) -set(linkDirectories "") -set(libsToLink VirtualFluids_GPU cudart_static VirtualFluidsBasics) -set(includeDirectories ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/VirtualFluids_GPU ${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics) +vf_add_library(BUILDTYPE binary DEPENDS VirtualFluids_GPU basics cudart_static) -#glob files and save in MY_SRCS -include(CMakePackage.cmake) - -buildExe(${targetName} "${MY_SRCS}" "${linkDirectories}" "${libsToLink}" "${includeDirectories}") -groupTarget(${targetName} ${testFolder}) - -#Specify the linking to 3rdParty libs -include(3rdPartyLinking.cmake) \ No newline at end of file +vf_get_library_name(library_name) +groupTarget(${library_name} ${testFolder}) diff --git a/apps/gpu/tests/NumericalTests/CMakeLists.txt b/apps/gpu/tests/NumericalTests/CMakeLists.txt index 1ff89574c313cad237fa2196c8d6c58f1c21e9b7..e6f426361f8ea402649e6a4df9dbb7b9d2cf2d8b 100644 --- a/apps/gpu/tests/NumericalTests/CMakeLists.txt +++ b/apps/gpu/tests/NumericalTests/CMakeLists.txt @@ -1,14 +1,16 @@ -setTargetNameToFolderName(${CMAKE_CURRENT_LIST_DIR}) +project(NumericalTestsGPU) -set(linkDirectories "") -set(libsToLink VirtualFluids_GPU cudart_static VirtualFluidsBasics) -set(includeDirectories ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/VirtualFluids_GPU ${CMAKE_SOURCE_DIR}/src/VirtualFluidsBasics) +vf_add_library(BUILDTYPE binary DEPENDS VirtualFluids_GPU GridGenerator basics cudart_static fftw3 gtest gmock gmock_main) -#glob files and save in MY_SRCS -include(CMakePackage.cmake) +vf_get_library_name(library_name) +groupTarget(${library_name} ${testFolder}) -buildExe(${targetName} "${MY_SRCS}" "${linkDirectories}" "${libsToLink}" "${includeDirectories}") -groupTarget(${targetName} ${testFolder}) +if(BUILD_SHARED_LIBS) + # add compile option according to + # https://github.com/google/googletest/blob/master/googletest/README.md#as-a-shared-library-dll + set_target_properties(${library_name} + PROPERTIES + COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1") +endif() -#Specify the linking to 3rdParty libs -include(3rdPartyLinking.cmake) \ No newline at end of file +linkCUDA() \ No newline at end of file diff --git a/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h b/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h index 418ef085aa7d1a319a2d0ad8fabd84c401e61d49..2a00f4286d59442046233ff19a7e95a105698928 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h +++ b/apps/gpu/tests/NumericalTests/Utilities/ColorConsoleOutput/ColorConsoleOutputImp.h @@ -12,18 +12,6 @@ namespace testing { namespace internal { - enum GTestColor { - COLOR_DEFAULT, - COLOR_RED, - COLOR_GREEN, - COLOR_YELLOW - }; - - // in case of unresoved external while using shared libraries - // add in gtest.h line 167 and 168: - // enum GTestColor; - // void GTEST_API_ ColoredPrintf(GTestColor color, const char* fmt, ...); - // see commit: 4c0ed885ceab18b9df7a2495c77a51e236aee6f1 extern void ColoredPrintf(GTestColor color, const char* fmt, ...); } } diff --git a/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/AnalyticalResults2DToVTKWriterImp.cpp b/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/AnalyticalResults2DToVTKWriterImp.cpp index 9225174bc33de2061283a06fbd181474d7d41596..bfcb8aca231c14f601a3a0148c02b02f24026c4c 100644 --- a/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/AnalyticalResults2DToVTKWriterImp.cpp +++ b/apps/gpu/tests/NumericalTests/Utilities/DataWriter/AnalyticalResults2DToVTKWriter/AnalyticalResults2DToVTKWriterImp.cpp @@ -12,7 +12,7 @@ #include "LBM/LB.h" #include "LBM/D3Q27.h" -#include <VirtualFluidsBasics/basics/writer/WbWriterVtkXmlBinary.h> +#include <basics/writer/WbWriterVtkXmlBinary.h> #include "Utilities/Results/AnalyticalResults/AnalyticalResult.h" #include <mpi.h> diff --git a/gpu.cmake b/gpu.cmake index b1c5bf6dfef1156bff2439a73e2e25886b115f77..be8b91477759fb264b8cce2b252365361ea14c0f 100644 --- a/gpu.cmake +++ b/gpu.cmake @@ -149,8 +149,8 @@ ENDIF() if(VF.BUILD_NUMERIC_TESTS) add_subdirectory(3rdParty/fftw/fftw-3.3.7) add_subdirectory(3rdParty/googletest) - add_subdirectory(targets/tests/NumericalTests) - add_subdirectory(targets/tests/NumericalTestPostProcessing) + add_subdirectory(apps/gpu/tests/NumericalTests) + add_subdirectory(apps/gpu/tests/NumericalTestPostProcessing) endif() #############################################################