From 0f973b7b3cf0987ee1e1a0dc094cc2a0024715bb Mon Sep 17 00:00:00 2001 From: Ilya Meignan--Masson Date: Thu, 27 Jun 2024 08:19:32 +0000 Subject: [PATCH] with umap and umap-apps --- default.nix | 2 ++ pkgs/umap-apps/cstdint.patch | 43 ++++++++++++++++++++++++++++++++++++ pkgs/umap-apps/default.nix | 23 +++++++++++++++++++ pkgs/umap/cstdint.patch | 36 ++++++++++++++++++++++++++++++ pkgs/umap/default.nix | 22 ++++++++++++++++++ 5 files changed, 126 insertions(+) create mode 100644 pkgs/umap-apps/cstdint.patch create mode 100644 pkgs/umap-apps/default.nix create mode 100644 pkgs/umap/cstdint.patch create mode 100644 pkgs/umap/default.nix diff --git a/default.nix b/default.nix index cd07161..6cc552e 100644 --- a/default.nix +++ b/default.nix @@ -21,4 +21,6 @@ rec { bima = pkgs.callPackage ./pkgs/bima {}; vhive = pkgs.callPackage ./pkgs/vhive { }; firecracker-containerd = pkgs.callPackage ./pkgs/firecracker-containerd { }; + umap = pkgs.callPackage ./pkgs/umap { }; + umap-apps = pkgs.callPackage ./pkgs/umap-apps { inherit umap; }; } diff --git a/pkgs/umap-apps/cstdint.patch b/pkgs/umap-apps/cstdint.patch new file mode 100644 index 0000000..17246de --- /dev/null +++ b/pkgs/umap-apps/cstdint.patch @@ -0,0 +1,43 @@ +diff --git a/src/bfs/bfs_kernel.hpp b/src/bfs/bfs_kernel.hpp +index 0fdd7ae..4e733ff 100644 +--- a/src/bfs/bfs_kernel.hpp ++++ b/src/bfs/bfs_kernel.hpp +@@ -17,6 +17,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + #include + #include ++#include + + #ifdef _OPENMP + #include +diff --git a/src/bfs/compute_degree_distribution.cpp b/src/bfs/compute_degree_distribution.cpp +index 27c70a2..cf2d53a 100644 +--- a/src/bfs/compute_degree_distribution.cpp ++++ b/src/bfs/compute_degree_distribution.cpp +@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + #include + #include + #include ++#include + + /// This is a utility program to compute a degree distribution + /// This program treat the input files as directed graph +@@ -90,4 +91,4 @@ int main(int argc, char **argv) { + std::cout << "Finished degree distribution computation" << std::endl; + + return 0; +-} +\ No newline at end of file ++} +diff --git a/src/bfs/ingest_edge_list.cpp b/src/bfs/ingest_edge_list.cpp +index a975d5b..461a05b 100644 +--- a/src/bfs/ingest_edge_list.cpp ++++ b/src/bfs/ingest_edge_list.cpp +@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + #include + #include + #include ++#include + + #include "../utility/bitmap.hpp" + #include "../utility/mmap.hpp" diff --git a/pkgs/umap-apps/default.nix b/pkgs/umap-apps/default.nix new file mode 100644 index 0000000..1d2cfab --- /dev/null +++ b/pkgs/umap-apps/default.nix @@ -0,0 +1,23 @@ +{ pkgs, stdenv, lib, fetchFromGitHub, umap }: + +stdenv.mkDerivation rec { + pname = "umap-apps"; + version = "v" + "1.1"; + src = fetchFromGitHub { + owner = "LLNL"; + repo = "umap-apps"; + rev = version; + hash = "sha256-n6UOqzfuI8DVIA7B6uYpPCpn78f+5w74pcsSYmGwHm8="; + }; + cmakeFlags = [ "-DUMAP_INSTALL_PATH=${umap}" ]; + + nativeBuildInputs = [ umap pkgs.cmake pkgs.gnumake ]; + patches = [ ./cstdint.patch ]; + + meta = with lib; { + homepage = https://github.com/LLNL/umap; + description = "User-space Page Management"; + license = licenses.lgpl2; + broken = false; + }; +} diff --git a/pkgs/umap/cstdint.patch b/pkgs/umap/cstdint.patch new file mode 100644 index 0000000..0e0f9a7 --- /dev/null +++ b/pkgs/umap/cstdint.patch @@ -0,0 +1,36 @@ +diff --git a/examples/bfs/bfs_kernel.hpp b/examples/bfs/bfs_kernel.hpp +index 8c8613b..599ab8a 100644 +--- a/examples/bfs/bfs_kernel.hpp ++++ b/examples/bfs/bfs_kernel.hpp +@@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + #include "utility/bitmap.hpp" + #include "utility/open_mp.hpp" ++#include + + namespace bfs { + +diff --git a/examples/bfs/rmat_graph_generator/ingest_edge_list.cpp b/examples/bfs/rmat_graph_generator/ingest_edge_list.cpp +index 09303f6..3ba259d 100644 +--- a/examples/bfs/rmat_graph_generator/ingest_edge_list.cpp ++++ b/examples/bfs/rmat_graph_generator/ingest_edge_list.cpp +@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + #include + #include + #include ++#include + + #include "utility/bitmap.hpp" + #include "utility/mmap.hpp" +diff --git a/examples/bfs/utility/bitmap.hpp b/examples/bfs/utility/bitmap.hpp +index 1881b85..c78c293 100644 +--- a/examples/bfs/utility/bitmap.hpp ++++ b/examples/bfs/utility/bitmap.hpp +@@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + #define LIB_UTILITY_BITMAP_HPP + + #include ++#include + + namespace utility + { diff --git a/pkgs/umap/default.nix b/pkgs/umap/default.nix new file mode 100644 index 0000000..0366829 --- /dev/null +++ b/pkgs/umap/default.nix @@ -0,0 +1,22 @@ +{ pkgs, stdenv, lib, fetchFromGitHub }: + +stdenv.mkDerivation rec { + pname = "umap"; + version = "v" + "2.1.1"; + src = fetchFromGitHub { + owner = "LLNL"; + repo = "umap"; + rev = version; + hash = "sha256-nAzQ7fK9BsfgOSWuoQLeqomy6LO+ERP0fjj12iQXp5I="; + }; + + nativeBuildInputs = [ pkgs.cmake pkgs.gnumake ]; + patches = [ ./cstdint.patch ]; + + meta = with lib; { + homepage = https://github.com/LLNL/umap; + description = "User-space Page Management"; + license = licenses.lgpl2; + broken = false; + }; +}