-
-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use --d4? #247
Comments
you need to compile with |
Does d4 need to be specified further with a path or something? CC: mosdepth.nim
/home/user/.cache/nim/mosdepth_d/@[email protected]@[email protected]@sd4.nim.c:8:10: fatal error: d4.h: No such file or directory
8 | #include <d4.h>
| ^~~~~~
compilation terminated.
Error: execution of an external compiler program 'gcc -c -w -fmax-errors=3 -I/home/user/.choosenim/toolchains/nim-1.6.14/lib -I/home/user/mosdepth -o /home/user/.cache/nim/mosdepth_d/@[email protected]@[email protected]@sd4.nim.c.o /home/user/.cache/nim/mosdepth_d/@[email protected]@[email protected]@sd4.nim.c' failed with exit code: 1
|
I tried the following: nim c -d:d4 --passC:"-I$HOME/.nimble/pkgs/d4-0.0.5/include" --passL:"-L$HOME/.nimble/pkgs/d4-0.0.5/lib" mosdepth.nim But the |
it is dynamically linking d4 so you need to build and install that. |
Okay, that was a lot of trial and error. Here's what I ended up with (since I don't have sudo permissions): cd ~/
git clone https://github.com/38/d4-format
cd d4-format
cargo build --release --package d4binding
# Make dirs for the relevant files (could probably skip this and point directly to d4-format/)
mkdir -p ~/local/d4/lib
mkdir -p ~/local/d4/include
cp ~/d4-format/target/release/libd4binding.* ~/local/d4/lib/
cp ~/d4-format/d4binding/include/d4.h ~/local/d4/include/
cd ../mosdepth/
nim c -d:d4 -d:release --passC:"-I$HOME/d4-format/d4binding/include" --passL:"-L$HOME/d4-format/target/release" mosdepth.nim I added the following to # d4tools
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/d4/lib/
export LIBRARY_PATH=$LIBRARY_PATH:$HOME/local/d4/lib/
export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/local/d4/include/ Now the |
Would it be possible to add a bit more information to the readme about how to use
--d4
? Maybe I'm missing something, but I'm failing to get the argument to show up.I've tried installing d4tools via conda and
nimble install https://github.com/brentp/d4-nim.git
and then installing the current master branch. And the--d4
argument is still missing. Do I need to add something to the $PATH or something? I feel like I got it to work a year ago or something, so I'm a bit confused :DI assume, the
when defined(d4):
means it only adds the argument when d4 is available. Wouldn't it be better not to hide it?The text was updated successfully, but these errors were encountered: