Jump to content
Sign in to follow this  
aurock

Recent build of CuraEngine won't compile on Raspberry Pi

Recommended Posts

Posted · Recent build of CuraEngine won't compile on Raspberry Pi

I'm building a new Octoprint server on Raspberry Pi. When I last built one in March, I was able to clone CuraEngine and compile it without issue, but it seems that some updates since then have made it so it won't compile anymore.

When I run 'make', I get the following error:

 


cc1plus: error: unrecovnized command line option '-std=c++11'

It looks like that command line option was added in the makefile in a commit on April 7th. Searching online, I found that this option requires GCC 4.7. I installed gcc4.7 and added it to 'update-alternatives' and selected it. Now the compile seems to get further, but eventually fails. Here's the tail end of the output:

 


g++ build/bridge.o build/comb.o build/gcodeExport.o build/infill.o build/inset.o build/layerPart.o build/main.o build/optimizedModel.o build/pathOrderOptimizer.o build/polygonOptimizer.o build/raft.o build/settings.o build/skin.o build/skirt.o build/slicer.o build/support.o build/timeEstimate.o build/modelFile/modelFile.o build/utils/gettime.o build/utils/logoutput.o build/utils/socket.o -o build/CuraEngine -Lbuild/ -lclipper --static -flto

/tmp/cciy4tHy.s: Assembler messages:

/tmp/cciy4tHy.s:69: Error: bad immediate value for offset (4096)

lto-wrapper: g++ returned 1 exit status

/usr/bin/ld: lto-wrapper failed

collect2: error: ld returned 1 exit status

make: *** [build/CuraEngine] Error 1

 

I think next up I'm going to clone a version of CuraEngine from before April 7th and try to compile it, just to confirm that the problem isn't something else on this system that I've overlooked.

If anyone has suggestions they can offer to help get this working, I'd appreciate hearing them.

Thanks!

Thanks!

 

Share this post


Link to post
Share on other sites
Posted · Recent build of CuraEngine won't compile on Raspberry Pi

I was able to successfully compile from commit d7d9b5b9a4a5aa6b138a3fa1e3c19b2f5f50f5bd.

 

Share this post


Link to post
Share on other sites
Posted · Recent build of CuraEngine won't compile on Raspberry Pi

Try removing the flto flag from the compiler and linker to see if that helps. It might be an obscure compiler bug (normally the assembler should never throw an error)

 

Share this post


Link to post
Share on other sites
Posted · Recent build of CuraEngine won't compile on Raspberry Pi

Using gcc-4.7 (which can be installed on Raspbian with "apt-get install gcc-4.7") and removing all references of -flto from the Makefile seems to work with the latest git version of CuraEngine.

Here's a patch to apply to the CuraEngine Makefile:

 


--- Makefile.back 2014-07-03 01:13:28.431840101 +0000
+++ Makefile 2014-07-03 01:13:20.222592688 +0000
@@ -12,6 +12,8 @@
CXX ?= g++
CFLAGS += -c -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -std=c++11 -DVERSION=\"$(VERSION)\" -isystem libs

+FLTO = #allow for enable/disabling of link-time-optimization. Pass FLTO=-flto to enable. Default is disabled.
+
ifeq ($(BUILD_TYPE),DEBUG)
CFLAGS+=-ggdb -Og -g
endif
@@ -38,16 +40,16 @@
ifeq ($(OS),Windows_NT)
#For windows make it large address aware, which allows the process to use more then 2GB of memory.
EXECUTABLE := $(EXECUTABLE).exe
- CFLAGS += -march=pentium4 -flto
- LDFLAGS += -Wl,--large-address-aware -lm -lwsock32 -flto
+ CFLAGS += -march=pentium4 $(FLTO)
+ LDFLAGS += -Wl,--large-address-aware -lm -lwsock32 $(FLTO)
MKDIR_PREFIX = mkdir -p
else
MKDIR_PREFIX = mkdir -p
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
OPEN_HTML=firefox
- CFLAGS += -flto
- LDFLAGS += --static -flto
+ CFLAGS += $(FLTO)
+ LDFLAGS += --static $(FLTO)
endif
ifeq ($(UNAME), Darwin)
OPEN_HTML=open

This way you can call "make" and get a non-lto version (buildable using gcc-4.7), or call "make FLTO=-flto" to get a version with link-time optimization (buildable with gcc-4.8). If gcc-4.7 is not the default (Can be checked by calling "gcc --version"), then you'll have to run "make CXX=gcc-4.7".

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Our picks

    • Ultimaker Cura 4.0 | Stable available!
      Ultimaker Cura 4.0 is mainly focused on the improved user interface and cloud integration.
      As always, we want to collect your user feedback for this release. If there are any improvements you can think of, feel free to mention it here and help us to shape the next release.
      • 98 replies
×
×
  • Create New...

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!