一、下载VTK
下载source源码和文档
下载较慢,可使用此链接:http://www.shucy.cn:9568/s/BDtQ 提取密码:vsfmho
二、解压源码
tar -zxvf xxx.tar.gz
VTK-9.2.6/Wrapping/Tools/vtkWrapPythonMethod.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonMethod.h VTK-9.2.6/Wrapping/Tools/vtkWrapPythonMethodDef.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonMethodDef.h VTK-9.2.6/Wrapping/Tools/vtkWrapPythonNamespace.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonNamespace.h VTK-9.2.6/Wrapping/Tools/vtkWrapPythonOverload.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonOverload.h VTK-9.2.6/Wrapping/Tools/vtkWrapPythonTemplate.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonTemplate.h VTK-9.2.6/Wrapping/Tools/vtkWrapPythonType.c VTK-9.2.6/Wrapping/Tools/vtkWrapPythonType.h VTK-9.2.6/Wrapping/Tools/vtkWrapText.c VTK-9.2.6/Wrapping/Tools/vtkWrapText.h VTK-9.2.6/Wrapping/Tools/vtkcompiletools.module VTK-9.2.6/vtkBanner.gif VTK-9.2.6/vtkLogo.ico shuchengyang@shuchengyang-PC:~/开发/VTK$ tar -zxvf VTK-9.2.6.tar.gz
三、Cmake编译
此处使用cmake-gui配置,如果使用命令行需要配置所有命令信息,在Linux,如果无CMake界面,使用命令:
sudo apt-get install cmake-qt-gui
无NVCC,未安装CUDA。
根据文章搭建环境:
https://10sxj.com/post/47.html
The CUDA compiler identification is unknown CMake Error at CMakeLists.txt:134 (enable_language): No CMAKE_CUDA_COMPILER could be found. Tell CMake where to find the compiler by setting either the environment variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.
export CUDACXX=/usr/local/cuda-12.0/bin/nvcc
CMake Warning at Rendering/OpenGL2/CMakeLists.txt:362 (message): X11::Xcursor not found; custom cursors will be ignored.
sudo apt-get install libxt-dev 请输入密码: 验证成功 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包是自动安装的并且现在不需要了: deepin-pw-check fbterm glx-alternative-mesa imageworsener libatkmm-1.6-1v5 libcairomm-1.0-1v5 libdumbnet1 libgtkmm-3.0-1v5 libheif1 liblqr-1-0 libmaxminddb0 libmspack0 libnvidia-egl-wayland1 libnvidia-eglcore-510 libnvidia-glcore-510 libpangomm-1.4-1v5 libqtermwidget5-0 libsmi2ldbl libutf8proc2 libwireshark-data libwireshark11 libwiretap8 libwscodecs2 libwsutil9 libx264-155 libx86-1 libxmlsec1 libxmlsec1-openssl qtermwidget5-data squashfs-tools update-glx 使用'sudo apt autoremove'来卸载它(它们)。
关于Qt路径
配置编译例子数据
CMake Error at CMake/vtkTesting.cmake:19 (message): VTK_BUILD_TESTING is ON, but there is no ExternalData directory! Please download VTKData, which contains an .ExternalData directory that must go into your VTK source directory (including the leading dot). Call Stack (most recent call first): CMakeLists.txt:58 (include)
下载VTKData包并解压到源码目录中隐藏文件。
关于MPI支持
Checking for module 'mpi-c' No package 'mpi-c' found Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) Could NOT find MPI (missing: MPI_C_FOUND C) CMake Error at CMake/vtkModule.cmake:4578 (message): Could not find the MPI external dependency. Call Stack (most recent call first): CMake/vtkModule.cmake:5172 (vtk_module_find_package) Utilities/MPI/CMakeLists.txt:1 (vtk_module_third_party_external)
https://10sxj.com/post/48.html
缺少MEMKIND :
CMake Error at CMake/vtkModule.cmake:4578 (message):
Could not find the MEMKIND external dependency.
Call Stack (most recent call first):
Common/Core/CMakeLists.txt:58 (vtk_module_find_package)
从GitHub上下载源码
shuchengyang@shuchengyang-PC:~/Downloads$ tar -zxvf memkind-1.14.0.tar.gz memkind-1.14.0/ memkind-1.14.0/.clang-format memkind-1.14.0/.github/ memkind-1.14.0/.github/pull_request_template.md memkind-1.14.0/.github/workflows/ memkind-1.14.0/.github/workflows/gha.yml memkind-1.14.0/.gitignore memkind-1.14.0/AUTHORS memkind-1.14.0/CONTRIBUTING memkind-1.14.0/COPYING memkind-1.14.0/ChangeLog memkind-1.14.0/MANIFEST memkind-1.14.0/Makefile.am memkind-1.14.0/NEWS memkind-1.14.0/README memkind-1.14.0/README.md memkind-1.14.0/VERSION memkind-1.14.0/autogen.sh memkind-1.14.0/autohbw/ memkind-1.14.0/autohbw/Makefile.mk memkind-1.14.0/autohbw/autohbw.c memkind-1.14.0/autohbw/autohbw_README memkind-1.14.0/autohbw/autohbw_api.h memkind-1.14.0/autohbw/autohbw_get_src_lines.pl memkind-1.14.0/autohbw/autohbw_test.sh memkind-1.14.0/build.sh memkind-1.14.0/codecov.yml memkind-1.14.0/configure.ac memkind-1.14.0/copying_headers/ memkind-1.14.0/copying_headers/MANIFEST.EXEMPT memkind-1.14.0/copying_headers/MANIFEST.freeBSD memkind-1.14.0/copying_headers/MANIFEST.freeBSD3 memkind-1.14.0/copying_headers/header.freeBSD memkind-1.14.0/copying_headers/header.freeBSD3 memkind-1.14.0/copying_headers/header.intel-acpi memkind-1.14.0/debian/ memkind-1.14.0/debian/changelog memkind-1.14.0/debian/compat
./build.sh make install
需要依赖
autoconf automake gcc-c++ libnuma-devel libtool numactl-devel unzip
未找到Python3扩展:
Could not find the Python3 external dependency.
sudo apt-get install python3-dev
无TCL
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find TCL (missing: TCL_INCLUDE_PATH)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMake/FindTCL.cmake:183 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Rendering/Tk/CMakeLists.txt:2 (find_package)
sudo apt-get install tcl sudo apt-get install tcl-dev
CMake Warning (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
The package name passed to `find_package_handle_standard_args` (TCLTK) does
not match the name of the calling package (TCL). This can lead to problems
in calling code that expects `find_package` result variables (e.g.,
`_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
CMake/FindTCL.cmake:186 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Rendering/Tk/CMakeLists.txt:2 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find TCLTK (missing: TK_LIBRARY TK_INCLUDE_PATH)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
CMake/FindTCL.cmake:186 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
Rendering/Tk/CMakeLists.txt:2 (find_package)
sudo apt-get install tk-dev
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindDoxygen.cmake:646 (find_package_handle_standard_args)
Utilities/Doxygen/CMakeLists.txt:4 (find_package)
sudo apt install doxygen
四、编译
进入build目录
make -j 64
64表示多核编译,我机子44核心,所以我直接写的64
make install
还没有评论,来说两句吧...