jgoldfar / Hypre.jl

Julia wrapper for the Hypre (https://computing.llnl.gov/projects/hypre-scalable-linear-solvers-multigrid-methods) linear solver library
MIT License
6 stars 2 forks source link

Add build step for Windows #2

Open jgoldfar opened 9 years ago

tkelman commented 9 years ago

Neat to see a Hypre wrapper package being worked on! I remember using it through petsc a while back.

The recommended, least-painful approach to supporting Windows binary dependencies is using WinRPM.jl. If the Hypre library can be cross-compiled from Linux (we use the openSUSE build service to create the binaries) using MinGW, then you can write up a spec script with compilation instructions and submit it to the build service there, then add a simple line in deps/build.jl to download the resulting binaries.

Unfortunately MPI on Windows is a difficult combination, none of the open-source implementations currently support Windows. There is a Microsoft MPI implementation but I don't think anyone has tried it yet with MPI.jl. Can Hypre be compiled and used in serial or shared-memory threaded mode (it's been a while, I don't remember)?

jgoldfar commented 9 years ago

Thanks for the feedback; I have this ticket open because it's something I've been thinking about along those lines, but don't have much capacity to develop it right now... Do all of my work on a Linux machine, but testing on Windows is a definite goal. WinRPM is a great suggestion, as is cross-compilation using the openSUSE build service. Will take a look. MPI is problematic in Julia in general from what I gather, still working through using it with Hypre on Linux, in fact! Hypre does have a serial compilation option (not well documented based on what I've seen) and pthreads-based shared memory support but it looks like it might either be technical, require PETSc, or both (the latter being problematic from my understanding of PETSc as it relates to Julia in particular, but I'm definitely willing to learn.) Looks like a good first place to look in that regard would be PETSc.jl I guess.

tkelman commented 9 years ago

Here's a relevant recipe I wrote for cross-compiling Metis, which might serve as a good start for the spec file: https://build.opensuse.org/package/show/windows:mingw:win64/mingw64-metis

jgoldfar commented 9 years ago

Thanks for the help; finally had some time to take a look at this and got it started here: https://build.opensuse.org/project/show/home:jgoldfar The whole cross-compilation thing and using OBS is all new. Interesting. By the way, it looks like OSX would also need the serial-only version of the codes; I'll be adding come commits with a working build script for OSX soon.

tkelman commented 9 years ago

Nice. I see you've made copies of the cross-compilers in your personal project. There's a way to avoid doing that, you can go to edit repositories and under "Additional package repositories (searched in descending order):" you can make your personal project depend on the normal mingw32/mingw64 libraries.

tkelman commented 9 years ago

And if you don't have access to a Windows machine to test on, once the binary install is set up I can show you how to set up AppVeyor (www.appveyor.com), which is like a Windows version of Travis CI.

jgoldfar commented 9 years ago

I was surprised when it seemed like they needed to be added; I've tried to go ahead and add mingw64 as an additional package repository, but they don't show up in the list afterwards... The build just seems to wait indefinitely, but the packages are not reporting unresolved. Am I missing something? It is likely the spec file needs some work, but I would like to be sure the environment is correct.

jgoldfar commented 9 years ago

Worked out that issue with OBS, but it looks like Windows support will have to be put on hold (more than it already was) since even in a sequential build, we still need to build against MPI. We could modify the Hypre codebase to remove this requirement, but I'd guess the modifications required would be extensive... OBS doesn't look to have MPI, and while compiling against MSMPI is a possibility, implementing these type of changes may still be nontrivial. Then there's this thread which suggests that though you can force Hypre to compile under Windows, it is unsupported and probably won't work anyways.

tkelman commented 9 years ago

Ah, so it can't build without MPI at all? Bummer. I've seen libraries like MUMPS that can build against a stub stand-in of MPI, but haven't tried that with Hypre. That's a good link for future reference though, may be easier than patching up openmpi or mvapich2 until they can cross-compile. Hard to use the MSMPI on OBS though...

jgoldfar commented 9 years ago

I'm not sure that substituting a MPI stub wouldn't work, but MPI appears to be hard-coded into quite a few makefiles throughout the source. Either that or cmake isn't configuring everything correctly, and I'm definitely no cmake expert

jgoldfar commented 9 years ago

Alright, poked around in the make process a bit and the actual build seems to be working correctly. That is, OBS builds a dll just fine. The spec file is really kludge-y, which may or may not be causing the problems with rmplint later in the build. Are there docs on packaging specific to mingw64? That's all that is left w.r.t. library build

tkelman commented 9 years ago

Are there docs on packaging specific to mingw64?

What do you mean? For OBS, or spec files in general, or for use with Julia packages?

There's https://fedoraproject.org/wiki/Packaging:MinGW?rd=Packaging/MinGW but OBS mingw spec files look a little bit different than Fedora mingw spec files.