0
我刚刚安装了trilinos 11.0.3,现在我正在尝试使用cmake编译我的第一个应用程序。编译trilinos程序
我试图编译的文件是在这里 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
命令会生成一个simi列表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)'
任何想法这里发生了什么?
(我命名为源文件teuchos_test.cpp因为首先我试图编译从teuchos包装一些代码,但是我收到了如上类似的错误)
谢谢
Giorgos
你使用[这个例子](http://code.google.com/p/trilinos/wiki/CMakeFindPackageTrilinosExample)? – Fraser 2013-03-07 23:16:40
感谢您的发现! 我使用了Trilinos的类似软件,但没有太多解释性评论。我会试一试 – giorgk 2013-03-08 23:51:45
这就是我的做法: 将http://trilinos.sandia.gov/Export_Makefile_example.txt 的内容复制到一个空的Makefile中。 在第一个以单词include开头的命令中,您必须提供安装的“Makefile.export.Trilinos”文件的路径。 接下来使用正确的名称更改库和源文件的名称,并执行make“MyApp.exe”,其中“MyApp.exe”是用来替换Makefile中的“MyApp.exe”的名称。 我希望这会有所帮助。 – giorgk 2013-06-27 19:44:14