diff --git a/0001-fix-not-being-able-to-find-demangle.patch b/0001-fix-not-being-able-to-find-demangle.patch new file mode 100644 index 0000000000000000000000000000000000000000..4255dde0529c007b68e4a420bd252563cd7a9a8f --- /dev/null +++ b/0001-fix-not-being-able-to-find-demangle.patch @@ -0,0 +1,143 @@ +From ef4388670464c85e284eb85bdf61d679a14d71fc Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Wed, 17 Jan 2024 07:13:07 +0000 +Subject: [PATCH 1/2] fix not being able to find demangle + +Signed-off-by: rpm-build +--- + configure.ac | 4 ++-- + src/include/gnu_demangle.h | 4 ++-- + src/lib/binutils/BinUtils.cpp | 2 +- + src/lib/profile/finalizers/directclassification.cpp | 2 +- + src/lib/profile/finalizers/intel_def_use_graph.cpp | 2 +- + src/lib/profile/finalizers/kernelsyms.cpp | 2 +- + src/lib/profile/finalizers/logical.cpp | 2 +- + src/lib/support-lean/demangle.c | 2 +- + src/lib/support-lean/{demangle.h => hpcdemangle.h} | 0 + 9 files changed, 10 insertions(+), 10 deletions(-) + rename src/lib/support-lean/{demangle.h => hpcdemangle.h} (100%) + +diff --git a/configure.ac b/configure.ac +index 75053e9..bf332d6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2389,10 +2389,10 @@ found_libiberty=no + case "$LIBIBERTY" in + /* ) + # demangle.h must exist +- if test -f "${LIBIBERTY}/include/libiberty/demangle.h" ; then ++ if test -f "${LIBIBERTY}/include/demangle.h" ; then + LIBIBERTY_IFLAGS="-I${LIBIBERTY}/include" + else +- AC_MSG_ERROR([unable to find libiberty/demangle.h in: $LIBIBERTY]) ++ AC_MSG_ERROR([unable to find demangle.h in: $LIBIBERTY]) + fi + + for lib in $multilib_path ; do +diff --git a/src/include/gnu_demangle.h b/src/include/gnu_demangle.h +index 2e62dfb..8a09d51 100644 +--- a/src/include/gnu_demangle.h ++++ b/src/include/gnu_demangle.h +@@ -48,7 +48,7 @@ + // smooth out some quirks in the header file, some real, some + // historical. + // +-// Files that want to use should include this ++// Files that want to use should include this + // file instead. + // + // We now use cplus_demangle() from libiberty again. It has better +@@ -65,7 +65,7 @@ + #define HAVE_DECL_BASENAME 1 + #endif + +-#include ++#include + + /* Undo possibly mischievous macros in binutils/include/ansidecl.h */ + #undef inline +diff --git a/src/lib/binutils/BinUtils.cpp b/src/lib/binutils/BinUtils.cpp +index e8bf27b..a135f05 100644 +--- a/src/lib/binutils/BinUtils.cpp ++++ b/src/lib/binutils/BinUtils.cpp +@@ -49,7 +49,7 @@ using std::string; + + #include // for 'free' + +-#include ++#include + #include + + #include "BinUtils.hpp" +diff --git a/src/lib/profile/finalizers/directclassification.cpp b/src/lib/profile/finalizers/directclassification.cpp +index 42d2fd9..50d7eb8 100644 +--- a/src/lib/profile/finalizers/directclassification.cpp ++++ b/src/lib/profile/finalizers/directclassification.cpp +@@ -46,7 +46,7 @@ + + #include "directclassification.hpp" + +-#include "lib/support-lean/demangle.h" ++#include "lib/support-lean/hpcdemangle.h" + #include "pipeline.hpp" + + #include +diff --git a/src/lib/profile/finalizers/intel_def_use_graph.cpp b/src/lib/profile/finalizers/intel_def_use_graph.cpp +index c4ae469..f862473 100644 +--- a/src/lib/profile/finalizers/intel_def_use_graph.cpp ++++ b/src/lib/profile/finalizers/intel_def_use_graph.cpp +@@ -60,7 +60,7 @@ + + #include "intel_def_use_graph.hpp" + #include "pipeline.hpp" +-#include ++#include + + + using namespace hpctoolkit; +diff --git a/src/lib/profile/finalizers/kernelsyms.cpp b/src/lib/profile/finalizers/kernelsyms.cpp +index 760320b..e0d1b35 100644 +--- a/src/lib/profile/finalizers/kernelsyms.cpp ++++ b/src/lib/profile/finalizers/kernelsyms.cpp +@@ -46,7 +46,7 @@ + + #include "kernelsyms.hpp" + +-#include "lib/support-lean/demangle.h" ++#include "lib/support-lean/hpcdemangle.h" + #include "pipeline.hpp" + #include "../util/lzmastream.hpp" + +diff --git a/src/lib/profile/finalizers/logical.cpp b/src/lib/profile/finalizers/logical.cpp +index 4b02018..ca8ae47 100644 +--- a/src/lib/profile/finalizers/logical.cpp ++++ b/src/lib/profile/finalizers/logical.cpp +@@ -46,7 +46,7 @@ + + #include "logical.hpp" + +-#include "lib/support-lean/demangle.h" ++#include "lib/support-lean/hpcdemangle.h" + #include "lib/prof-lean/hpcfmt.h" + + #include +diff --git a/src/lib/support-lean/demangle.c b/src/lib/support-lean/demangle.c +index 2f70e3f..4c88c2b 100644 +--- a/src/lib/support-lean/demangle.c ++++ b/src/lib/support-lean/demangle.c +@@ -58,7 +58,7 @@ + + #include + #include +-#include ++#include + + #define DEMANGLE_FLAGS (DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE | DMGL_RET_DROP) + +diff --git a/src/lib/support-lean/demangle.h b/src/lib/support-lean/hpcdemangle.h +similarity index 100% +rename from src/lib/support-lean/demangle.h +rename to src/lib/support-lean/hpcdemangle.h +-- +2.43.0 + diff --git a/0002-fix-dyninst-not-linking-properly.patch b/0002-fix-dyninst-not-linking-properly.patch new file mode 100644 index 0000000000000000000000000000000000000000..d7d3d4bcb1843c8fcf952f76d3361abaed407e4b --- /dev/null +++ b/0002-fix-dyninst-not-linking-properly.patch @@ -0,0 +1,29 @@ +From e759747ac4c6706f3ca757a078ba931a568f0ba1 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Wed, 17 Jan 2024 07:14:13 +0000 +Subject: [PATCH 2/2] fix dyninst not linking properly + +Signed-off-by: rpm-build +--- + src/tool/hpcstruct/Makefile.am | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/tool/hpcstruct/Makefile.am b/src/tool/hpcstruct/Makefile.am +index 2818c02..1c62c25 100644 +--- a/src/tool/hpcstruct/Makefile.am ++++ b/src/tool/hpcstruct/Makefile.am +@@ -53,10 +53,10 @@ include $(top_srcdir)/src/Makeinclude.config + # Fixme: new elfutils from spack wants bzip, xz and zlib. + + BOOST_IFLAGS = @BOOST_IFLAGS@ +-BOOST_LFLAGS = @BOOST_LFLAGS@ ++BOOST_LFLAGS = @BOOST_LFLAGS@ -lm @BOOST_LIB_DIR@/libboost_graph.a + + DYNINST_IFLAGS = @DYNINST_IFLAGS@ +-DYNINST_LFLAGS = @DYNINST_LFLAGS@ ++DYNINST_LFLAGS = @DYNINST_LFLAGS@ -L@LIBELF_LIB@/dyninst -lsymtabAPI -lparseAPI -ldyninstAPI -linstructionAPI -lcommon + + SYMTABAPI_LIB = @SYMTABAPI_LIB@ + SYMTABAPI_LIB_LIST = @SYMTABAPI_LIB_LIST@ +-- +2.43.0 diff --git a/0003-fix-hpcserver-build-error.patch b/0003-fix-hpcserver-build-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..c1f6fe210db69553693bb8a3ca7b4a32a3ed10fe --- /dev/null +++ b/0003-fix-hpcserver-build-error.patch @@ -0,0 +1,39 @@ +From 1f12712398730940d0631ae2b556ad6ebdd89da6 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Wed, 17 Jan 2024 08:32:31 +0000 +Subject: [PATCH] fix hpcserver build error + +Signed-off-by: rpm-build +--- + src/tool/hpcserver/LargeByteBuffer.cpp | 2 +- + src/tool/hpcserver/ProgressBar.hpp | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/tool/hpcserver/LargeByteBuffer.cpp b/src/tool/hpcserver/LargeByteBuffer.cpp +index d4765af..4e9bb83 100644 +--- a/src/tool/hpcserver/LargeByteBuffer.cpp ++++ b/src/tool/hpcserver/LargeByteBuffer.cpp +@@ -66,7 +66,7 @@ + + #include + #include +-#include ++#include + #include + #include + +diff --git a/src/tool/hpcserver/ProgressBar.hpp b/src/tool/hpcserver/ProgressBar.hpp +index 6873428..4311117 100644 +--- a/src/tool/hpcserver/ProgressBar.hpp ++++ b/src/tool/hpcserver/ProgressBar.hpp +@@ -67,7 +67,6 @@ namespace TraceviewerServer + { + class ProgressBar { + private: +-typedef uint64_t unsigned long; + + static const int DEFAULT_TERMINAL_WIDTH = 80; + +-- +2.43.0 + diff --git a/hpctoolkit-2023.08.1.tar.gz b/hpctoolkit-2023.08.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7aed5f7c6b87d0197c9121cc2a9f14a16c76279c Binary files /dev/null and b/hpctoolkit-2023.08.1.tar.gz differ diff --git a/hpctoolkit.spec b/hpctoolkit.spec new file mode 100644 index 0000000000000000000000000000000000000000..d11a4129a23819bfa38cfef9688cd80506d8fd9b --- /dev/null +++ b/hpctoolkit.spec @@ -0,0 +1,100 @@ +Name: hpctoolkit +Version: 2023.08.1 +Release: 1 +Summary: HPCToolkit performance tools: measurement and analysis components + +License: BSD-3-Clause +URL: https://gitlab.com/%{name}/%{name} +Source0: %{url}/-/archive/%{version}/%{name}-%{version}.tar.gz + +Patch1: 0001-fix-not-being-able-to-find-demangle.patch +Patch2: 0002-fix-dyninst-not-linking-properly.patch +Patch3: 0003-fix-hpcserver-build-error.patch + +BuildRequires: gcc-c++ automake autoconf libtool make python3-devel gcc-gfortran +BuildRequires: environment-modules openmpi-devel boost-devel binutils-devel +BuildRequires: bzip2-devel elfutils-devel dyninst-devel libdwarf-devel +BuildRequires: libunwind-devel xz-devel memkind-devel papi-devel tbb-devel +BuildRequires: xerces-c-devel yaml-cpp-devel zlib-devel libpfm-devel chrpath + +%ifarch %{valgrind_arches} +BuildRequires: valgrind-devel +%endif + +%description +HPCToolkit is an integrated suite of tools for measurement and analysis of +program performance on computers ranging from multicore desktop systems to +the nation's largest supercomputers. HPCToolkit provides accurate measurements +of a program's work, resource consumption, and inefficiency, correlates these +metrics with the program's source code, works with multilingual, fully +optimized binaries, has very low measurement overhead, and scales to large +parallel systems. HPCToolkit's measurements provide support for analyzing a +program execution cost, inefficiency, and scaling characteristics both within +and across nodes of a parallel system. + +%prep +%autosetup -p1 + + +%build +module load mpi +autoreconf -ivf +%set_build_flags +export CFLAGS="$CFLAGS -I%{_includedir}/dyninst " +export CXXFLAGS="$CXXFLAGS -I%{_includedir}/dyninst " +export MPICC=mpicc +export MPICXX=mpicxx +export MPIF77=mpif77 +%configure \ + --with-boost=%{_prefix} \ + --with-bzip=%{_prefix} \ + --with-elfutils=%{_prefix} \ + --with-libiberty=%{_prefix} \ + --with-lzma=%{_prefix} \ + --with-memkind=%{_prefix} \ + --with-papi=%{_prefix} \ + --with-tbb=%{_prefix} \ +%ifarch %{valgrind_arches} + --with-valgrind=%{_prefix} \ + --enable-valgrind-annotations \ +%endif + --with-xerces=%{_prefix} \ + --with-yaml-cpp=%{_prefix} \ + --with-zlib=%{_prefix} \ + --enable-hpcrun-static \ + --enable-hpcserver \ + --enable-openmp \ + --enable-lush + +%make_build + + +%install +%make_install + +find %{buildroot}%{_bindir} %{buildroot}%{_libexecdir}/%{name} -type f | + xargs -P $(nproc) -I'{fn}' file '{fn}' | grep -E '\' | + cut -d: -f 1 | xargs chrpath -d + + +%files +%license LICENSE +%{_bindir}/hpcprof +%{_bindir}/hpcserver +%{_bindir}/hpcstruct +%{_bindir}/hpcprof-mpi +%{_bindir}/hpcserver-mpi +%dir %{_prefix}/lib/%{name} +# Provided by the original package, not copied here +%exclude %{_prefix}/lib/%{name}/ext-libs +%{_prefix}/lib/%{name}/hash-file +%{_libexecdir}/%{name} +%exclude %{_libexecdir}/%{name}/config.guess +%{_docdir}/%{name}/* +%{_datadir}/%{name} +%{_mandir}/man1/hpc* + + +%changelog +* Wed Jan 17 2024 herengui - 2023.08.1-1 +- Initial package