Skip to content
Snippets Groups Projects
Commit 3e320d52 authored by Dominik Thoennes's avatar Dominik Thoennes
Browse files

prefer pystencils submodule over system

parent a44ca303
No related merge requests found
......@@ -551,22 +551,26 @@ endif ( )
##
#############################################################################################################################
if ( WALBERLA_BUILD_WITH_CODEGEN )
find_package( PythonInterp 3 QUIET REQUIRED)
git_update_submodules()
find_package( PythonInterp 3.6 QUIET REQUIRED)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import lbmpy; import pystencils"
RESULT_VARIABLE LBMPY_FOUND )
if(NOT LBMPY_FOUND EQUAL 0)
git_update_submodules()
if( GIT_FOUND )
message(FATAL_ERROR "Please update git submodules or install pystencils and lbmpy via pip.")
else()
message(FATAL_ERROR "Please install pystencils and lbmpy e.g. via pip")
endif()
endif()
set(ENV{PYTHONPATH} ${walberla_SOURCE_DIR}/extern/pystencils:$ENV{PYTHONPATH})
message(STATUS $ENV{PYTHONPATH})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from pystencils.include import get_pystencils_include_path; print(get_pystencils_include_path())"
OUTPUT_VARIABLE PYSTENCILS_INCLUDE_PATH)
include_directories( ${PYSTENCILS_INCLUDE_PATH} )
string(STRIP ${PYSTENCILS_INCLUDE_PATH} PYSTENCILS_INCLUDE_PATH_TMP)
message( STATUS "Found pystencils: ${PYSTENCILS_INCLUDE_PATH_TMP}" )
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import jinja2"
RESULT_VARIABLE JINJA2_FOUND )
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import jinja2" RESULT_VARIABLE JINJA2_FOUND )
if(NOT JINJA2_FOUND EQUAL 0)
message(FATAL_ERROR "WALBERLA_BUILD_WITH_CODEGEN activated and jinja2 package not found.
Please install jinja2 e.g.: 'pip3 install jinja2'")
......
......@@ -307,10 +307,12 @@ endfunction()
#######################################################################################################################
#
# updates all submodules in the walberla repository
# this function will propagate GIT_FOUND to the parent scope
#
#######################################################################################################################
function( git_update_submodules )
find_package(Git QUIET)
set(GIT_FOUND ${GIT_FOUND} PARENT_SCOPE)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Update submodules as needed
if(WALBERLA_GIT_SUBMODULE_AUTO)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment