02-08-2019 02:32 PM
Vivado 2018.3, Zynq UltraScale, using EIGEN library
The following program works perfectly fine in MS Visual Studio
#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; }
But in Vivado SDK I get the following error messages
'std::log1p' has not been declared 'std::round' has not been declared
This is clearly related to the iostream functions.
The Eigen library apparently use some "newer" iostream features
I have tried to add
-std=g++11 //or -std=g++0x
(as was suggested in some posts) to the compiler flags (Properties/Settings)
just to get another error message
Cannot find -lstdc++11
Has anybody ever successfuly used the EIGEN library in VIVADO SDK and what compiler flags do I have to set or
what do I have to do to make this work?
THANKS
02-09-2019 10:25 AM
After a few hours of trying all sorts of silly things...
First my application is obviously a lot more complex than the example above.
I am using freeRTOS, lwIP and the Eigen library and the application is C++.
Mixing C and C++ has its own unique problems... however
1. Properties/Settings/C/C++ Build/ARM v8 g++ compiler/Directories..... add <path to Eigen library>
2. Properties/Settings/C/C++ Build/ARM v8 g++ compiler/Inferred Options/Software Platform/ .... Software Platform Inferred Flags ... add -std=g++11
3. Then you must add the include files to the Eigen library BEFORE everything else. (only took me 8 hours to figure this out).
4. These are my other properties settings... for freeRTOS and lwIP
Properties/Settings/C/C++ Build/ARM v8 g++ linker/Inferred Options/Software Platform/ .... Software Platform Inferred Flags ... add
-Wl,--start-group,-lxil,-lfreertos,-lgcc,-lc,-lstdc++,--end-group
-Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,-lstdc++,--end-group
5. in FreeRtosConfig.h you may want to change a few default values
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16777216 ) )
6. Then the lwIP default settings are also good for nothing, just copy the settings from one of the provided demo programs
What tripped me up was:
Under tcp_options / tcp_snd_buf the maximum value is 65535 NOT 65536 (as I had to find out the hard way)
good luck
02-09-2019 06:49 AM
Here is one thing to try... #include <cmath> before including Eigen/Dense
Hope this helps
If so, please mark as solution accepted. Kudos also weclomed. :-)
02-09-2019 10:25 AM
After a few hours of trying all sorts of silly things...
First my application is obviously a lot more complex than the example above.
I am using freeRTOS, lwIP and the Eigen library and the application is C++.
Mixing C and C++ has its own unique problems... however
1. Properties/Settings/C/C++ Build/ARM v8 g++ compiler/Directories..... add <path to Eigen library>
2. Properties/Settings/C/C++ Build/ARM v8 g++ compiler/Inferred Options/Software Platform/ .... Software Platform Inferred Flags ... add -std=g++11
3. Then you must add the include files to the Eigen library BEFORE everything else. (only took me 8 hours to figure this out).
4. These are my other properties settings... for freeRTOS and lwIP
Properties/Settings/C/C++ Build/ARM v8 g++ linker/Inferred Options/Software Platform/ .... Software Platform Inferred Flags ... add
-Wl,--start-group,-lxil,-lfreertos,-lgcc,-lc,-lstdc++,--end-group
-Wl,--start-group,-lxil,-llwip4,-lgcc,-lc,-lstdc++,--end-group
5. in FreeRtosConfig.h you may want to change a few default values
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16777216 ) )
6. Then the lwIP default settings are also good for nothing, just copy the settings from one of the provided demo programs
What tripped me up was:
Under tcp_options / tcp_snd_buf the maximum value is 65535 NOT 65536 (as I had to find out the hard way)
good luck
02-09-2019 10:26 AM
02-09-2019 10:45 AM
Thanks for the reply, but this was not it
02-10-2019 06:35 PM
Sorry folks, the fingers were faster than the brain
In my solution, it should read
2. Properties/Settings/C/C++ Build/ARM v8 g++ compiler/Inferred Options/Software Platform/ .... Software Platform Inferred Flags ... add
-std=c++11
and NOT
-std=g++11
This will give you acompiler error