diff options
| author | Jake Forster <jakecameron.forster@gmail.com> | 2025-01-30 22:38:18 +1030 |
|---|---|---|
| committer | Ludovic Courtès <ludovic.courtes@inria.fr> | 2025-02-06 15:36:58 +0100 |
| commit | b643e805b596f57a17d73e450256efb03ebe1b28 (patch) | |
| tree | 5f1f5d6d72ee47a3246953dfd5292ee360a5205c | |
| parent | ce6e13844ab4933028381e41185e9b3ba7d4af4f (diff) | |
physics: Add root.
* guix-science/packages/physics.scm (root): New variable.
Signed-off-by: Ludovic Courtès <ludovic.courtes@inria.fr>
| -rw-r--r-- | guix-science/packages/physics.scm | 207 |
1 files changed, 205 insertions, 2 deletions
diff --git a/guix-science/packages/physics.scm b/guix-science/packages/physics.scm index 8bce259..b6493bf 100644 --- a/guix-science/packages/physics.scm +++ b/guix-science/packages/physics.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; | 1 | ;;; |
| 2 | ;;; Copyright © 2022-2025 Emmanuel Medernach <Emmanuel.Medernach@iphc.cnrs.fr> | 2 | ;;; Copyright © 2022-2025 Emmanuel Medernach <Emmanuel.Medernach@iphc.cnrs.fr> |
| 3 | ;;; Copyright © 2023-2024 Jake Forster <jakecameron.forster@gmail.com> | 3 | ;;; Copyright © 2023-2025 Jake Forster <jakecameron.forster@gmail.com> |
| 4 | ;;; Copyright © 2025 Lars Bilke <lars.bilke@ufz.de> | 4 | ;;; Copyright © 2025 Lars Bilke <lars.bilke@ufz.de> |
| 5 | ;;; Copyright © 2025 Romain Garbage <romain.garbage@inria.fr> | 5 | ;;; Copyright © 2025 Romain Garbage <romain.garbage@inria.fr> |
| 6 | ;;; | 6 | ;;; |
| @@ -40,7 +40,20 @@ | |||
| 40 | #:use-module (guix packages) | 40 | #:use-module (guix packages) |
| 41 | #:use-module (ice-9 string-fun) | 41 | #:use-module (ice-9 string-fun) |
| 42 | #:use-module (gnu packages readline) | 42 | #:use-module (gnu packages readline) |
| 43 | #:use-module (gnu packages kerberos)) | 43 | #:use-module (gnu packages kerberos) |
| 44 | #:use-module (ice-9 match) | ||
| 45 | #:use-module (gnu packages xorg) | ||
| 46 | #:use-module (gnu packages pcre) | ||
| 47 | #:use-module (gnu packages digest) | ||
| 48 | #:use-module (gnu packages tbb) | ||
| 49 | #:use-module (gnu packages gl) | ||
| 50 | #:use-module (gnu packages image) | ||
| 51 | #:use-module (gnu packages databases) | ||
| 52 | #:use-module (gnu packages sqlite) | ||
| 53 | #:use-module (gnu packages astronomy) | ||
| 54 | #:use-module (gnu packages python-science) | ||
| 55 | #:use-module (gnu packages machine-learning) | ||
| 56 | #:use-module (guix utils)) | ||
| 44 | 57 | ||
| 45 | (define (replace-char old-char new-char str) | 58 | (define (replace-char old-char new-char str) |
| 46 | (string-map (lambda (char) | 59 | (string-map (lambda (char) |
| @@ -355,3 +368,193 @@ to data repositories of many kinds, including file-based ones. It is | |||
| 355 | based on a scalable architecture, a communication protocol, and a set | 368 | based on a scalable architecture, a communication protocol, and a set |
| 356 | of plugins and tools.") | 369 | of plugins and tools.") |
| 357 | (license license:lgpl3+))) | 370 | (license license:lgpl3+))) |
| 371 | |||
| 372 | ;; TODO: Unbundle LLVM, Clang, and Cling. | ||
| 373 | (define-public root | ||
| 374 | (package | ||
| 375 | (name "root") | ||
| 376 | (version "6.34.02") | ||
| 377 | (source | ||
| 378 | (origin | ||
| 379 | (method git-fetch) | ||
| 380 | (uri (git-reference | ||
| 381 | (url "https://github.com/root-project/root") | ||
| 382 | (commit (string-append | ||
| 383 | "v" (string-map (match-lambda | ||
| 384 | (#\. #\-) | ||
| 385 | (chr chr)) version))))) | ||
| 386 | (file-name (git-file-name name version)) | ||
| 387 | (sha256 | ||
| 388 | (base32 "1whhmrz40x3blhzxsh8h6vfs8xi6pv0a3mwndlrapnajy5p582dk")))) | ||
| 389 | (build-system cmake-build-system) | ||
| 390 | (arguments | ||
| 391 | (list | ||
| 392 | #:configure-flags | ||
| 393 | #~(list "-Dtesting=ON" | ||
| 394 | ;; Python modules are installed in 'lib' by default. | ||
| 395 | (string-append | ||
| 396 | "-DCMAKE_INSTALL_PYTHONDIR=" | ||
| 397 | #$output "/lib/python" | ||
| 398 | #$(version-major+minor (package-version python)) | ||
| 399 | "/site-packages")) | ||
| 400 | #:phases | ||
| 401 | #~(modify-phases %standard-phases | ||
| 402 | (add-after 'unpack 'fix-cmake-rpath | ||
| 403 | (lambda _ | ||
| 404 | ;; Default RPATH is '.' and '../lib', but | ||
| 405 | ;; libROOTPythonizations.so is installed in Python | ||
| 406 | ;; 'site-packages'. Correct its path to 'lib'. | ||
| 407 | (substitute* "bindings/pyroot/pythonizations/CMakeLists.txt" | ||
| 408 | (("SHARED \\$\\{cpp_sources\\}\\)") | ||
| 409 | (string-append | ||
| 410 | "SHARED ${cpp_sources})\n\n" | ||
| 411 | "set_target_properties(ROOTPythonizations PROPERTIES " | ||
| 412 | "INSTALL_RPATH \"$ORIGIN;$ORIGIN/../../\")"))))) | ||
| 413 | (add-before 'build 'set-env | ||
| 414 | (lambda _ | ||
| 415 | ;; For bundled libAfterImage configure script. | ||
| 416 | (setenv "CONFIG_SHELL" (which "sh")))) | ||
| 417 | (replace 'check | ||
| 418 | (lambda* (#:key tests? parallel-tests? #:allow-other-keys) | ||
| 419 | (when tests? | ||
| 420 | (let ((skipped-tests | ||
| 421 | (list | ||
| 422 | ;; FIXME: This test failure may be fixed in 6.36.00. | ||
| 423 | ;; https://github.com/root-project/root/issues/17564 | ||
| 424 | "gtest-roofit-roofit-vectorisedPDFs-testLandau" | ||
| 425 | ;; Skip tests that require python-tensorflow | ||
| 426 | ;; due to limited availability of substitutes | ||
| 427 | ;; for that package from guix-science. | ||
| 428 | "test-import-tensorflow" | ||
| 429 | "pyunittests-bindings-pyroot-pythonizations-batchgen" | ||
| 430 | ;; Skip tests that require network. | ||
| 431 | "gtest-io-io-TFile" | ||
| 432 | "gtest-net-netxng-RRawFileNetXNG" | ||
| 433 | "gtest-net-netxng-TNetXNGFileTest" | ||
| 434 | "test-stressgeometry.*" | ||
| 435 | "test-stresslinear.*" | ||
| 436 | "test-stresshistogram.*" | ||
| 437 | "test-stressIOPlugins-xroot" | ||
| 438 | "PyMVA-RandomForest-Classification" | ||
| 439 | "PyMVA-GTB-Classification" | ||
| 440 | "PyMVA-AdaBoost-Classification" | ||
| 441 | "PyMVA-Torch-Classification" | ||
| 442 | "PyMVA-Torch-Regression" | ||
| 443 | "gtest-tmva-tmva-rstandardscaler" | ||
| 444 | "gtest-tmva-tmva-rreader" | ||
| 445 | "test-stresstmva" | ||
| 446 | "^TMVA-DNN-MethodDL-.*" | ||
| 447 | "^gtest-tmva-tmva-envelope-TMVA-.*" | ||
| 448 | "gtest-tree-tree-testTChainParsing" | ||
| 449 | "gtest-tree-treeplayer-treeprocessormt-remotefiles" | ||
| 450 | "tutorial-dataframe-df014_CSVDataSource" | ||
| 451 | "tutorial-dataframe-df015_LazyDataSource" | ||
| 452 | "tutorial-dataframe-df101_h1Analysis" | ||
| 453 | "tutorial-graphics-AtlasExample" | ||
| 454 | "tutorial-hist-th2polyEurope" | ||
| 455 | "tutorial-hist-th2polyUSA" | ||
| 456 | "tutorial-multicore-imt001_parBranchProcessing" | ||
| 457 | "tutorial-multicore-imt101_parTreeProcessing" | ||
| 458 | "tutorial-multicore-mp103_processSelector" | ||
| 459 | "tutorial-multicore-mp104_processH1" | ||
| 460 | "tutorial-multicore-mp105_processEntryList" | ||
| 461 | "tutorial-tmva-TMVAClassification" | ||
| 462 | "tutorial-tmva-TMVAClassificationApplication" | ||
| 463 | "tutorial-tmva-TMVACrossValidationRegression" | ||
| 464 | "tutorial-tmva-TMVAMulticlass" | ||
| 465 | "tutorial-tmva-TMVAMulticlassApplication" | ||
| 466 | "tutorial-tmva-TMVARegression" | ||
| 467 | "tutorial-tmva-TMVARegressionApplication" | ||
| 468 | "tutorial-tmva-TMVA_Higgs_Classification" | ||
| 469 | "tutorial-tmva-envelope-classification" | ||
| 470 | "tutorial-tmva-tmva003_RReader" | ||
| 471 | "tutorial-tmva-tmva004_RStandardScaler" | ||
| 472 | "tutorial-tree-run_h1analysis" | ||
| 473 | "tutorial-v7-ntuple-ntpl008_import" | ||
| 474 | "tutorial-dataframe-df014_CSVDataSource-py" | ||
| 475 | "tutorial-dataframe-df033_Describe-py" | ||
| 476 | "tutorial-dataframe-df102_NanoAODDimuonAnalysis-py" | ||
| 477 | "tutorial-dataframe-df103_NanoAODHiggsAnalysis-py" | ||
| 478 | "tutorial-dataframe-df104_HiggsToTwoPhotons-py" | ||
| 479 | "tutorial-dataframe-df105_WBosonAnalysis-py" | ||
| 480 | "tutorial-dataframe-df106_HiggsToFourLeptons-py" | ||
| 481 | "tutorial-dataframe-df107_SingleTopAnalysis-py" | ||
| 482 | "tutorial-rcanvas-df104-py" | ||
| 483 | "tutorial-rcanvas-df105-py" | ||
| 484 | "tutorial-roofit-rf618_mixture_models-py" | ||
| 485 | "tutorial-tmva-RBatchGenerator_NumPy-py" | ||
| 486 | "tutorial-tmva-RBatchGenerator_PyTorch-py" | ||
| 487 | "tutorial-tmva-TMVA_Higgs_Classification-py" | ||
| 488 | "tutorial-tmva-pytorch-ApplicationClassificationPyTorch-py" | ||
| 489 | "tutorial-tmva-pytorch-ApplicationRegressionPyTorch-py" | ||
| 490 | "tutorial-tmva-pytorch-ClassificationPyTorch-py" | ||
| 491 | "tutorial-tmva-pytorch-RegressionPyTorch-py" | ||
| 492 | "tutorial-tmva-tmva100_DataPreparation-py" | ||
| 493 | "tutorial-tmva-tmva101_Training-py" | ||
| 494 | "tutorial-tmva-tmva102_Testing-py"))) | ||
| 495 | (invoke "ctest" "-E" | ||
| 496 | (string-append | ||
| 497 | "^(" (string-join skipped-tests "|") ")$") | ||
| 498 | "-j" | ||
| 499 | (if parallel-tests? | ||
| 500 | (number->string (parallel-job-count)) | ||
| 501 | "1")))))) | ||
| 502 | (add-after 'install 'fix-python-so-loading | ||
| 503 | (lambda _ | ||
| 504 | ;; ctypes.CDLL fails to load shared library from | ||
| 505 | ;; absolute path to symlink. | ||
| 506 | (substitute* | ||
| 507 | (string-append | ||
| 508 | #$output "/lib/python" | ||
| 509 | #$(version-major+minor (package-version python)) | ||
| 510 | "/site-packages/cppyy_backend/loader.py") | ||
| 511 | (("if not c:") | ||
| 512 | (string-append "c = _load_helper(\"" | ||
| 513 | #$output | ||
| 514 | "/lib/libcppyy_backend.so\")" | ||
| 515 | "\n\n if not c:")))))))) | ||
| 516 | (inputs | ||
| 517 | (list libx11 | ||
| 518 | libxpm | ||
| 519 | libxft | ||
| 520 | libxext | ||
| 521 | python | ||
| 522 | libxcrypt | ||
| 523 | xrootd | ||
| 524 | ;; These are bundled. Use guix packages instead. | ||
| 525 | pcre2 | ||
| 526 | xxhash | ||
| 527 | `(,zstd "lib") | ||
| 528 | lz4 | ||
| 529 | ;; Support optional features. | ||
| 530 | tbb ;for imt | ||
| 531 | openblas ;for tmva-cpu | ||
| 532 | python-numpy ;for tmva-pymva | ||
| 533 | glew ;for opengl | ||
| 534 | gl2ps ;instead of bundled | ||
| 535 | ftgl ;instead of bundled | ||
| 536 | libxml2 | ||
| 537 | giflib | ||
| 538 | libtiff | ||
| 539 | libjpeg-turbo | ||
| 540 | openssl | ||
| 541 | mysql | ||
| 542 | postgresql | ||
| 543 | sqlite | ||
| 544 | cfitsio)) | ||
| 545 | (native-inputs | ||
| 546 | (list googletest | ||
| 547 | python-pandas ;for tests | ||
| 548 | python-numba ;for tests | ||
| 549 | python-pytorch ;for tests | ||
| 550 | python-scikit-learn ;for tests | ||
| 551 | python-xgboost)) ;for tests | ||
| 552 | (home-page "https://root.cern") | ||
| 553 | (synopsis "Data analysis framework made at CERN") | ||
| 554 | (description | ||
| 555 | "ROOT is a data analysis framework developed by CERN for tasks such | ||
| 556 | as data storage, processing, and visualization. It provides tools for | ||
| 557 | histograms, statistical tests, fitting, simulations, and machine | ||
| 558 | learning. It can handle large datasets and uses a specialized file | ||
| 559 | format.") | ||
| 560 | (license license:lgpl2.1+))) | ||
