Build wxparaver and paraver-kernel from github

This commit is contained in:
Rodrigo Arias 2023-03-02 17:58:53 +01:00
parent bff0395872
commit f28817c3bf
6 changed files with 275 additions and 66 deletions

View File

@ -1,74 +1,73 @@
{ {
stdenv stdenv
, lib , autoreconfHook
, fetchFromGitHub
, boost , boost
, libxml2 , libxml2
, xml2 , xml2
, fetchurl , wxGTK30
, wxGTK32
, autoconf , autoconf
, automake , automake
, openssl # For boost , paraverKernel
# Custom patches :) , openssl
, enableMouseLabel ? false , glibcLocales
}: }:
with lib;
let let
wx = wxGTK32; wx = wxGTK30;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "wxparaver"; pname = "wxparaver";
version = "4.10.6"; version = "4.10.6";
src = fetchurl { src = builtins.fetchGit {
url = "https://ftp.tools.bsc.es/wxparaver/wxparaver-${version}-src.tar.bz2"; url = "https://github.com/bsc-performance-tools/wxparaver.git";
sha256 = "a7L15viCXtQS9vAsdFzCFlUavUzl4Y0yOYmVSCrdWBU="; rev = "fe55c724ab59a5b0e60718919297bdf95582badb"; # v4.10.6 (missing tag)
ref = "master";
}; };
patches = [] hardeningDisable = [ "all" ];
++ optional (enableMouseLabel) ./mouse-label.patch;
# Fix the PARAVER_HOME variable
postPatch = ''
sed -i 's@^PARAVER_HOME=.*$@PARAVER_HOME='$out'@g' docs/wxparaver
sed -i '1aexport LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"' docs/wxparaver
'';
dontStrip = true;
enableParallelBuilding = true; enableParallelBuilding = true;
# What would we do without the great gamezelda:
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wxparaver
postPatch = ''
pushd src/wxparaver
sed -i \
-e 's|-lparaver-api -lparaver-kernel|-L../../paraver-kernel/src/.libs -L../../paraver-kernel/api/.libs -lparaver-api -lparaver-kernel -lssl -lcrypto -ldl|g' \
-e '$awxparaver_bin_CXXFLAGS = @CXXFLAGS@ -I../../paraver-kernel -I../../paraver-kernel/api' \
src/Makefile.am
sed -i 's| -L$PARAVER_LIBDIR||g' configure.ac
popd
# Patch shebang as /usr/bin/env is missing in nix
sed -i '1c#!/bin/sh' src/paraver-cfgs/install.sh
'';
#TODO: Move the sed commands to proper patches (and maybe send them upstream?)
preConfigure = '' preConfigure = ''
pushd src/wxparaver export CFLAGS="-O3"
autoreconf -i -f export CXXFLAGS="-O3"
popd
''; '';
configureFlags = [ configureFlags = [
"--with-boost=${boost}" "--with-boost=${boost}"
"--with-wx-config=${wx}/bin/wx-config" "--with-wx-config=${wx}/bin/wx-config"
"--with-paraver=${paraverKernel}"
"--with-openssl=${openssl.dev}"
]; ];
buildInputs = [ buildInputs = [
autoreconfHook
boost boost
xml2
libxml2.dev libxml2.dev
xml2
wx wx
autoconf autoconf
automake automake
paraverKernel
openssl.dev openssl.dev
paraverKernel
]; ];
postInstall = ''
mkdir -p $out/include
mkdir -p $out/lib/paraver-kernel
mkdir -p $out/share/filters-config
cp -p ${paraverKernel}/bin/* $out/bin
# cp -p ${paraverKernel}/include/* $out/include
cp -a ${paraverKernel}/lib/paraver-kernel $out/lib/paraver-kernel
cp -p ${paraverKernel}/share/filters-config/* $out/share/filters-config
'';
} }

View File

@ -0,0 +1,120 @@
commit c2fa29f7f1bbde86f41417b198610253fff93667
Author: Rodrigo Arias <rodarima@gmail.com>
Date: Thu Mar 2 13:14:56 2023 +0100
Add the PCF option DONT_EXPAND_COLORS
Allows the user to specify the complete palette in the PCF, preventing
Paraver from expanding the colors.
diff --git a/api/semanticcolor.cpp b/api/semanticcolor.cpp
index 9f86960..22859eb 100644
--- a/api/semanticcolor.cpp
+++ b/api/semanticcolor.cpp
@@ -232,8 +232,9 @@ rgb CodeColor::getColor( PRV_UINT32 pos ) const
{
if( pos == 0 && ParaverConfig::getInstance()->getColorsTimelineUseZero() )
return ParaverConfig::getInstance()->getColorsTimelineColorZero();
- pos = pos % colors.size();
- return colors[ pos ];
+ // Skip the black at 0
+ pos = pos % (colors.size() - 1);
+ return colors[ pos + 1 ];
}
void CodeColor::setColor( PRV_UINT32 whichPos, rgb whichColor )
@@ -250,6 +251,12 @@ void CodeColor::setColor( PRV_UINT32 whichPos, rgb whichColor )
colors[ whichPos ] = whichColor;
}
+void CodeColor::cutAfter( PRV_UINT32 pos )
+{
+ if ( pos < colors.size() )
+ colors.erase( colors.begin() + pos, colors.end() );
+}
+
void CodeColor::setCustomColor( TSemanticValue whichValue, rgb color )
{
customPalette[ whichValue ] = color;
diff --git a/api/semanticcolor.h b/api/semanticcolor.h
index a079556..bddf3d8 100644
--- a/api/semanticcolor.h
+++ b/api/semanticcolor.h
@@ -98,6 +98,7 @@ class CodeColor: public SemanticColor
PRV_UINT32 getNumColors() const;
void setColor( PRV_UINT32 pos, rgb color );
+ void cutAfter( PRV_UINT32 pos );
void setCustomColor( TSemanticValue whichValue, rgb color );
bool existCustomColors() const;
const std::map<TSemanticValue, rgb>& getCustomPalette() const;
diff --git a/api/trace.cpp b/api/trace.cpp
index b0d2050..ee2ab69 100644
--- a/api/trace.cpp
+++ b/api/trace.cpp
@@ -461,12 +461,21 @@ void TraceProxy::parsePCF( const string& whichFile )
rgb tmpColor;
const std::map< uint32_t, PCFFileParser<>::rgb >& semanticColors = pcfParser.getSemanticColors();
+ uint32_t maxValue = 0;
+
for ( auto it : semanticColors )
{
std::tie( tmpColor.red, tmpColor.green, tmpColor.blue ) = it.second;
myCodeColor.setColor( it.first, tmpColor );
+ if (it.first > maxValue)
+ maxValue = it.first;
}
+ // Cut the palette after the highest defined value, so there are no
+ // extra expanded values
+ if ( !pcfParser.expandColors )
+ myCodeColor.cutAfter(maxValue);
+
myEventLabels = EventLabels( pcfParser );
myStateLabels = StateLabels( pcfParser );
diff --git a/utils/traceparser/pcffileparser.cpp b/utils/traceparser/pcffileparser.cpp
index 9245955..3a1aecb 100644
--- a/utils/traceparser/pcffileparser.cpp
+++ b/utils/traceparser/pcffileparser.cpp
@@ -286,6 +286,7 @@ constexpr char PCF_LABEL_SPEED[] = "SPEED";
constexpr char PCF_LABEL_FLAG_ICONS[] = "FLAG_ICONS";
constexpr char PCF_LABEL_NUM_OF_STATE_COLORS[] = "NUM_OF_STATE_COLORS";
constexpr char PCF_LABEL_YMAX_SCALE[] = "YMAX_SCALE";
+constexpr char PCF_LABEL_DONT_EXPAND_COLORS[] = "DONT_EXPAND_COLORS";
template< typename dummyParser = std::nullptr_t >
class DefaultOptionsParser : public PCFFileParser<>::SectionParser<>
@@ -293,12 +294,13 @@ class DefaultOptionsParser : public PCFFileParser<>::SectionParser<>
public:
DefaultOptionsParser( PCFFileParser<> *whichMainParser ) : PCFFileParser<>::SectionParser<>( whichMainParser )
{
- parameterSetter[ PCF_LABEL_LEVEL ] = [this]( std::string line ) { mainParser->level = line; };
- parameterSetter[ PCF_LABEL_UNITS ] = [this]( std::string line ) { mainParser->units = line; };
- parameterSetter[ PCF_LABEL_LOOK_BACK ] = [this]( std::string line ) { mainParser->lookBack = line; };
- parameterSetter[ PCF_LABEL_SPEED ] = [this]( std::string line ) { mainParser->speed = line; };
- parameterSetter[ PCF_LABEL_FLAG_ICONS ] = [this]( std::string line ) { mainParser->flagIcons = line; };
- parameterSetter[ PCF_LABEL_YMAX_SCALE ] = [this]( std::string line ) { mainParser->ymaxScale = line; };
+ parameterSetter[ PCF_LABEL_LEVEL ] = [this]( std::string line ) { mainParser->level = line; };
+ parameterSetter[ PCF_LABEL_UNITS ] = [this]( std::string line ) { mainParser->units = line; };
+ parameterSetter[ PCF_LABEL_LOOK_BACK ] = [this]( std::string line ) { mainParser->lookBack = line; };
+ parameterSetter[ PCF_LABEL_SPEED ] = [this]( std::string line ) { mainParser->speed = line; };
+ parameterSetter[ PCF_LABEL_FLAG_ICONS ] = [this]( std::string line ) { mainParser->flagIcons = line; };
+ parameterSetter[ PCF_LABEL_YMAX_SCALE ] = [this]( std::string line ) { mainParser->ymaxScale = line; };
+ parameterSetter[ PCF_LABEL_DONT_EXPAND_COLORS ] = [this]( std::string line ) { mainParser->expandColors = false; };
}
virtual ~DefaultOptionsParser() = default;
diff --git a/utils/traceparser/pcffileparser.h b/utils/traceparser/pcffileparser.h
index 5fe2634..c12ecc8 100644
--- a/utils/traceparser/pcffileparser.h
+++ b/utils/traceparser/pcffileparser.h
@@ -100,6 +100,7 @@ class PCFFileParser
void setEventLabel( TEventType eventType, const std::string& label );
void setEventValues( TEventType eventType, const std::map< TEventValue, std::string >& values );
void setEventValueLabel( TEventType eventType, TEventValue eventValue, const std::string& label );
+ bool expandColors = true;
private:
struct EventTypeData

View File

@ -1,35 +1,53 @@
{ stdenv {
, fetchFromGitHub stdenv
, autoreconfHook
, boost , boost
, libxml2 , libxml2
, xml2 , xml2
, fetchurl , wxGTK30
, symlinkJoin , autoconf
, automake
}: }:
let
wx = wxGTK30;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "paraver-kernel"; pname = "paraver-kernel";
version = "4.8.2"; version = "${src.shortRev}";
src = fetchurl { src = builtins.fetchGit {
url = "https://ftp.tools.bsc.es/wxparaver/wxparaver-${version}-src.tar.bz2"; url = "https://github.com/bsc-performance-tools/paraver-kernel.git";
sha256 = "0b8rrhnf7h8j72pj6nrxkrbskgg9b5w60nxi47nxg6275qvfq8hd"; rev = "3f89ec68da8e53ee227c57a2024bf789fa68ba98"; # master (missing tag)
ref = "master";
}; };
postUnpack = "sourceRoot=$sourceRoot/src/paraver-kernel"; patches = [
# https://github.com/bsc-performance-tools/paraver-kernel/pull/11
enableParallelBuilding = true; ./dont-expand-colors.patch
preConfigure = ''
configureFlagsArray=(
"--with-boost=${boost}"
)
'';
buildInputs = [
boost
xml2
libxml2.dev
]; ];
hardeningDisable = [ "all" ];
enableParallelBuilding = true;
dontStrip = true;
preConfigure = ''
export CFLAGS="-O3 -DPARALLEL_ENABLED"
export CXXFLAGS="-O3 -DPARALLEL_ENABLED"
'';
configureFlags = [
"--with-boost=${boost}"
"--enable-openmp"
];
buildInputs = [
autoreconfHook
boost
libxml2.dev
xml2
autoconf
automake
];
} }

74
bsc/paraver/release.nix Normal file
View File

@ -0,0 +1,74 @@
{
stdenv
, lib
, fetchFromGitHub
, boost
, libxml2
, xml2
, fetchurl
, wxGTK32
, autoconf
, automake
, openssl # For boost
# Custom patches :)
, enableMouseLabel ? false
}:
with lib;
let
wx = wxGTK32;
in
stdenv.mkDerivation rec {
pname = "wxparaver";
version = "4.10.6";
src = fetchurl {
url = "https://ftp.tools.bsc.es/wxparaver/wxparaver-${version}-src.tar.bz2";
sha256 = "a7L15viCXtQS9vAsdFzCFlUavUzl4Y0yOYmVSCrdWBU=";
};
patches = []
++ optional (enableMouseLabel) ./mouse-label.patch;
enableParallelBuilding = true;
# What would we do without the great gamezelda:
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wxparaver
postPatch = ''
pushd src/wxparaver
sed -i \
-e 's|-lparaver-api -lparaver-kernel|-L../../paraver-kernel/src/.libs -L../../paraver-kernel/api/.libs -lparaver-api -lparaver-kernel -lssl -lcrypto -ldl|g' \
-e '$awxparaver_bin_CXXFLAGS = @CXXFLAGS@ -I../../paraver-kernel -I../../paraver-kernel/api' \
src/Makefile.am
sed -i 's| -L$PARAVER_LIBDIR||g' configure.ac
popd
# Patch shebang as /usr/bin/env is missing in nix
sed -i '1c#!/bin/sh' src/paraver-cfgs/install.sh
'';
#TODO: Move the sed commands to proper patches (and maybe send them upstream?)
preConfigure = ''
pushd src/wxparaver
autoreconf -i -f
popd
'';
configureFlags = [
"--with-boost=${boost}"
"--with-wx-config=${wx}/bin/wx-config"
];
buildInputs = [
boost
xml2
libxml2.dev
wx
autoconf
automake
openssl.dev
];
}

View File

@ -169,14 +169,12 @@ let
# Tracing # Tracing
# ================================================================= # =================================================================
paraver = callPackage ./bsc/paraver/default.nix { }; paraverKernel = callPackage ./bsc/paraver/kernel.nix { };
wxparaver = callPackage ./bsc/paraver/default.nix { };
# We should maintain these...
paraverKernelFast = callPackage ./bsc/paraver/kernel-fast.nix { }; paraverKernelFast = callPackage ./bsc/paraver/kernel-fast.nix { };
paraverFast = callPackage ./bsc/paraver/wxparaver-fast.nix { }; wxparaverFast = callPackage ./bsc/paraver/wxparaver-fast.nix { };
paraverExtra = bsc.paraver.override { enableMouseLabel = true; };
paraverDebug = bsc.paraver.overrideAttrs (old: {
dontStrip = true;
enableDebugging = true;
});
extrae = callPackage ./bsc/extrae/default.nix { extrae = callPackage ./bsc/extrae/default.nix {
libdwarf = super.libdwarf_20210528; libdwarf = super.libdwarf_20210528;

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
# Tools # Tools
ovni ovni
extrae extrae
paraver wxparaver
# Runtimes # Runtimes
nanos6 nanos6
]; ];