+eigen.tuxfamily.org (#439)

* eigen.tuxfamily.org built

* Should pass CI, cleaned up package.yaml

* tweaks

* wip

---------

Co-authored-by: Max Howell <mxcl@me.com>
This commit is contained in:
Sanchit Ram Arvind 2023-03-03 10:47:06 -04:00 committed by GitHub
parent 92a80c7ea0
commit a703502b0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,56 @@
distributable:
url: https://gitlab.com/libeigen/eigen/-/archive/{{version}}/eigen-{{version}}.tar.gz
strip-components: 1
versions:
- 3.4.0
build:
working-directory: build
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
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
ln -s eigen3 .
test:
make test
test:
dependencies:
tea.xyz/gx/cc: c99
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