Jump to content
Ultimaker Community of 3D Printing Experts
Sign in to follow this  

Recent build of CuraEngine won't compile on Raspberry Pi

Recommended Posts

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.




Share this post

Link to post
Share on other sites

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.
CFLAGS+=-ggdb -Og -g
@@ -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.
- 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
MKDIR_PREFIX = mkdir -p
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
- CFLAGS += -flto
- LDFLAGS += --static -flto
+ LDFLAGS += --static $(FLTO)
ifeq ($(UNAME), Darwin)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Our picks

    • How to 3D print with reinforced engineering materials
      Ultimaker is hosting a webinar where we explain how you can achieve and maintain a high print success rate using these new reinforced engineering materials. Learn from Ultimaker's Product Manager of Materials and top chemical engineer Bart van As how you can take your 3D printing to that next level.
      • 2 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies

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!