Jump to content

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
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...