halbux / sparselizard

C++ FEM library | user-friendly | multi-physics | hp-adaptive | HPC
http://www.sparselizard.org
Other
332 stars 62 forks source link

Sparselizard under Windows OS and Visual Studio #20

Closed hbadi closed 3 years ago

hbadi commented 4 years ago

Hi everybody,

I should have post this message few months ago, i'd like to share my experience using Sparselizard under Window OS. This is only my short experience and i don't pretend to be complete, maybe there is still a lot to do to get a "perfect" procedure. I'm sorry if my comments sound obvious for some people ;-)

First of all I won't talk about Sparselizard under "Linux" like systems as Mingw, Cygwin or WSL 1/2, it's exactly the same procedure as "real" linux system described in the official Sparselizard documentation. It may be interesting to try to compile Sparselizard, and also all the dependencies, with the mingw cross compiler for windows using msys or WSL, but i'm a little bit lazy...

Under Windows OS the difficulty is to get Petsc and Slepc working natively, that's why i do not use native Microsoft compiler but rather Intel compiler, this latter can be used with Visual Studio.

  1. Sligth modifications on the Sparselizard source code must to done, it's mainly about shortcutting MUMPS, C++11 standard compatibilities between Intel and GNU compiler, and also some include file. I've sent to Alex the list of modifications.
  2. To get dynamic libraries of Petsc and Slepc one have to compile with unimpi, specify mkl librarie and set the rigth compiler win32fe. Maybe it's possible to use openblas (there is an interesting wiki on the official web page of Openblas on how to compile openblas with VS). Moreover i didn't manage to compile PETSC with MUMPS library (it's not a problem about MUMPS compilation but more about how petsc use it). At this stage you'll get both static librarie .lib and dynamic libraries .dll file. Unfortunatly i didn't manage to have ligth static file .lib file from the dynamic file (or def file for VS).
  3. There is no problem with Gmsh api link.
  4. I managed to get a dll and lib file of Sparselizard using Intel Compiler.

Best regards.

Remark : Petsc and Slepc are very good numerical frameworks for very large computation and are suited for complex configurations (up to cluser), but in a lot cases (mine also) one want to use Sparselizard on small or academic cases only to test and validate a mathematical development. May be Petsc is a hammer to crack a nut... Moreover compilation issues are mainly related to Petsc and Slepc... it'd be great if one could specify its own solver as MUMPS or Eigen for instance. If so i'll be easy to compile Sparselizard with native microsoft compiler and enlarge the Sparselizard community !

halbux commented 4 years ago

Thank you for this Hamid!

It seems Stefan S. was able to get it working with MUMPS, openblas and all natively on windows:

Here a detailed description:

http://www.sparselizard.org/sparselizardonwindows.zip

I'll do the minor code changes needed asap.

Alexandre