biod / sambamba

Tools for working with SAM/BAM data
http://thebird.nl/blog/D_Dragon.html
GNU General Public License v2.0
555 stars 104 forks source link

Cannot build 0.8.1 with Guix #482

Closed rekado closed 2 years ago

rekado commented 2 years ago

On the core-updates-frozen branch of GNU Guix we cannot build Sambamba 0.8.1.

This is the build output:

python3 ./gen_ldc_version_info.py /gnu/store/7q260qa0aj3lj1wm7pkbr23af9wip1dr-ldc-1.27.1/bin/ldc2 > utils/ldc_version_info_.d
cat utils/ldc_version_info_.d
module utils.ldc_version_info_;
immutable LDC_VERSION_STRING = "1.27.1";
immutable DMD_VERSION_STRING = "v2.097.2";
immutable LLVM_VERSION_STRING = "11.0.0";
immutable BOOTSTRAP_VERSION_STRING = "LDC - the LLVM D compiler (1.27.1)";
mkdir -p bin/
compile single object...
ldc2 -singleobj -wi -I. -IBioD -g -J. -O3 -release -enable-inlining -boundscheck=off -L-lz -c -of=bin/sambamba-0.8.1.o utils/ldc_version_info_.d utils/lz4.d utils/strip_bcf_header.d BioD/contrib/undead/cstream.d BioD/contrib/undead/doformat.d BioD/contrib/undead/internal/file.d BioD/contrib/undead/stream.d BioD/contrib/undead/utf.d utils/version_.d BioD/bio/core/base.d BioD/bio/core/bgzf/block.d BioD/bio/core/bgzf/chunk.d BioD/bio/core/bgzf/compress.d BioD/bio/core/bgzf/constants.d BioD/bio/core/bgzf/inputstream.d BioD/bio/core/bgzf/outputstream.d BioD/bio/core/bgzf/virtualoffset.d BioD/bio/core/call.d BioD/bio/core/decompress.d BioD/bio/core/genotype.d BioD/bio/core/kmer.d BioD/bio/core/region.d BioD/bio/core/sequence.d BioD/bio/core/tinymap.d BioD/bio/core/utils/algo.d BioD/bio/core/utils/bylinefast.d BioD/bio/core/utils/exception.d BioD/bio/core/utils/format.d BioD/bio/core/utils/memoize.d BioD/bio/core/utils/outbuffer.d BioD/bio/core/utils/range.d BioD/bio/core/utils/roundbuf.d BioD/bio/core/utils/stream.d BioD/bio/core/utils/switchendianness.d BioD/bio/core/utils/tmpfile.d BioD/bio/core/utils/zlib.d BioD/bio/std/experimental/hts/bam/header.d BioD/bio/std/experimental/hts/bam/reader.d BioD/bio/std/experimental/hts/bam/writer.d BioD/bio/std/experimental/hts/bgzf.d BioD/bio/std/experimental/hts/bgzf_writer.d BioD/bio/std/experimental/hts/constants.d BioD/bio/std/experimental/hts/hashing.d BioD/bio/std/experimental/hts/logger.d BioD/bio/std/experimental/hts/pileup.d BioD/bio/std/experimental/hts/reads.d BioD/bio/std/experimental/hts/unpack.d BioD/bio/std/file/fai.d BioD/bio/std/file/fasta.d BioD/bio/std/file/fastq.d BioD/bio/std/genotype/maf.d BioD/bio/std/genotype/snp.d BioD/bio/std/hts/bam/abstractreader.d BioD/bio/std/hts/bam/bai/bin.d BioD/bio/std/hts/bam/bai/indexing.d BioD/bio/std/hts/bam/baifile.d BioD/bio/std/hts/bam/baseinfo.d BioD/bio/std/hts/bam/cigar.d BioD/bio/std/hts/bam/constants.d BioD/bio/std/hts/bam/md/core.d BioD/bio/std/hts/bam/md/operation.d BioD/bio/std/hts/bam/md/parse.d BioD/bio/std/hts/bam/md/reconstruct.d BioD/bio/std/hts/bam/multireader.d BioD/bio/std/hts/bam/pileup.d BioD/bio/std/hts/bam/randomaccessmanager.d BioD/bio/std/hts/bam/read.d BioD/bio/std/hts/bam/reader.d BioD/bio/std/hts/bam/readrange.d BioD/bio/std/hts/bam/reference.d BioD/bio/std/hts/bam/referenceinfo.d BioD/bio/std/hts/bam/region.d BioD/bio/std/hts/bam/splitter.d BioD/bio/std/hts/bam/tagvalue.d BioD/bio/std/hts/bam/validation/alignment.d BioD/bio/std/hts/bam/validation/samheader.d BioD/bio/std/hts/bam/writer.d BioD/bio/std/hts/iontorrent/flowcall.d BioD/bio/std/hts/iontorrent/flowindex.d BioD/bio/std/hts/sam/header.d BioD/bio/std/hts/sam/reader.d BioD/bio/std/hts/sam/utils/fastrecordparser.d BioD/bio/std/hts/sam/utils/recordparser.d BioD/bio/std/hts/snpcallers/maq.d BioD/bio/std/hts/snpcallers/simple.d BioD/bio/std/hts/thirdparty/msgpack.d BioD/bio/std/hts/utils/array.d BioD/bio/std/hts/utils/graph.d BioD/bio/std/hts/utils/samheadermerger.d BioD/bio/std/hts/utils/value.d BioD/bio/std/maf/block.d BioD/bio/std/maf/parser.d BioD/bio/std/maf/reader.d BioD/bio/std/range/splitter.d BioD/bio/std/sff/constants.d BioD/bio/std/sff/index.d BioD/bio/std/sff/read.d BioD/bio/std/sff/reader.d BioD/bio/std/sff/readrange.d BioD/bio/std/sff/utils/roundup.d BioD/bio/std/sff/writer.d sambamba/depth.d sambamba/fixbins.d sambamba/flagstat.d sambamba/index.d sambamba/main.d sambamba/markdup.d sambamba/markdup2.d sambamba/merge.d sambamba/pileup.d sambamba/slice.d sambamba/sort.d sambamba/subsample.d sambamba/utils/common/bed.d sambamba/utils/common/file.d sambamba/utils/common/filtering.d sambamba/utils/common/intervaltree.d sambamba/utils/common/ldc_gc_workaround.d sambamba/utils/common/overwrite.d sambamba/utils/common/pratt_parser.d sambamba/utils/common/progressbar.d sambamba/utils/common/queryparser.d sambamba/utils/common/readstorage.d sambamba/utils/common/tmpdir.d sambamba/utils/view/alignmentrangeprocessor.d sambamba/utils/view/headerserializer.d sambamba/validate.d sambamba/view.d thirdparty/mergesort.d thirdparty/unstablesort.d
BioD/contrib/undead/stream.d(1831): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/contrib/undead/stream.d(2914): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/contrib/undead/stream.d(2932): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/bio/core/bgzf/compress.d(48): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/bio/core/bgzf/virtualoffset.d(42): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/bio/core/utils/switchendianness.d(17): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/bio/std/hts/thirdparty/msgpack.d(1760): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
thirdparty/unstablesort.d(183): Deprecation: Usage of the `body` keyword is deprecated. Use `do` instead.
BioD/bio/std/hts/bam/reader.d(182): Deprecation: module bio.core.bgzf.block is not accessible here, perhaps add 'static import bio.core.bgzf.block;'
BioD/bio/std/hts/bam/md/parse.d(49): Deprecation: returning `this._cached_front` escapes a reference to parameter `this`
BioD/bio/std/hts/bam/md/parse.d(49):        perhaps annotate the parameter with `return`
BioD/bio/std/hts/bam/md/parse.d(53): Deprecation: returning `this._cached_back` escapes a reference to parameter `this`
BioD/bio/std/hts/bam/md/parse.d(53):        perhaps annotate the parameter with `return`
BioD/contrib/undead/doformat.d(128): Deprecation: use of imaginary type `ifloat` is deprecated, use `float` instead
BioD/contrib/undead/doformat.d(129): Deprecation: use of imaginary type `idouble` is deprecated, use `double` instead
BioD/contrib/undead/doformat.d(130): Deprecation: use of imaginary type `ireal` is deprecated, use `real` instead
BioD/contrib/undead/doformat.d(131): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/doformat.d(132): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/doformat.d(133): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/stream.d(450): Deprecation: use of imaginary type `ifloat` is deprecated, use `float` instead
BioD/contrib/undead/stream.d(451): Deprecation: use of imaginary type `idouble` is deprecated, use `double` instead
BioD/contrib/undead/stream.d(452): Deprecation: use of imaginary type `ireal` is deprecated, use `real` instead
BioD/contrib/undead/stream.d(453): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/stream.d(454): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/stream.d(455): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/stream.d(1116): Deprecation: use of imaginary type `ifloat` is deprecated, use `float` instead
BioD/contrib/undead/stream.d(1117): Deprecation: use of imaginary type `idouble` is deprecated, use `double` instead
BioD/contrib/undead/stream.d(1118): Deprecation: use of imaginary type `ireal` is deprecated, use `real` instead
BioD/contrib/undead/stream.d(1119): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/stream.d(1120): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/stream.d(1121): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/doformat.d(494): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/doformat.d(449): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/doformat.d(447): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/doformat.d(449): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/doformat.d(447): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/doformat.d(449): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/doformat.d(447): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/stream.d(2472): Deprecation: use of imaginary type `ifloat` is deprecated, use `float` instead
BioD/contrib/undead/stream.d(2473): Deprecation: use of imaginary type `idouble` is deprecated, use `double` instead
BioD/contrib/undead/stream.d(2474): Deprecation: use of imaginary type `ireal` is deprecated, use `real` instead
BioD/contrib/undead/stream.d(2475): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/stream.d(2476): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/stream.d(2477): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/contrib/undead/stream.d(2527): Deprecation: use of imaginary type `ifloat` is deprecated, use `float` instead
BioD/contrib/undead/stream.d(2528): Deprecation: use of imaginary type `idouble` is deprecated, use `double` instead
BioD/contrib/undead/stream.d(2529): Deprecation: use of imaginary type `ireal` is deprecated, use `real` instead
BioD/contrib/undead/stream.d(2530): Deprecation: use of complex type `cfloat` is deprecated, use `std.complex.Complex!(float)` instead
BioD/contrib/undead/stream.d(2531): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead
BioD/contrib/undead/stream.d(2532): Deprecation: use of complex type `creal` is deprecated, use `std.complex.Complex!(real)` instead
BioD/bio/core/tinymap.d(76): Deprecation: `opIn_r` is deprecated.  Use `opBinaryRight(string op)(...) if (op == "in")` instead.
BioD/bio/core/tinymap.d(101): Deprecation: `opIn_r` is deprecated.  Use `opBinaryRight(string op)(...) if (op == "in")` instead.
BioD/bio/std/experimental/hts/bam/reader.d(237): Error: no property `cleanup` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(245): Error: no property `is_mapped` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(246): Error: no property `refid` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(250): Error: no property `refid` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(254): Error: no property `_flag_nc` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(258): Error: no property `_flag` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(267): Error: no property `is_mapped` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(268): Error: no property `pos` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(269): Error: no property `pos` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(273): Error: no property `pos` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(280): Error: incompatible types for `(this.start_pos()) + (this.consumed_reference_bases())`: `uint` and `Nullable!uint`
BioD/bio/std/experimental/hts/bam/reader.d(284): Error: incompatible types for `(this.raw_start_pos()) + (this.consumed_reference_bases())`: `uint` and `Nullable!uint`
BioD/bio/std/experimental/hts/bam/reader.d(296): Error: no property `is_mapped` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(297): Error: no property `mapping_quality` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(301): Error: no property `_tlen` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(306): Error: no property `sequence_length` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(307): Error: cannot implicitly convert expression `this.sequence_length2` of type `Nullable!int` to `uint`
BioD/bio/std/experimental/hts/bam/reader.d(314): Error: no property `is_mapped` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(316): Error: no property `raw_cigar` for type `std.typecons.Nullable!(ReadBlob)`
BioD/bio/std/experimental/hts/bam/reader.d(335): Error: no property `is_mapped` for type `std.typecons.Nullable!(ReadBlob)`
make: *** [Makefile:90: singleobj] Error 1

