You still there? Ok, time to use CMake.
Now, we will compile SPlisH SPlasH via GIT. To keep things organized, I created a directory in miniconda/envs/DeepFluid/GIT. Then, I cloned the repository by:
- git clone https://github.com/InteractiveComputerGraphics/SPlisHSPlasH.git
The Deep Fluid readme needs SPlisH SPlasH 2.4, because this version compiles the two binaries for building the dataset. You can find the released versions here, and the needed version here [1]. One of these binaries have a Graphical User Interface. When the program is compiled within WSL, the GUI won't show. But a version compiled under Windows, with "exe" extension, will show it, and the WSL terminal can call it with GUI.[2]
So, change to the correct release:
- cd SPlisHSPlasH
- git checkout 2.4.0
- sudo apt-get install freeglut3-dev
- Do a sudo install, so CMake will find it. FreeGlut is another lib that other programs may need. Leave it visible to everyone.
There is a problem to compile the Volume Sampling and the Dynamic and Static Boundary Simulator. So, just put the following lines in the CMakeLists of both, just below the endif() of if(WIN32), right in the begining of the file of the two simulators, and in the beginning of the file for the volume sampling.
if(USE_OpenMP)
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
- set(OpenGL_GL_PREFERENCE GLVND)
- set(CUDA_PATH "/usr/local/cuda")
- set(CUDAToolkit_ROOT "/usr/local/cuda")
- set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
- -DCUDA_PATH=${CUDA_PATH}
- -DCUDAToolkit_ROOT=${CUDAToolkit_ROOT}
- -DCMAKE_CUDA_COMPILER=${CMAKE_CUDA_COMPILER}
- set(CMAKE_CXX_STANDARD 14)
- std::cout<<"Time: "<<TimeManager::getCurrent()->getTime()<<" to "<<stopAt<<std::endl;
- mkdir build && cd build
- cmake ..
- make
[1] Note: I found the pre-compiled binaries for Windows here, for version 2.3.0, so you can execute it on Windows without compiling it from the source, if you need. But 2.3.0 version does not write some files that the Deep Lagrangian Fluid net needs.
[2] Note: If you want to visualize the simulation with SPlisH SPlasH, compile it on Windows and be sure to checkout to the latest release version. The latest version in the main branch, may not include all the features with all the options available. Like, the Foam Generator does not work with Cuda yet, and it is not available for the 2.10.0 (current version as I'm writing this).
No comments:
Post a Comment