forked from bartvdbraak/blender
Fluid: Numpy support for Mantaflow build system
Adjusted the fluid build system so that plugins that depend on numpy can be compiled as well. Note that in this commit numpy support is still disabled. It can be enabled by re-running the Mantaflow update script with USE_NUMPY=1 and enabling WITH_MANTA_NUMPY in extern/mantaflow/CMakeLists.txt. This will happen in a future commit.
This commit is contained in:
parent
0cdc75ccd2
commit
893eb30730
36
extern/mantaflow/CMakeLists.txt
vendored
36
extern/mantaflow/CMakeLists.txt
vendored
@ -39,6 +39,9 @@ add_definitions(-DWITH_FLUID=1)
|
|||||||
# Make sure that dependencies exist before enabling this option by updating the source files in extern/
|
# Make sure that dependencies exist before enabling this option by updating the source files in extern/
|
||||||
set(WITH_MANTA_DEPENDENCIES 0)
|
set(WITH_MANTA_DEPENDENCIES 0)
|
||||||
|
|
||||||
|
# Enable Mantaflow numpy support
|
||||||
|
set(WITH_MANTA_NUMPY 0)
|
||||||
|
|
||||||
if(NOT WITH_MANTA_DEPENDENCIES)
|
if(NOT WITH_MANTA_DEPENDENCIES)
|
||||||
add_definitions(-DNO_CNPY=1)
|
add_definitions(-DNO_CNPY=1)
|
||||||
endif()
|
endif()
|
||||||
@ -72,6 +75,10 @@ if(WIN32)
|
|||||||
add_definitions(-D_USE_MATH_DEFINES)
|
add_definitions(-D_USE_MATH_DEFINES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY)
|
||||||
|
add_definitions(-DNUMPY=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(INC
|
set(INC
|
||||||
${MANTA_PP}
|
${MANTA_PP}
|
||||||
${MANTA_PP}/fileio
|
${MANTA_PP}/fileio
|
||||||
@ -79,14 +86,25 @@ set(INC
|
|||||||
${MANTA_PP}/plugin
|
${MANTA_PP}/plugin
|
||||||
${MANTA_HLP}/pwrapper
|
${MANTA_HLP}/pwrapper
|
||||||
${MANTA_HLP}/util
|
${MANTA_HLP}/util
|
||||||
${MANTA_DEP}/cnpy
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WITH_MANTA_DEPENDENCIES)
|
||||||
|
list(APPEND INC
|
||||||
|
${MANTA_DEP}/cnpy
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(INC_SYS
|
set(INC_SYS
|
||||||
${PYTHON_INCLUDE_DIRS}
|
${PYTHON_INCLUDE_DIRS}
|
||||||
${ZLIB_INCLUDE_DIRS}
|
${ZLIB_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY)
|
||||||
|
list(APPEND INC_SYS
|
||||||
|
${PYTHON_NUMPY_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_TBB)
|
if(WITH_TBB)
|
||||||
list(APPEND INC_SYS
|
list(APPEND INC_SYS
|
||||||
${TBB_INCLUDE_DIRS}
|
${TBB_INCLUDE_DIRS}
|
||||||
@ -168,14 +186,10 @@ set(SRC
|
|||||||
${MANTA_PP}/plugin/initplugins.cpp
|
${MANTA_PP}/plugin/initplugins.cpp
|
||||||
${MANTA_PP}/plugin/kepsilon.cpp
|
${MANTA_PP}/plugin/kepsilon.cpp
|
||||||
${MANTA_PP}/plugin/meshplugins.cpp
|
${MANTA_PP}/plugin/meshplugins.cpp
|
||||||
# TODO (sebbas): add numpy to libraries
|
|
||||||
# ${MANTA_PP}/plugin/numpyconvert.cpp
|
|
||||||
${MANTA_PP}/plugin/pressure.cpp
|
${MANTA_PP}/plugin/pressure.cpp
|
||||||
${MANTA_PP}/plugin/ptsplugins.cpp
|
${MANTA_PP}/plugin/ptsplugins.cpp
|
||||||
${MANTA_PP}/plugin/secondaryparticles.cpp
|
${MANTA_PP}/plugin/secondaryparticles.cpp
|
||||||
${MANTA_PP}/plugin/surfaceturbulence.cpp
|
${MANTA_PP}/plugin/surfaceturbulence.cpp
|
||||||
# TODO (sebbas): add numpy to libraries
|
|
||||||
# ${MANTA_PP}/plugin/tfplugins.cpp
|
|
||||||
${MANTA_PP}/plugin/vortexplugins.cpp
|
${MANTA_PP}/plugin/vortexplugins.cpp
|
||||||
${MANTA_PP}/plugin/waveletturbulence.cpp
|
${MANTA_PP}/plugin/waveletturbulence.cpp
|
||||||
${MANTA_PP}/plugin/waves.cpp
|
${MANTA_PP}/plugin/waves.cpp
|
||||||
@ -200,9 +214,6 @@ set(SRC
|
|||||||
${MANTA_PP}/vortexsheet.h.reg.cpp
|
${MANTA_PP}/vortexsheet.h.reg.cpp
|
||||||
|
|
||||||
${MANTA_HLP}/pwrapper/manta.h
|
${MANTA_HLP}/pwrapper/manta.h
|
||||||
# TODO (sebbas): add numpy to libraries
|
|
||||||
# ${MANTA_HLP}/pwrapper/numpyWrap.cpp
|
|
||||||
# ${MANTA_HLP}/pwrapper/numpyWrap.h
|
|
||||||
${MANTA_HLP}/pwrapper/pclass.cpp
|
${MANTA_HLP}/pwrapper/pclass.cpp
|
||||||
${MANTA_HLP}/pwrapper/pclass.h
|
${MANTA_HLP}/pwrapper/pclass.h
|
||||||
${MANTA_HLP}/pwrapper/pconvert.cpp
|
${MANTA_HLP}/pwrapper/pconvert.cpp
|
||||||
@ -235,6 +246,15 @@ if(WITH_MANTA_DEPENDENCIES)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_MANTA_NUMPY AND WITH_PYTHON_INSTALL_NUMPY)
|
||||||
|
list(APPEND SRC
|
||||||
|
${MANTA_PP}/plugin/numpyconvert.cpp
|
||||||
|
${MANTA_PP}/plugin/tfplugins.cpp
|
||||||
|
${MANTA_HLP}/pwrapper/numpyWrap.cpp
|
||||||
|
${MANTA_HLP}/pwrapper/numpyWrap.h
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LIB
|
set(LIB
|
||||||
${PYTHON_LINKFLAGS}
|
${PYTHON_LINKFLAGS}
|
||||||
${PYTHON_LIBRARIES}
|
${PYTHON_LIBRARIES}
|
||||||
|
5
extern/mantaflow/UPDATE.sh
vendored
5
extern/mantaflow/UPDATE.sh
vendored
@ -16,6 +16,9 @@ CLEAN_REPOSITORY=0
|
|||||||
# Skip copying dependency files?
|
# Skip copying dependency files?
|
||||||
WITH_DEPENDENCIES=0
|
WITH_DEPENDENCIES=0
|
||||||
|
|
||||||
|
# Build with numpy support?
|
||||||
|
USE_NUMPY=0
|
||||||
|
|
||||||
# Choose which multithreading platform to use for Mantaflow preprocessing
|
# Choose which multithreading platform to use for Mantaflow preprocessing
|
||||||
USE_OMP=0
|
USE_OMP=0
|
||||||
USE_TBB=1
|
USE_TBB=1
|
||||||
@ -53,7 +56,7 @@ fi
|
|||||||
MANTA_BUILD_PATH=$MANTA_INSTALLATION/build_blender/
|
MANTA_BUILD_PATH=$MANTA_INSTALLATION/build_blender/
|
||||||
mkdir -p $MANTA_BUILD_PATH
|
mkdir -p $MANTA_BUILD_PATH
|
||||||
cd $MANTA_BUILD_PATH
|
cd $MANTA_BUILD_PATH
|
||||||
cmake ../mantaflowgit -DGUI=0 -DOPENMP=$USE_OMP -DTBB=$USE_TBB -DBLENDER=1 -DPREPDEBUG=1 && make -j8
|
cmake ../mantaflowgit -DGUI=0 -DOPENMP=$USE_OMP -DTBB=$USE_TBB -DBLENDER=1 -DPREPDEBUG=1 -DNUMPY=$USE_NUMPY && make -j8
|
||||||
|
|
||||||
# ==================== 3) COPY MANTAFLOW FILES TO BLENDER ROOT ===========================
|
# ==================== 3) COPY MANTAFLOW FILES TO BLENDER ROOT ===========================
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user