Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake for hpmpc and blasfeo? #61

Closed
zanellia opened this issue Apr 11, 2017 · 34 comments
Closed

cmake for hpmpc and blasfeo? #61

zanellia opened this issue Apr 11, 2017 · 34 comments

Comments

@zanellia
Copy link
Member

zanellia commented Apr 11, 2017

I had some troubles managing ExternalProjects based on Makefiles so I made a minimal port of hpmpc's build system to CMake. Not sure this is better than a Makefile-based build system, but at least all our core code is going to be built with CMake (good? dunno). Anyways, if you guys like it we could give it a shot. The code is here:

https://github.com/zanellia/hpmpc/tree/crosscompiling

and it is based on a single CMakeLists.txt file (unlike the previous hpmpc's CMake build system).

@roversch
Copy link
Contributor

roversch commented Apr 11, 2017 via email

@zanellia
Copy link
Member Author

As @giaf is not a big fun of cmake, I thought I could start an acados-based discussion here to convince him :P

@roversch
Copy link
Contributor

roversch commented Apr 11, 2017 via email

@zanellia
Copy link
Member Author

@ghorn already uses CMake for qpOASES actually...(hint)

@doanminhdang
Copy link
Contributor

doanminhdang commented Apr 11, 2017 via email

@roversch
Copy link
Contributor

roversch commented Apr 11, 2017 via email

@zanellia
Copy link
Member Author

zanellia commented Apr 11, 2017

Hey Dang, in my limited experience, build systems can be a pain. CMake might help to manage builds as the project(s) grows in complexity.

Could you give an example of what such a toolchain would look like?

I would be also interested in knowing more about practical problems, if you are facing some already. I guess you could encounter problems whenever you have to use some high-level IDE or environment right? Otherwise you just need to have CMake installed on your host machine, configure the project and cross-compile, right?

@doanminhdang
Copy link
Contributor

doanminhdang commented Apr 11, 2017 via email

@zanellia
Copy link
Member Author

I do see the point in the sense that integrating acados directly into the toolchain might be tricky. However, you could also cross-compile a static or shared library for acados and just link against it from your Makefile-based build system.

@doanminhdang
Copy link
Contributor

doanminhdang commented Apr 11, 2017 via email

@doanminhdang
Copy link
Contributor

doanminhdang commented Apr 11, 2017 via email

@giaf
Copy link
Collaborator

giaf commented Apr 12, 2017

Yes I'm still a fan of make instead of cmake, nothing has changed in that regard ;)

Make provides exactly what I want: a clean and low-level way to tell exactly how the project build should be, and where I know exactly what is going on (e.g. regarding dependencies). The flexibility provided by cmake is in my opinion a minus and not a plus, at least in the (low level) stuff I'm doing.

That said, I'm not against adding to the make an additional cmake if this can make stuff easier in ACADOS. But this cmake should mimic exactly what the make does (e.g. fix the compiler to the ones that work, fix the compilation flags to the ones I know work well). But at this point I don't see any difference with respect to a make called using e.g.
make TARGET=X64_INTEL_HASWELL LA=HIGH_PERFORMANCE

@zanellia thanks for the effort of adding a cmake.
As it is now, it only works when BLASFEO is used (when it is not, entirely different sources are employed).

Note that BLASFEO HP doesn't work with any compiler other than gcc and clang, since the assembly-coded kernels can be processed only by these compilers.
HPMPC also doesn't work with e.g. visual studio (and I never tested with anything else than gcc and clang). In my opinion, removing the list of tested compilers to choose among is a kind of blind guess on what can happen with other compilers.

@zanellia
Copy link
Member Author

zanellia commented Apr 12, 2017 via email

@giaf
Copy link
Collaborator

giaf commented Apr 12, 2017

@zanellia Maybe I can return the question to you :) What would such a CMake give more than the current makefile? What are the features that you would like to have?

@zanellia
Copy link
Member Author

I had some troubles managing ExternalProjects based on Makefiles so I made a minimal port of hpmpc's build system to CMake.

This is the main reason I hacked together a CMake build system for hpmpc.

I personally find CMake easier and I would expect it to bring some advantages in the near future. Instead of comparing CMake and Makefile in terms of what functionalities they offer, I would focus on how easy it is to develop and maintain build systems based on the two approaches.

@giaf
Copy link
Collaborator

giaf commented Apr 13, 2017

What about discussing this once we are back to the office after Easter?

@zanellia
Copy link
Member Author

Yea, sure!

@roversch roversch added the build label Apr 17, 2017
@zanellia
Copy link
Member Author

So, although I do like the idea of having all the external projects using CMake, as Gianluca pointed out, it might be difficult to keep Make- and CMake-based build systems in sync. This holds for hpmpc and blasfeo and it is even more of a relevant issue with other dependencies like qpOASES. Thoughts?

@roversch
Copy link
Contributor

roversch commented Apr 21, 2017 via email

@zanellia
Copy link
Member Author

zanellia commented Apr 21, 2017 via email

@rienq rienq mentioned this issue Jun 14, 2017
@zanellia
Copy link
Member Author

zanellia commented Jun 17, 2017

Hi all, since both @giaf and @roversch asked for CMake for hpmpc and blasfeo, you can find the link to my (very rough) version of the build system for hpmpc here:

https://github.com/zanellia/hpmpc/blob/crosscompiling/CMakeLists.txt

Analogously the one for blasfeo is here:

https://github.com/zanellia/blasfeo/blob/crosscompiling/CMakeLists.txt

They only work for a single target since I only needed that specific version when hacked CMake in. However, it should be very easy to extend to all the other targets.

@giaf
Copy link
Collaborator

giaf commented Jun 17, 2017

Yep I already found ;)

And I added cmake to HPIPM (that by the way now is only missing partial condensing, compared to HPMPC)

@zanellia
Copy link
Member Author

zanellia commented Jun 17, 2017 via email

@giaf
Copy link
Collaborator

giaf commented Jun 17, 2017

nope there is no partial tightening, that will be your part of the fun ;)

@giaf
Copy link
Collaborator

giaf commented Jun 17, 2017

it has ipm for dense qp, ipm for ocp qp, (full) condensing from ocp qp to dense qp

@giaf
Copy link
Collaborator

giaf commented Jun 18, 2017

Now also BLASFEO has cmake @roversch
@zanellia why the minimum version is 2.8.11?

@giaf
Copy link
Collaborator

giaf commented Jun 18, 2017

@roversch HPMPC won't get any cmake: as soon as HPIPM is up and running, we can remove HPMPC from ACADOS

@zanellia
Copy link
Member Author

zanellia commented Jun 18, 2017 via email

@giaf
Copy link
Collaborator

giaf commented Jun 19, 2017

the "stable version of HPMPC" is the one already used in ACADOS, and I'm not putting any more effort in improving it

and HPIPM is stable and ready to be used, you can give it a try ;)

@giaf
Copy link
Collaborator

giaf commented Jun 19, 2017

@zanellia how did you choose cmake minimum version 2.8.11 in your cmake (that I just copied for now, but I would like to know more about?)

@zanellia
Copy link
Member Author

zanellia commented Jun 19, 2017 via email

@giaf
Copy link
Collaborator

giaf commented Jun 19, 2017

In my pc I have version 3.5. What is the oldest version you tested on?

Also, I had to replace all EQUAL with MATCHES in order to make it work properly

@giaf
Copy link
Collaborator

giaf commented Jun 19, 2017

I downloaded 2.8.0 and it fails with BLASFEO due to the assembly code.
Version 2.8.11 works, so I'll leave that as minimum version.

@roversch
Copy link
Contributor

Closing this in favour of #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants