giaf / blasfeo

Basic linear algebra subroutines for embedded optimization
Other
308 stars 84 forks source link

Variable size arrays in examples (see acados failing appveyor build for instances) #65

Closed dkouzoup closed 6 years ago

dkouzoup commented 6 years ago

It would be great to either eliminate those or provide a cmake variable to compile blasfeo without the examples.

dkouzoup commented 6 years ago

the errors can be found here:

https://ci.appveyor.com/project/roversch/acados/build/1.0.459

Note that the more we delay this and the continuous integration fails, the more errors will accumulate. Already the latest master has a bunch of new errors. @bnovoselnik maybe you can create a quick PR for this one?

bnovoselnik commented 6 years ago

I'm on it!

bnovoselnik commented 6 years ago

PR #67 should do it

edit: nevermind, const int is still not allowed with C

https://msdn.microsoft.com/en-us/library/eff825eh.aspx

edit2: ok, now it should be fine

dkouzoup commented 6 years ago

oh that was fast! Thanks! Can you also check these newer syntax errors at the end of this log maybe?

https://ci.appveyor.com/project/dkouzoup/acados/build/1.0.436

are they easy to fix?

bnovoselnik commented 6 years ago

These seem to be caused by the use of gcc's __attribute__ mechanism (which is not implemented in Visual Studio). I guess some kind of preprocessing macro could be used to circumvent this. I'll give it a try.

dkouzoup commented 6 years ago

Thanks! It must have been introduced recently because the previous version of blasfeo coupled to acados did not produce these errors.

bnovoselnik commented 6 years ago

OK, so according to the link below, VS 2015 (and later) supports this:

__declspec( align( # ) )

which should be equivalent to gcc's

__attribute__ ((aligned (#)))

link: https://msdn.microsoft.com/en-us/library/83ythb65.aspx

So I added a small macro CACHE_ALIGN(X) in the latest commit that uses the first one in case Visual Studio is detected and the second one otherwise (thankfully, gcc and clang have the same implementation).

dkouzoup commented 6 years ago

Awesome! Thanks @bnovoselnik. @giaf can you please check and merge this one? I will then check if Appveyor succeeds in acados.

dkouzoup commented 6 years ago

Can't really test it but closing for now.