Jump to content
Ultimaker Community of 3D Printing Experts

Recent build of CuraEngine won't compile on Raspberry Pi


aurock
 Share

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!

 

  • 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)

     

  • Link to post
    Share on other sites

    • 4 weeks later...
    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".

     

  • 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
     Share

    • Our picks

      • New here? Get ahead with a free onboarding course
        Hi,
         
        Often getting started is the most difficult part of any process. A good start sets you up for success and saves you time and energy that could be spent elsewhere. That is why we have a onboarding course ready for
        Ultimaker S5 Pro Bundle, Ultimaker S5, Ultimaker S3 Ultimaker 2+ Connect.   
        They're ready for you on the Ultimaker Academy platform. All you need to do to gain access is to register your product to gain free access. 
        Ready? Register your product here in just 60 seconds.
          • Like
        • 8 replies
    ×
    ×
    • Create New...