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

Document and build system updates for the RPi. #370

Closed
wants to merge 8 commits into from
Closed

Document and build system updates for the RPi. #370

wants to merge 8 commits into from

Conversation

ebo
Copy link

@ebo ebo commented Jan 21, 2022

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.

@cerna
Copy link
Contributor

cerna commented Jan 21, 2022

Hmm, the Github Actions CI needs an approval for first time contributors. That's new.

@cerna
Copy link
Contributor

cerna commented Jan 21, 2022

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.) Machinekit-HAL's toolchain for Debian is in 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

@ebo
Copy link
Author

ebo commented Jan 21, 2022 via email

@cerna

This comment has been minimized.

@cerna
Copy link
Contributor

cerna commented Jan 21, 2022

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!

@ebo
Copy link
Author

ebo commented Jan 21, 2022 via email

@ebo
Copy link
Author

ebo commented Jan 29, 2022

@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.

@ebo ebo closed this Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants