Hello Guixers !

I am new to Guix and try to write package definitions to automate and make
some installation reproducible.

I have few questions:

- Why not export the license record type from license.scm ? Some project
has its own license and I cannot create it.

- I have errors when I try to build with guix that I don't have when I
build manually. I have a package (asiofi) which depends on another one
(libfabric) but the build does not find it. Here is my current file
attached and the command I use:

# guix build -K --load-path=/home/emederna/src/packages -e '(@ (CBM)
asiofi)'
...
CMake Error at test/CMakeLists.txt:9 (add_executable):
  Target "afi_msg_bw" links to target "OFI::libfabric" but the target was
not
  found.  Perhaps a find_package() call is missing for an IMPORTED target,
or
  an ALIAS target is missing?

Manually the compilation works fine, what am I missing ?

Thanks in advance

Best regards,

Emmanuel Medernach
(define-module (CBM)

  #:use-module  (guix packages)
  #:use-module  (guix download)
  #:use-module  (guix build-system cmake)
  #:use-module  (guix build-system gnu)

  #:use-module  (gnu packages autotools)
  #:use-module  (gnu packages commencement) ;; gcc-toolchain

  #:use-module  (gnu packages boost)
  #:use-module  (gnu packages sqlite)

  #:use-module  ((guix licenses) #:prefix license:))


(define-public libfabric
  (package
    (name "libfabric")
    (version "1.9.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://github.com/ofiwg/libfabric/archive/v";
             version
             ".tar.gz"))
       (sha256
        (base32
         "0sic649kg9jhljqhffgyc5pihpysc8gjg0hc924rs5wxv5qxypvn"))))
    (build-system gnu-build-system)
    (inputs
     `(("autoconf" ,autoconf) ;; autogen autoreconf
       ("automake" ,automake) ;; aclocal
       ("libtool" ,libtool) 
       ))

    (home-page "https://github.com/ofiwg/libfabric";)
    (synopsis "Open Fabrics Interfaces")
    (description "Framework focused on exporting fabric communication services to applications.")
    (license license:bsd-2)))

(define-public asiofi
  (package
    (name "asiofi")
    (version "0.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://github.com/FairRootGroup/asiofi/archive/v";
             version
             ".tar.gz"))
       (sha256
        (base32
         "0q88k7kffpa66327gnd7wwzrhqnhmqxpgyqa68aqs7l28f4iq9sn"))))
    (build-system cmake-build-system)
    (inputs
     `(("gcc-toolchain" ,gcc-toolchain)
       ("libfabric" ,libfabric)
       ("boost" ,boost)))
    (arguments
     `(;; #:configure-flags
       ;; (list
       ;; 	;; find_package uses <PackageName>_ROOT variables.
       ;; 	;; For compatibility, CMake is ignoring the variable.
       ;; 	(string-append "-DOFI_ROOT="
       ;; 		       (assoc-ref %build-inputs "libfabric")
       ;; 		       ))
       
       #:phases       
       (modify-phases
	%standard-phases
	(add-after
	 'unpack 'use-system-libraries
	 (lambda _
	   (substitute*
	    "cmake/asiofiLib.cmake"
	    (("### PUBLIC") "cmake_policy(SET CMP0074 NEW)"))
	   #t))
	(add-before
	 'configure 'OFI
	 (lambda _
	   (let ((libfabric-path (assoc-ref %build-inputs "libfabric")))
	     (let* ((var (getenv "PKG_CONFIG_PATH"))
	     	    (result (string-append 
			     (if var (string-append var ":") "")
			     libfabric-path
			     "/lib/pkgconfig")))
	       (setenv "PKG_CONFIG_PATH" result))))))))

    (home-page "https://github.com/FairRootGroup/asiofi";)
    (synopsis "C++ Boost.Asio language bindings for OFI libfabric")
    (description "")
    (license license:lgpl2.1+)))



Reply via email to