Skip to content
Merged
7 changes: 6 additions & 1 deletion dart-impl/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ set_target_properties(
C_STANDARD_REQUIRED ${DART_C_STD_REQUIRED}
)

set_target_properties(
${DASH_DART_BASE_LIBRARY}
PROPERTIES POSITION_INDEPENDENT_CODE TRUE
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Will pydash be integrated into the main build system? If so, we might just trigger PIC builds if pydash is being built.

## Installation

DeployLibrary(${DASH_DART_BASE_LIBRARY})
Expand All @@ -137,5 +142,5 @@ install(TARGETS ${DASH_DART_BASE_LIBRARY}

# Export dependencies
install(EXPORT "${DASH_DART_BASE_LIBRARY}-config"
DESTINATION cmake)
DESTINATION share/cmake)

6 changes: 4 additions & 2 deletions dart-impl/base/src/internal/domain_locality.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ dart_ret_t dart__base__locality__domain__update_subdomains(
domain->unit_ids = malloc(sizeof(dart_global_unit_t));
domain->unit_ids[0] = unit_id;
} else {
domain->unit_ids = malloc(sizeof(dart_global_unit_t) * domain->num_units);
domain->unit_ids = malloc(sizeof(dart_global_unit_t)
* domain->num_units);
int domain_unit_idx = 0;
for (int sd = 0; sd < domain->num_domains; sd++) {
dart_domain_locality_t * subdomain = domain->children[sd];
Expand Down Expand Up @@ -1101,7 +1102,8 @@ dart_ret_t dart__base__locality__domain__create_module_subdomains(

if (subdomain->num_units > 0) {
subdomain->unit_ids = realloc(subdomain->unit_ids,
subdomain->num_units * sizeof(dart_global_unit_t));
subdomain->num_units
* sizeof(dart_global_unit_t));
DART_ASSERT(NULL != subdomain->unit_ids);
} else {
free(subdomain->unit_ids);
Expand Down
9 changes: 7 additions & 2 deletions dart-impl/mpi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ target_link_libraries(
${ADDITIONAL_LIBRARIES}
)

set_target_properties(
${DASH_DART_IMPL_MPI_LIBRARY}
PROPERTIES POSITION_INDEPENDENT_CODE TRUE
)

if(MPI_LINK_FLAGS)
set_target_properties(
${DASH_DART_IMPL_MPI_LIBRARY} PROPERTIES
Expand Down Expand Up @@ -248,9 +253,9 @@ install(TARGETS ${DASH_DART_IMPL_MPI_LIBRARY}
if(${CMAKE_VERSION} VERSION_GREATER 3.0.0)
# exports
install(EXPORT "${DASH_DART_IMPL_MPI_LIBRARY}-targets"
DESTINATION cmake)
DESTINATION share/cmake)

# install custom config
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DASH_DART_IMPL_MPI_LIBRARY}-config.cmake"
DESTINATION cmake)
DESTINATION share/cmake)
endif()
5 changes: 3 additions & 2 deletions dart-impl/mpi/dart-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

set(DART_INSTALL_PREFIX "${PACKAGE_PREFIX_DIR}")

find_package(DART-BASE REQUIRED HINTS "${DART_INSTALL_PREFIX}/cmake")
find_package(DART-BASE REQUIRED HINTS "${DASH_INSTALL_PREFIX}/share/cmake")

include("${DASH_INSTALL_PREFIX}/share/cmake/@[email protected]")

include("${DART_INSTALL_PREFIX}/cmake/@[email protected]")
12 changes: 9 additions & 3 deletions dash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ foreach (dart_variant ${DART_IMPLEMENTATIONS_LIST})
${ADDITIONAL_LINK_FLAGS}
${ADDITIONAL_LIBRARIES}
)

set_target_properties(
${DASH_LIBRARY}
PROPERTIES POSITION_INDEPENDENT_CODE TRUE
)

if (${dart_variant} STREQUAL "mpi")
include_directories(
${MPI_INCLUDE_PATH})
Expand Down Expand Up @@ -343,10 +349,10 @@ foreach (dart_variant ${DART_IMPLEMENTATIONS_LIST})
DESTINATION lib
EXPORT "${DASH_LIBRARY}-targets")

# exports
# Exports
install(
EXPORT "${DASH_LIBRARY}-targets"
DESTINATION cmake)
DESTINATION share/cmake)

if(${CMAKE_VERSION} VERSION_GREATER 3.0.0 )
configure_package_config_file(
Expand All @@ -356,7 +362,7 @@ foreach (dart_variant ${DART_IMPLEMENTATIONS_LIST})

# install custom config
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${DASH_LIBRARY}-config.cmake"
DESTINATION "${CMAKE_INSTALL_PREFIX}/cmake")
DESTINATION "${CMAKE_INSTALL_PREFIX}/cmake")
endif()

# Examples
Expand Down
4 changes: 2 additions & 2 deletions dash/dash-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ set(DASH_LIBRARIES ${DASH_LIBRARY} "dart-@dart_variant@")
set(DASH_CXX_FLAGS "@VARIANT_ADDITIONAL_COMPILE_FLAGS@ @CMAKE_CXX_FLAGS_RELEASE@")
set(DASH_INSTALL_PREFIX "${PACKAGE_PREFIX_DIR}")

find_package(DART-@DART_VARIANT@ REQUIRED HINTS "${DASH_INSTALL_PREFIX}/cmake")
find_package(DART-@DART_VARIANT@ REQUIRED HINTS "${DASH_INSTALL_PREFIX}/share/cmake")

include("${DASH_INSTALL_PREFIX}/cmake/${DASH_LIBRARY}-targets.cmake")
include("${DASH_INSTALL_PREFIX}/share/cmake/${DASH_LIBRARY}-targets.cmake")