Implementing updates/fixes without complete compiling

Discussion about building and installing Elmer
Post Reply
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Implementing updates/fixes without complete compiling

Post by JanHoek »

Hey everyone,

I understood that the nightly version for windows are currently down, which is why I have been trying to compile Elmer from the source code. However, every time I fix the error at hand a new error occurs. I am compiling on Windows 10 with Visual Studio 15. I am now trying to compile ElmerGUI, however after adjusting the CMakeLists.txt file for compiling using Qt5, it still does not produce a .exe file. I think it has to do with .dll files missing, however cmake does not give an error. I am definitely no expert in compiling from source, so I could have made very basic and obvious errors. Anyway, here is the ElmerGUI cmake file I am using:
CMakeLists.txt
(4.82 KiB) Downloaded 312 times
Because so many errors occurred in compiling, I doubt it will work after the current problem is fixed. I was wondering if it would also be possible to implement fixes/updates in modules without compiling or by compiling partially, as I only need one fix in a certain module. The modules in the build from source however do have another extension than those created by the Elmer installer...
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Implementing updates/fixes without complete compiling

Post by raback »

Hi Jan,

Yes, the nightly build is currently down. We just got a new virtual machine for the job but it is not configured yet. May still take some time...

Personally I tried compiling with msys2+gfortran and it almost works out of the box for basic setup. What comes to compiling is not really my cup of tea either. Still, maybe you can use the notes below for starters and perhaps even improve on them.

Code: Select all

1) install msys2
https://www.msys2.org/
msys2-x86_64-20190524.exe
c:\msys64/

2) Run MSYS2 shell (Command Prompt). C:\msys64\msys2_shell.bat
First update msys2 core components:
pacman -Sy
pacman --needed -S bash pacman pacman-mirrors msys2-runtime
You must exit out from MSYS2-shell, restart MSYS2-shell, then run below command, to complete rest of other components update:
pacman -Su

3) in msys install
pacman -S git
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
pacman -S mingw-w64-x86_64-qt5
pacman -S mingw-w64-x86_64-qwt-qt5 (includes qt5)

4) fetch source codes, e.g. under c:\ElmerBuilder
git clone https://github.com/ElmerCSC/elmerfem.git
for zoltan:
git submodule sync
git submodule update --init

5) make, compile, install under msys64 (not msys2) 
source elmer_msys.sh
make -j6
ctest -L quick 
make install -j6
make package

6) set environmental variables
export ELMER_HOME=/c/ElmerBuilder/Elmer8
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ELMER_HOME/lib
export PATH=$PATH:$ELMER_HOME/bin
with the scipt elmer_msys.sh being something like:

Code: Select all

echo build: $BUILDDIR

mkdir -p $BUILDDIR
cd ${BUILDDIR}
pwd
ls -ltr

ELMER_FEM_REVISION=Release

echo starting
cmake -G"MSYS Makefiles"\
	   -DCMAKE_INSTALL_PREFIX=$INSTALLDIR \
       -DCMAKE_PREFIX_PATH:PATH="c:/msys64/mingw64/bin;c:/msys64/mingw64/;" \
	   -DWITH_MPI:BOOL=FALSE \
	   -DWITH_OCC:BOOL=FALSE \
	   -DWITH_ELMERGUI:BOOL=TRUE \
	   -DWITH_QT5:BOOL=TRUE	\
       -DWITH_QWT:BOOL=TRUE \
       -DWITH_PARAVIEW:BOOL=TRUE \
       -DWITH_VTK:BOOL=FALSE \
	   -DWITH_OpenMP:BOOL=TRUE \
	   -DWITH_Mumps:BOOL=FALSE \
	   -DWITH_Hypre:BOOL=FALSE \
	   -DWITH_LUA:BOOL=TRUE \
	   -DWITH_Zoltan:BOOL=FALSE \
	   -DWITH_ElmerIce:BOOL=FALSE \
	   -DWITH_Trilinos:BOOL=FALSE  \
	   -DBUNDLE_STRIPPED_GFORTRAN:BOOL=FALSE \
       -DCPACK_BUNDLE_EXTRA_WINDOWS_DLLS:BOOL=TRUE \
       -DCPACK_PACKAGE_BASE_FILE_NAME:STRING=elmerfem \
       -DWITH_ELMERGUILOGGER:BOOL=FALSE \
       -DWITH_ELMERPOST:BOOL=FALSE \
       -DELMER_FEM_REVISION:STRING=$ELMER_FEM_REVISION \
    $ELMERSRC
-Peter
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Implementing updates/fixes without complete compiling

Post by raback »

Hi

The 2nd part of your question: you can compile modules (F90 files under fem/src/modules) separately. Just use the elmerf90 script. Compiling just part of the library or part of ElmerGUI is probably more or less impossible as you don't know (and cannot reproduce) the setup of the initial build environment.

-Peter
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Implementing updates/fixes without complete compiling

Post by JanHoek »

Hi Peter,

Thank you for your quick reply, much appreciated! I will look into both and post my results later.

-Jan
JanHoek
Posts: 15
Joined: 13 Jan 2020, 14:06
Antispam: Yes

Re: Implementing updates/fixes without complete compiling

Post by JanHoek »

Unfortunately, the installation gets stuck at 80% when running the command 'pacman -S mingw-w64-x86_64-qt5', at installing qt. Has anyone else experienced this problem? I also tried to download Qt as a stand-alone, however that hasn't worked for me so far...
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Implementing updates/fixes without complete compiling

Post by mzenker »

Hi,

I remember having tried to compile Elmer on Windoze quite some time ago. It was before the move to cmake, so I cannot really help here.
But maybe you can try to just compile the solver suite without ElmerGUI and take the GUI from the last binary build. That is what I did as I also didn't manage to compile the GUI.

HTH,
Matthias
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Implementing updates/fixes without complete compiling

Post by raback »

Hi

There are some tentative builds on:

http://www.nic.funet.fi/pub/sci/physics ... dows-test/

Note that these are completely untested. Any part or the whole installation could be broken. All I know is the compilation goes through.For the ElmerGUI the Qwt (convergence plotter) is still missing. There is also a version without MPI as this may well spoil the party (as the redistributable package for MPSMPI 8 is probably missing).

It would be nice if somebody could test and report where these fail. I'm pretty sure they will. I guess you need at least to set the paths as before, e.g.
PATH must include "C:\Elmer 8.4\bin" and "C:\Elmer8.4\lib" and SET ELMER_HOME=C:\Elmer8.4.

-Peter

Edit: It seems that several files are missing making GUI and elmerf90 not operational.
Post Reply