SCIInstitute / ShapeWorks

ShapeWorks
http://sciinstitute.github.io/ShapeWorks/
Other
103 stars 32 forks source link

Enable Link-time optimization #1231

Open medakk opened 3 years ago

medakk commented 3 years ago

By enabling LTO on only the Shapeworks and geometry-central build, I observed a ~5% speedup in shapeworks optimize. It might be beneficial to enable this on all dependencies as well(ITK/VTK/etc). I did it the "wrong" way for this benchmark. In the main CMakeLists.txt:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS},-flto")

because I couldn't figure out how to get CMAKE_INTERPROCEDURAL_OPTIMIZATION working

akenmorris commented 2 years ago

We are doing this for Windows now.