guix mkl package only sequential
Related ogs/ogs!4886 (merged)
/opt/intel/compilers_and_libraries_2020.4.304/linux/compiler/lib/intel64_lin/libiomp5.so is missing and therefore mkl pkgconfig mkl-dynamic-${MKL_INTERFACE}-iomp5
cannot be used:
--- A/app.kaleidoscope.kaleidoscope_dynamic_file_C8556034-34D6-4AE4-BFC0-6EAA650510F5-8175-00000050B969A6A6.txt
+++ B/app.kaleidoscope.kaleidoscope_dynamic_file_82B40ACC-B8AC-478E-B0B7-CAD4BEAE6A7C-8175-00000050A83096E6.txt
@@ -1,6 +1,7 @@
prefix=<INSTALLDIR>/mkl
exec_prefix=${prefix}
libdir=${exec_prefix}/lib/intel64_lin
+omplibdir=${exec_prefix}/../compiler/lib/intel64_lin
includedir=${prefix}/include
#info
@@ -9,7 +10,7 @@
Version: 2020 Update 4
URL: https://software.intel.com/en-us/mkl
#Link line
+Libs: -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -L${omplibdir} -liomp5 -lpthread -lm -ldl
-Libs: -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
#Compiler line
Cflags: -I${MKLROOT}/include
Tried this package modification:
(define-module (mkl)
#:use-module (guix)
#:use-module (guix packages)
#:use-module (non-free mkl)
#:use-module (ogs-dependencies))
(define-public mkl-fix
(package
(inherit mkl)
(name "mkl-fix")
(arguments
`(#:phases (modify-phases %standard-phases
(delete 'configure)
(delete 'check)
(delete 'build)
(add-before 'install 'extract-rpms
(lambda _
;; Instead of running their 'install.sh', a script-generating
;; script that attempts to run obscure pre-built binaries,
;; simply extract the RPMs to ./opt/intel.
(mkdir "opt")
(for-each (lambda (rpm)
(format #t "extracting ~a...~%" rpm)
(let* ((command (string-append "rpm2cpio "
rpm
" | cpio -i"))
(status (system command)))
(unless (zero? status)
(error (format #f
"command '~a' failed with ~a"
command status)))))
(find-files "rpm" "\\.rpm$"))))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(source-prefix (string-append
"opt/intel/compilers_and_libraries_"
,(package-version this-package)
"/linux/mkl"))
(compiler-prefix (string-append
"opt/intel/compilers_and_libraries_"
,(package-version this-package)
"/linux/compiler"))
(bindir (string-append out "/bin"))
(libdir (string-append out "/lib"))
(includedir (string-append out "/include"))
(linktool (string-append bindir "/mkl_link_tool")))
;; Install libraries. Don't install .a files: that saves
;; ~1 GB and presumably nobody cares.
(for-each (lambda (lib)
(install-file lib libdir))
(find-files (string-append source-prefix
"/lib/intel64_lin") "\\.so$"))
(for-each (lambda (lib)
(install-file lib libdir))
(find-files (string-append compiler-prefix
"/lib/intel64_lin") "\\.so$"))
(copy-recursively (string-append source-prefix
"/include")
includedir)
(copy-recursively (string-append source-prefix "/bin")
bindir)
;; 'mkl_link_tool' is in version 2020, but not in 2019.
(when (file-exists? linktool)
;; Note: 'set-file-runpath' from gremlin.scm can modify
;; DT_RUNPATH, but it cannot add it when it's missing, hence
;; PatchELF.
(invoke "patchelf" linktool "--set-rpath"
(string-join (list (dirname (search-input-file
inputs
"/lib/libgcc_s.so"))
(dirname (search-input-file
inputs
"/lib/libstdc++.so.6")))
":")))))))
;; Let's not publish or obtain substitutes for that.
#:substitutable? #f))
))
But results in
starting phase `validate-runpath'
validating RUNPATH of 39 binaries in "/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib"...
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiomp5.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiomp5.so: error: depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH ()
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiomp5_db.so: error: depends on 'libstdc++.so.6', which cannot be found in RUNPATH ()
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiomp5_db.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiomp5_db.so: error: depends on 'ld-linux-x86-64.so.2', which cannot be found in RUNPATH ()
/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/lib/libiompstubs5.so: error: depends on 'libgcc_s.so.1', which cannot be found in RUNPATH ()
validating RUNPATH of 1 binaries in "/gnu/store/g1cnx27d5zv0mw8i2iya1r8lh8s4g48d-mkl-fix-2020.4.304/bin"...
error: in phase 'validate-runpath': uncaught exception:
misc-error #f "RUNPATH validation failed" () #f
phase `validate-runpath' failed after 0.2 seconds
Backtrace:
8 (primitive-load "/gnu/store/f1d7mhszsshn5ymj0ja2yxjbp6p…")
In guix/build/gnu-build-system.scm:
908:2 7 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
1752:10 6 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
634:9 5 (for-each #<procedure 7fffeef14820 at guix/build/gnu-b…> …)
In ice-9/boot-9.scm:
1752:10 4 (with-exception-handler _ _ #:unwind? _ # _)
In guix/build/gnu-build-system.scm:
929:23 3 (_)
570:10 2 (validate-runpath #:validate-runpath? _ # _ #:outputs _)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
RUNPATH validation failed
builder for `/gnu/store/nvh59jc8f7qn2yhly3jc4ksiacy1f7hx-mkl-fix-2020.4.304.drv' failed with exit code 1
build of /gnu/store/nvh59jc8f7qn2yhly3jc4ksiacy1f7hx-mkl-fix-2020.4.304.drv failed
View build log at '/var/log/guix/drvs/nv/h59jc8f7qn2yhly3jc4ksiacy1f7hx-mkl-fix-2020.4.304.drv.gz'.
guix build: error: build of `/gnu/store/nvh59jc8f7qn2yhly3jc4ksiacy1f7hx-mkl-fix-2020.4.304.drv' failed
Related https://gitlab.inria.fr/guix-hpc/guix-hpc-non-free/-/blob/master/non-free/mkl.scm.
Edited by Lars Bilke