MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.17k stars 19.21k forks source link

[BUG] toolchain-gccarmnoneeabi Not working on Mac #15288

Closed ReadieS closed 5 years ago

ReadieS commented 5 years ago

Description

Bug fix 2.0 wont build on Macs due to an error with toolchain-gccarmnoneeabi compatibility. Issue can be rectified by editing ~/.platformio/platforms/nxplpc-arduino-lpc176x/platform.json

Please see discussion here

Steps to Reproduce

  1. Edit bug fix 2.0 to compile for LCP1768
  2. Press Build

Expected behavior: [What you expect to happen] Marlin to compile correctly

Actual behavior: [What actually happens] `Processing LPC1768 (platform: https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/maste

r.zip; framework: arduino; board: nxp_lpc1768)


PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.80201.181221

Downloading...

Unpacking...

toolchain-gccarmnoneeabi @ 1.80201.181221 has been successfully installed!

Verbose mode can be enabled via `-v, --verbose` option

CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc-arduino-lpc176x/nxp_lpc1768.htm

l

PLATFORM: NXP Arduino LPC176x 0.0.2 > NXP LPC1768

HARDWARE: LPC1768 100MHz, 31.80KB RAM, 464KB Flash

DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (blackmagic, jlink)

PACKAGES: framework-arduino-lpc176x 0.1.3

Converting Marlin.ino

sh: arm-none-eabi-g++: command not found

*** Error 127

AssertionError: :

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/main.py", line 126:

    env.SConscript("$BUILD_SCRIPT")

  File "/Volumes/Macintosh HDD/samuelread/.platformio/packages/tool-scons/script/../engine/SC

ons/Script/SConscript.py", line 541:

    return _SConscript(self.fs, *files, **subst_kw)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/packages/tool-scons/script/../engine/SC

ons/Script/SConscript.py", line 250:

    exec _file_ in call_stack[-1].globals

  File "/Volumes/Macintosh HDD/samuelread/.platformio/platforms/nxplpc-arduino-lpc176x/builde

r/main.py", line 136:

    target_elf = env.BuildProgram()

  File "/Volumes/Macintosh HDD/samuelread/.platformio/packages/tool-scons/script/../engine/SC

ons/Environment.py", line 224:

    return self.method(*nargs, **kwargs)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/tools/platformio.py", line 110:

    env.BuildFrameworks(env.get("PIOFRAMEWORK"))

  File "/Volumes/Macintosh HDD/samuelread/.platformio/packages/tool-scons/script/../engine/SC

ons/Environment.py", line 224:

    return self.method(*nargs, **kwargs)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/tools/platformio.py", line 288:

    env.ConvertInoToCpp()

  File "/Volumes/Macintosh HDD/samuelread/.platformio/packages/tool-scons/script/../engine/SC

ons/Environment.py", line 224:

    return self.method(*nargs, **kwargs)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/tools/piomisc.py", line 198:
out_file = c.convert(ino_nodes)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/tools/piomisc.py", line 57:

    return self.process(contents)

  File "/Volumes/Macintosh HDD/samuelread/.platformio/penv/lib/python2.7/site-packages/platfo

rmio/builder/tools/piomisc.py", line 80:

    assert self._gcc_preprocess(contents, out_file)

========================= [FAILED] Took 154.12 seconds =========================

Additional Information

Please see discussion here

Config Files.zip

Please note: I have searched for a log of this issue on here but cannot find any indication of one. apologies if this is a repeat.

darknode commented 5 years ago

You can install it with brew tap from here https://github.com/darknode/homebrew-stm32:

brew tap darknode/stm32
brew install arm-none-eabi-gcc
k-plan commented 5 years ago

You can install it with brew tap from here ...

Thanks for your answer @darknode But is there no other solution as install homebrew packages into your Mac OSX system? If I remember correctly, it had been working with VS Code on Mac awhile ago.

darknode commented 5 years ago

@k-plan It should work if have Arduino IDE installed and added arm-none-eabi into Arduino tool-chain. But if you don't have IDE or don't want to use it, you could use brew (for MacOS) or install gcc manually. You can find download link inside brew tap file: https://github.com/darknode/homebrew-stm32/blob/master/arm-none-eabi-gcc.rb

k-plan commented 5 years ago

@darknode thanks for your response. Yes, I have a look into your Ruby scripts. Problem is, arm-none-eabi toolchain doesn’t reference the manifest.json on disk but link on the web.

~/.platformio/platforms/nxplpc-arduino-lpc176x/platform.json

refer to https://raw.githubusercontent.com/p3p/pio-nxplpc-arduino-lpc176x/master/manifest.json which work well on Windows and Linux, but not an MacOS.

], "toolchain-gccarmnoneeabi":[ { "url": "https://github.com/p3p/pio-nxplpc-arduino-lpc176x/releases/download/0.0.1/toolchain-gccarmnoneeabi-opt.tar.gz", "version": "1.80201.181221" }

We will need an either way link in nxplpc-arduino-lpc176x/platform.json for MacOS. Think it is something @p3p have to look into.

Arduino IDE is not the way to go Marlin suggest for ARM-based boards. PlatformIO IDE is recommended for the next generation of ARM-based boards.

ReadieS commented 5 years ago

You can install it with brew tap from here https://github.com/darknode/homebrew-stm32:

brew tap darknode/stm32
brew install arm-none-eabi-gcc

Thanks for your reply @darknode I am not a very experienced user of Arduino or Platformio I only really use it for marlin installations. I reported it as a bug as there is no mention of the issue in the marlin guides or anyway to get around. I managed to follow the linked forum post from the original post and get my installation working but I thought either the links need addressing or the marlin guide needs to be updated to include any additional steps for mac users as it was quite hard to track down the solution.

Thanks @k-plan

You can install it with brew tap from here ...

Thanks for your answer @darknode But is there no other solution as install homebrew packages into your Mac OSX system? If I remember correctly, it had been working with VS Code on Mac awhile ago.

I can confirm Vscode was not working on my mac either. As you mention above it would be great if homebrew installations weren't required so mac installations are as easy as for other OS's.

Thanks all,

p3p commented 5 years ago

Fix one mildly annoying thing for most users and completely break it for the others, .. that does sound like something I would do.

I replaced the officially distributed arm-none-eabi-gcc package because they have been building it with optimisations turned off, which at least doubles build times, not really a problem when doing one build but the Travis tests were taking too long.

I'l roll back the change and hope they fix the issue on their side one day.

ReadieS commented 5 years ago

Hi @p3p . Apologies I didn't mean any offence to your work. I have no real problem with it being left the same if the work around is in the guides my comment about avoiding home brew really comes from a complete lack of knowledge on the subject. Just took me a long time to figure out how to get it up and running on Mac. Didn't want to leave it causing any offence and I appreciate I have no knowledge of the subject other than I had this issue. Thanks to you and all who put time and effort into this.

k-plan commented 5 years ago

Hi @p3p , thanks for all information and your fast help. Sorry to hear, that optimisations turned on break compatibility with Mac OS. Yes, now with your roll back, it will work on Mac OSX. Thanks. Is it not possible, to keep this enable for Linux and Windows by disable it only for Mac? In this way, other user will not hate Mac users for doing this.

Didn't want to leave it causing any offence and I appreciate I have no knowledge of the subject other than I had this issue. Thanks to you and all who put time and effort into this.

Same on my side. Sorry and no harm meant.

thinkyhead commented 5 years ago

My entire workflow is Mac-based and I have never had any issues with builds for any target. Is it the default python install that is the problem? I use MacPorts and probably have a different python install than the default.

thinkyhead commented 5 years ago

Note that if you want a decent gcc toolchain on the Mac, you must install XCode.

k-plan commented 5 years ago

@thinkyhead

First I have Mac default installed Python 2.7 .platformio/penv/lib/python2.7/ => didn't work.

Then install Python 3.7 but not via MacPorts, it's the last Python Version, in the way platformIO suggest on their website .platformio/penv/lib/python3.7/=> didn't work.

p3p commented 5 years ago

@ReadieS @k-plan Don't worry no offence taken ^^, (my irritation may have accidentally come though in my response but it wasn't directed at you) I have no OSX experience and don't have the time to research the correct solution at the moment so rolling back is the best I can do. It is only going to noticeably effect Travis tests so I don't think mac users are going to get any hate ;) .. no more than usual anyway.

ReadieS commented 5 years ago

I'll mark this as closed due to the roll back. Thank you all again for everything.

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.