Merge remote-tracking branch 'upstream/master' into wrapper-pname-support

This commit is contained in:
John Ericson
2019-11-24 17:25:07 +00:00
5772 changed files with 168373 additions and 134383 deletions
@@ -1,15 +1,15 @@
{ stdenv, fetchurl, cmake, itk, python }:
{ stdenv, fetchFromGitHub, cmake, itk, python }:
stdenv.mkDerivation rec {
pname = "elastix";
pversion = "4.9.0";
name = "${pname}-${pversion}";
version = "5.0.0";
src = fetchurl {
url = "https://github.com/SuperElastix/${pname}/archive/${pversion}.tar.gz";
sha256 = "02pbln36nq98xxfyqwlxg7b6gmigdq4fgfqr9mym1qn58aj04shg";
src = fetchFromGitHub {
owner = "SuperElastix";
repo = pname;
rev = version;
sha256 = "1zrl7rz4lwsx88b2shnl985f3a97lmp4ksbd437h9y0hfjq8l0lj";
};
nativeBuildInputs = [ cmake python ];
buildInputs = [ itk ];
@@ -31,6 +31,6 @@ stdenv.mkDerivation rec {
license = licenses.mit;
homepage = http://www.htslib.org/;
platforms = platforms.unix;
maintainers = [ maintainers.mimadrid ];
maintainers = [ maintainers.mimame ];
};
}
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
homepage = https://sourceforge.net/projects/niftilib;
description = "Medical imaging format C API";
maintainers = with maintainers; [ bcdarwin ];
platforms = platforms.linux;
platforms = platforms.unix;
license = licenses.publicDomain;
};
}
@@ -41,6 +41,6 @@ stdenv.mkDerivation rec {
description = "Legacy version of PolyBoRi maintained by sagemath developers";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -1,4 +1,4 @@
{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0 }:
{ callPackage, cudatoolkit_7, cudatoolkit_7_5, cudatoolkit_8, cudatoolkit_9_0, cudatoolkit_9_1, cudatoolkit_9_2, cudatoolkit_10_0, cudatoolkit_10_1 }:
let
generic = args: callPackage (import ./generic.nix (removeAttrs args ["cudatoolkit"])) {
@@ -65,5 +65,12 @@ in rec {
sha256 = "18ys0apiz9afid2s6lvy9qbyi8g66aimb2a7ikl1f3dm09mciprf";
};
cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_0;
cudnn_cudatoolkit_10_1 = generic rec {
version = "7.6.3";
cudatoolkit = cudatoolkit_10_1;
srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.3.30.tgz";
sha256 = "0qc9f1xpyfibwqrpqxxq2v9h6w90j0dbx564akwy44c1dls5f99m";
};
cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_1;
}
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
passthru = {
inherit cudatoolkit;
majorVersion = lib.head (lib.splitString "." version);
majorVersion = lib.versions.major version;
};
meta = with stdenv.lib; {
@@ -104,10 +104,10 @@ index 84e4e88..56ca676 100644
- cp -rf ../include $(INSTALL_DIR)/include/Lfunction
+ install -d $(INSTALL_DIR)/bin
+ install -d $(INSTALL_DIR)/$(LIB_DIR)
+ install -d $(INSTALL_DIR)/include/libLfunction
+ install -d $(INSTALL_DIR)/include/Lfunction
+ install lcalc $(INSTALL_DIR)/bin
+ install libLfunction.so $(INSTALL_DIR)/$(LIB_DIR)
+ install -m 644 -t $(INSTALL_DIR)/include/libLfunction ../include/*.h
+ install -m 644 -t $(INSTALL_DIR)/include/Lfunction ../include/*.h
SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
nativeBuildInputs = [ python2 ];
cmakeFlags = [
"-DUSE_OPTIMIZED_BLAS=ON"
"-DCMAKE_Fortran_FLAGS=-fPIC"
"-DLAPACKE=ON"
]
++ (optional shared "-DBUILD_SHARED_LIBS=ON");
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
description = "Library to do fast arithmetic with dense matrices over F_2";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -34,6 +34,6 @@ stdenv.mkDerivation rec {
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -24,6 +24,10 @@ in stdenv.mkDerivation {
MKLROOT = optionalString mklSupport mkl;
preConfigure = ''
export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
'';
enableParallelBuilding=true;
buildFlags = [ "magma" "magma_sparse" ];
@@ -3,11 +3,25 @@
For details on using mkl as a blas provider for python packages such as numpy,
numexpr, scipy, etc., see the Python section of the NixPkgs manual.
*/
stdenvNoCC.mkDerivation (rec {
name = "mkl-${version}";
version = "${date}.${rel}";
date = "2019.3";
rel = "199";
let
# Release notes and download URLs are here:
# https://registrationcenter.intel.com/en/products/
version = "${year}.${spot}.${rel}";
year = "2019";
# Darwin is pinned to 2019.3 because the DMG does not unpack; see here for details:
# https://github.com/matthewbauer/undmg/issues/4
spot = if stdenvNoCC.isDarwin then "3" else "5";
rel = if stdenvNoCC.isDarwin then "199" else "281";
rpm-ver = "${year}.${spot}-${rel}-${year}.${spot}-${rel}";
# Intel openmp uses its own versioning, but shares the spot release patch.
openmp-ver = "19.0.${spot}-${rel}-19.0.${spot}-${rel}";
in stdenvNoCC.mkDerivation {
pname = "mkl";
inherit version;
src = if stdenvNoCC.isDarwin
then
@@ -17,29 +31,42 @@ stdenvNoCC.mkDerivation (rec {
})
else
(fetchurl {
url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15275/l_mkl_${version}.tgz";
sha256 = "13rb2v2872jmvzcqm4fqsvhry0j2r5cn4lqql4wpqbl1yia2pph6";
url = "https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15816/l_mkl_${version}.tgz";
sha256 = "0zkk4rrq7g44acxaxhpd2053r66w169mww6917an0lxhd52fm5cr";
});
nativeBuildInputs = if stdenvNoCC.isDarwin
then
[ undmg
darwin.cctools
]
[ undmg darwin.cctools ]
else
[ rpmextract ];
buildPhase = if stdenvNoCC.isDarwin then ''
for f in Contents/Resources/pkg/*.tgz; do
tar xzvf $f
done
for f in Contents/Resources/pkg/*.tgz; do
tar xzvf $f
done
'' else ''
rpmextract rpm/intel-mkl-common-c-${date}-${rel}-${date}-${rel}.noarch.rpm
rpmextract rpm/intel-mkl-core-rt-${date}-${rel}-${date}-${rel}.x86_64.rpm
rpmextract rpm/intel-openmp-19.0.3-${rel}-19.0.3-${rel}.x86_64.rpm
rpmextract rpm/intel-mkl-cluster-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-common-c-${rpm-ver}.noarch.rpm
rpmextract rpm/intel-mkl-core-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-mkl-core-rt-${rpm-ver}.x86_64.rpm
rpmextract rpm/intel-openmp-${openmp-ver}.x86_64.rpm
'';
installPhase = if stdenvNoCC.isDarwin then ''
installPhase = ''
for f in $(find . -name 'mkl*.pc') ; do
bn=$(basename $f)
substituteInPlace $f \
--replace "prefix=<INSTALLDIR>/mkl" "prefix=$out" \
--replace "lib/intel64_lin" "lib"
done
for f in $(find opt/intel -name 'mkl*iomp.pc') ; do
substituteInPlace $f \
--replace "../compiler/lib" "lib"
done
'' +
(if stdenvNoCC.isDarwin then ''
mkdir -p $out/lib
cp -r compilers_and_libraries_${version}/mac/mkl/include $out/
@@ -48,6 +75,9 @@ stdenvNoCC.mkDerivation (rec {
cp -r compilers_and_libraries_${version}/mac/compiler/lib/* $out/lib/
cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/
cp -r compilers_and_libraries_${version}/mac/tbb/lib/* $out/lib/
mkdir -p $out/lib/pkgconfig
cp -r compilers_and_libraries_${version}/mac/mkl/bin/pkgconfig/* $out/lib/pkgconfig
'' else ''
mkdir -p $out/lib
@@ -56,18 +86,21 @@ stdenvNoCC.mkDerivation (rec {
cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/* $out/lib/
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/
cp license.txt $out/lib/
'';
mkdir -p $out/lib/pkgconfig
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/* $out/lib/pkgconfig
'');
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
# larger updated load commands do not fit. Use install_name_tool
# explicitly and ignore the error.
postFixup = stdenvNoCC.lib.optionalString stdenvNoCC.isDarwin ''
for f in $out/lib/*.dylib; do
install_name_tool -id $out/lib/$(basename $f) $f || true
done
install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
install_name_tool -change @rpath/libtbb.dylib $out/lib/libtbb.dylib $out/lib/libmkl_tbb_thread.dylib
install_name_tool -change @rpath/libtbbmalloc.dylib $out/lib/libtbbmalloc.dylib $out/lib/libtbbmalloc_proxy.dylib
for f in $out/lib/*.dylib; do
install_name_tool -id $out/lib/$(basename $f) $f || true
done
install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libmkl_intel_thread.dylib
install_name_tool -change @rpath/libtbb.dylib $out/lib/libtbb.dylib $out/lib/libmkl_tbb_thread.dylib
install_name_tool -change @rpath/libtbbmalloc.dylib $out/lib/libtbbmalloc.dylib $out/lib/libtbbmalloc_proxy.dylib
'';
# Per license agreement, do not modify the binary
@@ -85,12 +118,6 @@ stdenvNoCC.mkDerivation (rec {
homepage = https://software.intel.com/en-us/mkl;
license = licenses.issl;
platforms = [ "x86_64-linux" "x86_64-darwin" ];
maintainers = [ maintainers.bhipple ];
maintainers = with maintainers; [ bhipple ];
};
} // stdenvNoCC.lib.optionalAttrs stdenvNoCC.isLinux {
# Since on Linux binaries are unmodified, we can make them
# fixed-output derivations.
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "101krzh2mjbfx8kvxim2zphdvgg7iijhbf9xdz3ad3ncgybxbdvw";
})
}
@@ -0,0 +1,5 @@
--- a/makefiles/Makefile.python.mk
+++ b/makefiles/Makefile.python.mk
@@ -1070 +1070 @@ $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/data: $(PYDATA_LIBS) | $(PYPI_ARCHIVE_T
-$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYUTIL_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
+$(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools/util: $(PYSORTED_INTERVAL_LIST_LIBS) | $(PYPI_ARCHIVE_TEMP_DIR)/ortools/ortools
@@ -5,15 +5,20 @@
stdenv.mkDerivation rec {
pname = "or-tools";
version = "v7.0";
version = "7.3";
src = fetchFromGitHub {
owner = "google";
repo = "or-tools";
rev = version;
sha256 = "09rs2j3w4ljw9qhhnsjlvfii297njjszwvkbgj1i6kns3wnlr7cp";
rev = "v${version}";
sha256 = "0q06vxmds6nm3dpjw4y5jzr8j98qgfb9i8pbm9pfhmqigv791hwc";
};
patches = [
./build.patch # https://github.com/google/or-tools/pull/1619
./protobuf.patch # Otherwise it tries to install protobuf from pypi.
];
# The original build system uses cmake which does things like pull
# in dependencies through git and Makefile creation time. We
# obviously don't want to do this so instead we provide the
@@ -0,0 +1,10 @@
--- a/makefiles/Makefile.third_party.unix.mk
+++ b/makefiles/Makefile.third_party.unix.mk
@@ -24,1 +24,1 @@ GLOG_TAG = 0.4.0
-PROTOBUF_TAG = 3.9.0
+PROTOBUF_TAG = 3.7.0
--- a/makefiles/Makefile.third_party.win.mk
+++ b/makefiles/Makefile.third_party.win.mk
@@ -40 +40 @@ GLOG_TAG = 0.4.0
-PROTOBUF_TAG = 3.9.0
+PROTOBUF_TAG = 3.7.0
@@ -22,6 +22,6 @@ stdenv.mkDerivation rec {
description = "Calculates rank-width and rank-decompositions";
license = with licenses; [ gpl2Plus ];
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -76,6 +76,6 @@ stdenv.mkDerivation rec {
mit # Dik T. Winter's software
];
maintainers = with maintainers; [ timokau ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}
@@ -1,20 +1,19 @@
{ stdenv, fetchurl, cmake, openssh
{ stdenv, fetchFromGitHub, cmake, openssh
, gfortran, mpi, openblasCompat
} :
stdenv.mkDerivation rec {
pname = "scalapack";
version = "2.0.2";
version = "2.1";
src = fetchurl {
url = "http://www.netlib.org/scalapack/scalapack-${version}.tgz";
sha256 = "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c";
src = fetchFromGitHub {
owner = "Reference-ScaLAPACK";
repo = pname;
rev = "v${version}";
sha256 = "042q9kc383h7y0had9a37702z4s0szavss063ljvfdsbjy07gzb1";
};
# patch to rename outdated MPI functions
patches = [ ./openmpi4.patch ];
nativeBuildInputs = [ cmake openssh ];
buildInputs = [ mpi gfortran openblasCompat ];
@@ -1,143 +0,0 @@
diff --git a/BLACS/SRC/blacs_get_.c b/BLACS/SRC/blacs_get_.c
index e979767..d4b04cf 100644
--- a/BLACS/SRC/blacs_get_.c
+++ b/BLACS/SRC/blacs_get_.c
@@ -23,7 +23,7 @@ F_VOID_FUNC blacs_get_(int *ConTxt, int *what, int *val)
case SGET_MSGIDS:
if (BI_COMM_WORLD == NULL) Cblacs_pinfo(val, &val[1]);
iptr = &val[1];
- ierr=MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
+ ierr=MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_TAG_UB, (BVOID **) &iptr,val);
val[0] = 0;
val[1] = *iptr;
break;
diff --git a/BLACS/SRC/cgamn2d_.c b/BLACS/SRC/cgamn2d_.c
index 2db6ccb..6958f32 100644
--- a/BLACS/SRC/cgamn2d_.c
+++ b/BLACS/SRC/cgamn2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC cgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/cgamx2d_.c b/BLACS/SRC/cgamx2d_.c
index 707c0b6..f802d01 100644
--- a/BLACS/SRC/cgamx2d_.c
+++ b/BLACS/SRC/cgamx2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC cgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/dgamn2d_.c b/BLACS/SRC/dgamn2d_.c
index dff23b4..a2627ac 100644
--- a/BLACS/SRC/dgamn2d_.c
+++ b/BLACS/SRC/dgamn2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC dgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/dgamx2d_.c b/BLACS/SRC/dgamx2d_.c
index a51f731..2a644d0 100644
--- a/BLACS/SRC/dgamx2d_.c
+++ b/BLACS/SRC/dgamx2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC dgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/igamn2d_.c b/BLACS/SRC/igamn2d_.c
index 16bc003..f6a7859 100644
--- a/BLACS/SRC/igamn2d_.c
+++ b/BLACS/SRC/igamn2d_.c
@@ -218,7 +218,7 @@ F_VOID_FUNC igamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/igamx2d_.c b/BLACS/SRC/igamx2d_.c
index 8165cbe..a7cfcc6 100644
--- a/BLACS/SRC/igamx2d_.c
+++ b/BLACS/SRC/igamx2d_.c
@@ -218,7 +218,7 @@ F_VOID_FUNC igamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/sgamn2d_.c b/BLACS/SRC/sgamn2d_.c
index d6c95e5..569c797 100644
--- a/BLACS/SRC/sgamn2d_.c
+++ b/BLACS/SRC/sgamn2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC sgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/sgamx2d_.c b/BLACS/SRC/sgamx2d_.c
index 4b0af6f..8897ece 100644
--- a/BLACS/SRC/sgamx2d_.c
+++ b/BLACS/SRC/sgamx2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC sgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/zgamn2d_.c b/BLACS/SRC/zgamn2d_.c
index 9de2b23..37897df 100644
--- a/BLACS/SRC/zgamn2d_.c
+++ b/BLACS/SRC/zgamn2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC zgamn2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
diff --git a/BLACS/SRC/zgamx2d_.c b/BLACS/SRC/zgamx2d_.c
index 414c381..0e9d474 100644
--- a/BLACS/SRC/zgamx2d_.c
+++ b/BLACS/SRC/zgamx2d_.c
@@ -221,7 +221,7 @@ F_VOID_FUNC zgamx2d_(int *ConTxt, F_CHAR scope, F_CHAR top, int *m, int *n,
{
#endif
i = 2;
- ierr=MPI_Type_struct(i, len, disp, dtypes, &MyType);
+ ierr=MPI_Type_create_struct(i, len, disp, dtypes, &MyType);
ierr=MPI_Type_commit(&MyType);
bp->N = bp2->N = 1;
bp->dtype = bp2->dtype = MyType;
@@ -1,6 +1,6 @@
{ stdenv
, fetchurl
, patchelf
, addOpenGLRunpath
, cudaSupport ? false, symlinkJoin, cudatoolkit, cudnn, nvidia_x11
}:
@@ -35,6 +35,9 @@ let
else ''
patchelf --set-rpath "${rpath}:$out/lib" $out/lib/libtensorflow.so
patchelf --set-rpath "${rpath}" $out/lib/libtensorflow_framework.so
${optionalString cudaSupport ''
addOpenGLRunpath $out/lib/libtensorflow.so $out/lib/libtensorflow_framework.so
''}
'';
in stdenv.mkDerivation rec {
@@ -43,6 +46,8 @@ in stdenv.mkDerivation rec {
src = fetchurl url;
nativeBuildInputs = optional cudaSupport addOpenGLRunpath;
# Patch library to use our libc, libstdc++ and others
buildCommand = ''
mkdir -pv $out
@@ -1,5 +1,5 @@
{ stdenv
, fetchFromGitHub
, fetchFromGitLab
, python
, wafHook
@@ -22,75 +22,89 @@
, dia, tetex ? null, ghostscript ? null, texlive ? null
# generates python bindings
, generateBindings ? false, ncurses ? null
, pythonSupport ? false, ncurses ? null
# All modules can be enabled by choosing 'all_modules'.
# we include here the DCE mandatory ones
, modules ? [ "core" "network" "internet" "point-to-point" "fd-net-device" "netanim"]
, gcc6
, lib
}:
let
pythonEnv = python.withPackages(ps:
stdenv.lib.optional withManual ps.sphinx
++ stdenv.lib.optionals generateBindings (with ps;[ pybindgen pygccxml ])
++ stdenv.lib.optionals pythonSupport (with ps;[ pybindgen pygccxml ])
);
in
stdenv.mkDerivation rec {
pname = "ns-3";
version = "30";
name = "ns-3.${version}";
version = "28";
# the all in one https://www.nsnam.org/release/ns-allinone-3.27.tar.bz2;
# fetches everything (netanim, etc), this package focuses on ns3-core
src = fetchFromGitHub {
owner = "nsnam";
repo = "ns-3-dev-git";
rev = name;
sha256 = "17kzfjpgw2mvyx1c9bxccnvw67jpk09fxmcnlkqx9xisk10qnhng";
src = fetchFromGitLab {
owner = "nsnam";
repo = "ns-3-dev";
rev = "ns-3.${version}";
sha256 = "0smdi3gglmafpc7a20hj2lbmwks3d5fpsicpn39lmm3svazw0bvp";
};
nativeBuildInputs = [ wafHook ];
# ncurses is a hidden dependency of waf when checking python
buildInputs = lib.optionals generateBindings [ castxml ncurses ]
++ stdenv.lib.optional enableDoxygen [ doxygen graphviz imagemagick ]
++ stdenv.lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ];
propagatedBuildInputs = [ gcc6 pythonEnv ];
outputs = [ "out" ] ++ lib.optional pythonSupport "py";
# ncurses is a hidden dependency of waf when checking python
buildInputs = lib.optionals pythonSupport [ castxml ncurses ]
++ lib.optional enableDoxygen [ doxygen graphviz imagemagick ]
++ lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ];
propagatedBuildInputs = [ pythonEnv ];
postPatch = ''
patchShebangs doc/ns3_html_theme/get_version.sh
'';
wafConfigureFlags = with stdenv.lib; [
"--enable-modules=${stdenv.lib.concatStringsSep "," modules}"
"--enable-modules=${concatStringsSep "," modules}"
"--with-python=${pythonEnv.interpreter}"
]
++ optional (build_profile != null) "--build-profile=${build_profile}"
++ optional generateBindings [ ]
++ optional withExamples " --enable-examples "
++ optional doCheck " --enable-tests "
;
doCheck = true;
buildTargets = "build"
+ lib.optionalString enableDoxygen " doxygen"
+ lib.optionalString withManual "sphinx";
doCheck = true;
# to prevent fatal error: 'backward_warning.h' file not found
CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
# we need to specify the proper interpreter else ns3 can check against a
# different version even though we
checkPhase = ''
${pythonEnv.interpreter} ./test.py
postBuild = with stdenv.lib; let flags = concatStringsSep ";" (
optional enableDoxygen "./waf doxygen"
++ optional withManual "./waf sphinx"
);
in "${flags}"
;
postInstall = ''
moveToOutput "${pythonEnv.libPrefix}" "$py"
'';
hardeningDisable = [ "fortify" ];
# we need to specify the proper interpreter else ns3 can check against a
# different version
checkPhase = ''
${pythonEnv.interpreter} ./test.py --nowaf
'';
meta = {
homepage = http://www.nsnam.org;
license = stdenv.lib.licenses.gpl3;
# strictoverflow prevents clang from discovering pyembed when bindings
hardeningDisable = [ "fortify" "strictoverflow"];
meta = with stdenv.lib; {
homepage = "http://www.nsnam.org";
license = licenses.gpl3;
description = "A discrete time event network simulator";
platforms = with stdenv.lib.platforms; unix;
platforms = with platforms; unix;
maintainers = with maintainers; [ teto ];
};
}