From 5695215a8749e3ad8a80a5d7a1f86f345ae17ab4 Mon Sep 17 00:00:00 2001 From: Kevin Huck Date: Thu, 31 Oct 2024 17:42:52 -0700 Subject: [PATCH] Updating APEX build support. To build APEX with TAU, just configure TAU with -apex. Former-commit-id: 99f41816c25936c3a4c7352cab0482ce58518167 --- apex | 2 +- configure | 62 ++++++++++++++++++++++++----------------------- etc/Makefile.apex | 3 +-- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/apex b/apex index bc636daa5..6edfb9298 160000 --- a/apex +++ b/apex @@ -1 +1 @@ -Subproject commit bc636daa54f158a733a5d7cb0e1349d0af80faaa +Subproject commit 6edfb929860bf8e46577353c908042e09a12b8d8 diff --git a/configure b/configure index 7704b5773..6708e9121 100755 --- a/configure +++ b/configure @@ -11605,49 +11605,51 @@ fi build_apex() { -if [ $apex = yes ] ; then - cd ${START_DIR} - if [ $boost = no -a ${architecture} = "mic_linux" ] ; then - echo "Error: APEX requires Boost 1.54 or newer. Please specify the Boost installation location with the -boost option." - exit 1; - fi - if [ $openmp = no -a $pthread = no ] ; then - echo "Error: APEX is for multithreaded runtimes. Please configure TAU with thread support (pthread or OpenMP)." + if [ $apex = yes ] ; then + cd ${START_DIR} + check_cmake 3 20 "APEX" + result=$? + if [ $result -eq 1 ]; then + echo 'ERROR: cmake version 3.20 or higher required to build APEX.' exit 1; fi - check_cmake 2 8 "APEX" - result=$? - if [ $result -eq 1 ]; then - echo 'ERROR: cmake version 2.8 or higher required to build APEX.' - exit 1; - fi - echo "NOTE: Building APEX" + if [ ! -d apex ] ; then + git submodule update --init --recursive + fi apex_include_file=apex/apex.mk rm -f ${apex_include_file} touch ${apex_include_file} echo "CC=${c_compiler}" >> ${apex_include_file} - echo "CXX=${cxx_compiler}" >> ${apex_include_file} - echo "PREFIX=${targetdir}" >> ${apex_include_file} - echo "TAUARCH=${architecture}" >> ${apex_include_file} - echo "TAUOPTIONS=${tauoptions}" >> ${apex_include_file} - echo "BOOSTROOT=${boostdir}" >> ${apex_include_file} + echo "CXX=${cxx_compiler}" >> ${apex_include_file} + echo "PREFIX=${targetdir}" >> ${apex_include_file} + echo "TAUARCH=${architecture}" >> ${apex_include_file} + echo "TAUOPTIONS=${tauoptions}" >> ${apex_include_file} if [ ! "x${bfddir}" = "x" ] ; then - echo "BFDOPT=-USE_BFD=TRUE -DBFD_ROOT=${bfddir}" >> ${apex_include_file} + echo "BFDOPT=-DAPEX_WITH_BFD=TRUE -DBFD_ROOT=${bfddir}" >> ${apex_include_file} else - if [ ${bfd_worked} = "yes" ] ; then - echo 'BFDOPT=-DUSE_BFD=TRUE' >> ${apex_include_file} - fi - fi - if [ ${architecture} = "mic_linux" ] ; then - echo 'TAUCFLAGS=-DCMAKE_C_FLAGS=-xMIC-AVX512' >> ${apex_include_file} - echo 'TAUCXXFLAGS=-DCMAKE_CXX_FLAGS="-xMIC-AVX512 -DBOOST_NO_CXX11_ALLOCATOR"' >> ${apex_include_file} + if [ ${bfd_worked} = "yes" ] ; then + echo 'BFDOPT=-DAPEX_WITH_BFD=TRUE' >> ${apex_include_file} + fi fi if [ ! "x${omptlib}" = "x" ] ; then - echo "TAUOMPT=-DUSE_OMPT=TRUE -DOMPT_ROOT=${omptlib}" >> ${apex_include_file} + echo "TAUOMPT=-DAPEX_WITH_OMPT=TRUE" >> ${apex_include_file} + fi + if [ "${cuda}" = "yes" ] ; then + echo "TAUCUDA=-DAPEX_WITH_CUDA=TRUE -DCUDAToolkit_ROOT=${cudadir}" >> ${apex_include_file} + fi + if [ "${rocm}" = "yes" ] ; then + echo "TAUHIP=-DAPEX_WITH_HIP=TRUE" >> ${apex_include_file} + fi + if [ "${level_zero}" = "yes" ] ; then + echo "TAUSYCL=-DAPEX_WITH_LEVEL0=TRUE" >> ${apex_include_file} + fi + if [ "${mpi}" = "yes" ] ; then + echo "TAUMPI=-DAPEX_WITH_MPI=TRUE" >> ${apex_include_file} fi + echo "TAUOPENCL=-DAPEX_WITH_OPENCL=TRUE" >> ${apex_include_file} cp etc/Makefile.apex apex/Makefile - fixmakeargs="$fixmakeargs APEX " + fixmakeargs="$fixmakeargs APEX " make -C apex clean fi } diff --git a/etc/Makefile.apex b/etc/Makefile.apex index 37b75d428..7ad9f8463 100644 --- a/etc/Makefile.apex +++ b/etc/Makefile.apex @@ -1,8 +1,7 @@ include apex.mk build/CMakeCache.txt: - mkdir -p build - cd build && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DBUILD_TESTS=FALSE -DBUILD_EXAMPLES=TRUE -DBOOST_ROOT=$(BOOSTROOT) $(BFDOPT) -DUSE_ACTIVEHARMONY=TRUE -DACTIVEHARMONY_ROOT=$(PREFIX)/$(TAUARCH) -DTAU_ROOT=$(PREFIX) -DCMAKE_INSTALL_PREFIX=$(PREFIX)/$(TAUARCH) -DTAU_ARCH=$(TAUARCH) -DTAU_OPTIONS=$(TAUOPTIONS) -DBUILD_EXAMPLES=FALSE -DBUILD_TESTS=FALSE $(TAUOMPT) $(TAUCFLAGS) $(TAUCXXFLAGS) .. + cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) -DAPEX_BUILD_TESTS=FALSE -DAPEX_BUILD_EXAMPLES=FALSE -DAPEX_WITH_KOKKOS=TRUE $(BFDOPT) -DCMAKE_INSTALL_PREFIX=$(PREFIX)/$(TAUARCH) $(TAUOMPT) $(TAUOPENCL) $(TAUCFLAGS) $(TAUCXXFLAGS) $(TAUCUDA) $(TAUHIP) $(TAUSYCL) all : build/CMakeCache.txt $(MAKE) -C build all