Я хотел бы использовать libElemental в качестве библиотеки после ее установки следующим образом:
git clone https://github.com/elemental/Elemental
mkdir build
cd build
cmake ../Elemental
make
make install
Установка прошла успешно, примеры собраны. У меня ограниченный опыт работы с makefile
, но я бы не хотел использовать cmake
, чтобы легко интегрироваться в другие приложения.
У меня есть один файл: test.cpp
:
#include <El.hpp>
#include <stdlib.h>
int main(int argc, char* argv[]) {
return 0;
}
Вот моя неудачная makefile
попытка:
CFLAGS = -O3 -std=gnu++11
LDFLAGS := -lEl
CC = mpicc.mpich2
CXX = mpicxx.mpich2
all: test
test: test.cpp
$(CXX) $(CFLAGS) $(LDFLAGS) test.cpp -o test
Вот фрагмент ошибок компоновщика, которые я получаю:
/tmp/ccgDsmEV.o: In function __static_initialization_and_destruction_0':
/usr/local/include/El/number_theory/lattice/LLL.hpp:316: undefined reference to El::Timer::Timer(std::string const&)'
:
:
/tmp/ccgDsmEV.o:/usr/local/include/El/number_theory/lattice/LLL.hpp:318: more undefined references to El::Timer::Timer(std::string const&)' follow
collect2: error: ld returned 1 exit status
make: *** [test] Error 1
Любая помощь или указатели, которые помогут мне решить эту проблему, очень ценятся!
$(CXX) test.cpp $(CFLAGS) $(LDFLAGS) -o test
. Хотя никаких гарантий. - person andars   schedule 04.10.2016would like to avoid using cmake so I can easily integrate elsewhere
Но для этого и существует CMake. - person arrowd   schedule 04.10.2016