From 88a92435eef14da63ff3d310dd6c224c8739a56f Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Tue, 25 Apr 2017 08:38:46 +0200 Subject: [PATCH] Python Module two versions available now via CMake switch: - by default the Python module is built without LBM module, since lbmpy can be used for this. Reduces compile time substantially. - if the LBM is needed in python, for example for the lbmpy testsuite it can be included by setting the CMake switch WALBERLA_BUILD_WITH_PYTHON_LBM --- CMakeLists.txt | 2 ++ apps/pythonmodule/CMakeLists.txt | 8 +++++--- apps/pythonmodule/PythonModuleWithLbmModule.cpp | 3 ++- python/waLBerla_docs/modules/lbm.rst | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c690878c..cfb5752ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,8 @@ option ( WALBERLA_BUILD_WITH_LTO "Enable link time optimizations" option ( WALBERLA_BUILD_WITH_OPENMP "Enable OpenMP support" ) option ( WALBERLA_BUILD_WITH_PYTHON "Support for embedding Python" ) option ( WALBERLA_BUILD_WITH_PYTHON_MODULE "Build waLBerla python module" ) +option ( WALBERLA_BUILD_WITH_PYTHON_LBM "Include LBM module into python module" OFF ) + option ( WALBERLA_BUILD_WITH_LIKWID_MARKERS "Compile in markers for likwid-perfctr" ) diff --git a/apps/pythonmodule/CMakeLists.txt b/apps/pythonmodule/CMakeLists.txt index 0893abaa0..b52d000da 100644 --- a/apps/pythonmodule/CMakeLists.txt +++ b/apps/pythonmodule/CMakeLists.txt @@ -11,9 +11,11 @@ if ( WALBERLA_BUILD_WITH_PYTHON_MODULE ) set ( pythonModules "-Wl,-whole-archive" blockforest boundary domain_decomposition core field geometry lbm postprocessing python_coupling timeloop vtk "-Wl,-no-whole-archive" ) endif() - - #add_library( walberla_cpp SHARED PythonModuleWithLbmModule.cpp ) - add_library( walberla_cpp SHARED PythonModule.cpp ) + if( WALBERLA_BUILD_WITH_PYTHON_LBM ) + add_library( walberla_cpp SHARED PythonModuleWithLbmModule.cpp ) + else() + add_library( walberla_cpp SHARED PythonModule.cpp ) + endif() target_link_libraries( walberla_cpp ${pythonModules} ${SERVICE_LIBS} ) set_target_properties( walberla_cpp PROPERTIES PREFIX "") diff --git a/apps/pythonmodule/PythonModuleWithLbmModule.cpp b/apps/pythonmodule/PythonModuleWithLbmModule.cpp index d749c9e19..03301a723 100644 --- a/apps/pythonmodule/PythonModuleWithLbmModule.cpp +++ b/apps/pythonmodule/PythonModuleWithLbmModule.cpp @@ -21,10 +21,11 @@ #include "waLBerlaDefinitions.h" #include "blockforest/python/Exports.h" #include "field/GhostLayerField.h" +#include "field/python/Exports.h" #include "geometry/python/Exports.h" #include "lbm/all.h" #include "lbm/lattice_model/ForceModel.h" -#include "lbm/python/ExportBasic.h" +#include "lbm/python/Exports.h" #include "postprocessing/python/Exports.h" #include "python_coupling/Manager.h" #include "python_coupling/helper/ModuleInit.h" diff --git a/python/waLBerla_docs/modules/lbm.rst b/python/waLBerla_docs/modules/lbm.rst index 48b4bf7ca..519462ef2 100644 --- a/python/waLBerla_docs/modules/lbm.rst +++ b/python/waLBerla_docs/modules/lbm.rst @@ -2,6 +2,8 @@ LBM module ********** +.. note:: This module is deprecated and about to be replaced by the native Python module *lbmpy* + Creation Functions ================== -- GitLab