graph.scm 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2017, 2018, 2019, 2020, 2022 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  4. ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
  5. ;;; Copyright © 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
  6. ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
  7. ;;; Copyright © 2020 Alexander Krotov <krotov@iitp.ru>
  8. ;;; Copyright © 2020 Pierre Langlois <pierre.langlos@gmx.com>
  9. ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
  10. ;;; Copyright © 2021 Alexandre Hannud Abdo <abdo@member.fsf.org>
  11. ;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  12. ;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
  13. ;;;
  14. ;;; This file is part of GNU Guix.
  15. ;;;
  16. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  17. ;;; under the terms of the GNU General Public License as published by
  18. ;;; the Free Software Foundation; either version 3 of the License, or (at
  19. ;;; your option) any later version.
  20. ;;;
  21. ;;; GNU Guix is distributed in the hope that it will be useful, but
  22. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  23. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. ;;; GNU General Public License for more details.
  25. ;;;
  26. ;;; You should have received a copy of the GNU General Public License
  27. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  28. (define-module (gnu packages graph)
  29. #:use-module (guix download)
  30. #:use-module (guix gexp)
  31. #:use-module (guix git-download)
  32. #:use-module (guix packages)
  33. #:use-module (guix utils)
  34. #:use-module (guix build-system cmake)
  35. #:use-module (guix build-system gnu)
  36. #:use-module (guix build-system python)
  37. #:use-module (guix build-system r)
  38. #:use-module ((guix licenses) #:prefix license:)
  39. #:use-module (gnu packages)
  40. #:use-module (gnu packages autotools)
  41. #:use-module (gnu packages bioconductor)
  42. #:use-module (gnu packages bioinformatics)
  43. #:use-module (gnu packages boost)
  44. #:use-module (gnu packages check)
  45. #:use-module (gnu packages compression)
  46. #:use-module (gnu packages cran)
  47. #:use-module (gnu packages datastructures)
  48. #:use-module (gnu packages gd)
  49. #:use-module (gnu packages graphics)
  50. #:use-module (gnu packages graphviz)
  51. #:use-module (gnu packages gtk)
  52. #:use-module (gnu packages maths)
  53. #:use-module (gnu packages multiprecision)
  54. #:use-module (gnu packages ncurses)
  55. #:use-module (gnu packages pkg-config)
  56. #:use-module (gnu packages python)
  57. #:use-module (gnu packages python-build)
  58. #:use-module (gnu packages python-science)
  59. #:use-module (gnu packages python-web)
  60. #:use-module (gnu packages python-xyz)
  61. #:use-module (gnu packages statistics)
  62. #:use-module (gnu packages swig)
  63. #:use-module (gnu packages time)
  64. #:use-module (gnu packages xml))
  65. (define-public plfit
  66. (package
  67. (name "plfit")
  68. (version "0.9.3")
  69. (source (origin
  70. (method git-fetch)
  71. (uri (git-reference
  72. (url "https://github.com/ntamas/plfit")
  73. (commit version)))
  74. (file-name (git-file-name name version))
  75. (sha256
  76. (base32
  77. "03x5jbvg8vwr92682swy58ljxrhqwmga1xzd0cpfbfmda41gm2fb"))))
  78. (build-system cmake-build-system)
  79. (arguments
  80. '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON")))
  81. (home-page "https://github.com/ntamas/plfit")
  82. (synopsis "Tool for fitting power-law distributions to empirical data")
  83. (description "The @command{plfit} command fits power-law distributions to
  84. empirical (discrete or continuous) data, according to the method of Clauset,
  85. Shalizi and Newman (@cite{Clauset A, Shalizi CR and Newman MEJ: Power-law
  86. distributions in empirical data. SIAM Review 51, 661-703 (2009)}).")
  87. (license license:gpl2+)))
  88. (define-public igraph
  89. (package
  90. (name "igraph")
  91. (version "0.9.6")
  92. (source
  93. (origin
  94. (method url-fetch)
  95. (uri (string-append "https://github.com/igraph/igraph/releases/"
  96. "download/" version "/igraph-" version ".tar.gz"))
  97. (modules '((guix build utils)))
  98. (snippet '(begin
  99. ;; Fully unbundle igraph (see:
  100. ;; https://github.com/igraph/igraph/issues/1897).
  101. (delete-file-recursively "vendor")
  102. (substitute* "CMakeLists.txt"
  103. (("add_subdirectory\\(vendor\\).*")
  104. ""))
  105. ;; Help CMake to find our plfit headers.
  106. (substitute* "etc/cmake/FindPLFIT.cmake"
  107. (("^ NAMES plfit.h.*" all)
  108. (string-append all
  109. " PATH_SUFFIXES plfit")))
  110. (substitute* '("src/CMakeLists.txt"
  111. "etc/cmake/benchmark_helpers.cmake")
  112. ;; Remove bundling related variables.
  113. ((".*_IS_VENDORED.*")
  114. ""))))
  115. (sha256
  116. (base32 "11zkj9bpqcadb0rc4ahvjp9047dp9hna8cn3b0vl3zpc9v2rwabw"))))
  117. (build-system cmake-build-system)
  118. (arguments
  119. '(#:configure-flags (list "-DBUILD_SHARED_LIBS=ON")))
  120. (native-inputs (list pkg-config))
  121. (inputs
  122. (list arpack-ng
  123. gmp
  124. glpk
  125. libxml2
  126. lapack
  127. openblas
  128. plfit
  129. suitesparse))
  130. (home-page "https://igraph.org")
  131. (synopsis "Network analysis and visualization")
  132. (description
  133. "This package provides a library for the analysis of networks and graphs.
  134. It can handle large graphs very well and provides functions for generating
  135. random and regular graphs, graph visualization, centrality methods and much
  136. more.")
  137. (license license:gpl2+)))
  138. (define-public python-igraph
  139. (package
  140. (inherit igraph)
  141. (name "python-igraph")
  142. (version "0.9.9")
  143. (source (origin
  144. (method git-fetch)
  145. ;; The PyPI archive lacks tests.
  146. (uri (git-reference
  147. (url "https://github.com/igraph/python-igraph")
  148. (commit version)))
  149. (file-name (git-file-name name version))
  150. (sha256
  151. (base32
  152. "0ravcww2jcr8fgi97gdxv00s5nkx59ljxy928nnniyd0231bqwlc"))))
  153. (build-system python-build-system)
  154. (arguments
  155. (list
  156. #:phases
  157. #~(modify-phases %standard-phases
  158. (add-after 'unpack 'specify-libigraph-location
  159. (lambda _
  160. (let ((igraph #$(this-package-input "igraph")))
  161. (substitute* "setup.py"
  162. (("(LIBIGRAPH_FALLBACK_INCLUDE_DIRS = ).*" _ var)
  163. (string-append
  164. var (format #f "[~s]~%" (string-append igraph
  165. "/include/igraph"))))
  166. (("(LIBIGRAPH_FALLBACK_LIBRARY_DIRS = ).*" _ var)
  167. (string-append
  168. var (format #f "[~s]~%" (string-append igraph "/lib"))))))))
  169. (replace 'check
  170. (lambda* (#:key tests? #:allow-other-keys)
  171. (when tests?
  172. (invoke "pytest" "-v")))))))
  173. (inputs
  174. (list igraph))
  175. (propagated-inputs
  176. (list python-texttable))
  177. (native-inputs
  178. (list python-pytest))
  179. (home-page "https://igraph.org/python/")
  180. (synopsis "Python bindings for the igraph network analysis library")))
  181. (define-public r-rbiofabric
  182. (let ((commit "666c2ae8b0a537c006592d067fac6285f71890ac")
  183. (revision "1"))
  184. (package
  185. (name "r-rbiofabric")
  186. (version (string-append "0.3-" revision "." (string-take commit 7)))
  187. (source (origin
  188. (method git-fetch)
  189. (uri (git-reference
  190. (url "https://github.com/wjrl/RBioFabric")
  191. (commit commit)))
  192. (file-name (string-append name "-" version "-checkout"))
  193. (sha256
  194. (base32
  195. "1yahqrcrqpbcywv73y9rlmyz8apdnp08afialibrr93ch0p06f8z"))))
  196. (build-system r-build-system)
  197. (propagated-inputs
  198. (list r-igraph))
  199. (home-page "http://www.biofabric.org/")
  200. (synopsis "BioFabric network visualization")
  201. (description "This package provides an implementation of the function
  202. @code{bioFabric} for creating scalable network digrams where nodes are
  203. represented by horizontal lines, and edges are represented by vertical
  204. lines.")
  205. (license license:expat))))
  206. (define-public python-plotly
  207. (package
  208. (name "python-plotly")
  209. (version "4.14.3")
  210. (source (origin
  211. (method git-fetch)
  212. (uri (git-reference
  213. (url "https://github.com/plotly/plotly.py")
  214. (commit (string-append "v" version))))
  215. (file-name (git-file-name name version))
  216. (sha256
  217. (base32
  218. "02wlgy7gf3v5ckiq9ab3prm53cckxkavlghqgkk9xw2sfmmrn61q"))))
  219. (build-system python-build-system)
  220. (arguments
  221. `(#:phases
  222. (modify-phases %standard-phases
  223. (add-after 'unpack 'chdir
  224. (lambda _
  225. (chdir "packages/python/plotly")
  226. #t))
  227. (replace 'check
  228. (lambda* (#:key tests? #:allow-other-keys)
  229. (when tests?
  230. (invoke "pytest" "-x" "plotly/tests/test_core")
  231. (invoke "pytest" "-x" "plotly/tests/test_io")
  232. ;; FIXME: Add optional dependencies and enable their tests.
  233. ;; (invoke "pytest" "-x" "plotly/tests/test_optional")
  234. (invoke "pytest" "_plotly_utils/tests")))))))
  235. (native-inputs
  236. (list python-ipywidgets python-pytest python-xarray))
  237. (propagated-inputs
  238. (list python-ipython
  239. python-pandas
  240. python-pillow
  241. python-requests
  242. python-retrying
  243. python-six
  244. python-statsmodels))
  245. (home-page "https://plotly.com/python/")
  246. (synopsis "Interactive plotting library for Python")
  247. (description "Plotly's Python graphing library makes interactive,
  248. publication-quality graphs online. Examples of how to make line plots, scatter
  249. plots, area charts, bar charts, error bars, box plots, histograms, heatmaps,
  250. subplots, multiple-axes, polar charts, and bubble charts.")
  251. (license license:expat)))
  252. (define-public python-plotly-2.4.1
  253. (package (inherit python-plotly)
  254. (version "2.4.1")
  255. (source
  256. (origin
  257. (method url-fetch)
  258. (uri (pypi-uri "plotly" version))
  259. (sha256
  260. (base32
  261. "0s9gk2fl53x8wwncs3fwii1vzfngr0sskv15v3mpshqmrqfrk27m"))))
  262. (native-inputs '())
  263. (propagated-inputs
  264. (list python-decorator
  265. python-nbformat
  266. python-pandas
  267. python-pytz
  268. python-requests
  269. python-six))
  270. (arguments
  271. '(#:tests? #f)))) ; The tests are not distributed in the release
  272. (define-public python-louvain
  273. (package
  274. (name "python-louvain")
  275. (version "0.16")
  276. (source
  277. (origin
  278. (method url-fetch)
  279. (uri (pypi-uri "python-louvain" version))
  280. (sha256
  281. (base32 "0sx53l555rwq0z7if8agirjgw4ddp8r9b949wwz8vlig03sjvfmp"))))
  282. (build-system python-build-system)
  283. (native-inputs
  284. (list python-setuptools)) ;for use_2to3 support
  285. (propagated-inputs
  286. (list python-networkx python-numpy))
  287. (home-page "https://github.com/taynaud/python-louvain")
  288. (synopsis "Louvain algorithm for community detection")
  289. (description
  290. "This package provides a pure Python implementation of the Louvain
  291. algorithm for community detection in large networks.")
  292. (license license:bsd-3)))
  293. (define-public python-louvain-0.7
  294. (package
  295. (name "python-louvain")
  296. (version "0.7.1")
  297. ;; The tarball on Pypi does not include the tests.
  298. (source (origin
  299. (method git-fetch)
  300. (uri (git-reference
  301. (url "https://github.com/vtraag/louvain-igraph")
  302. (commit version)))
  303. (file-name (git-file-name name version))
  304. (sha256
  305. (base32
  306. "1g6b5c2jgwagnhnqh859g61h7x6a81d8hm3g6mkin6kzwafww3g2"))))
  307. (build-system python-build-system)
  308. (arguments
  309. (list
  310. #:phases
  311. #~(modify-phases %standard-phases
  312. (add-before 'build 'pretend-version
  313. ;; The version string is usually derived via setuptools-scm, but
  314. ;; without the git metadata available this fails.
  315. (lambda _
  316. (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
  317. (add-before 'build 'find-igraph
  318. (lambda* (#:key inputs #:allow-other-keys)
  319. (setenv "IGRAPH_EXTRA_INCLUDE_PATH"
  320. (string-append (assoc-ref inputs "igraph")
  321. "/include/igraph:"
  322. (getenv "C_INCLUDE_PATH")))
  323. (setenv "IGRAPH_EXTRA_LIBRARY_PATH"
  324. (getenv "LIBRARY_PATH")))))))
  325. (propagated-inputs
  326. (list python-ddt python-igraph))
  327. (inputs
  328. (list igraph))
  329. (native-inputs
  330. (list pkg-config
  331. python-pytest
  332. python-setuptools-scm
  333. python-wheel))
  334. (home-page "https://github.com/vtraag/louvain-igraph")
  335. (synopsis "Algorithm for methods of community detection in large networks")
  336. (description
  337. "This package provides an implementation of the Louvain algorithm for use
  338. with igraph. Louvain is a general algorithm for methods of community
  339. detection in large networks.
  340. This package has been superseded by the @code{leidenalg} package and should
  341. not be used for new projects.")
  342. (license license:gpl3+)))
  343. (define-public faiss
  344. (package
  345. (name "faiss")
  346. (version "1.5.0")
  347. (source (origin
  348. (method git-fetch)
  349. (uri (git-reference
  350. (url "https://github.com/facebookresearch/faiss")
  351. (commit (string-append "v" version))))
  352. (file-name (git-file-name name version))
  353. (sha256
  354. (base32
  355. "0pk15jfa775cy2pqmzq62nhd6zfjxmpvz5h731197c28aq3zw39w"))
  356. (modules '((guix build utils)))
  357. (snippet
  358. '(begin
  359. (substitute* "utils.cpp"
  360. (("#include <immintrin.h>")
  361. "#ifdef __SSE__\n#include <immintrin.h>\n#endif"))
  362. #t))))
  363. (build-system cmake-build-system)
  364. (arguments
  365. `(#:configure-flags
  366. (list "-DBUILD_WITH_GPU=OFF" ; thanks, but no thanks, CUDA.
  367. "-DBUILD_TUTORIAL=OFF") ; we don't need those
  368. #:phases
  369. (modify-phases %standard-phases
  370. (add-after 'unpack 'prepare-build
  371. (lambda _
  372. (let ((features (list ,@(let ((system (or (%current-target-system)
  373. (%current-system))))
  374. (cond
  375. ((string-prefix? "x86_64" system)
  376. '("-mavx" "-msse2" "-mpopcnt"))
  377. ((string-prefix? "i686" system)
  378. '("-msse2" "-mpopcnt"))
  379. (else
  380. '()))))))
  381. (substitute* "CMakeLists.txt"
  382. (("-m64") "")
  383. (("-mpopcnt") "") ; only some architectures
  384. (("-msse4")
  385. (string-append
  386. (string-join features)
  387. " -I" (getcwd)))
  388. ;; Build also the shared library
  389. (("ARCHIVE DESTINATION lib")
  390. "LIBRARY DESTINATION lib")
  391. (("add_library.*" m)
  392. "\
  393. add_library(objlib OBJECT ${faiss_cpu_headers} ${faiss_cpu_cpp})
  394. set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
  395. add_library(${faiss_lib}_static STATIC $<TARGET_OBJECTS:objlib>)
  396. add_library(${faiss_lib} SHARED $<TARGET_OBJECTS:objlib>)
  397. install(TARGETS ${faiss_lib}_static ARCHIVE DESTINATION lib)
  398. \n")))
  399. ;; See https://github.com/facebookresearch/faiss/issues/520
  400. (substitute* "IndexScalarQuantizer.cpp"
  401. (("#define USE_AVX") ""))
  402. ;; Make header files available for compiling tests.
  403. (mkdir-p "faiss")
  404. (for-each (lambda (file)
  405. (mkdir-p (string-append "faiss/" (dirname file)))
  406. (copy-file file (string-append "faiss/" file)))
  407. (find-files "." "\\.h$"))
  408. #t))
  409. (replace 'check
  410. (lambda _
  411. (invoke "make" "-C" "tests"
  412. (format #f "-j~a" (parallel-job-count)))))
  413. (add-after 'install 'remove-tests
  414. (lambda* (#:key outputs #:allow-other-keys)
  415. (delete-file-recursively
  416. (string-append (assoc-ref outputs "out")
  417. "/test"))
  418. #t)))))
  419. (inputs
  420. (list openblas))
  421. (native-inputs
  422. (list googletest))
  423. (home-page "https://github.com/facebookresearch/faiss")
  424. (synopsis "Efficient similarity search and clustering of dense vectors")
  425. (description "Faiss is a library for efficient similarity search and
  426. clustering of dense vectors. It contains algorithms that search in sets of
  427. vectors of any size, up to ones that possibly do not fit in RAM. It also
  428. contains supporting code for evaluation and parameter tuning.")
  429. (license license:bsd-3)))
  430. (define-public python-faiss
  431. (package (inherit faiss)
  432. (name "python-faiss")
  433. (build-system python-build-system)
  434. (arguments
  435. `(#:phases
  436. (modify-phases %standard-phases
  437. (add-after 'unpack 'chdir
  438. (lambda _ (chdir "python") #t))
  439. (add-after 'chdir 'build-swig
  440. (lambda* (#:key inputs #:allow-other-keys)
  441. (with-output-to-file "../makefile.inc"
  442. (lambda ()
  443. (let ((python-version ,(version-major+minor (package-version python))))
  444. (format #t "\
  445. PYTHONCFLAGS =-I~a/include/python~am/ -I~a/lib/python~a/site-packages/numpy/core/include
  446. LIBS = -lpython~am -lfaiss
  447. SHAREDFLAGS = -shared -fopenmp
  448. CXXFLAGS = -fpermissive -fopenmp -fPIC
  449. CPUFLAGS = ~{~a ~}~%"
  450. (assoc-ref inputs "python*") python-version
  451. (assoc-ref inputs "python-numpy") python-version
  452. python-version
  453. (list ,@(let ((system (or (%current-target-system)
  454. (%current-system))))
  455. (cond
  456. ((string-prefix? "x86_64" system)
  457. '("-mavx" "-msse2" "-mpopcnt"))
  458. ((string-prefix? "i686" system)
  459. '("-msse2" "-mpopcnt"))
  460. (else
  461. '()))))))))
  462. (substitute* "Makefile"
  463. (("../libfaiss.a") ""))
  464. (invoke "make" "cpu"))))))
  465. (inputs
  466. `(("faiss" ,faiss)
  467. ("openblas" ,openblas)
  468. ("python*" ,python)
  469. ("swig" ,swig)))
  470. (propagated-inputs
  471. (list python-matplotlib python-numpy))
  472. (description "Faiss is a library for efficient similarity search and
  473. clustering of dense vectors. This package provides Python bindings to the
  474. Faiss library.")))
  475. (define-public python-leidenalg
  476. (package
  477. (name "python-leidenalg")
  478. (version "0.7.0")
  479. (source
  480. (origin
  481. (method url-fetch)
  482. (uri (pypi-uri "leidenalg" version))
  483. (sha256
  484. (base32
  485. "15fwld9hdw357rd026mzcwpah5liy4f33vc9x9kwy37g71b2rjf1"))))
  486. (build-system python-build-system)
  487. (arguments
  488. '(#:tests? #f ;tests are not included
  489. #:phases (modify-phases %standard-phases
  490. (add-after 'unpack 'fix-requirements
  491. (lambda _
  492. (substitute* "setup.py"
  493. (("python-igraph >=")
  494. "igraph >=")))))))
  495. (native-inputs
  496. ;; XXX: setuptools >= 58 as shipped with Python 3.9+ removes support
  497. ;; for lib2to3, so use this older variant.
  498. (list pkg-config python-setuptools))
  499. (inputs
  500. (list igraph))
  501. (propagated-inputs
  502. (list python-igraph))
  503. (home-page "https://github.com/vtraag/leidenalg")
  504. (synopsis "Community detection in large networks")
  505. (description
  506. "Leiden is a general algorithm for methods of community detection in
  507. large networks. This package implements the Leiden algorithm in C++ and
  508. exposes it to Python. Besides the relative flexibility of the implementation,
  509. it also scales well, and can be run on graphs of millions of nodes (as long as
  510. they can fit in memory). The core function is @code{find_partition} which
  511. finds the optimal partition using the Leiden algorithm, which is an extension
  512. of the Louvain algorithm, for a number of different methods.")
  513. (license license:gpl3+)))
  514. (define-public edge-addition-planarity-suite
  515. (package
  516. (name "edge-addition-planarity-suite")
  517. (version "3.0.0.5")
  518. (source
  519. (origin
  520. (method git-fetch)
  521. (uri (git-reference
  522. (url (string-append "https://github.com/graph-algorithms/"
  523. name))
  524. (commit (string-append "Version_" version))))
  525. (file-name (git-file-name name version))
  526. (sha256
  527. (base32
  528. "01cm7ay1njkfsdnmnvh5zwc7wg7x189hq1vbfhh9p3ihrbnmqzh8"))))
  529. (build-system gnu-build-system)
  530. (native-inputs
  531. (list autoconf automake libtool))
  532. (synopsis "Embedding of planar graphs")
  533. (description "The package provides a reference implementation of the
  534. linear time edge addition algorithm for embedding planar graphs and
  535. isolating planarity obstructions.")
  536. (license license:bsd-3)
  537. (home-page
  538. "https://github.com/graph-algorithms/edge-addition-planarity-suite")))
  539. (define-public rw
  540. (package
  541. (name "rw")
  542. ;; There is a version 0.8, but the tarball is broken with symlinks
  543. ;; to /usr/share.
  544. (version "0.7")
  545. (source (origin
  546. (method url-fetch)
  547. (uri (string-append "mirror://sourceforge/rankwidth/"
  548. "rw-" version ".tar.gz"))
  549. (sha256
  550. (base32
  551. "1rv2v42x2506x7f10349m1wpmmfxrv9l032bkminni2gbip9cjg0"))))
  552. (build-system gnu-build-system)
  553. (native-inputs
  554. (list pkg-config))
  555. (inputs
  556. (list igraph))
  557. (home-page "https://sourceforge.net/projects/rankwidth/")
  558. (synopsis "Rank-width and rank-decomposition of graphs")
  559. (description "rw computes rank-width and rank-decompositions
  560. of graphs.")
  561. (license license:gpl2+)))
  562. (define-public mscgen
  563. (package
  564. (name "mscgen")
  565. (version "0.20")
  566. (source
  567. (origin
  568. (method url-fetch)
  569. (uri (string-append "http://www.mcternan.me.uk/mscgen/software/mscgen-src-"
  570. version ".tar.gz"))
  571. (sha256
  572. (base32
  573. "08yw3maxhn5fl1lff81gmcrpa4j9aas4mmby1g9w5qcr0np82d1w"))))
  574. (build-system gnu-build-system)
  575. (native-inputs
  576. (list pkg-config))
  577. (inputs
  578. (list gd))
  579. (home-page "http://www.mcternan.me.uk/mscgen/")
  580. (synopsis "Message Sequence Chart Generator")
  581. (description "Mscgen is a small program that parses Message Sequence Chart
  582. descriptions and produces PNG, SVG, EPS or server side image maps (ismaps) as
  583. the output. Message Sequence Charts (MSCs) are a way of representing entities
  584. and interactions over some time period and are often used in combination with
  585. SDL. MSCs are popular in Telecoms to specify how protocols operate although
  586. MSCs need not be complicated to create or use. Mscgen aims to provide a simple
  587. text language that is clear to create, edit and understand, which can also be
  588. transformed into common image formats for display or printing.")
  589. (license license:gpl2+)))
  590. (define-public python-graph-tool
  591. (package
  592. (name "python-graph-tool")
  593. (version "2.43")
  594. (source (origin
  595. (method url-fetch)
  596. (uri (string-append
  597. "https://downloads.skewed.de/graph-tool/graph-tool-"
  598. version ".tar.bz2"))
  599. (sha256
  600. (base32
  601. "0v58in4rwk9fhjarjw6xfxpx5zz2z13sy3yvd14b5kr0884yw6sz"))))
  602. (build-system gnu-build-system)
  603. (arguments
  604. `(#:imported-modules (,@%gnu-build-system-modules
  605. (guix build python-build-system))
  606. #:modules (,@%gnu-build-system-modules
  607. ((guix build python-build-system) #:select (site-packages)))
  608. #:configure-flags
  609. (list (string-append "--with-boost="
  610. (assoc-ref %build-inputs "boost"))
  611. (string-append "--with-python-module-path="
  612. (site-packages %build-inputs %outputs)))))
  613. (native-inputs
  614. (list ncurses pkg-config))
  615. (inputs
  616. (list boost
  617. cairomm-1.14
  618. cgal
  619. expat
  620. gmp
  621. gtk+
  622. python-wrapper
  623. sparsehash))
  624. (propagated-inputs
  625. (list python-matplotlib python-numpy python-pycairo python-scipy))
  626. (synopsis "Manipulate and analyze graphs with Python efficiently")
  627. (description "Graph-tool is an efficient Python module for manipulation
  628. and statistical analysis of graphs (a.k.a. networks). Contrary to most other
  629. Python modules with similar functionality, the core data structures and
  630. algorithms are implemented in C++, making extensive use of template
  631. metaprogramming, based heavily on the Boost Graph Library. This confers it a
  632. level of performance that is comparable (both in memory usage and computation
  633. time) to that of a pure C/C++ library.")
  634. (home-page "https://graph-tool.skewed.de/")
  635. (license license:lgpl3+)))