New build system introduced, testing and feedback needed
-
@oozebot I successfully did that, see the discussion at https://github.com/Duet3D/PanelDueFirmware/pull/179. You may need to pull that PR into your local repo to successfully build as it's not committed yet (or check out https://github.com/mfs12/PanelDueFirmware/tree/cmake-improvements).
- If you don't have the GNU ARM Compiler and Build Tools installed yet, follow steps 1 and 3 from the RRF Build Instructions. I did re-use the 2018-q4 release but
- Install CMake from the CMake Download Page. This replaces step 2 in the build instructions mentioned above.
- Make sure to add the directories the binaries end up in to your Path.
- Using Powershell, check you can find
make
,rm
using(Get-Command make).Path
and(Get-Command rm).Path
. - Generate the build files running
make -G "Unix Makefiles" -B build -DDEVICE="5.0i" -DCROSS_COMPILE="C:/Program\ Files\ (x86)/GNU\ Tools\ ARM\ Embedded/8\ 2018-q4-major/bin/arm-none-eabi-"
(adjusting the value for-DCROSS_COMPILE
parameter to your version and install path and the value for-DDEVICE
for the PanelDue you want to build for). - Build the binary running
make -C build all
(you can run this with-j4 -O
for maximum parallelism)
And that should be it.
@mfs12 I think it might be a good idea to follow the RRF change of moving the build instructions to the GitHub wiki and replacing both BuildInstructions.md (outdated now) and the Development section in Readme.md (more current).
-
I updated the readme file accordingly.
Updated the master branch https://github.com/duet3d/PanelDueFirmware/tree/master with fixes from @oliof and better documentation.
Feedback on the documentation is very welcome so people will be able to setup things as quick as possible.
-
And what's really a bummer is the path handling for the CROSS_COMPILE variable on windows. If you have any good solutions for that I want to learn about them.
-
I can confirm that a clean checkout of PanelDueFirmware master branch builds cleanly on Windows now.
Will this build environment also come to RepRapFirmware?
-
Will this build environment also come to RepRapFirmware?
This is still unclear. It depends on the experiences we collect with paneldue.
-
You have my vote of confidence (-:
And also let me point out that when I implemented the Colinear Tripteron kinematics, I resorted to building new versions of RepRapFirmware with the Makefiles Eclipse generated to relieve my anemic machine from running Eclipse all the time. So it's possible and desirable (-:
-
This is probably sacrilege but I find using cmake overly complex and much prefer good old make. cmake is great when it works, but when there is a problem it can be very hard to identify what is the cause. The LPC and STM32 builds of RRF both use make, for the recent ESP32 version of the Duet WiFi software I used cmake (to fit in with the espressif build system), it is way more complex and hard to debug than the corresponding make system I use to build the ESP8266 version. Maybe I'm just too old school, but having watched many software projects disappear down a rat hole of a "new improved build system", sometimes simple is best.
-
@gloomyandy, settting cmake up i stumbled also in quite some pitfalls. although i think the found solution is quite handy but still not perfect. but neither is make, it also has a lot of pitfalls from my experience.
But once either of them is working things should be ok.
So far we are living with eclipse build file generation, which is even harder to debug compared to make and cmake.
What convinced me to use cmake is the support for different IDEs, I hope this will lower the bar to build and develop the project.
Let's give it a shot.
-
@gloomyandy said in New build system introduced, testing and feedback needed:
The LPC and STM32 builds of RRF both use make
Can you point me to the repository? Eventually it would be an option to port your solution to RRF.
-
@mfs12
Here's the main build repo https://github.com/gloomyandy/RRFBuild/tree/v3.4-dev -
@gloomyandy I kind of agree. Considering I need to manually pass the really important info (where are the build binaries, what do I want to build) manually into CMake to make it work on Windows, a well-constructed set of Makefiles might be cleaner and easier to follow along in the end. But I won't say no to CMake, and it's @mfs12ยดs weapon of choice (-:
-
@mfs12 The repo that jay pointed you to is the overall build repo. The actual make files we currently keep in the CoreN2G repo (which may or may not be a good idea):
https://github.com/gloomyandy/CoreN2G/tree/v3.4-dev/src/STM32F4/makefiles
https://github.com/gloomyandy/CoreN2G/tree/v3.4-dev/src/LPC/makefilesI doubt if these qualify as a "well constructed set of makefiles", but they do the job. For historical reasons we currently keep two separate sets of build files for the two different mcus, it would probably make sense to combine them and have a different make build target.
cmake is certainly a lot easier to handle than the eclipse build file system!
-
Thanks all. I'm getting further and can create the build files, but am now stuck at the following:
PS C:\Eclipse\PanelDueFirmware> make -C build all -j12 make: Entering directory 'C:/Eclipse/PanelDueFirmware/build' Makefile:32: *** missing separator. Stop.
I've tried other variations with no luck. FYI - (Get-Command make).Path returns:
C:\Program Files\GNU ARM Eclipse\Build Tools\2.6-201507152002\bin\make.exe
Thanks in advance.
-
@oozeBot
can you send the file 'C:/Eclipse/PanelDueFirmware/build/Makefile'There's something wrong with the makefile. any path you pass as commandline parameter needs to be in quotes, backslash replaced with slash and whitespaces escaped with backslash.
Can you share your cmake call?
-
@mfs12 - Here you go - both renamed to ".txt". I believe I've setup env.vmake correctly. With it, my cmake command is just
cmake -B build
I'm reviewing the makefile now - one thing of note I've found is on line 79 - note the double "\\". edit - changing the \\ to \ didn't fix it. still reviewing.
C:\Eclipse\PanelDueFirmware\build\\CMakeFiles\progress.marks
edit - There was an unescaped space in my env.cmake file that I just corrected, but still receiving the same error.
-
@oozeBot somehow make wants the if-block at line 32 indented. I don't understand why. Weird enough.
Anyway i want cmake to run on you machine so hacking the makefiles is not really an option. Just for testing.
-
@mfs12 - thanks. I got past it by indenting the entire IF block in both makefile and CMakeFiles\makefile2. Pretty strange..
Current error I'm researching:
PS C:\Eclipse\PanelDueFirmware> make -C build all make: Entering directory 'C:/Eclipse/PanelDueFirmware/build' make[1]: Entering directory 'C:/Eclipse/PanelDueFirmware/build' make[1]: *** No rule to make target '/nologo'. Stop. make[1]: Leaving directory 'C:/Eclipse/PanelDueFirmware/build' Makefile:79: recipe for target 'all' failed make: *** [all] Error 2 make: Leaving directory 'C:/Eclipse/PanelDueFirmware/build'
-
You can always make the build verbose.
$ make -C build VERBOSE=1 all
-
@mfs12 - Thank you for the hand-holding.
I see an error but am not sure where it came from yet. Look at line 5. That does not exist on my system and was not defined anywhere that I have yet to find.edit - that's the path to "make" and does exist. My mistake - I was looking in Program Files (x86).
PS C:\Eclipse\PanelDueFirmware> make -C build VERBOSE=1 all make: Entering directory 'C:/Eclipse/PanelDueFirmware/build' "C:\Program Files\CMake\bin\cmake.exe" -SC:\Eclipse\PanelDueFirmware -BC:\Eclipse\PanelDueFirmware\build --check-build-system CMakeFiles\Makefile.cmake 0 "C:\Program Files\CMake\bin\cmake.exe" -E cmake_progress_start C:\Eclipse\PanelDueFirmware\build\CMakeFiles C:\Eclipse\PanelDueFirmware\build\CMakeFiles\progress.marks C:/Program Files/GNU ARM Eclipse/Build Tools/2.6-201507152002/bin/make -f CMakeFiles\Makefile2 /nologo -w -- VERBOSE=1 all make[1]: Entering directory 'C:/Eclipse/PanelDueFirmware/build' make[1]: *** No rule to make target '/nologo'. Stop. make[1]: Leaving directory 'C:/Eclipse/PanelDueFirmware/build' Makefile:79: recipe for target 'all' failed make: *** [all] Error 2 make: Leaving directory 'C:/Eclipse/PanelDueFirmware/build'
-
@oozebot said in New build system introduced, testing and feedback needed:
C:/Program Files/GNU ARM Eclipse/Build Tools/2.6-201507152002/bin/make
How old is your eclipse and toolchain? Is this a date 201507152002?
I think this might be an issue.