Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds HPX_LINKER_FLAGS to HPX applications without editing their source codes #3371

Merged
merged 2 commits into from Jul 9, 2018

Conversation

Projects
None yet
2 participants
@NK-Nikunj
Copy link
Contributor

NK-Nikunj commented Jul 9, 2018

Fixes breaking of HPX applications due to recent merged pull request (#3357 )

Proposed Changes

Creates a separate static library for hpx_wrap.cpp. If the option HPX_WITH_DYNAMIC_HPX_MAIN is set to ON then it will be created. It would also add the specific HPX_LINKER_FLAGS to CMAKE_EXE_LINKER_FLAGS which will be propagated to HPX specific apps. If it is set to OFF then it will not generate the static library. The linker flags will not be added as well. Therefore, the system will default to the previous implementation.

Use in HPX applications (Ex: phylanx)

Since CMAKE_EXE_LINKER_FLAGS is updated in HPXConfig, it is propagated to the application using HPX. The linker flag contains the value for HPX_LINKER_FLAGS which can be empty or the linker flag specific to Linux implementation (depending upon the option HPX_WITH_DYNAMIC_HPX_MAIN).

If HPX was built with the option set to OFF then the library won't be built and the linker flags won't be updated as well. This would mean that any application utilizing HPX will use the previous implementation.

If HPX was built with the option set to ON then the library will be built and linker flags will be updated and will propagate to the HPX applications (using HPXConfig). This would mean that any application utilizing HPX will use the current implementation (in case of Linux).

@NK-Nikunj NK-Nikunj force-pushed the NK-Nikunj:fix_hpx_cmake_apps branch from 6a1ce59 to fa197d6 Jul 9, 2018

@hkaiser hkaiser added this to the 1.2.0 milestone Jul 9, 2018

@@ -188,7 +188,11 @@ function(hpx_setup_target target)
endif()

if(NOT target_NOLIBS)
set(hpx_libs hpx)
if(HPX_WITH_DYNAMIC_HPX_MAIN AND ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux"))

This comment has been minimized.

@hkaiser

hkaiser Jul 9, 2018

Member

Shouldn't this happen for executables only?

This comment has been minimized.

@NK-Nikunj

NK-Nikunj Jul 9, 2018

Author Contributor

@hkaiser if we limit it to Executables only, then some shared objects that link to it in phylanx will throw a linker error for not defined __real___libc_start_main. Providing this flag to non-executables will not produce unexpected results.

@@ -316,11 +330,64 @@ foreach(_flag ${HPX_TARGET_COMPILE_DEFINITIONS_VAR})
endif()
endforeach()

################################################################################
# libhpx_wrap

This comment has been minimized.

@hkaiser

hkaiser Jul 9, 2018

Member

All of this should be disabled for anything but Linux

This comment has been minimized.

@NK-Nikunj

NK-Nikunj Jul 9, 2018

Author Contributor

oh yes! forgot that.

@NK-Nikunj NK-Nikunj force-pushed the NK-Nikunj:fix_hpx_cmake_apps branch from 989d822 to da46a78 Jul 9, 2018

@hkaiser

hkaiser approved these changes Jul 9, 2018

Copy link
Member

hkaiser left a comment

LGTM, thanks!

@hkaiser hkaiser merged commit 4de0e63 into STEllAR-GROUP:master Jul 9, 2018

43 of 44 checks passed

ci/circleci: install CircleCI is running your tests
Details
ci/circleci: checkout_code Your tests passed on CircleCI!
Details
ci/circleci: clang_tidy Your tests passed on CircleCI!
Details
ci/circleci: configure Your tests passed on CircleCI!
Details
ci/circleci: core Your tests passed on CircleCI!
Details
ci/circleci: examples Your tests passed on CircleCI!
Details
ci/circleci: inspect Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.compat Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.components Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.compute Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.config Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.include Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.lcos Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.parallel Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.performance_counters Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.plugins Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.runtime Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.traits Your tests passed on CircleCI!
Details
ci/circleci: tests.headers.util Your tests passed on CircleCI!
Details
ci/circleci: tests.performance Your tests passed on CircleCI!
Details
ci/circleci: tests.regressions Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.actions Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.agas Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.build Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.component Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.computeapi Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.diagnostics Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.lcos Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.algorithms Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.block Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.container_algorithms Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.datapar_algorithms Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.executors Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parallel.segmented_algorithms Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.parcelset Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.performance_counter Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.resource Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.serialization Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.threads Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.traits Your tests passed on CircleCI!
Details
ci/circleci: tests.unit.util Your tests passed on CircleCI!
Details
pycicle daint-gcc-7.3.0-boost-1.67.0-c++17-Release Build errors 0
Details
pycicle daint-gcc-7.3.0-boost-1.67.0-c++17-Release Config errors 0
Details
pycicle daint-gcc-7.3.0-boost-1.67.0-c++17-Release Test errors 0
Details

@NK-Nikunj NK-Nikunj deleted the NK-Nikunj:fix_hpx_cmake_apps branch Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.