2017-03-14 2 views
0

PETSc를 사용하는 프로젝트를 작성하려고했습니다. 이렇게하려면 cmake 모듈을 https://github.com/jedbrown/cmake-modules에서 다운로드했습니다. 내가 프로젝트를 빌드했을 때, 나는 다음과 같은 오류 메시지가 있어요 :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를 구축 :

"--prefix =" "where_petsc_will_be_installed - with-clanguage = C --with-mpi --with-cc = mpicc --with-cxx = 0 --with-fc = 0 --download-f2cblaslapack --with-debugging = yes "

경로는 다음을 사용하여 내보내기했습니다.

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"을 사용하여 빌드해야합니다. 정적 라이브러리를 사용해야합니다.

관련 문제