To Reproduce

$ cd guix
$ git checkout core-updates-frozen
...
$ ./pre-inst-env guix build sambamba

The same build errors appear with Sambamba 0.8.1.

rekado commented 2 years ago

We're using Makefile, not meson.build.

pjotrp commented 2 years ago

Thanks @rekado. I'll fix it.

pjotrp commented 2 years ago

https://github.com/biod/sambamba/commit/8f4a6edb3d03d91361088ef3562b954d641f1c4d fixes the build. I'll do some more testing and a release in the coming days.

pjotrp commented 2 years ago

Dear @rekado, we have a new 0.8.2 release. The Makefile should build fine on Guix (as it is my dev system). See also

https://github.com/biod/sambamba/blob/master/.guix-build

rekado commented 2 years ago

Thank you!

I'm setting CC=gcc, because otherwise cc is not found. Unfortunately, the linking stage fails:

linking...
ldc2 -wi -I. -IBioD -g -J. -O3 -release -enable-inlining -boundscheck=off -L-lz -of=bin/sambamba-0.8.2 bin/sambamba-0.8.2.o  -L-L/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib:/gnu/store/qannyaplwfw65kk9mqydsz0igwabm505-ldc-1.27.1/lib:/gnu/store/c164sc1h1095y566gcgc1w34nfg48k1x-lz4-1.9.3/lib:/gnu/store/2i0zpa5w320y8m4zbqk1va8vs6dbawv0-zlib-1.2.11/lib:/gnu/store/w6zv2mz56wyxr471q38a3cmzm4iqimy8-bzip2-1.0.8/lib:/gnu/store/72kpdqplq4nc87fm7ch47kxy3nlkzsyx-xz-5.2.5/lib:/gnu/store/jazwfsj2v41yih2yzw5nydqgdz1hgfm4-file-5.39/lib:/gnu/store/v45pjc1yqmy59j9ff913p3ywn9qk4lqx-gawk-5.1.0/lib:/gnu/store/6mqcv52gwn2dnbislgv9k99525mzmrrs-binutils-2.37/lib:/gnu/store/2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33/lib:/gnu/store/3ywv7s8d38rgcq7ljmc1s084358a2m3h-glibc-2.33-static/lib:/gnu/store/0brdikxqk59hdr47qabcm3sya001d8vf-glibc-utf8-locales-2.33/lib -L-lpthread -L-lm -L-lz -L-llz4
collect2: fatal error: cannot find ‘ld’
compilation terminated.
Error: /gnu/store/vakvgvrb839igv16jkif4lmx11d25jqb-gcc-10.3.0/bin/gcc failed with status: 1
make: *** [Makefile:94: bin/sambamba-0.8.2] Error 1

I wonder about two things:

pjotrp commented 2 years ago

You should use the standard makefile. And, yes, ldc requires the gold linker. Almost there!

In the guix-build shell I simply run

CC=gcc make release

which results in an optimized sambamba.

rekado commented 2 years ago

Excellent, thank you. I've updated sambamba to 0.8.2 with Guix commit 4acf3251508967e83a54818e1859c7594102a6ec.