I would like to use libElemental as a library after installing it as follows:
git clone https://github.com/elemental/Elemental
mkdir build
cd build
cmake ../Elemental
make
make install
Install is successful & examples build. I have limited makefile
experience, but would like to avoid using cmake
so I can easily integrate elsewhere.
I have one file: test.cpp
:
#include <El.hpp>
#include <stdlib.h>
int main(int argc, char* argv[]) {
return 0;
}
Here is my unsuccessful makefile
attempt:
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
Here is a snippet of the linker errors I receive:
/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
Any help or pointers to help me resolve this is much appreciated!