-
Notifications
You must be signed in to change notification settings - Fork 64
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
Document and build system updates for the RPi. #370
Conversation
…t will now work out of the box on RPi.
Hmm, the Github Actions CI needs an approval for first time contributors. That's new. |
I don't think it can work as it is right now. I hard sets some compile flags in main
The architecture specific settings (and settings specific to a platform, i.e. operating system vendor) should be in a toolchain file. (Toolchain files are passed to cmake as I presume that when compiling directly on Raspberry PI, it works, right? And these flags can be used for all Now, the configuration step fails on
|
As I said the CMakeList.txt file was not ready, but if I did not turn in
the rest of it now it might be a while before I got to finish it.
…On Jan 21 2022 12:35 PM, cerna wrote:
I don't think it can work as it is right now. I hard sets some compile
flags in main `CMakeLists.txt` file which are only valid for `arm64`
architecture (I think):
```
set(CMAKE_C_FLAGS "-O0 -march=armv8-a -mfloat-abi=hard
-mfpu=neon-fp-armv8 ${COMMON_FLAGS}")
```
The architecture specific settings (and settings specific to a
platform, i.e. operating system vendor) should be in a toolchain file.
(Toolchain files are passed to cmake as `cmake $PATH
--toolchain=$TOOLCHAIN_FILE`, more info can be acquired in
[documentation](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html).)
Machinekit-HAL's toolchain for Debian is in
[debianMultiarchToolchain.cmake](https://github.com/machinekit/machinekit-hal/blob/eca0570d9d827dc7b4fcaa029eb8407db0b6e0e1/debian/debianMultiarchToolchain.cmake).
(But there could be more.)
I presume that when compiling directly on Raspberry PI, it works,
right? And these flags can be used for all `armv8` `arm64` devices,
right? So maybe adding an if/switch construct to that Toolchain file
would be the best solution.
Now, the configuration step fails on
```
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_3f9e7/fast &&
/usr/bin/gmake -f CMakeFiles/cmTC_3f9e7.dir/build.make
CMakeFiles/cmTC_3f9e7.dir/build
gmake[1]: Entering directory
'/home/mars/Documents/Programming/machinekit/cmk-hal2/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3f9e7.dir/CheckIncludeFile.c.o
/usr/bin/cc -O0 -march=armv8-a -mfloat-abi=hard -mfpu=neon-fp-armv8
-std=gnu11 -o CMakeFiles/cmTC_3f9e7.dir/CheckIncludeFile.c.o -c
/home/mars/Documents/Programming/machinekit/cmk-hal2/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
cc: error: unrecognized command-line option ‘-mfloat-abi=hard’
cc: error: unrecognized command-line option ‘-mfpu=neon-fp-armv8’
gmake[1]: *** [CMakeFiles/cmTC_3f9e7.dir/build.make:78:
CMakeFiles/cmTC_3f9e7.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory
'/home/mars/Documents/Programming/machinekit/cmk-hal2/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:127: cmTC_3f9e7/fast] Error 2
```
|
This comment has been minimized.
This comment has been minimized.
Ah, OK, got it! |
I'll try to get back to CMakeList.txt again ASAP, but I spent quite some
time trying to track down how to pull the march, mcpu and other bits
from the build system to get it right. I have not seen any exemplar,
but I was sent some reference documents which will help -- when
supporting things like the RPi1, Nano, ...
…On Jan 21 2022 12:53 PM, cerna wrote:
> As I said the CMakeList.txt file was not ready, but if I did not turn
> in
the rest of it now it might be a while before I got to finish it.
Ah, OK, got it!
|
@cerna I broke out the documentation edits from the work to get the build system to work as described, and sent another pull request. I am closing this one. |
I made a number of minor changes to the documentation and build system to get it to work. I am sending in the changes for a PR now, as it is likely going to be days before I can finish working on the CMakeLists.txt to handle setting the -march robustly.