windows下编译paraview552_Qt562_vs2013_CMake3114

  • 下载安装CMake

去官网下载二进制版本的CMake,下载3.11.4即可。按照提示安装就行。

  • 下载安装Qt

下载64位二进制版本的Qt5.6.2,按照提示安装即可(或参照一些安装教程)。安装时唯一需要注意的点就是按需安装。

  • 下载安装MPI

https://www.microsoft.com/en-us/download/details.aspx?id=56727下载这两个文件进行安装。如果这个版本不合适,可以换一个较低版本的试一下。

  • 下载安装Python

下载安装Python 3.6,注意需要的是64位的。

  • 下载安装visual studio

安装64位的visual studio community 2013,360软件管家里就有。

  • 安装Git

安装Git for Windows。 

  • 下载paraview的源码

可以使用Git去paraview的代码库去下载,也可以直接在官网下载源码。我当时是直接在官网下载的源码,所以下面使用CMake配置工程的时候会显示Git确定不了paraview的版本,这不影响编译,不过以后再编译的时候最好使用Git来下载源码。

  • 使用CMake配置paraview

在Where is the source code:中选择paraview的源码路径;在Where to build the binaries:中指定编译的位置。下面是我的配置:

勾选Advanced选项,可以显示出更多的内容。然后点击Configure,会提示选择generator,选择Visual Studio 12 2013 Win64,随后进入配置过程,一般Configure会重复很多次。第一次Configure后很多Name和Value是红色的(如下图所示),这需要继续进行Configure。

找到下面的变量不断进行Configure,直到红色消失。

Variable

Description

BUILD_SHARED_LIBS

如果是on,采用的是动态编译。此时的可执行文件较小,一般选择on。

BUILD_TESTING

If ON, tests will be built and related data downloaded. Unless you have a specific needs for this, it is recommended to set it to OFF to speed up the compilation.

PARAVIEW_USE_MPI

Turn this to ON to enable MPI. Other MPI options will not be available until you turn this on.

MPI_C_LIBRARIES

MPI链接库的位置,我的是D:/Program Files (x86)/Microsoft SDKs/MPI/lib/x64/msmpi.lib

MPI_C_INCLUDE_PATH

MPI的头文件位置,我的是D:/Program Files (x86)/Microsoft SDKs/MPI/include

PARAVIEW_ENABLE_PYTHON

Makes Python client scripting and the Python programmable filter available. You will also need to setup the following variables:

PYTHON_LIBRARY: Should point to your python*.lib file. For example on Windows: D:/Program Files/Python36/libs/python36.lib

PYTHON_INCLUDE_DIR: Should point to the include directory inside your Python installation. For example on Windows: D:/Program Files/Python36/include

PYTHON_EXECUTABLE: Should point to the python executable file. For example on Windows: D:/Program Files/Python36/python.exe

PARAVIEW_BUILD_QT_GUI

默认打开

PARAVIEW_QT_VERSION

Make sure it is set to the major version of Qt you are using.我编译的时候这个变量需要自己新建,对于只安装了一个版本的Qt用户,这个变量不用新建

Qt5_DIR

Path to the directory of Qt5 containing the description of Qt5 installation on this computer via Qt5Config.cmake. On a windows binary version of Qt it may be in D:/Qt/Qt5.6.2/5.6/msvc2013_64/lib/cmake/Qt5(这是我的Qt路径)

Configure完成后,就可以点击Generate了,完成后可以点击Open Project打开visual studio等待载入工程。待全部读入后,build即可,一般根据电脑配置需要1-3小时。最后编译完成后,可以在D:\ParaView\buildParaView552\bin\Debug路径下看到编译好的可执行文件。

 

  • 参考资料

编译安装主要参考的是wiki上的介绍:

https://www.paraview.org/Wiki/ParaView:Build_And_Install

猜你喜欢

转载自blog.csdn.net/dsfsdffgfd/article/details/81252783