From 655ca71329ebdc44d78c3ee1f7b68d29ff6b273b Mon Sep 17 00:00:00 2001 From: Fis Trivial Date: Sat, 12 May 2018 15:28:35 +0000 Subject: gnu: Add xsimd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/cpp.scm (xsimd): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/cpp.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gnu/packages/cpp.scm') diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 3e9c39df618..80ffc1ea2c7 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -124,3 +124,30 @@ unified access to TCP/UDP sockets, serial ports, console, and files streams. It also allows a server application to wait for any activity on any combination of these streams.") (license license:bsd-3))) + +(define-public xsimd + (package + (name "xsimd") + (version "4.1.2") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/QuantStack/xsimd/archive/" + version ".tar.gz")) + (sha256 + (base32 + "0x05l4xpqr9b66sm6lkf48n6x7999ks921x6k2hzkkg6mh3gqd46")) + (file-name (string-append name "-" version ".tar.gz")))) + (home-page "https://github.com/QuantStack/xsimd") + (build-system cmake-build-system) + (arguments + `(#:test-target "xtest")) + (native-inputs + `(("googletest" ,googletest))) + (synopsis "C++ wrappers for SIMD intrinsics and math implementations") + (description "xsimd provides a unified means for using SIMD features for +library authors. Namely, it enables manipulation of batches of numbers with +the same arithmetic operators as for single values. It also provides +accelerated implementation of common mathematical functions operating on +batches.") + (license license:bsd-3))) -- cgit v1.3 From 385357c0d7ebdb7102133095de1667f43ad00116 Mon Sep 17 00:00:00 2001 From: Fis Trivial Date: Mon, 28 May 2018 08:10:26 +0000 Subject: gnu: Add fifo-map. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/cpp.scm (fifo-map): New variable. * gnu/packages/patches/fifo-map-fix-flags-for-gcc.patch: New file. * gnu/packages/patches/fifo-map-remove-catch.hpp.patch: New file. * gnu/local.mk: Add new patch files. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 2 + gnu/packages/cpp.scm | 44 ++++++++++++++++++++++ .../patches/fifo-map-fix-flags-for-gcc.patch | 39 +++++++++++++++++++ .../patches/fifo-map-remove-catch.hpp.patch | 30 +++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 gnu/packages/patches/fifo-map-fix-flags-for-gcc.patch create mode 100644 gnu/packages/patches/fifo-map-remove-catch.hpp.patch (limited to 'gnu/packages/cpp.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 4d9edc354fa..7734586f0a4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -661,6 +661,8 @@ dist_patch_DATA = \ %D%/packages/patches/fasthenry-spFactor.patch \ %D%/packages/patches/fcgi-2.4.0-gcc44-fixes.patch \ %D%/packages/patches/fcgi-2.4.0-poll.patch \ + %D%/packages/patches/fifo-map-fix-flags-for-gcc.patch \ + %D%/packages/patches/fifo-map-remove-catch.hpp.patch \ %D%/packages/patches/file-CVE-2017-1000249.patch \ %D%/packages/patches/findutils-localstatedir.patch \ %D%/packages/patches/findutils-test-xargs.patch \ diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 80ffc1ea2c7..2caf6af4d3d 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -151,3 +151,47 @@ the same arithmetic operators as for single values. It also provides accelerated implementation of common mathematical functions operating on batches.") (license license:bsd-3))) + +(define-public fifo-map + (let* ((commit "0dfbf5dacbb15a32c43f912a7e66a54aae39d0f9") + (revision "0") + (version (git-version "1.1.1" revision commit))) + (package + (name "fifo-map") + (version version) + (home-page "https://github.com/nlohmann/fifo_map") + (source (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit commit))) + (sha256 + (base32 + "0pi77b75kp0l7z454ihcd14nzpi3nc5m4nyjbsgy5f9bw3676196")) + (patches (search-patches "fifo-map-remove-catch.hpp.patch" + "fifo-map-fix-flags-for-gcc.patch")) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "./test/thirdparty")))) + (native-inputs + `(("catch2" ,catch-framework2))) + (build-system cmake-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (replace 'check + (lambda _ + (invoke "./unit"))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (inc (string-append out "/include/fifo_map"))) + (with-directory-excursion + (string-append "../" ,name "-" ,version "-checkout") + (install-file "src/fifo_map.hpp" inc) + #t))))))) + (synopsis "FIFO-ordered associative container for C++") + (description "Fifo_map is a C++ header only library for associative +container which uses the order in which keys were inserted to the container +as ordering relation.") + (license license:expat)))) diff --git a/gnu/packages/patches/fifo-map-fix-flags-for-gcc.patch b/gnu/packages/patches/fifo-map-fix-flags-for-gcc.patch new file mode 100644 index 00000000000..59b71052204 --- /dev/null +++ b/gnu/packages/patches/fifo-map-fix-flags-for-gcc.patch @@ -0,0 +1,39 @@ +From 0871db30bd73d112a434f54572d34cca28de61c5 Mon Sep 17 00:00:00 2001 +From: fis +Date: Sat, 26 May 2018 22:58:37 +0800 +Subject: [PATCH 2/2] * CMakeLists.txt: Fix flags for gcc. + +--- + CMakeLists.txt | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index eba147b..d60dcef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -6,20 +6,6 @@ add_executable(unit src/fifo_map.hpp test/unit.cpp) + + target_include_directories(unit PRIVATE "test" "src") + +-if(MSVC) +- set(CMAKE_CXX_FLAGS +- "/EHsc" +- ) ++set(CMAKE_CXX_FLAGS "-std=c++11 -fpermissive") + +- STRING(REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}) +- +- add_definitions(-D_SCL_SECURE_NO_WARNINGS) +-else(MSVC) +- set(CMAKE_CXX_FLAGS +- "-std=c++11 -stdlib=libc++" +- ) +-endif(MSVC) +- +-include_directories( +- src test +-) ++include_directories(src test) +-- +2.14.3 + diff --git a/gnu/packages/patches/fifo-map-remove-catch.hpp.patch b/gnu/packages/patches/fifo-map-remove-catch.hpp.patch new file mode 100644 index 00000000000..be4efd3e9a4 --- /dev/null +++ b/gnu/packages/patches/fifo-map-remove-catch.hpp.patch @@ -0,0 +1,30 @@ +From 20dcf90fd02511f8d78ea7cc8ac82c121fd2f6cf Mon Sep 17 00:00:00 2001 +From: fis +Date: Sat, 26 May 2018 22:56:29 +0800 +Subject: [PATCH 1/2] * CMakeLists.txt: Remove catch.hpp. + +--- + CMakeLists.txt | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6603c7f..eba147b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 2.8) + + project(fifo_map LANGUAGES CXX) + +-add_executable(unit +- src/fifo_map.hpp test/thirdparty/catch/catch.hpp test/unit.cpp +-) ++add_executable(unit src/fifo_map.hpp test/unit.cpp) + +-target_include_directories(unit PRIVATE "test" "src" "test/thirdparty") ++target_include_directories(unit PRIVATE "test" "src") + + if(MSVC) + set(CMAKE_CXX_FLAGS +-- +2.14.3 + -- cgit v1.3 From e3c0676adfb954f58b9237629d82ad2030159f40 Mon Sep 17 00:00:00 2001 From: Fis Trivial Date: Mon, 28 May 2018 08:11:23 +0000 Subject: gnu: Add json-modern-cxx. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/cpp.scm (json-modern-cxx): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/cpp.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'gnu/packages/cpp.scm') diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 2caf6af4d3d..4831ab035ec 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -29,7 +29,9 @@ #:use-module (gnu packages) #:use-module (gnu packages autotools) #:use-module (gnu packages check) + #:use-module (gnu packages code) #:use-module (gnu packages compression) + #:use-module (gnu packages llvm) #:use-module (gnu packages pkg-config) #:use-module (gnu packages tls)) @@ -195,3 +197,44 @@ batches.") container which uses the order in which keys were inserted to the container as ordering relation.") (license license:expat)))) + +(define-public json-modern-cxx + (package + (name "json-modern-cxx") + (version "3.1.2") + (source + (origin + (method url-fetch) + (uri (string-append + "https://github.com/nlohmann/json/archive/v" version ".tar.gz")) + (sha256 + (base32 + "0m5fhdpx2qll933db2nsi30nns3cifavzvijzz6mxhdkpmngmzz8")) + (file-name (string-append name "-" version ".tar.gz")) + (modules '((guix build utils))) + (snippet + '(begin + (delete-file-recursively "./third_party") + (delete-file-recursively "./test/thirdparty") + (delete-file-recursively "./benchmarks/thirdparty") + ;; Splits catch and fifo_map + (with-directory-excursion "test/src" + (let ((files (find-files "." ".*\\.cpp"))) + (substitute* files + (("#include ?\"(catch.hpp)\"" all catch-hpp) + (string-append "#include "))) + (substitute* files + (("#include ?\"(fifo_map.hpp)\"" all fifo-map-hpp) + (string-append + "#include "))))))))) + (native-inputs + `(("amalgamate" ,amalgamate))) + (inputs + `(("catch2" ,catch-framework2) + ("fifo-map" ,fifo-map))) + (home-page "https://github.com/nlohmann/json") + (build-system cmake-build-system) + (synopsis "JSON parser and printer library for C++") + (description "JSON for Modern C++ is a C++ JSON library that provides +intutive syntax and trivial integration.") + (license license:expat))) -- cgit v1.3 From 6f3c850618ff67d508addd1394a41401aa3be564 Mon Sep 17 00:00:00 2001 From: Fis Trivial Date: Mon, 28 May 2018 08:12:05 +0000 Subject: gnu: Add xtl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/cpp.scm (xtl): New variable. Signed-off-by: Ludovic Courtès --- gnu/packages/cpp.scm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gnu/packages/cpp.scm') diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 4831ab035ec..cc5375095bd 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -238,3 +238,36 @@ as ordering relation.") (description "JSON for Modern C++ is a C++ JSON library that provides intutive syntax and trivial integration.") (license license:expat))) + +(define-public xtl + (package + (name "xtl") + (version "0.4.8") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/QuantStack/xtl/archive/" + version ".tar.gz")) + (sha256 + (base32 + "05bcz9y590b77bxcip0k31rgsapmkwqi1smvsvc84zz7m87d4jvy")) + (file-name (string-append name "-" version ".tar.gz")))) + (native-inputs + `(("googletest" ,googletest) + ("json-modern-cxx" ,json-modern-cxx))) + (arguments + `(#:configure-flags + '("-DBUILD_TESTS=ON") + #:phases + (modify-phases %standard-phases + (replace 'check + (lambda* _ + (with-directory-excursion "test" + (invoke "./test_xtl") + #t)))))) + (home-page "https://github.com/QuantStack/xtl") + (build-system cmake-build-system) + (synopsis "C++ template library providing some basic tools") + (description "xtl is a C++ header-only template library providing basic +tools (containers, algorithms) used by other QuantStack packages.") + (license license:bsd-3))) -- cgit v1.3