git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #111453 from markuskowa/upd-mpich

mpich: 3.2.2 -> 3.4.1

commitdfab15bd086ed794229200fe256b836b466b4017 authorSandro <sandro.jaeckel@gmail.com> dateWed 3 Feb 2021, 18:13 (6 years ago) parent7750e6ad47f08d
2 files changed+96−13
pkgs/development/libraries/mpich/default.nix+34−13 pkgs/development/libraries/mpich/jsonc-test.patch+62
pkgs/development/libraries/mpich/default.nix+34−13
@@ -1,24 +1,52 @@
1−{ lib, stdenv, fetchurl, perl, gfortran
2−, openssh, hwloc
1+{ stdenv, lib, fetchurl, perl, gfortran
2+, openssh, hwloc, autoconf, automake, libtool
3+# device options are ch3 or ch4
4+, device ? "ch4"
5+# backend option are libfabric or ucx
6+, ch4backend ? "libfabric"
7+, ucx, libfabric
8+# Process manager to build
9+, withPm ? "hydra:gforker"
310} :
411
12+assert (ch4backend == "ucx" || ch4backend == "libfabric");
13+
514stdenv.mkDerivation rec {
615 pname = "mpich";
7− version = "3.3.2";
16+ version = "3.4.1";
817
918 src = fetchurl {
1019 url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
11− sha256 = "1farz5zfx4cd0c3a0wb9pgfypzw0xxql1j1294z1sxslga1ziyjb";
20+ sha256 = "09wpfw9lsrc84vcmfw94razd4xv4znx4mmg7rqmljvgg0jc96dl8";
1221 };
1322
23+ patches = [
24+ # Reverts an upstream change that causes json-c test to fail
25+ ./jsonc-test.patch
26+ ];
27+
28+ # Required for the json-c patch
29+ nativeBuildInputs = [ autoconf automake libtool ];
30+
31+ # Update configure after patch
32+ postPatch = ''
33+ cd modules/json-c
34+ ./autogen.sh
35+ cd ../..
36+ '';
37+
38+
1439 configureFlags = [
1540 "--enable-shared"
1641 "--enable-sharedlib"
42+ "--with-pm=${withPm}"
1743 ];
1844
1945 enableParallelBuilding = true;
2046
21− buildInputs = [ perl gfortran openssh hwloc ];
47+ buildInputs = [ perl gfortran openssh hwloc ]
48+ ++ lib.optional (ch4backend == "ucx") ucx
49+ ++ lib.optional (ch4backend == "libfabric") libfabric;
2250
2351 doCheck = true;
2452
@@ -27,14 +55,7 @@ stdenv.mkDerivation rec {
2755 sed -i 's:CC="gcc":CC=${stdenv.cc}/bin/gcc:' $out/bin/mpicc
2856 sed -i 's:CXX="g++":CXX=${stdenv.cc}/bin/g++:' $out/bin/mpicxx
2957 sed -i 's:FC="gfortran":FC=${gfortran}/bin/gfortran:' $out/bin/mpifort
30− ''
31− + lib.optionalString (!stdenv.isDarwin) ''
32− # /tmp/nix-build... ends up in the RPATH, fix it manually
33− for entry in $out/bin/mpichversion $out/bin/mpivars; do
34− echo "fix rpath: $entry"
35− patchelf --set-rpath "$out/lib" $entry
36− done
37− '';
58+ '';
3859
3960 meta = with lib; {
4061 description = "Implementation of the Message Passing Interface (MPI) standard";
pkgs/development/libraries/mpich/jsonc-test.patchnew file+62
@@ -0,0 +1,62 @@
1+--- b/modules/json-c/configure.ac
2++++ a/modules/json-c/configure.ac
3+@@ -75,7 +75,7 @@
4+ AC_FUNC_VPRINTF
5+ AC_FUNC_MEMCMP
6+ AC_CHECK_FUNCS([realloc])
7++AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open strncasecmp setlocale)
8+-AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf open strncasecmp setlocale)
9+ AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
10+ AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
11+ AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
12+--- b/modules/json-c/json_pointer.c
13++++ a/modules/json-c/json_pointer.c
14+@@ -208,7 +208,7 @@
15+ }
16+
17+ va_start(args, path_fmt);
18++ rc = vasprintf(&path_copy, path_fmt, args);
19+- rc = json_vasprintf(&path_copy, path_fmt, args);
20+ va_end(args);
21+
22+ if (rc < 0)
23+@@ -287,7 +287,7 @@
24+
25+ /* pass a working copy to the recursive call */
26+ va_start(args, path_fmt);
27++ rc = vasprintf(&path_copy, path_fmt, args);
28+- rc = json_vasprintf(&path_copy, path_fmt, args);
29+ va_end(args);
30+
31+ if (rc < 0)
32+--- b/modules/json-c/printbuf.c
33++++ a/modules/json-c/printbuf.c
34+@@ -129,7 +129,7 @@
35+ would have been written - this code handles both cases. */
36+ if(size == -1 || size > 127) {
37+ va_start(ap, msg);
38++ if((size = vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }
39+- if((size = json_vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }
40+ va_end(ap);
41+ printbuf_memappend(p, t, size);
42+ free(t);
43+--- b/modules/json-c/vasprintf_compat.h
44++++ a/modules/json-c/vasprintf_compat.h
45+@@ -8,8 +8,9 @@
46+
47+ #include "snprintf_compat.h"
48+
49++#if !defined(HAVE_VASPRINTF)
50+ /* CAW: compliant version of vasprintf */
51++static int vasprintf(char **buf, const char *fmt, va_list ap)
52+-static int json_vasprintf(char **buf, const char *fmt, va_list ap)
53+ {
54+ #ifndef WIN32
55+ static char _T_emptybuffer = '\0';
56+@@ -40,5 +41,6 @@
57+
58+ return chars;
59+ }
60++#endif /* !HAVE_VASPRINTF */
61+
62+ #endif /* __vasprintf_compat_h */