| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 |
|
| 18 | (define-module (gnu packages rocm-tools)
|
| 19 | #:use-module (guix build-system cmake)
|
| 20 | #:use-module (guix gexp)
|
| 21 | #:use-module (guix git-download)
|
| 22 | #:use-module ((guix licenses) #:prefix license:)
|
| 23 | #:use-module (guix packages)
|
| 24 | #:use-module (gnu packages check)
|
| 25 | #:use-module (gnu packages elf)
|
| 26 | #:use-module (gnu packages libffi)
|
| 27 | #:use-module (gnu packages linux)
|
| 28 | #:use-module (gnu packages llvm)
|
| 29 | #:use-module (gnu packages pciutils)
|
| 30 | #:use-module (gnu packages perl)
|
| 31 | #:use-module (gnu packages pkg-config)
|
| 32 | #:use-module (gnu packages python)
|
| 33 | #:use-module (gnu packages python-science)
|
| 34 | #:use-module (gnu packages python-xyz)
|
| 35 | #:use-module (gnu packages rocm)
|
| 36 | #:use-module (gnu packages xdisorg))
|
| 37 |
|
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 |
|
| 45 | (define %rocm-version "7.1.1")
|
| 46 |
|
| 47 | (define-public hipify
|
| 48 | (package
|
| 49 | (name "hipify")
|
| 50 | (version %rocm-version)
|
| 51 | (source
|
| 52 | (origin
|
| 53 | (method git-fetch)
|
| 54 | (uri (git-reference
|
| 55 | (url "https://github.com/ROCm/hipify")
|
| 56 | (commit (string-append "rocm-" version))))
|
| 57 | (file-name (git-file-name name (string-append "rocm-" version)))
|
| 58 | (sha256
|
| 59 | (base32 "153nzm292sp9m52dkjss5bf3971p5nwi38dw49pnlc1g00f4bc9m"))))
|
| 60 | (build-system cmake-build-system)
|
| 61 | (arguments
|
| 62 | (list
|
| 63 | #:build-type "Release"
|
| 64 | #:tests? #f |
| 65 | #:configure-flags
|
| 66 | #~'("-DCMAKE_CXX_COMPILER=clang++")
|
| 67 | #:phases
|
| 68 | #~(modify-phases %standard-phases
|
| 69 | (add-after 'unpack 'remove-generated
|
| 70 | (lambda _
|
| 71 | (delete-file "bin/hipify-perl")))
|
| 72 | (add-before 'configure 'prepare-cmake
|
| 73 | (lambda _
|
| 74 | (substitute* "CMakeLists.txt"
|
| 75 | (("set.CMAKE_CXX_COMPILER.*") "")
|
| 76 | (("set.CMAKE_C_COMPILER.*") ""))))
|
| 77 | (add-after 'build 'build-hipify-perl
|
| 78 | (lambda _
|
| 79 | (invoke "./hipify-clang" "--perl" "--o-hipify-perl-dir=../source/bin")))
|
| 80 | (add-after 'install 'chmod
|
| 81 | (lambda _
|
| 82 | (for-each (lambda (file)
|
| 83 | (chmod file #o555))
|
| 84 | (find-files (string-append #$output "/bin")))))
|
| 85 | (add-after 'install 'patch-shebang
|
| 86 | (lambda _
|
| 87 | (patch-shebang (string-append #$output "/bin/hipify-perl")))))))
|
| 88 | (inputs (list clang-rocm perl))
|
| 89 | (synopsis "HIPIFY: Convert CUDA to HIP code")
|
| 90 | (description
|
| 91 | "HIPIFY is a set of tools that you can use to automatically
|
| 92 | translate CUDA source code into portable HIP C++.")
|
| 93 | (home-page "https://github.com/ROCm/HIPIFY")
|
| 94 | (license license:ncsa)))
|