static builder failed
lch14forever opened this issue · comments
Hi,
I was trying to build this repo (https://bitbucket.org/andreas-wilm/decontanimate/src/master/) with the 'hts_nim_static_builder' software. However, the final product was not statically linked.
Could there something wrong with the nimble file?
Here are the commands and outputs:
ubuntu@ip-10-0-3-37:~/hts-nim$ ./hts_nim_static_builder -s ../decontanimate/src/decontanimate.nim -n ../decontanimate/decontanimate.nimble
{"--debug": false, "--nim-src-file": ../decontanimate/src/decontanimate.nim, "<nim_compiler_args>": [], "--": false, "--nimble-file": ../decontanimate/decontanimate.nimble, "--tag": latest, "--deps": []}
docker run -v /home/ubuntu/decontanimate:/home/ubuntu/decontanimate -v /home/ubuntu/hts-nim:/load/ brentp/musl-hts-nim:latest /usr/local/bin/nsb -n /home/ubuntu/decontanimate/decontanimate.nimble -s /home/ubuntu/decontanimate/src/decontanimate.nim -- -d:danger -d:release
Unable to find image 'brentp/musl-hts-nim:latest' locally
latest: Pulling from brentp/musl-hts-nim
050382585609: Pull complete
abfd771006f0: Pull complete
8e509104d7b9: Pull complete
f0da7d0f3c7b: Pull complete
70d99ed0e009: Pull complete
8cb505a3e512: Pull complete
Digest: sha256:c9c9456eff1b935e32fd94c7d68d07b46d3c73bd009f77f8a348178c85704e0c
Status: Downloaded newer image for brentp/musl-hts-nim:latest
@["-n", "/home/ubuntu/decontanimate/decontanimate.nimble", "-s", "/home/ubuntu/decontanimate/src/decontanimate.nim", "--", "-d:danger", "-d:release"]
{"<nim_compiler_args>": ["-d:danger", "-d:release"], "--nim-src-file": /home/ubuntu/decontanimate/src/decontanimate.nim, "--nimble-file": /home/ubuntu/decontanimate/decontanimate.nimble, "--": true, "--deps": []}
Verifying dependencies for decontanimate@0.0.1
Installing cligen@>= 0.9.11
Downloading https://github.com/c-blake/cligen.git using git
Verifying dependencies for cligen@0.9.38
Installing cligen@0.9.38
Success: cligen installed successfully.
Info: Dependency on hts@>= 0.2.4 already satisfied
Verifying dependencies for hts@0.2.18
Installing zip@>= 0.2.1
Downloading https://github.com/nim-lang/zip using git
Verifying dependencies for zip@0.2.1
Installing zip@0.2.1
Success: zip installed successfully.
Hint: used config file '/nim/config/nim.cfg' [Conf]
Hint: used config file '/nim/config/config.nims' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: decontanimate [Processing]
Hint: osproc [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: macros [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
Hint: os [Processing]
Hint: pathnorm [Processing]
Hint: osseps [Processing]
Hint: posix [Processing]
Hint: times [Processing]
Hint: options [Processing]
Hint: typetraits [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
Hint: cpuinfo [Processing]
Hint: linux [Processing]
Hint: bam [Processing]
Hint: hts_concat [Processing]
Hint: strformat [Processing]
Hint: simpleoption [Processing]
Hint: tables [Processing]
Hint: gzipfiles [Processing]
Hint: zlib [Processing]
Hint: logging [Processing]
/home/ubuntu/decontanimate/src/decontanimate.nim(190, 23) Warning: ref_coverage is deprecated [Deprecated]
Hint: cligen [Processing]
Hint: parseopt3 [Processing]
Hint: critbits [Processing]
Hint: argcvt [Processing]
Hint: sets [Processing]
Hint: textUt [Processing]
Hint: terminal [Processing]
Hint: colors [Processing]
Hint: termios [Processing]
Hint: wordwrap [Processing]
Hint: sysUt [Processing]
Hint: macUt [Processing]
CC: stdlib_assertions.nim
CC: stdlib_dollars.nim
CC: stdlib_io.nim
CC: stdlib_system.nim
CC: stdlib_parseutils.nim
CC: stdlib_math.nim
CC: stdlib_unicode.nim
CC: stdlib_strutils.nim
CC: stdlib_pathnorm.nim
CC: stdlib_posix.nim
CC: stdlib_times.nim
CC: stdlib_os.nim
CC: stdlib_hashes.nim
CC: stdlib_strtabs.nim
CC: stdlib_streams.nim
CC: stdlib_osproc.nim
CC: ../../../../root/.nimble/pkgs/hts-0.2.18/hts/private/hts_concat.nim
CC: ../../../../root/.nimble/pkgs/hts-0.2.18/hts/bam.nim
CC: stdlib_tables.nim
CC: ../../../../root/.nimble/pkgs/zip-0.2.1/zip/zlib.nim
CC: ../../../../root/.nimble/pkgs/zip-0.2.1/zip/gzipfiles.nim
CC: stdlib_logging.nim
CC: stdlib_critbits.nim
CC: ../../../../root/.nimble/pkgs/cligen-0.9.38/cligen/parseopt3.nim
CC: stdlib_terminal.nim
CC: stdlib_wordwrap.nim
CC: ../../../../root/.nimble/pkgs/cligen-0.9.38/cligen/textUt.nim
CC: ../../../../root/.nimble/pkgs/cligen-0.9.38/cligen/argcvt.nim
CC: ../../../../root/.nimble/pkgs/cligen-0.9.38/cligen/sysUt.nim
CC: ../../../../root/.nimble/pkgs/cligen-0.9.38/cligen.nim
CC: decontanimate.nim
Hint: [Link]
Hint: operation successful (74494 lines compiled; 5.011 sec total; 90.461MiB peakmem; Dangerous Release Build) [SuccessX]
wrote executable: decontanimate
ubuntu@ip-10-0-3-37:~/hts-nim$ file decontanimate
decontanimate: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped
hmm, that is odd. I see:
(base) brentp@lorax:~/src/decontanimate$ file ./decontanimate
./decontanimate: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, with debug_info, not stripped
(base) brentp@lorax:~/src/decontanimate$ ldd ./decontanimate
statically linked
Thanks for the quick response!
Were you able to run the binary without libhts.so? It still complains about missing library on my machine.
i'll look into this today. thanks for letting me know.
I think this is fixed. It now says:
$ file ./decontanimate
./decontanimate: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
just requires getting the latest docker container from brentp:musl-hts-nim.
Thanks! I am getting an error when running it though:
ubuntu@ip-10-0-3-37:~/hts-nim$ file decontanimate
decontanimate: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
ubuntu@ip-10-0-3-37:~/hts-nim$ ./decontanimate
could not load: libz.so.1
compile with -d:nimDebugDlOpen for more information
ubuntu@ip-10-0-3-37:~/hts-nim$
I guess it is probably a problem with the decontanimate then...
you're right. I was able to get it to work with:
../hts-nim/hts_nim_static_builder -s src/decontanimate.nim -n decontanimate.nimble -- --dynlibOverride:"z"
Thank you very much! This worked like a charm.
great! thanks for pointing this out.