summaryrefslogtreecommitdiff
path: root/gnu/packages/maths.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/maths.scm')
-rw-r--r--gnu/packages/maths.scm37
1 files changed, 35 insertions, 2 deletions
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 72a963db701..db6eceabeae 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -8397,7 +8397,8 @@ s-expression-based format.")
8397 (commit (string-append "symfpu-" version "-dual-license")))) 8397 (commit (string-append "symfpu-" version "-dual-license"))))
8398 (file-name (git-file-name name version)) 8398 (file-name (git-file-name name version))
8399 (sha256 8399 (sha256
8400 (base32 "13a9y0spyi6pggbhjgwi9g2qy822h1zakzhhwvm8qgk5c4njv3c6")))) 8400 (base32 "13a9y0spyi6pggbhjgwi9g2qy822h1zakzhhwvm8qgk5c4njv3c6"))
8401 (patches (search-patches "symfpu-fix-rounding-test-case.patch"))))
8401 (build-system copy-build-system) 8402 (build-system copy-build-system)
8402 (arguments 8403 (arguments
8403 (list 8404 (list
@@ -8407,6 +8408,38 @@ s-expression-based format.")
8407 ("utils" "include/symfpu/utils" #:exclude ("Makefile"))) 8408 ("utils" "include/symfpu/utils" #:exclude ("Makefile")))
8408 #:phases 8409 #:phases
8409 #~(modify-phases %standard-phases 8410 #~(modify-phases %standard-phases
8411 ;; Make sure that the tests exit with a zero exit status by default.
8412 ;; Generated tests have assert(3) statements which exit with a
8413 ;; non-zero exit status on test failure.
8414 (add-after 'unpack 'fix-tests
8415 (lambda _
8416 (substitute* "applications/test.cpp"
8417 (("return 1") "return 0"))))
8418 (add-before 'install 'check
8419 (lambda* (#:key tests? #:allow-other-keys)
8420 (when tests?
8421 ;; To ensure the test application builds prior to 'install,
8422 ;; set up a symlink and modify CXXFLAGS to find the headers.
8423 (symlink #$source "symfpu")
8424 (invoke "make" "CXXFLAGS=-I." "test")
8425
8426 ;; Run tests in their breadth (i.e., --allTests) but on a very
8427 ;; small value range as otherwise the tests run for a long time.
8428 (invoke "./test"
8429 "--allTests"
8430 "--printC"
8431 "--start=0"
8432 "--end=125"
8433 "--verbose")
8434
8435 ;; Test script generates C code which we then compile & execute.
8436 (for-each
8437 (lambda (file)
8438 (let ((case (string-drop-right file (string-length ".c"))))
8439 (format #t "Running test case ~a~%" case)
8440 (invoke "g++" "-std=gnu++11" "-o" case file)
8441 (invoke (string-append "./" case))))
8442 (find-files "." "^testC..*\\.c$")))))
8410 (add-before 'install 'build-pkgconfig 8443 (add-before 'install 'build-pkgconfig
8411 (lambda* (#:key outputs #:allow-other-keys) 8444 (lambda* (#:key outputs #:allow-other-keys)
8412 (with-output-to-file "symfpu.pc" 8445 (with-output-to-file "symfpu.pc"
@@ -8427,7 +8460,7 @@ s-expression-based format.")
8427 "Concrete and symbolic implementation of IEEE-754 floating-point numbers") 8460 "Concrete and symbolic implementation of IEEE-754 floating-point numbers")
8428 (description 8461 (description
8429 "SoftFPU is a C++ library implementing concrete and symbolic 8462 "SoftFPU is a C++ library implementing concrete and symbolic
8430mantics for floating point numbers as defined in the IEEE-764 Standard 8463mantics for floating point numbers as defined in the IEEE-754 Standard
8431r Floating-Point Arithmetic. It is templated in terms of the 8464r Floating-Point Arithmetic. It is templated in terms of the
8432t-vectors, propositions, floating-point formats and rounding mode types 8465t-vectors, propositions, floating-point formats and rounding mode types
8433ed. This allow the same code to be executed as an arbitrary precision 8466ed. This allow the same code to be executed as an arbitrary precision