diff --git a/CMakeLists.txt b/CMakeLists.txt index b0d4d2df..b3d15838 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ endif() # if the user didn't specify, set the installation directory. if(NOT DEFINED CMAKE_INSTALL_PREFIX OR CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}" CACHE STRING "APEX Installation directory" FORCE) + SET(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}" CACHE STRING "APEX Installation directory" FORCE) endif() # check if we are building for Kitten / LXK, and force some settings. diff --git a/cmake/Modules/APEX_Compile.cmake b/cmake/Modules/APEX_Compile.cmake index a8a54f04..cc772d6d 100644 --- a/cmake/Modules/APEX_Compile.cmake +++ b/cmake/Modules/APEX_Compile.cmake @@ -88,10 +88,10 @@ macro(apex_compile name) set(${name}_RESULT "1") endif() endif() - file(WRITE ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${name}.${${name}_LANGUAGE}.stderr ${${name}_STDERR}) + file(WRITE ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${name}.${${name}_LANGUAGE}.stderr ${${name}_STDERR}) endif() if(${name}_STDOUT) - file(WRITE ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${name}.${${name}_LANGUAGE}.stdout ${${name}_STDOUT}) + file(WRITE ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${name}.${${name}_LANGUAGE}.stdout ${${name}_STDOUT}) endif() endif() endmacro() diff --git a/cmake/Modules/APEX_GCCVersion.cmake b/cmake/Modules/APEX_GCCVersion.cmake index d5124825..adc4f360 100644 --- a/cmake/Modules/APEX_GCCVersion.cmake +++ b/cmake/Modules/APEX_GCCVersion.cmake @@ -7,7 +7,7 @@ apex_include(Option) set(APEX_GCCVERSION_LOADED TRUE) -set(source_dir "${CMAKE_SOURCE_DIR}/cmake/tests") +set(source_dir "${PROJECT_SOURCE_DIR}/cmake/tests") if(NOT MSVC) include(APEX_Include) @@ -24,17 +24,17 @@ if(NOT MSVC) set(source_dir "$ENV{APEX_ROOT}/share/apex/cmake/tests") endif() - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests) + file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests) apex_compile(gcc_version SOURCE ${source_dir}/gcc_version.cpp LANGUAGE CXX - OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version + OUTPUT ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version FLAGS -I${BOOST_INCLUDE_DIR} ${include_dir}) if("${gcc_version_RESULT}" STREQUAL "0") if(NOT GCC_VERSION) execute_process( - COMMAND "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version" + COMMAND "${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version" OUTPUT_VARIABLE GCC_VERSION) endif() diff --git a/cmake/Modules/APEX_SetupHPXMP.cmake b/cmake/Modules/APEX_SetupHPXMP.cmake index 5d734721..301c10d1 100644 --- a/cmake/Modules/APEX_SetupHPXMP.cmake +++ b/cmake/Modules/APEX_SetupHPXMP.cmake @@ -5,7 +5,7 @@ add_library(hpxmp INTERFACE IMPORTED) set_property(TARGET hpxmp PROPERTY - INTERFACE_INCLUDE_DIRECTORIES ${HPXMP_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/hpxmp/src) + INTERFACE_INCLUDE_DIRECTORIES ${HPXMP_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/hpxmp/src) set_property(TARGET hpxmp PROPERTY INTERFACE_LINK_LIBRARIES ${HPXMP_LIBRARIES}) set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${HPXMP_LIBRARY_DIR}) diff --git a/cmake/Modules/APEX_Utils.cmake b/cmake/Modules/APEX_Utils.cmake index ef26d1ce..c7d22fd7 100644 --- a/cmake/Modules/APEX_Utils.cmake +++ b/cmake/Modules/APEX_Utils.cmake @@ -7,9 +7,9 @@ include(APEX_Include) apex_include(Message) macro(apex_force_out_of_tree_build message) - string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) - get_filename_component(parentdir ${CMAKE_SOURCE_DIR} PATH) - string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${parentdir}" insourcesubdir) + string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" insource) + get_filename_component(parentdir ${PROJECT_SOURCE_DIR} PATH) + string(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${parentdir}" insourcesubdir) if(insource OR insourcesubdir) apex_error("in_tree" "${message}") endif() diff --git a/src/apex/CMakeLists.hpx b/src/apex/CMakeLists.hpx index 6195b569..9ba8a26b 100644 --- a/src/apex/CMakeLists.hpx +++ b/src/apex/CMakeLists.hpx @@ -77,7 +77,7 @@ endif() # Get the current working branch execute_process( COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -85,7 +85,7 @@ execute_process( # Get the current working tag execute_process( COMMAND git describe --abbrev=0 --tags - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_TAG OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -93,7 +93,7 @@ execute_process( # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND git log -1 --format=%h - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE ) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index 0982428b..0b88e4d6 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -1,6 +1,6 @@ CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/src/scripts/apex_exec ${PROJECT_BINARY_DIR}/src/scripts/apex_exec @ONLY) -#INSTALL_FILES(bin FILES ${CMAKE_BINARY_DIR}/src/scripts/apex_exec) +#INSTALL_FILES(bin FILES ${PROJECT_BINARY_DIR}/src/scripts/apex_exec) if (BUILD_STATIC_EXECUTABLES) diff --git a/src/scripts/apex_exec b/src/scripts/apex_exec index b0e893b8..f7b65121 100755 --- a/src/scripts/apex_exec +++ b/src/scripts/apex_exec @@ -42,6 +42,7 @@ where APEX options are zero or more of: (python required for post-processing) --apex:openacc enable OpenACC support --apex:kokkos enable Kokkos support + --apex:kokkos_tuning enable Kokkos runtime autotuning support --apex:raja enable RAJA support --apex:pthread enable pthread wrapper support --apex:memory enable memory wrapper support @@ -71,6 +72,7 @@ where APEX options are zero or more of: openacc=no kokkos=no +kokkos_tuning=no raja=no otf2=no gtrace=no @@ -118,6 +120,11 @@ while (( "$#" )); do kokkos=yes shift ;; + --apex:kokkos_tuning) + kokkos=yes + kokkos_tuning=yes + shift + ;; --apex:raja) raja=yes shift @@ -405,6 +412,9 @@ fi if [ ${kokkos} = yes ] ; then export KOKKOS_PROFILE_LIBRARY=${BASEDIR}/lib/libapex${SHLIBX} fi +if [ ${kokkos_tuning} = yes ] ; then + export APEX_KOKKOS_TUNING=1 +fi if [ ${raja} = yes ] ; then export RAJA_PLUGINS=${BASEDIR}/lib/libapex${SHLIBX} fi