Compile Elmer under Windows

Discussion about building and installing Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Compile Elmer under Windows

Post by mzenker »

Hi Juha,

it seems that the compilation has terminated successfully :D just before the end of my working day - after 3 1/2 hours compile time for fem alone!
So for the future it would be very useful to be able to compile ElmerSolver alone. Is that possible, and if so, how?
Would it be enough to comment "make clean" in the script?
When I try to start the freshly compiled ElmerSolver.exe, I get an error message that libgcc_s_dw2-1.dll was not found.
So what remains to be done before the binaries can be used?

Thank you,

Matthias
Attachments
compile-elmer-2012-09-27-12-46-26.zip
(9.2 KiB) Downloaded 374 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Compile Elmer under Windows

Post by raback »

Hi Matthias

Just go to the file
$ELMERSRC/fem

and say 'make' and 'make install'. Should not take that long.

If you're working with modifications that you know will not affect the module dependencies then you can say:
$ELMERSRC/fem/src>make nofdeps

and then remake. This will then only compile the file that was actually changed and not any that depends on that. To go back to considering the dependencies say 'make fdeps'.

-Peter
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Compile Elmer under Windows

Post by Juha »

Hi,

did a web search 'bout the libgcc_s_dw2-1.dll, guess it should be located
at c:\mingw\bin (or whatever your main mingw installation directory), and
seen when applications run under mingw, but not when run from Windows
directly (?) Adding c:\mingw\bin to your PATH should do the trick or
copying the file to some directory in default PATH ....

Some bad current mingw/gcc installation policy, i guess...

Regards, Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Compile Elmer under Windows

Post by mzenker »

Hi,

adding C:\Programme\MINGW\bin to my PATH makes the error message go away. But I am asking myself why this file is not included in the binary distribution. And the solver claims to be Rev.5817, but I have compiled Rev. 5837.
So there seem to be some extra steps before the compiled binaries behave like the distributed ones.
What do I have to do?

Thanks,

Matthias
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Compile Elmer under Windows

Post by Juha »

Hi,

be sure NOT to include elmer binary distribution \bin and \lib directories in your PATH when running the new ElmerSolver binary. It might pick the old libelmersolver.dll library if your PATH includes those.

The gcc-elmer* only includes static gcc libraries, and thus the dynamic libraries
are not there...

Regards,Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Compile Elmer under Windows

Post by mzenker »

Hi Juha,

thank you for this explanation.
However, my question remains: what do I have to do in order to be able to use my freshly compiled Elmer suite like the binary distribution? Do I need to build gfortran-elmer and gcc-elmer and recompile with those? If so, how do I do that?

Thanks,

Matthias
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Compile Elmer under Windows

Post by Juha »

Hi,

sorry but i don't quite get the question? Do you mean you want run the solver
from ElmerGUI? Or something else?

Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Compile Elmer under Windows

Post by mzenker »

Hmmm...
I just had understood that the compiled binaries are somehow different from what is in the Windows distribution. E.g. ElmerSolver needs extra libraries to run, and there is no gfortran-elmer to compile UDFs and solvers. So I thought that there is something else that I have to do before the result of my compilation is equivalent to what I get when I install the windows binary distribution.
If I understand correctly, all I have to do to run the new Elmersolver (also from the GUI) is to tweak my Windows PATH so that it finds only the new solver and the MinGW libraries. Is that right?
If so, I can narrow down the question: how do I compile UDFs or solvers with the new binaries?
Do I have to build gfortran-elmer? If so, how? Or do I have to "make nofdeps" in $ELMERSRC/fem/src as Peter wrote?

Thank you for your continued assistance,

Matthias
Juha
Site Admin
Posts: 357
Joined: 21 Aug 2009, 15:11

Re: Compile Elmer under Windows

Post by Juha »

Hi,

yes that should be the case. The difference in libraries is due to different
compiler configuration. In addition to PATH you might need to also set ELMER_HOME to
point to your new ElmerSolver installation directory in order to pick up the new modules instead of the old installed ones.

An alternative would be to replace the stuff in binary Elmer installation directories
bin/, lib/ and share/elmersolver/lib with the freshly compiled stuff in respective directories...

The new ElmerSolver installation bin/ directory should include elmerf90.bat &
elmerf90.sh that can be used to compile UDFs.

Regards,Juha
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Compile Elmer under Windows

Post by mzenker »

Hi Juha,

so I know (I think) what I have to do when I want to switch to the new binaries.

For the elmerf90 issue, there is no elmerf90.bat in the bin directory. There is a shellscript elmerf90, which did not work under MinGW at the first attempt:

Code: Select all

Fatal Error: Parse error when checking module version for file 'defutils.mod' opened at (1)
I will try it again next week paying more attention to $PATH and report back...

Thank you very much, and have a nice weekend!

Matthias
Post Reply