2017-03-14 65 views
0

我試圖建立一個使用PETSc的項目。爲此,我從https://github.com/jedbrown/cmake-modules下載了cmake模塊。當我試圖建立的項目,我得到了以下錯誤消息:不能與cmake一起使用petsc

(...) 

-- petsc_lib_dir /cygdrive/d/Git-Projects/build_libs/INSTALL/petsc-3.7.5/lib 
-- Recognized PETSc install with single library for all packages 
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal 
-- Performing Test MULTIPASS_TEST_1_petsc_works_minimal - Failed 
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes 
-- Performing Test MULTIPASS_TEST_2_petsc_works_allincludes - Failed 
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries 
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. 
Please set them or make sure they are set and tested correctly in the CMake files: 
PETSC_LIBRARY_SINGLE 
    linked by target "cmTC_bb78d" in directory /cygdrive/d/Git-Projects/EFVLib_dev/EFVLib/_build/CMakeFiles/CMakeTmp 

CMake Error: Internal CMake error, TryCompile configure of cmake failed 
-- Performing Test MULTIPASS_TEST_3_petsc_works_alllibraries - Failed 
-- Performing Test MULTIPASS_TEST_4_petsc_works_all 
CMake Error: The following variables are used in this project, but they are set to NOTFOUND. 
Please set them or make sure they are set and tested correctly in the CMake files: 
PETSC_LIBRARY_SINGLE 
    linked by target "cmTC_9aa2b" in directory /cygdrive/d/Git-Projects/EFVLib_dev/EFVLib/_build/CMakeFiles/CMakeTmp 

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. 
Please set them or make sure they are set and tested correctly in the CMake files: 
PETSC_LIBRARY_SINGLE (ADVANCED) 

我已經下載了openmpi(Cygwin的包),並使用內置PETSC:

「前綴=」 where_petsc_will_be_installed」 - with-clanguage = C --with-mpi --with-cc = mpicc --with-cxx = 0 --with-fc = 0 --download -f2cblaslapack --with-debugging = yes「

and the路徑使用:

export PETSC_DIR="where_petsc_is_installed" 
export PETSC_ARCH="" 
export PATH=${PATH}:${PETSC_DIR}/lib:${PETSC_DIR}/bin 

爲什麼我會遇到這些錯誤以及如何解決這些錯誤?

回答

0

爲了在cygwin中使用cmake中的petsc,它必須使用「--with-shared-libraries = 0」構建,您必須使用靜態庫。

相關問題