-
Notifications
You must be signed in to change notification settings - Fork 104
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 dependencies #236
Comments
Not sure about the minimum version, I usually test only on the latest ones. And unfortunately I cannot test on windows, sorry. But pull requests are welcome! |
I've also been trying to get I documented the steps I took in some detail on my fork. Would much appreciate it if someone (@Mistuke?) could look at these and have a go on their machine before I make a pull request. In order to use my local build of
|
Hi @rossng, A couple of comments:
Also even though your tests ran, they're not stable in GHCi. |
@rossng Thanks for the run-down. In your
How did you do this - Did you edit the local versions that |
@kewp I think I had cloned the git repository and was just trying build hmatrix from that. As such, I could just edit the files directly and run I gave up on this after reading Mistuke's comment - looks like the fix he linked to is still in progress and hopefully going into GHC 8.8.1 (March 2019). I'm not familiar with GHC internals so you might want comment from someone a bit more qualified! |
@rossng It's been committed, it'll be in 8.8. I hadn't been able to get anyone to review the changes in time for 8.6 sadly. |
Huh. Well I managed to get things working. Didn't need to do anything special with libfortran... |
Thanks @rossng. I did something similar and managed to get it working |
Did anyone here have an issue with Sundials? |
EDIT: The steps below have been revised in the light of @Mistuke's subsequent comments. I have been trying to build
a. Running b. Running
becomes
The dependency on
I use the GHC 8.10.1 It seems to build, but the error/warning below is reported - I do not know its significance:
|
See my previous comment. You do not ever link against a dll. Ever. You link against its import library or you can violate the program's code model. Binutils allows this because of historical reasons and for 32-bit code it didn't matter if it was supposed to use strict bindings. But do not ever link against a dll. See my very long post on the topic explaining why.. https://hub.zhox.com/posts/why-doesnt-ghc-on-windows-find-my-dll/ |
Further to my comment above, if I take the following additional steps, I can build all of the packages in the
becomes
becomes
|
@Mistuke, I have read your comment and post, but I may not understand fully its implications for a user of I note the following: [1] [2] I think MSYS2 only provides [3] In the case of the (apparently unnecessary) In your post, you write: "So what is one supposed to do when you only have a DLL? Create an import library from the Microsoft DEF file." Is the implication that a user should, perhaps, take the MSYS2-provided |
@mpilgrem well..
Correct, your import libraries are compile time libraries so are in by using In other words, this allows users to choose how they want to link, further it also preserves the binding mode the developer intended. If the developer wanted lazy binding and you link directly against a DLL you force strict binding. Unlike Linux, the shared library does not contain a
It provides
This is why the import libraries exist. They allow the linker to be able to resolve these differences while making it so that you don't have to change how you compile your program.
Those packages are intended to provide the runtime dependencies of
Yes, but no library that is intended to be used by developers as a link rather than a runtime target will ship without an import library (a so like I mentioned in my original post, you don't need the prefixes or suffixes for the libraries. The search order of libraries on Windows is documented https://sourceware.org/binutils/docs/ld/WIN32.html and it's
by prefixing it with |
@Mistuke, thank you for your comprehensive further explanation. I have changed the Step 2 in my original comment, in the light of it. I will propose a pull request, that reflects these steps. |
The changes proposed in this pull request allow the respository's packages to be built on Windows 10 version 2004, with: `stack --resolver nightly-2020-07-24 build --flag hmatrix:openblas` See the discussion, including about the use of MSYS2 packages and import libraries, at: haskell-numerics#236 The `.gitignore` file is also updated to exclude `.stack-work`.
Actually, after a bit of experimentation, I think the dependency on
|
The changes proposed in this pull request allow the respository's packages to be built on Windows 10 version 2004, with: `stack --resolver nightly-2020-07-24 build --flag hmatrix:openblas` See the discussion, including about the use of MSYS2 packages and import libraries, at: haskell-numerics#236 The `.gitignore` file is also updated to exclude `.stack-work`.
What's the minimum supported GHC version for hmatrix?
I've noticed the dependencies for Windows are as follows:
This essentially limits
hmatrix
to only dynamic linking (because these names will force the finding of a dll in some cases) and also only tox86_64
GCC because oflibgcc_s_seh-1
(32 bit GCCs that we use in GHC use different exception handling mechanisms, so it haslibgcc_s_dw2-1.dll
instead).Ideally this should just be
But whether this will work or not will depend on whether or which minimum GHC is supported.
Also as a side note, you won't be able to use
hmatrix
reliably inghci
until the next major release of GHC (8.4) if the C files are compiled using-O3
which turns on SSE vectorization, at the moment you'll get random segfaults (see https://ghc.haskell.org/trac/ghc/ticket/13617).The text was updated successfully, but these errors were encountered: