Jump to content
Ultimaker Community of 3D Printing Experts

Statically linked CuraEngine


Recommended Posts

Posted (edited) · Statically linked CuraEngine

Hi,

I'd like to compile a version of CuraEngine which is statically linked (I don't need libArcus or Protobuf). I started with the usual:

 

# mkdir build; cd build; cmake ..

 

And then edited the "CMakeCache.txt" file. Since there is no "static" for "CMAKE_BUILD_TYPE", I went with "MinRelSize" and added the following to the other relevant variables:

 

CMAKE_CXX_FLAGS:STRING=-static-libstdc++

 

 

CMAKE_C_FLAGS:STRING=-static

 

While the project compiles I see the following output:

 

Linking CXX static library libclipper.a[...]Linking CXX static library lib_CuraEngine.a[...]

 

But it still creates a dynamically linked binary :/

Why?

 

root@curaengine:~/CuraEngine/build# ldd CuraEnginelinux-vdso.so.1 (0x00007ffe399b6000)libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb3ba1e1000)libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb3b9ee0000)libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb3b9cca000)libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb3b991f000)/lib64/ld-linux-x86-64.so.2 (0x00007fb3ba3fe000)

 

HALP! :)

Edited by Guest
  • Link to post
    Share on other sites
    • 2 weeks later...
    Posted (edited) · Statically linked CuraEngine

    Oh man, this was too easy...

    I needed to edit the CMakeCache.txt file in the build/ dir and/replace the following:

     

    CMAKE_EXE_LINKER_FLAGS:STRING=-static

     

    Now I have the following:

     

    root@curaengine:~/CuraEngine/build# ldd CuraEnginenot a dynamic executable

     

    Props to this stackoverflow tip:

    http://stackoverflow.com/a/3755713/134923

    Edited by Guest
  • 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
    ×
    ×
    • Create New...