-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Crosscompile an example #3832
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
Crosscompile an example #3832
Conversation
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
Signed-off-by: Omar Shrit <[email protected]>
doc/embedded/crosscompile_example.md
Outdated
| bindings such as kNN command line program on a Raspberry PI 2. Please refer to that | ||
| article first and follow the first part on how to setup cross-compilation toolchain, | ||
| and then continue with this article. Or refer to this | ||
| [table](supported_boards.md) for a quick start guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just to be clear, it seems like this example is focused on using CMake to set up a project that will do embedded cross-compilation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes indeed, this is the main idea, because you need a guide if you have your own code
Co-authored-by: Ryan Curtin <[email protected]>
rcurtin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started reviewing this and adding more suggestions; of course I think it is a great idea to add an example like this. But as I got further into it, I wondered if this is actually the way people will use mlpack inside of a CMake project. I can definitely see that users will fall into one of two camps:
- They'll either want a fully-working example that they can adapt; or
- they'll want some kind of
Findmlpack.cmakefile (which has been requested in various issues, I haven't dug one up) that they can include, and optionally they may want to use the autodownloader too, for convenience
In either case, I think it's important that the CMake file is as simple as possible. So I think we need to start with the Findmlpack.cmake file, and we can put a lot of the logic that searches for mlpack's dependencies in there. Then, the random forest example can be structured like this:
- define the project and C++ standard and whatever else
- use the autodownloader to download the dependencies of mlpack
- call
find_package(mlpack)with the locations of all mlpack's dependencies set (and point out that if you don't want to autodownload/compile OpenBLAS, you can just comment all that out) - define the actual example compilation
What do you think? I know it will be a bit of an overhaul, but I want to make sure that when people come to use mlpack in their CMake projects that it feels as natural as possible. Happy to help with the Findmlpack.cmake file.
| @@ -0,0 +1,194 @@ | |||
| ## Crosscompile mlpack example for an embedded hardware | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some general thoughts:
-
Once Overhaul documentation homepage #3836 is merged, we should add this to the SVGs, but I'm not 100% sure how. Maybe for now it could be a line in the "Deployment" section, but eventually we'll need to split out and create a landing page for our embedded deployment tutorials.
-
Renaming this to something like "Cross-compiling mlpack in a CMake project" might be more accurate?
-
Up to you, but we could even just make it "Using mlpack in a CMake project", and then keep the stuff specific to cross-compilation at the end.
Co-authored-by: Ryan Curtin <[email protected]>
|
We can have |
|
With all CMake |
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
Co-authored-by: Ryan Curtin <[email protected]>
This PR explains how to crosscompile an mlpack example by analysing the template cmake file we have provided in the examples repository.