compile linux program (OpenMX) for windows with MinGw platform and libraries such as MPICH,fftw lapack and BLAS?

144 Views Asked by At

The openMX code (http://www.openmx-square.org/download.html) is a software package for nano-scale material simulations based on density functional theories. it has a make file which contains C and fortran compiler executable, libraries and include files,

see below:

CC = mpicc -O3 -fopenmp   -Dnosse -I/usr/include  -I/mirror/fftw/include -I/mirror/mpich/include
FC = mpif90 -O3 -fopenmp  -Dnosse -I/usr/include  -I/mirror/fftw/include -I/mirror/mpich/include

LIB=-L/mirror/lib -llapack -lblas -lfftw3 -L/mirror/mpich -lmpi -lmpicxx -lmpifort  -lpthread -lgfortran

I want to compile this program for windows as can be run independently. I don't know is it possible with MinGw? how can i use mpicc and mpif90 compilers and lapack, blas and fftw3 libraries for mingw?

Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

OK. Couple things:

  1. mpicc/mpif90 are wrappers, which add proper compile / link flags. there is no need for them to be available to build programs.

  2. MinGW used to be the way to go on Windows in my view. Nowadays, I'd invest the energy in setting up CMake for the project and actually build with VisualStudio.

  3. If you want to use gcc etc for building, that's totally fine, but I would not use MinGW, but do cross compilation on Linux. That's truly a time saver. The configure scripts need sometimes 10 times longer or more to finish under MinGW that when cross compiling with Linux.

  4. MPI is not as trivially done on Windows. You need Windows domain with domain authentication for MPI to work. comparable to you ssh public key.

    check this page for example: https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html