Jump to content
Ultimaker Community of 3D Printing Experts
Nicolinux

Statically linked CuraEngine

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

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

[[Template core/front/global/_customFooter does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]
×

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!