Subject: [bug#31172] [PATCH 1/1] gnu: Add psm2.

From: [email-masked] (Ludovic Courtès)
Date: Mon, 23 Apr 2018 14:52:15 +0200

Hello,

Rouby Pierre-Antoine <[email-masked]> skribis:

> * gnu/packages/linux.scm (psm2): New variable.

Overall LGTM!  Some comments:

> +(define-public psm2
> +  (package
> +    (name "psm2")
> +    (version "10.3-46")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/intel/opa-psm2.git")
> +                    (commit "5fabd0e699a920e74333f789923fd1c02bb7c629")))

I think you can use the “PSM2_10.3-46” tag for clarity here.

> +    (arguments
> +     '(#:modules ((guix build utils)
> +                  (guix build gnu-build-system))

This #:modules isn’t needed since it’s already the default set of
modules.

> +       #:phases (modify-phases %standard-phases
> +                  (delete 'configure)
> +                  (delete 'check)
> +                  (replace 'install
> +                    (lambda* (#:key outputs #:allow-other-keys)
> +                      (let* ((out (assoc-ref outputs "out")))
> +                        (setenv "DESTDIR" out)
> +                        (invoke "make" "install")

Setting DESTDIR doesn’t quite work; it leads to an incorrect layout with
some files going to $prefix/usr:

--8<---------------cut here---------------start------------->8---
$ find /gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/lib
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/lib/udev
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/lib/udev/rules.d
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/lib/udev/rules.d/40-psm.rules
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/lib/udev/rules.d/40-psm-compat.rules
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/share
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/share/doc
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/share/doc/psm2-10.3-46
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/share/doc/psm2-10.3-46/COPYING
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib/libpsm2
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib/libpsm2/libpsm2-compat.cmds
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/libpsm2.so.2
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/psm2-compat
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/psm2-compat/libpsm_infinipath.so.1
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/libpsm2.so
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/libpsm2.so.2.1
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/lib64/libpsm2.a
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/psm2.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/hfi1_deprecated.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/ptl_ips
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/ptl_ips/ipserror.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/psmi_wrappers.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_intf.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/linux-x86_64
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/linux-x86_64/bit_ops.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/linux-x86_64/sysdep.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_udebug.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_debug.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_byteorder.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_common.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_revision.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_service.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/psm2_mock_testing.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/hfi1diag/opa_user.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/psm2_mq.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/usr/include/psm2_am.h
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/etc
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/etc/modprobe.d
/gnu/store/i1ln5bgdkspm959nv7k42ysgycgsm3v6-psm2-10.3-46/etc/modprobe.d/libpsm2-compat.conf
--8<---------------cut here---------------end--------------->8---

Also we should avoid lib64/.

Could you send an updated patch?

Eventually we should try adding psm2 as an input to ‘openmpi’ so that it
is built with PSM2 modules.

Thank you!

Ludo’.