-
Notifications
You must be signed in to change notification settings - Fork 40
/
guix.scm
126 lines (121 loc) · 3.69 KB
/
guix.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
;; To use this file to build HEAD of odgi:
;;
;; guix build -f guix.scm
;;
;; To do a cross compilation build for ARM64
;;
;; guix build -f guix.scm --target=aarch64-linux
;;
;; To get a development container (inside emacs shell will work)
;;
;; guix shell -C -D -f guix.scm -- bash --init-file <(echo "ln -s /bin/sh /bin/bash")
;;
;; and build
;;
;; find -name CMakeCache.txt|xargs rm -v
;; cd build
;; cmake -DCMAKE_BUILD_TYPE=Debug ..
;; cmake --build . --verbose -- -j 14 && ctest . --verbose
;;
;; For the tests you may need /usr/bin/env. In a container create it with
;;
;; mkdir -p /usr/bin ; ln -s $GUIX_ENVIRONMENT/bin/env /usr/bin/env
;;
;; Note for python bindings you may need to run against gcc-11 with something
;; like
;;
;; env LD_LIBRARY_PATH=$GUIX_ENVIRONMENT/lib LD_PRELOAD=libjemalloc.so.2 python3 -c 'import odgi'
;;
;; this is because the underlying libraries were built with gcc-10 and
;; jemalloc needs to be preloaded.
;;
;; cmake -DCMAKE_BUILD_TYPE=Debug -DINLINE_HANDLEGRAPH_SOURCES=ON ..
;; make
;; ctest .
;;
(use-modules
(ice-9 popen)
(ice-9 rdelim)
((guix licenses) #:prefix license:)
(guix gexp)
(guix packages)
(guix download)
(guix git-download)
(guix build-system cmake)
(guix utils)
(gnu packages base)
(gnu packages compression)
(gnu packages bioinformatics)
(gnu packages build-tools)
(gnu packages commencement) ; gcc-toolchain
(gnu packages curl)
(gnu packages datastructures)
(gnu packages gdb)
(gnu packages gcc)
(gnu packages jemalloc)
(gnu packages libffi)
(gnu packages mpi)
(gnu packages python)
(gnu packages python-xyz)
(gnu packages pkg-config)
(gnu packages tls)
(gnu packages version-control)
)
(define %source-dir (dirname (current-filename)))
(define %git-commit
(read-string (open-pipe "git show HEAD | head -1 | cut -d ' ' -f 2" OPEN_READ)))
(define-public odgi-git
(package
(name "odgi-git")
(version (git-version "0.6.3" "HEAD" %git-commit))
(source (local-file %source-dir #:recursive? #t))
(build-system cmake-build-system)
(inputs
`(
("coreutils" ,coreutils)
; ("cpp-httplib" ,cpp-httplib) later!
("pybind11" ,pybind11) ;; see libstd++ note in remarks above
; ("intervaltree" ,intervaltree) later!
("jemalloc" ,jemalloc)
("gcc" ,gcc-11)
("gcc-lib" ,gcc-11 "lib")
("gcc-toolchain" ,gcc-toolchain)
("gdb" ,gdb)
("git" ,git) ; pulls in perl which does not do RISV-V cross builds yet
; ("lodepng" ,lodepng) later!
("openmpi" ,openmpi)
("python" ,python)
("sdsl-lite" ,sdsl-lite)
("libdivsufsort" ,libdivsufsort)
))
(native-inputs
`(("pkg-config" ,pkg-config)
))
(arguments
`(#:phases
(modify-phases
%standard-phases
(add-after 'unpack 'symlink-bash
(lambda _
(symlinklink "/bin/bash" "/bin/sh")
#t))
;; This stashes our build version in the executable
(add-after 'unpack 'set-version
(lambda _
(mkdir-p "include")
(with-output-to-file "include/odgi_git_version.hpp"
(lambda ()
(format #t "#define ODGI_GIT_VERSION \"~a\"~%" version)))
#t))
;; (delete 'check)
)
;; #:make-flags (list ,(string-append "CC=" (cc-for-target)))))
))
(synopsis "odgi pangenome optimized dynamic sequence graph implementation")
(description
"odgi pangenome graph tooling provides an efficient, succinct dynamic
DNA sequence graph model, as well as a host of algorithms that allow
the use of such graphs.")
(home-page "https://github.com/vgteam/odgi")
(license license:expat)))
odgi-git