Hello, 
We are trying to build a package for intel onepi fortran compiler. The sources 
are installed through a script "install" (/bin/sh) which calls a binary 
bootstrapper which allows to download the files and install them 
Fisrt, launching the script as a standard user is OK. 

Writing a scm file, we can run the install script but when calling the 
boostrapper binary ends with the following error message "no such file or 
directory". 
Adding a phase to chmod this binary is OK, so the file is in the supposed 
directory. We have tried to export HOME and USER environement variables but 
without any effect. 
Has anyone encountered this kind of error ? 

I join the package 

Thank you very much in advance for any help ... 
Best regards 
Céline 

-----------------------------------------------------------------------------------------
 
guix build -f oneapi.scm returns 


phase `set-paths' succeeded after 1.3 seconds 
starting phase `install-locale' 
using 'en_US.utf8' locale for category "LC_ALL" 
phase `install-locale' succeeded after 0.0 seconds 
starting phase `unpack' 
phase `unpack' succeeded after 0.9 seconds 
starting phase `bootstrap' 
no 'configure.ac' or anything like that, doing nothing 
phase `bootstrap' succeeded after 0.0 seconds 
starting phase `patch-usr-bin-file' 
phase `patch-usr-bin-file' succeeded after 0.0 seconds 
starting phase `patch-source-shebangs' 
patch-shebang: ./l_fortran-compiler_p_2022.0.1.70_offline.sh: changing 
`/bin/sh' to `/gnu/store/d99ykvj3axzzidygsmdmzxah4lvxd6hw-bash-5.1.8/bin/sh' 
phase `patch-source-shebangs' succeeded after 5.2 seconds 
starting phase `patch-generated-file-shebangs' 
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds 
starting phase `extract-package' 
Extracted to 
/tmp/guix-build-intel_oneapi-2022.0.1.70.drv-0/l_fortran-compiler_p_2022.0.1.70_offline
 
phase `extract-package' succeeded after 6.3 seconds 
starting phase `patch-more-shebangs' 
phase `patch-more-shebangs' succeeded after 0.0 seconds 
starting phase `install' 
./install.sh: line 34: 
/tmp/guix-build-intel_oneapi-2022.0.1.70.drv-0/l_fortran-compiler_p_2022.0.1.70_offline/bootstrapper:
 No such file or directory 
error: in phase 'install': uncaught exception: 
%exception #<&invoke-error program: "sh" arguments: ("./install.sh" "--silent" 
"--eula accept") exit-status: 127 term-signal: #f stop-signal: #f> 
phase `install' failed after 0.0 seconds 
command "sh" "./install.sh" "--silent" "--eula accept" failed with status 127 

-- 
Céline Acary-Robert 
LJK[Scalde/AirSea]/GRICAD/MaiMoSiNE 
04 57 42 17 89 
(use-modules
   ((guix licenses) #:prefix license:)
   (gnu packages)
   (guix packages)
   (guix utils)
   (guix download)
   (guix build-system gnu)
   (gnu packages maths)
   (gnu packages gcc)
   (gnu packages cmake)
   (gnu packages base)
   (gnu packages bash)
   (gnu packages ssh)
   (gnu packages gtk)
   (gnu packages freedesktop)
   (gnu packages ncurses)
   (gnu packages nss)
   (gnu packages xorg)
   (gnu packages xdisorg)
   (gnu packages gl)
   (gnu packages pkg-config)
   (gnu packages compression)
   (gnu packages lxqt)
   (gnu packages gnome))


(define-public oneapi
  (package
    (name "intel_oneapi")
    (version "2022.0.1.70")
    (source
      (origin
        (method url-fetch)
        (uri (string-append "https://registrationcenter-download.intel.com/akdlm/irc_nas/18436/l_fortran-comp$
        (sha256
          (base32
            "1lah7y9zhvd8vrahchvk7prka9q8wz88pbbczppvym1mz428mcic"))))
    (build-system gnu-build-system)
    (arguments
      '(#:tests? #f
        #:phases
          (modify-phases %standard-phases
         (delete 'configure)
         (delete 'check)
         (delete 'build)
         (add-before 'install 'extract-package
           (lambda _
             ;; simply extract the package  into the build directory
             (chmod "l_fortran-compiler_p_2022.0.1.70_offline.sh" #o755)
             (invoke "./l_fortran-compiler_p_2022.0.1.70_offline.sh"
                       "--extract-only" "--silent"
                      ;;"--extract-folder opt/intel/" "-a" "--install-dir opt/intel" "--download-cache opt/in$
                      ;;"--download-dir opt/intel/tmp" "--log-dir opt/intel" "--silent" "--eula accept"
    )))
       (add-after 'extract-package 'patch-more-shebangs
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((bash (assoc-ref inputs "bash")))
             (substitute* '("l_fortran-compiler_p_2022.0.1.70_offline/install.sh")
                   (("/bin/sh")
                    (string-append bash "/bin/sh"))))))
        (replace 'install
        (lambda _
             ;; install the package with the provided installer.
        (chmod "l_fortran-compiler_p_2022.0.1.70_offline/install.sh" #o777)
        (chmod "l_fortran-compiler_p_2022.0.1.70_offline/bootstrapper" #o777)
        (chdir "l_fortran-compiler_p_2022.0.1.70_offline")
        (find-files ".")
        (invoke "sh" "./install.sh"  "--silent" "--eula accept"
                     ;;"--install-dir ./opt/intel" "--download-cache ./opt/intel/tmp"
                     ;;"--download-dir ./opt/intel/tmp" "--log-dir ./opt/intel/logs" "--ignore-errors"
    )))
)))
(inputs
       (list bash gtk+ mesa lxqt zlib cmake gcc))
      (native-inputs
       (list pkg-config bash))
      (propagated-inputs
       ;; These two libraries are in 'Requires.private' in libgit2.pc.
       (list libnotify xdg-utils ncurses nss libxcb libdrm gtk+ mesa lxqt zlib))

    (home-page
      "https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html";)
    (synopsis
      "Intel OneAPI HPC tools")
    (description
      "C and fortran intel compilers, MPI suite etc ..  ")
    (license #f)))

oneapi

Reply via email to