Hi, I’m new to PlatformIO and really struggling with including libraries that are not part of the Arduino/PlatformIO ecosystem.
I am writing an embedded project and want to use libeigen (libeigen / eigen · GitLab). No matter how I try to include this in my project, when I attempt to build I get hundreds of errors linked to the benchmarks and examples included in the Eigen repo (despite the fact that at no point in my code do I include these), or I simply can’t build it at all.
I have tried:
- Cloning the repo to my shared libs dir and adding this with
lib_extra_dirs = /Users/mariana/PlatformIO/Shared/
- Cloning the repo into the project’s /lib dir, (which I want to avoid as I want to use it for multiple different projects and not duplicate it each time)
- Adding the repo’s URL using
lib_deps = git+https://gitlab.com/libeigen/eigen.git
- As with #3 but without the
git+
preposition
Even with the most basic main.cpp file that just has:
#include <Arduino.h>
#include <Eigen/Dense>
void setup() { }
void loop() { }
I cannot get the library to work.
In the case of #1 and #2 I get hundreds of errors like:
/Users/mariana/PlatformIO/Shared/eigen/bench/BenchUtil.h:11:57: fatal error: boost/preprocessor/repetition/enum_params.hpp: No such file or directory
/Users/mariana/PlatformIO/Shared/eigen/bench/BenchUtil.h:11:57: fatal error: boost/preprocessor/repetition/enum_params.hpp: No such file or directory
I have not referenced or included the benchmarks anywhere. If I delete the /bench/ dir I instead get errors thrown by example projects in the repo, which I also haven’t included.
In the case of #3 I get red lines under the Eigen includes in main.cpp and immediate compile failure because it cannot find them. But if I type:
pio lib install git+https://gitlab.com/libeigen/eigen.git
In the CLI I get:
Library Manager: eigen @ 0.0.0+20210217162937.sha.be0574e is already installed
And curiously when I check what is downloaded, it is nothing like what the repo itself contains, instead mostly containing files relating to the performance monitoring / benchmarking and none of the actual Eigen files:
What am I doing wrong here? My ideal solution would be to have a separate directory in my filesystem where I keep my shared files, linked to their respective repos, then included these from PIO. However it seems no matter what I do I can’t get this library to be included correctly.
Many thanks