cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Participant
Participant
1,369 Views
Registered: ‎04-08-2015

iostream problems

Jump to solution

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

 

0 Kudos
Reply
1 Solution

Accepted Solutions
Participant
Participant
1,294 Views
Registered: ‎04-08-2015

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

View solution in original post

0 Kudos
Reply
5 Replies
Instructor
Instructor
1,308 Views
Registered: ‎10-23-2018

@annosauer1

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. :-)

0 Kudos
Reply
Participant
Participant
1,295 Views
Registered: ‎04-08-2015

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

View solution in original post

0 Kudos
Reply
Participant
Participant
1,293 Views
Registered: ‎04-08-2015
Thanks for reply, but this was not it
0 Kudos
Reply
Participant
Participant
1,280 Views
Registered: ‎04-08-2015

@xilinxacct

Thanks for the reply, but this was not it

0 Kudos
Reply
Participant
Participant
1,247 Views
Registered: ‎04-08-2015

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

 

0 Kudos
Reply