Skip to content

Commit

Permalink
changes to work on nim 2.0 (force refc for gc)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Aug 27, 2024
1 parent 7fd4a85 commit 749995c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
if: runner.os == 'Linux'
run: |
cd
git clone --recursive https://github.com/samtools/htslib.git
cd htslib && git checkout 1.11 && autoheader && autoconf && ./configure --enable-libcurl
git clone -b 1.18 --recursive https://github.com/samtools/htslib.git
cd htslib && autoheader && autoconf && ./configure --enable-libcurl
sudo make -j 4 install
sudo ldconfig
#echo "::set-env name=LD_LIBRARY_PATH::${LD_LIBRARY_PATH}:${HOME}/htslib"
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
run: chmod +x mosdepth && mkdir bin && cp mosdepth bin/mosdepth_debug_${{ matrix.os }}

- name: "Build and Copy release binary"
run: nim c -d:danger -d:release -o:bin/mosdepth_${{ matrix.os }} mosdepth
run: nim c --mm:refc -d:danger -d:release -o:bin/mosdepth_${{ matrix.os }} mosdepth

- name: Functional Tests
env:
Expand Down
4 changes: 2 additions & 2 deletions functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ set -o nounset


set -e
nim c --boundChecks:on -x:on mosdepth.nim
nim c -r tests/funcs.nim
nim c --boundChecks:on -x:on -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo --mm:refc mosdepth.nim
nim c -x:on --mm:refc -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo -r tests/funcs.nim
set +e
exe=./mosdepth
bam=/data/human/NA12878.subset.bam
Expand Down
6 changes: 4 additions & 2 deletions mosdepth.nim
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,8 @@ proc write_thresholds(fh:BGZI, tid:int, arr:var coverage_t, thresholds:seq[int],
return

var counts = new_seq[int](len(thresholds))
shallow(arr)
when NimMajor < 2:
shallow(arr)

# iterate over the region and count bases >= request cutoffs.
for v in arr[start..<stop]:
Expand Down Expand Up @@ -630,7 +631,8 @@ proc main(bam: hts.Bam, chrom: region_t, mapq: int, min_len: int, max_len: int,
window = uint32(S.parse_int(region))
else:
bed_regions = bed_to_table(region)
shallow(arr)
when NimMajor < 2:
shallow(arr)

var cs = initCountStat[uint32](size=if use_median: 65536 else: 0)

Expand Down
2 changes: 1 addition & 1 deletion mosdepth.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = "MIT"

# Dependencies

requires "hts >= 0.3.22", "docopt == 0.7.0", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.3"
requires "hts >= 0.3.22", "docopt == 0.7.1", "nim >= 1.0.0", "https://github.com/brentp/d4-nim >= 0.0.3"

bin = @["mosdepth"]
skipDirs = @["tests"]
Expand Down

0 comments on commit 749995c

Please sign in to comment.