unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: zamfofex <zamfofex@twdb.moe>
To: 63088@debbugs.gnu.org
Cc: zamfofex <zamfofex@twdb.moe>
Subject: [bug#63088] [PATCH 1/3] gnu: Add ISPC. * gnu/packages/c.scm (ispc): New variable.
Date: Wed, 26 Apr 2023 10:17:37 -0300	[thread overview]
Message-ID: <7ad5f28721fe957a4863500b29e31a1191166041.1682514072.git.zamfofex@twdb.moe> (raw)
In-Reply-To: <cover.1682514072.git.zamfofex@twdb.moe>

---
 gnu/packages/c.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index b2f16613dd..28438f56c8 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
 ;;; Copyright © 2022 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2022 ( <paren@disroot.org>
+;;; Copyright © 2023 zamfofex <zamfofex@twdb.moe>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,7 +58,9 @@ (define-module (gnu packages c)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages m4)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages ncurses)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
@@ -1375,3 +1378,63 @@ (define-public utest-h
       (description
        "This package provides a header-only unit testing library for C/C++.")
       (license license:unlicense))))
+
+(define-public ispc
+  (package
+    (name "ispc")
+    (version "1.19.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/ispc/ispc")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0yhcgyzjlrgs920lm0l6kygj2skanfb6qkxbdgm69r8c2xkzkaa3"))))
+    (inputs (list ncurses))
+    (native-inputs (list bison clang flex m4 python))
+    (build-system cmake-build-system)
+    (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux" "armhf-linux"))
+    (arguments `(#:tests? #f
+                 #:configure-flags
+                   `(,,(string-append "-DCMAKE_C_COMPILER=" (cc-for-target))
+                     ,,(string-append "-DCMAKE_CXX_COMPILER=" (cxx-for-target))
+                     ,(string-append "-DCLANG_EXECUTABLE="
+                                     (assoc-ref %build-inputs "clang")
+                                     "/bin/clang")
+                     ,(string-append "-DCLANGPP_EXECUTABLE="
+                                     (assoc-ref %build-inputs "clang")
+                                     "/bin/clang++"))
+                 #:phases
+                   (modify-phases %standard-phases
+                     (add-before 'configure 'patch-curses-requirement
+                       (lambda _
+                         (substitute* "CMakeLists.txt"
+                                      (("\\bCURSES_CURSES_LIBRARY\\b")
+                                        "CURSES_LIBRARY"))))
+                     ; Note: This works around the following issue:
+                     ; <https://github.com/ispc/ispc/issues/1865>
+                     ; Because GCC in Guix does not have multilib support.
+                     (add-before 'configure 'patch-target-archs
+                       (lambda _
+                         (substitute* "cmake/GenerateBuiltins.cmake"
+                                      (("\\bforeach \\(bit 32 64\\)")
+                                        ,(if (target-64bit?)
+                                             "foreach (bit 64)"
+                                             "foreach (bit 32)"))
+                                      (("\\bforeach \\(arch .*?\\)")
+                                        ,(if (target-x86?)
+                                             "foreach (arch \"x86\")"
+                                             "foreach (arch \"arm\")"))
+                                      (("\\bforeach \\(os_name \"windows\" .*?\\)")
+                                        "foreach (os_name \"linux\")")))))))
+    (synopsis "Implicit SPMD Program Compiler")
+    (description
+     "ISPC is a compiler for a variant of the C programming language, with
+extensions for single program, multiple data programming.  Under the SPMD
+model, the programmer writes a program that generally appears to be a regular
+serial program, though the execution model is actually that a number of program
+instances execute in parallel on the hardware.")
+    (home-page "https://github.com/ispc/ispc")
+    (license license:bsd-3)))
-- 
2.39.2





  reply	other threads:[~2023-04-26 13:19 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 13:13 [bug#63088] [PATCH 0/3] Add Lc0 zamfofex
2023-04-26 13:17 ` zamfofex [this message]
2023-04-26 13:17 ` [bug#63088] [PATCH 2/3] gnu: Add oneDNN. * gnu/packages/machine-learning.scm (oneapi-dnnl): New variable zamfofex
2023-04-26 13:17 ` [bug#63088] [PATCH 3/3] gnu: Add Lc0. * gnu/packages/games.scm (lc0): " zamfofex
2023-05-11 14:29   ` [bug#63088] [PATCH 0/3] Add Lc0 宋文武 via Guix-patches via
2023-05-11 21:25     ` zamfofex
2023-05-16 12:16       ` Simon Tournier
2023-07-27 23:34 ` [bug#63088] [PATCH] " zamfofex
2023-07-28  0:24   ` zamfofex
2023-07-28  4:23   ` Liliana Marie Prikler
2023-07-28 18:14     ` zamfofex
2023-09-07 10:23 ` [bug#63088] [PATCH v2] gnu: " iyzsong--- via Guix-patches via
2023-09-07 17:03   ` Liliana Marie Prikler
2023-09-11 10:22     ` zamfofex
2023-09-11 18:00       ` Liliana Marie Prikler
2023-09-12 11:58 ` [bug#63088] [PATCH 1/3] gnu: Add lc0 zamfofex
2023-09-12 11:58   ` [bug#63088] [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero zamfofex
2023-09-12 17:07     ` Liliana Marie Prikler
2023-09-12 11:58   ` [bug#63088] [PATCH 3/3] gnu: Add neural networks from the Maia Chess project zamfofex
2023-09-13  1:49 ` [bug#63088] [PATCH 1/3] gnu: Add lc0 zamfofex
2023-09-13  1:49   ` [bug#63088] [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero zamfofex
2023-09-13  1:49   ` [bug#63088] [PATCH 3/3] gnu: Add neural networks from the Maia Chess project zamfofex

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ad5f28721fe957a4863500b29e31a1191166041.1682514072.git.zamfofex@twdb.moe \
    --to=zamfofex@twdb.moe \
    --cc=63088@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).