Easy compilation in Windows?

Discussion about building and installing Elmer
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Easy compilation in Windows?

Post by 888 »

Hello!

I would like to test the MPI version of ElmerSolver.

Is it possible to simply compile the ElmerSolver.src from https://elmerfem.svn.sourceforge.net/sv ... k/fem/src/ using the elmerf90 command and adding the MPI flags?

Since im in a restricted PC it would be great to avoid installing anything extra, except libraries or other files that could be used without installation. For example if the MinGW and MinSYS are needed, wich packages to download.
Also, the MPI libraries, this are ok? -> http://www.mcs.anl.gov/research/projects/mpich2/ or you recommend some in particular?

Finally, i have read the manual and wiki for compilation instructions but it is not quit clear, for example i cant find the four packages needed from MinGW (http://www.elmerfem.org/wiki/index.php/ ... P_Part_Two) in the MinGW sourceforge download page.

If would be great if someone could give me some simple instructions on how to compile the MPI capable version of ElmerSolver.
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Ok, i have installed MinGW and MinSYS, so i should be able to compile using the next script (launching from MinSYS):

Code: Select all

#!/bin/sh -f 
# Compile Elmer modules and install it
## replace these with your compilers:
export CC=gcc
export CXX=g++
export FC=gfortran
export F77=gfortran
modules="fem" 
for m in $modules; do  
cd $m  
./configure --with-mpi=yes with-mpi-dir=MPI/directory --prefix=/opt/elmer  
make  
make install  
cd .. 
done
What else i need to set in this script? keeping in mind im only searching to compile ElmerSolver. Also, what .src files need to be present for this?
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Im close to do the first compilation attempt, however im stuck in the download source code part, because in the restricted PC im using i cannot install the SVN client, then i would like to do it manually, so this time the question is: which files i need to download? i assume it will be all contents within https://elmerfem.svn.sourceforge.net/sv ... trunk/fem/ is that correct?
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Easy compilation in Windows?

Post by raback »

Hi

If you do not have svn client it is probably easiest to go to

http://elmerfem.svn.sourceforge.net/vie ... fem/trunk/

and at the bottom of the page press "Download GNU tarball".

-Peter
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Ah, that did it, great!

Now, for the ElmerSolver MPI version to work, what modules i need to compile? i assume that it is not necesary to compile all, for example "post" and "front" shouldnt be compiled right? what else i could remove?
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Easy compilation in Windows?

Post by raback »

Hi

This is the typical list if no GUI or Post is compiled:
"matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem"

As you can see in examples in:
http://www.elmerfem.org/?category_name= ... stallation

-Peter
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Ok, i manage to run the script from the MinGw32 console but im getting some errors.

For each of the compile loops its the same:

Code: Select all

configure: error: C compiler cannot create executables
Then follows two lines where the make and install instances are stoped.

It says that more details are given in some config.log file but where is it?

And in one of the other loops the "C" is replaced by "Fortran 77". Actually in this loop in particular i also get a missing .dll error

The script:

Code: Select all

#start of script, compile-elmer.sh 

#!/bin/sh -f 

# 

# Create temp names 

# 

#change the next statement to reflect your directory structure 

export ELMER_HOME=/E/Programas/ElmerMPI/Build

#export ELMER_POST_HOME=$ELMER_HOME/share/elmerpost 

#export ELMER_FRONT_HOME=$ELMER_HOME/share/elmerfront 

export PATH=$ELMER_HOME/bin:$PATH 

export CC=mpicc 

export CXX=mpic++

export FC=mpif90

export F77=mpif77

#export CPP=cpp-elmer

export LDFLAGS="-L/e/Programas/MinGW/lib/gcc/mingw32/4.5.2 -Xlinker --stack=1000000000 " 

#change that to your MPI installation path

export MPIDIR="E/Programas/OpenMPI_v1.5.3-win32"

#following statement is optional, will suppress ’deprecated’ warning in compiler output 

export CXXFLAGS="-Wno-deprecated" 

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem" 

for m in $modules; do 

cd $m 

./configure --with-mpi=yes --with-mpi-dir="$MPIDIR" --with-mpi-lib-dir="$MPIDIR/lib" --with-mpi-inc-dir="$MPIDIR/include" --prefix=$ELMER_HOME

#if you get an error message at the end of compiling with ’gcc-sjlj’ in it, then 

#uncomment the next line and run once. Then recomment the line, and run 

#again to compile. 

# make distclean 

make 

make install 

cd .. 

done 

#end of script 

tzwinger
Site Admin
Posts: 99
Joined: 24 Aug 2009, 12:20
Antispam: Yes

Re: Easy compilation in Windows?

Post by tzwinger »

Hi,
the config.log should be directly in the sub-directory of the module source, where the compilation/configuration failed. For instance, when you spotted errors during compilation of the module fem, then check in fem/config.log

My experience (on LINUX/UNIX platforms) with your error message "C compiler cannot create executables" is, that you added something into the CFLAGS or the LDFLAGS, the compiler cannot deal with (unknown optimization flag, not found path, ...);

-Thomas
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Thanks!

I found the config.log file and i was able to solve the problem that caused the first error, however im still getting the same error but with a different cause (according to the config.log). Now the problem is that the wraper.txt for the mpicc.exe makes reference to some cl.exe compiler and of course doesnt find it in the "PATH", so... where is it?
888
Posts: 77
Joined: 10 May 2011, 18:05
Antispam: Yes
Location: Buenos Aires - Argentina

Re: Easy compilation in Windows?

Post by 888 »

Hello!

Im back with this topic, that i cant solve last time.

Now i need to compile Elmer in a 64Bit 4-core processor PC (Windows 7). I would like to do it with MUMPS, HYPRE and SUPERLU-MT support (im missing something?), since i want to take advantage of the SMP capabilities of the new PC (now only 25% of the CPU is used).

The problem is the same, the instructions on how to compile seem to requiere some base knowledge in this type of procedure, wich i dont have, so i get stuked very easy.
I allready know that for compiling under Windows i need MinGW and MinSYS, in this case i assume the 64bit versions.
Forgeting for now the requirements for the aditional libraries (mumps, etc), to compile ElmerSolver with MPI is there anything missing in the following script?
#start of script, compile-elmer.sh

#!/bin/sh -f

#

# Create temp names

#

#change the next statement to reflect your directory structure

export ELMER_HOME=/E/Programas/ElmerMPI/Build

#export ELMER_POST_HOME=$ELMER_HOME/share/elmerpost

#export ELMER_FRONT_HOME=$ELMER_HOME/share/elmerfront

export PATH=$ELMER_HOME/bin:$PATH

export CC=mpicc

export CXX=mpic++

export FC=mpif90

export F77=mpif77

#export CPP=cpp-elmer

export LDFLAGS="-L/e/Programas/MinGW/lib/gcc/mingw32/4.5.2"

#change that to your MPI installation path

export MPIDIR="E/Programas/OpenMPI_v1.5.4-win64"

#following statement is optional, will suppress ’deprecated’ warning in compiler output

export CXXFLAGS="-Wno-deprecated"

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem"

for m in $modules; do

cd $m

./configure --with-mpi=yes --with-64bits=yes --with-mpi-dir="$MPIDIR" --with-mpi-lib-dir="$MPIDIR/lib" --with-mpi-inc-dir="$MPIDIR/include" --prefix=$ELMER_HOME

#if you get an error message at the end of compiling with ’gcc-sjlj’ in it, then

#uncomment the next line and run once. Then recomment the line, and run

#again to compile.

# make distclean

make

make install

cd ..

done

#end of script
Post Reply