2023-03-03 17:47:06 +03:00
|
|
|
distributable:
|
|
|
|
url: https://gitlab.com/libeigen/eigen/-/archive/{{version}}/eigen-{{version}}.tar.gz
|
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
2023-05-01 20:14:59 +03:00
|
|
|
gitlab: libeigen/eigen/tags
|
2023-03-03 17:47:06 +03:00
|
|
|
|
|
|
|
build:
|
|
|
|
working-directory: build
|
|
|
|
dependencies:
|
|
|
|
cmake.org: '^3'
|
|
|
|
script: |
|
|
|
|
cmake .. -DCMAKE_INSTALL_PREFIX={{prefix}}
|
|
|
|
make install
|
|
|
|
|
|
|
|
# stuff expects `Eigen` to be in `include` rather than namespaced
|
|
|
|
cd "{{prefix}}"
|
|
|
|
mv include/eigen3/* include
|
|
|
|
cd include
|
|
|
|
rmdir eigen3
|
|
|
|
# but work for stuff that expects the namespace too
|
2023-10-08 21:58:42 +03:00
|
|
|
ln -s . eigen3
|
2023-03-03 17:47:06 +03:00
|
|
|
test:
|
|
|
|
make test
|
|
|
|
|
|
|
|
test:
|
|
|
|
dependencies:
|
|
|
|
freedesktop.org/pkg-config: ^0.29
|
|
|
|
env:
|
|
|
|
cxxflags: $(pkg-config --cflags eigen3)
|
|
|
|
fixture: |
|
|
|
|
#include <iostream>
|
|
|
|
#include <Eigen/Dense>
|
|
|
|
using Eigen::MatrixXd;
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
MatrixXd m(2,2);
|
|
|
|
m(0,0) = 3;
|
|
|
|
m(1,0) = 2.5;
|
|
|
|
m(0,1) = -1;
|
|
|
|
m(1,1) = m(1,0) + m(0,1);
|
|
|
|
std::cout << m << std::endl;
|
|
|
|
}
|
|
|
|
script: |
|
|
|
|
mv $FIXTURE test.cpp
|
|
|
|
g++ test.cpp ${cxxflags} -o test
|
|
|
|
./test > output.txt
|
|
|
|
out=$(./test)
|
|
|
|
if test "$out" = $' 3 -1\n2.5 1.5'; then
|
|
|
|
echo "PASS"
|
|
|
|
else
|
|
|
|
echo "FAIL"
|
|
|
|
fi
|