Skip to content

Commit

Permalink
Updating APEX build support. To build APEX with TAU, just
Browse files Browse the repository at this point in the history
configure TAU with -apex.


Former-commit-id: 99f41816c25936c3a4c7352cab0482ce58518167
  • Loading branch information
khuck committed Nov 1, 2024
1 parent 12a93fd commit 5695215
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion apex
Submodule apex updated from bc636d to 6edfb9
62 changes: 32 additions & 30 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions etc/Makefile.apex
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 5695215

Please sign in to comment.