Giter Club home page Giter Club logo

Comments (14)

brentp avatar brentp commented on June 15, 2024 1

if you use choosenim
then it's simply: choosenim 0.17.2 or choosenim 0.18.0.

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024 1

Would be great to join forces.

Yes! When I get this working, I will gladly drop my htslib-wrapping work. What I need the most is a subset of networkx, for graph libraries.

Just sent you an invite for bio-nim. If you want to host hts-nim there, I'd even make you an owner. Otherwise, we'll just updated our fork now and then.

from hts-nim.

brentp avatar brentp commented on June 15, 2024 1

I joined. I'm not opposed to moving, but don't want to do it now as it just came out. If it gains traction and contributors then the bio-nim namespace would be nice.

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024 1

With nim-0.18.0, the cigar.nim valgrind warnings are gone. (There are still tons in Nim alloc.nim, but that's because of Nim's memory-management.) And the tests never fail. Excellent!

Closing.

from hts-nim.

brentp avatar brentp commented on June 15, 2024

I think this is a bug in the testing framework in nim. I see it periodically but I can never recreate in real code. We've run mosdepth 10's of thousands of times, and each of those writes multiple bgzf files and never get a failure.

how did you link statically?

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

I ran valgrind on tests/all, and I found some possible problems:

==5486== Use of uninitialised value of size 8
==5486==    at 0x459A6A: ref_coverage_YBLv47zweGLEtZG2KmYifw (cigar.nim:100)
==5486==    by 0x4264C7: hts_cigartestInit000 (cigartest.nim:23)
==5486==    by 0x40223F: PreMainInner (system.nim:2844)
==5486==    by 0x40229B: PreMain (system.nim:2862)
==5486==    by 0x4022B7: NimMain (system.nim:2874)
==5486==    by 0x40230B: main (system.nim:2884)
==5486==
==5486== Use of uninitialised value of size 8
==5486==    at 0x459174: X5BX5D__Wj0nQaHHpbJA69bFJgqE2BQbam (cigar.nim:51)
==5486==    by 0x459A88: ref_coverage_YBLv47zweGLEtZG2KmYifw (cigar.nim:100)
==5486==    by 0x4264C7: hts_cigartestInit000 (cigartest.nim:23)
==5486==    by 0x40223F: PreMainInner (system.nim:2844)
==5486==    by 0x40229B: PreMain (system.nim:2862)
==5486==    by 0x4022B7: NimMain (system.nim:2874)
==5486==    by 0x40230B: main (system.nim:2884)
 18   test "ref coverage":
 19     var b:hts.Bam
 20     open(b, "tests/HG02002.bam")
 21     for rec in b:
 22       if rec.flag.unmapped: continue
 23       var pieces = rec.cigar.ref_coverage(ipos=rec.start)

I think rec.cigar is not fully initialized there. I hope that helps.

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

How did you link statically?

Actually, I don't know.

Hint: gcc   -o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/all  /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_all.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_system.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_cigartest.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_faitest.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_unittest.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_macros.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_strutils.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_streams.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_times.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_sets.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_parseutils.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_math.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_algorithm.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_hashes.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_os.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_posix.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_ospaths.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_terminal.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_termios.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_bam.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_hts_concat.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_simpleoption.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/stdlib_typetraits.o /home/UNIXHOME/cdunn/repo/gh/hts-nim/tests/nimcache/hts_fai.o  -lm -lrt   -ldl [Exec]

I don't see where that links with htslib. It's definitely not dynamically linked:

$ ldd tests/all
        linux-vdso.so.1 =>  (0x00007ffe63752000)
        libm.so.6 => /lib64/libm.so.6 (0x00002ac4332ee000)
        librt.so.1 => /lib64/librt.so.1 (0x00002ac4335f1000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002ac4337f9000)
        libc.so.6 => /lib64/libc.so.6 (0x00002ac4339fd000)
        /lib64/ld-linux-x86-64.so.2 (0x00005574d0019000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ac433dc1000)

from hts-nim.

brentp avatar brentp commented on June 15, 2024

can you try with nim 0.18.XX ? I just did:

for i in $(seq 200); do ./tests/all || break; done

and got no problems. but got a break nearly immediately with 0.17.2

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

I have to install 0.18. 😄

I'll update this ticket when I do.

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

We have an older glibc, so I have to do something special to install. (Long story.)

* https://github.com/nim-lang/Nim/issues/1734
* https://forum.nim-lang.org/t/1972
* https://github.com/nim-lang/Nim/issues/3138

Not sure if that's solved yet. (Araq would have to update csources.)

from hts-nim.

brentp avatar brentp commented on June 15, 2024

ouch. yeah, that's a pain. can you setup your own gcc via (bio)conda and use that?

I see you probably have more experience in nim than I do! I hadn't seen your stuff. Would be great to join forces.

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

What versions of htslib does this work with? I had to do some special if-wrapping for older htslib.

from hts-nim.

brentp avatar brentp commented on June 15, 2024

1.6+ for sure. maybe 1.5+

from hts-nim.

pb-cdunn avatar pb-cdunn commented on June 15, 2024

The biggest annoyance was new return values on old functions. In C, those funcs are still binary-compatible, but in Nim you have to "discard" or use the return values.

I don't think you need to worry about 1.5 though. You're lucky you started with 1.6!

from hts-nim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.