forked from crillab/d4v2
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8cd1816
commit 0022194
Showing
3 changed files
with
155 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
{ | ||
description = "Packages and development environments for d4"; | ||
|
||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
|
||
outputs = { | ||
self, | ||
nixpkgs, | ||
... | ||
}: let | ||
systems = nixpkgs.lib.systems.doubles.unix; | ||
eachSystem = nixpkgs.lib.genAttrs systems; | ||
in { | ||
packages = eachSystem (system: | ||
with import nixpkgs {inherit system;}; { | ||
default = self.packages.${system}.d4; | ||
|
||
d4 = stdenv.mkDerivation { | ||
pname = "d4"; | ||
version = "2.0"; | ||
|
||
src = fetchgit { | ||
url = "https://github.com/SoftVarE-Group/d4v2.git"; | ||
rev = "8cd1816ca10a9286ea7955ef9f37b5001f976290"; | ||
hash = "sha256-GmlU0w/skqMcTIrLDaYU7eZxxdEJRjnDFOOyaXBBbbU="; | ||
}; | ||
|
||
buildInputs = [ | ||
self.packages.${system}.mt-kahypar | ||
boost.dev | ||
gmp.dev | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
ninja | ||
]; | ||
|
||
meta = with lib; { | ||
description = "A CNF to d-DNNF compiler"; | ||
homepage = "https://github.com/SoftVarE-Group/d4v2"; | ||
license = licenses.lgpl3Plus; | ||
platforms = systems; | ||
}; | ||
}; | ||
|
||
container = dockerTools.buildLayeredImage { | ||
name = "d4v2"; | ||
contents = [self.packages.${system}.d4]; | ||
config.Entrypoint = ["/bin/d4"]; | ||
}; | ||
|
||
mt-kahypar = let | ||
stdenv' = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv; | ||
in | ||
stdenv'.mkDerivation { | ||
pname = "mt-kahypar"; | ||
version = "1.4"; | ||
|
||
src = fetchgit { | ||
url = "https://github.com/kahypar/mt-kahypar.git"; | ||
rev = "c51ffeaa3b1040530bf821b7f323e3790b147b33"; | ||
hash = "sha256-MlF6ZGsqtGQxzDJHbvo5uFj+6w8ehr9V4Ul5oBIGzws="; | ||
fetchSubmodules = true; | ||
}; | ||
|
||
buildInputs = [ | ||
boost.dev | ||
git | ||
hwloc.dev | ||
tbb_2021_11.dev | ||
]; | ||
|
||
nativeBuildInputs = [ | ||
cmake | ||
ninja | ||
]; | ||
|
||
patches = [./mt-kahypar-pc.patch]; | ||
|
||
cmakeFlags = [ | ||
"-D KAHYPAR_PYTHON=false" | ||
"-D MT_KAHYPAR_DISABLE_BOOST=true" | ||
"-G Ninja" | ||
]; | ||
|
||
preBuild = lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") '' | ||
export MACOSX_DEPLOYMENT_TARGET=10.14 | ||
''; | ||
|
||
buildPhase = ''cmake --build . --target mtkahypar''; | ||
installPhase = ''cmake --install .''; | ||
|
||
meta = with lib; { | ||
description = "A shared-memory multilevel graph and hypergraph partitioner"; | ||
longDescription = '' | ||
Mt-KaHyPar (Multi-Threaded Karlsruhe Hypergraph Partitioner) is a shared-memory multilevel graph and hypergraph partitioner equipped with parallel implementations of techniques used in the best sequential partitioning algorithms. | ||
Mt-KaHyPar can partition extremely large hypergraphs very fast and with high quality. | ||
''; | ||
homepage = "https://github.com/kahypar/mt-kahypar"; | ||
license = licenses.mit; | ||
platforms = systems; | ||
}; | ||
}; | ||
|
||
bundled = buildEnv { | ||
name = "bundled"; | ||
paths = [ | ||
self.packages.${system}.d4 | ||
self.packages.${system}.mt-kahypar | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
diff '--color=auto' -Naur a/lib/CMakeLists.txt b/lib/CMakeLists.txt | ||
--- a/lib/CMakeLists.txt 2024-04-30 16:31:54.639650905 +0200 | ||
+++ b/lib/CMakeLists.txt 2024-04-30 16:32:12.586535317 +0200 | ||
@@ -22,15 +22,10 @@ | ||
|
||
target_include_directories(mtkahypar SYSTEM PUBLIC ../include) | ||
|
||
-configure_file(libmtkahypar.pc.in libmtkahypar.pc @ONLY) | ||
- | ||
install(TARGETS mtkahypar | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
-install(FILES ${CMAKE_BINARY_DIR}/lib/libmtkahypar.pc | ||
- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig) | ||
- | ||
configure_file(cmake_uninstall.cmake.in cmake_uninstall.cmake IMMEDIATE @ONLY) | ||
|
||
add_custom_target(uninstall-mtkahypar "${CMAKE_COMMAND}" -P cmake_uninstall.cmake) |