elmerfem
elmerfem copied to clipboard
Build instructions on windows using MinGW-MSYS2
I have been trying here to compile the software on Windows using MinGW-MSYS2, with no success. Here is what I have tried so far:
cmake -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/mingw64/bin/g++.exe -DCMAKE_Fortran_COMPILER=C:/msys64/mingw64/bin/gfortran.exe -DCMAKE_MAKE_PROGRAM=C:/msys64/mingw64/bin/mingw32-make.exe -DBLAS_INCLUDE_DIRS=C:/msys64/mingw64/include/liblas/ -DBLAS_LIBRARIES=C:/msys64/mingw64/lib/libcblas.dll.a -DLAPACK_LIBRARIES=C:/msys64/mingw64/lib/liblapacke.dll.a .. -G "MinGW Makefiles" -DWITH_Mumps=FALSE -DWITH_MPI=FALSE -DWITH_OpenMP=FALSE -DWITH_MKL=FALSE -DWITH_ELMERGUI=FALSE -DWITH_ELMERPOST=FALSE -DWITH_ELMERGUITESTER=FALSE
But in the end I get the error:
collect2.exe: error: ld returned 1 exit status
fhutiter\src\CMakeFiles\fhuti.dir\build.make:230: recipe for target 'fhutiter/src/libfhuti.dll' failed
mingw32-make[2]: *** [fhutiter/src/libfhuti.dll] Error 1
CMakeFiles\Makefile2:14279: recipe for target 'fhutiter/src/CMakeFiles/fhuti.dir/all' failed
mingw32-make[1]: *** [fhutiter/src/CMakeFiles/fhuti.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I would appreciate it if you could help me with the proper command-line instructions including the CMake command.
There are scripts that work with msys2. Even make the packages including Qt5 and MPI. The only important library missing is oce (OpenCascade community edition). See,
http://www.nic.funet.fi/pub/sci/physics/elmer/bin/windows-test/
@raback Thanks. I will dig into the shell script. Any way to compile it outside of MSYS2, using only MinGW compilers? a cmd/Batch or PowerShell script for example?
@raback may you be kind to make a list of the specific packages required to be installed with mingw-get from cmd/PowerShell or pacman from inside MSYS2?
I have also requested a Chocolatey package for the software. But, the issue is that the sourceforge link is for the nightly build. The FUNET link, however, has two sets of binaries, with and without the nightly tag. May I consider the non-nightly ones as stable?
So far here are the instructions:
- Install MSYS2 from the official website and update the packages accordingly
- install below packages inside the MSYS2 with
pacman -S <packageName>:
mingw64/mingw-w64-x86_64-gccmingw64/mingw-w64-x86_64-makemingw64/mingw-w64-x86_64-cmakemingw64/mingw-w64-x86_64-gcc-libgfortranandmingw64/mingw-w64-x86_64-gcc-fortranmingw64/mingw-w64-x86_64-msmpimingw64/mingw-w64-x86_64-openblas
- add
C:\msys64\mingw64\binfolder to the Windows Environment Variables path - open cmd and go to the downloaded Elmer's source and create-go inside the
buildfolder - run
cmake -DCMAKE_C_COMPILER:FILEPATH=gcc -DCMAKE_CXX_COMPILER:FILEPATH=g++ .. -G "MinGW Makefiles" - run
cmake --build .
This is my list of installed packages in msys2. oce not yet functional.
pacman -Sy
pacman --needed -S bash pacman pacman-mirrors msys2-runtime
! exit msys & restart
pacman -Su
pacman -S git
pacman -S emacs
pacman -S make mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-gcc-fortran # (includes gcc)
pacman -S mingw-w64-x86_64-openblas
pacman -S mingw-w64-x86_64-nsis # (packaging under Windows)
pacman -S mingw-w64-x86_64-qt5
pacman -S mingw-w64-x86_64-qwt-qt5 # (includes qt5)
pacman -S mingw-w64-x86_64-msmpi # (for parallel version)
pacman -S mingw-w64-x86_64-oce # (OpenCASCADE community version)
pacman -S mingw-w64-x86_64-vtk
pacman -S mingw-w64-x86_64-lapack # (needed by MUMPS)