-
Notifications
You must be signed in to change notification settings - Fork 1
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
Windows compatibility #38
Comments
After a couple of edits to dhtslib, compiling htslib with mingw64, a lot of searching on how to get a .lib file from .dll, and including all necessary dlls, I did manage to compile a program with dhtslib on windows and get it to run. So definitely possible, just tedious. See #39 |
Just to record it somewhere. Here are the steps to replicate this on an x86_64 machine:
If all of this was done correctly, it should run. |
@charlesgregory can 3c65795 close this? |
Just a list of dlls required (copy to dhtslib folder) on my machine (found in my mingw64\bin folder) to run unittests:
|
Updates as my initial instructions were a bit wrong. If using MinGW as your environment you need Did this for msys2
Compiles but is broken so unsure what is wrong. Tested only msys2 so unsure if mingw is broken. |
I seem to have hit an interesting snag. htslib can be built on windows via mingw64 or msys2 and used to build dhtslib but it doesn't pass unittests. This is because dmd and ldc by default use the MSVC toolchain. So your malloc/free calls internally in a mingw64 built htslib use mingw's heap, however Dlang is using MSVC's heap. So any free calls in the D code will crash when freeing htslib data. You also can't realloc htslib data from D (which we do). This also explains why building with msys2 doesn't work either for basically the same reason, htslib and dhtslib are being built from two different toolchains. In order to resolve this, we will have to have either a d compiler with support for compiling with mingw64 or htslib will have to become fully MSVC compatible. Currently dmd has no mingw support, ldc's is limited to mingw32, gdc maybe has newly found mingw64 support but finding documentation is hard. Meanwhile htslib appears to be moving to be (or is already) MSVC compatible, but I cannot find information on how to build it as it is a very different toolchain that I have little experience with. This is a very low priority issue, but I would love the opportunity to allow native windows development (that doesn't require WSL). |
say no more |
So turns out htslib can be built for windows.
I attempted to build dhtslib on windows and got errors for the following:
ssize_t
is not defined for windows in the d library. We can probablyalias
it for windows.The text was updated successfully, but these errors were encountered: