Build DART/DASH static libs with PIC#405
Conversation
dash/include/dash/Array.h
Outdated
| this, std::bind(&Array::deallocate, this)); | ||
| // Actual destruction of the array instance: | ||
| DASH_LOG_TRACE_VAR("Array.deallocate()", m_globmem); | ||
| // DASH_LOG_TRACE_VAR("Array.deallocate()", m_globmem); |
There was a problem hiding this comment.
Please remove the commented out code.
| ${DASH_DART_BASE_LIBRARY} | ||
| PROPERTIES POSITION_INDEPENDENT_CODE TRUE | ||
| ) | ||
|
|
There was a problem hiding this comment.
Fine with me, couldn't see a performance impact significant to stick out of the noise in my experiments. That might be different on 32bit systems, though (in case anyone still uses them for real).
There was a problem hiding this comment.
Hmyes. I'd prefer a more canonical way myself to toggle this setting, like BUILD_SHARED_LIBS, but I'm not aware of any. Still, will wrap it in a build option BUILD_PIC_LIBS and disable it by default. It's sensible to assume that the common use case is to link DASH with an executable.
There was a problem hiding this comment.
Agreed. Will pydash be integrated into the main build system? If so, we might just trigger PIC builds if pydash is being built.
…uild-pic Conflicts: dart-impl/mpi/dart-config.cmake.in dash/include/dash/Array.h
When linking DART/DASH libraries in a shared library (as required for pydash bindings), static libraries must be build with
-fPIC(Position Independent Code).Using PIC per default increases library filesize, but it shouldn't hurt to enable it by default.
Also, with @fmoessbauer 's changes in
dash::Array, the build broke when logging was enabled as no stream conversion forstd::unique_ptris defined. Fixed by removing a log message.