Ubuntu 16.04 OpenFOAM-5.0 makeParaView Qt5 错误

Ubuntu 16.04 OpenFOAM-5.0 makeParaView Qt5 错误

./Allwmake我正在尝试从源代码构建和安装流体模拟软件 OpenFOAM。第一步是通过在 中运行来构建所有第三方软件$WM_THIRD_PARTY_DIR。我这样做了,没有任何错误,然后继续通过运行 来构建和安装 ParaView ./makeParaView。这会导致以下错误(开头被剪掉,以保证您和我自己的安全):

...

-- Looking for jbg_newlen
-- Looking for jbg_newlen - not found
-- Protobuf: doing try-compiles for hash map/set headers
-- Protobuf: doing try-compiles for pthread test
CMake Error at CMake/ParaViewQt.cmake:65 (find_package):
  Could not find a configuration file for package "Qt5" that is compatible
  with requested version "5.6".

  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.5.1
    /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.5.1

Call Stack (most recent call first):
  Qt/Widgets/CMakeLists.txt:203 (pv_find_package_qt)


-- Configuring incomplete, errors occurred!
See also "/home/trent/OpenFOAM/ThirdParty-5.0/build/linux64Gcc/ParaView-5.4.0/CMakeFiles/CMakeOutput.log".
See also "/home/trent/OpenFOAM/ThirdParty-5.0/build/linux64Gcc/ParaView-5.4.0/CMakeFiles/CMakeError.log".`

我已经尝试过找到的解决方案这里,但我仍然收到相同的错误。应该说我确实将 Qt5.6.x 安装到了我的主目录中,并相应地更改了链接建议的路径。

提前致谢

答案1

似乎您混淆了环境变量的名称,与设置 Qt5 目录Qt5_DIR所接受的选项: 。请记住,当您调用时,它将在其自己的环境中运行,并且不会看到您在本地声明的任何变量。要使您的 Qt5 安装可用于脚本以及它调用的所有进程,您需要将其导出:cmakecmake -DQt5_DIR="....."./makeParaView

export Qt5_DIR="/home/trent/Qt5.6.x/lib/cmake/Qt5"

请务必仔细检查您指定的路径是否正确并且确实包含所请求的Qt5Config.cmake

我不完全确定这个解决方案是否也能让链接器知道 Qt 库的位置,因此您也可以通过将相应的目录添加到共享库的路径来传达这一点:

export LD_LIBRARY_PATH="/home/trent/Qt5.6.x/lib":$LD_LIBRARY_PATH"

相关内容