我刚刚安装了trilinos 11.0.3,现在我正在尝试使用cmake编译我的第一个应用程序。
我尝试编译的文件在这里是http://code.google.com/p/trilinos/wiki/EpetraSimpleVector
第一个命令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.除此之外,似乎已经正确地找到了trilinos的位置和库。
但是,make命令会生成类似的错误列表,例如:
/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)'知道这是怎么回事吗?
(我将源文件命名为teuchos_test.cpp,因为首先我试图编译teuchos包中的一些代码,但是我收到了与上面类似的错误)
谢谢
乔戈斯
发布于 2019-01-04 21:31:00
您可以使用cmake或make在Trilinos中构建程序。我建议您访问官方教程网站here,其中提供了这两种方法的详细解释。
发布于 2013-03-08 06:54:46
我不能用cmake编译trilinos的例子,但是我可以通过连接我自己的一切来做到这一点。对于给出上述错误的示例,我执行了以下操作
g++ -o teuchos_test teuchos_test.cpp \
-I/home/giorgos/Documents/TRILINOS/include \
-L/home/giorgos/Documents/TRILINOS/lib -lepetra因为它只依赖于epetra包(我仍然需要更改名称:)
但是,如果有人知道如何使用cmake编译trilinos,我将非常感谢您在这里提供的意见
https://stackoverflow.com/questions/15259907
复制相似问题