2013-03-06 8 views
0

방금 ​​trilinos 11.0.3을 설치했는데 이제 cmake를 사용하여 첫 번째 응용 프로그램을 컴파일하려고합니다.trilinos 프로그램 컴파일

CMake Warning (dev) at /home/giorgos/Documents/TRILINOS/lib/cmake/Trilinos/ 
    TrilinosTargets.cmake:208 (ADD_LIBRARY):   
    ADD_LIBRARY called with SHARED option but the target platform does not 
    support dynamic linking. Building a STATIC library instead. This may lead 
    to problems. 
:

내가 컴파일하기 위해 노력하고있어 파일이 http://code.google.com/p/trilinos/wiki/EpetraSimpleVector

첫 번째 명령 cmake 내가 각 trilinos 패키지에 대한 다음과 같은 경고 (다만 만일의 관련에서) 얻을 수 있지만 작동하는 것 같다 여기

기타는 trilinos의 위치를 ​​포함하고 make 명령 시미의 목록을 생성하지만 라이브러리가 제대로

을 발견 한 것 같다보다 다음과 같은 lar 오류가 발생했습니다.

/home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:11: 
    undefined reference to `Epetra_SerialComm::Epetra_SerialComm()' 

    /home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:16: 
    undefined reference to `Epetra_Map::Epetra_Map(int, int, Epetra_Comm const&)' 

    /home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:19: 
    undefined reference to `Epetra_Vector::Epetra_Vector(Epetra_BlockMap const&, bool)' 

    /home/giorgos/Documents/mpi_tests/trilinos_test/test1/src/teuchos_test.cpp:20: 
    undefined reference to `Epetra_Vector::Epetra_Vector(Epetra_BlockMap const&, bool)' 

여기에 무슨 일이 일어 났는지 생각해보십시오.

답변

-1

당신에게

Giorgos 감사 (첫번째 나는 teuchos 패키지의 일부 코드를 컴파일하려고 때문에 그러나 나는 위와 비슷한 오류를 수신하고, 소스 파일 teuchos_test.cpp 이름) 나는 cmake와 함께 trilinos 예제를 컴파일 할 수 없었지만, 모든 것을 연결함으로써 그렇게 할 수있었습니다. 그것은 단지 epetra 패키지에 의존하기 때문에 나에게 위의 오류를주는 예를 들어 나는

g++ -o teuchos_test teuchos_test.cpp \ 
    -I/home/giorgos/Documents/TRILINOS/include \ 
    -L/home/giorgos/Documents/TRILINOS/lib -lepetra 

을 다음 않은 사람이 컴파일하는 방법을 알고 그러나 경우

(나는 아직도 이름을 : 변경해야합니다) trickinos with cmake 여기에 입력 해 주시면 고맙겠습니다

+0

[이 예제] (http://code.google.com/p/trilinos/wiki/CMakeFindPackageTrilinosExample)를 사용하셨습니까? – Fraser

+0

발견해 주셔서 감사합니다! Trilinos에서 비슷한 설명을 사용했지만 설명이 너무 많았습니다. 나는 그것을 시도해 볼 것입니다 – giorgk

+0

이것은 어떻게합니까 : http://trilinos.sandia.gov/Export_Makefile_example.txt 의 내용을 빈 Makefile에 복사하십시오. include라는 단어로 시작하는 첫 번째 명령에서 설치의 "Makefile.export.Trilinos"파일의 경로를 지정해야합니다. 다음으로 라이브러리 및 소스 파일의 이름을 올바른 이름으로 변경하고 make "MyApp.exe"를 실행하십시오. 여기서 "MyApp.exe"는 Makefile의 "MyApp.exe"를 바꾸는 데 사용하는 이름입니다. 도움이되기를 바랍니다. – giorgk