installation fails on mac OS 10.9

Discussion about building and installing Elmer
Post Reply
smurphy
Posts: 2
Joined: 10 Feb 2014, 14:03
Antispam: Yes

installation fails on mac OS 10.9

Post by smurphy »

Hi,
I'm trying to install the latest version of elmer on mac os 10.9 Mavericks. It seems the f90 files in the fem/ repository are not properly generated.
I get the following error at iso_varying_string.f90.

cpp -DCONTIG=",CONTIGUOUS" -DALLOC_CHAR=1 -P -I. -I/Users/sebastienmurphy/elmerfem/include -DFULL_INDUCTION -DUSE_ARPACK -DCONTIG=",CONTIGUOUS" -DALLOC_CHAR=1 -P -I. -I/Users/sebastienmurphy/elmerfem/include -DFULL_INDUCTION -DUSE_ARPACK iso_varying_string.src > iso_varying_string.f90
gfortran -O -I. -Ibinio -I../binio -I. -Ibinio -c iso_varying_string.f90

so_varying_string.f90:56.21:

interface operator(
1
Error: Syntax error in generic specification at (1)
iso_varying_string.f90:57.21:

If I correct by hand I get errors in other f90 files.
Does anybody have any ideas?
Thank you very much,
Sebastien

I use the following install script (I tried with gcc and the apple compiler clang and get the same error, also -ansi in the flags doesn't help).
#export CC=gcc
#export CXX=g++
export CC=clang
export CXX=clang++
export FC=gfortran
export F77=g77
export FCPPFLAGS=-ansi
export FCFLAGS=-ansi
export CFLAGS=-ansi

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem"
for m in $modules; do
cd $m
autogen.sh
./configure --prefix=$HOME/elmerfem --with-64bits=yes
make
make install
cd ..
done
smurphy
Posts: 2
Joined: 10 Feb 2014, 14:03
Antispam: Yes

Re: installation fails on mac OS 10.9

Post by smurphy »

Ok I solved the problem. Somehow the -ansi flag was not set when running the cpp command (I though setting FCPPFLAGS=-ansi in the install script did it but obviously not). So I had to set manually in the Makefile
cpp -DCONTIG=",CONTIGUOUS" -DALLOC_CHAR=1 -P -I. -I/Users/sebastienmurphy/elmerfem/include -DFULL_INDUCTION -DUSE_ARPACK -DCONTIG=",CONTIGUOUS" -DALLOC_CHAR=1 -P -I. -I/Users/sebastienmurphy/elmerfem/include -DFULL_INDUCTION -DUSE_ARPACK -ansi iso_varying_string.src > iso_varying_string.f90
It Works!
Hope this helps others
henrotte
Posts: 8
Joined: 08 Oct 2011, 19:53
Antispam: Yes

Re: installation fails on mac OS 10.9

Post by henrotte »

The following has worked for me for a fresh installation of Elmer on MACOS 10.9

Install Xcode (5.0.2) and macports from web
>> sudo port install automake
>> sudo port install autoconf
>> sudo port install g95

ajouter dans le .bash_profile
export ELMER_HOME="/directory/where/you/install/Elmer"
>> source ~/.bash_profile
>> cd $ELMER_HOME
>> svn checkout svn://svn.code.sf.net/p/elmerfem/code/trunk elmerfem
>> cd elmerfem

A few bugs need be fixed. Make the indicated substitutions
(awaiting them beeing fixed in the repository):
fem/src/fft.c:492: "return" -> "return 0"
fem/src/fft.c:579: "return" -> "return 0"
fem/src/modules/ResultOutputSolve.src:1550: "(I8,A,I0)" -> "(I8,A,I0,A)"
fem/src/modules/ResultOutputSolve.src:1558: "(I8,A,I0)" -> "(I8,A,I0,A)"

Then execute the script (all warnings seem to be harmless) :
"

Code: Select all

#!/bin/sh -f 
export CC=gcc
export CXX=g++
export FC=g95
export F77=g95
export F90=g95

export ELMER_HOME=/Users/frhenrotte/SOLVERS/elmer
LIBS="-L$ELMER_HOME/elmerfem/lib" 
CPPFLAGS=" -I$ELMER_HOME/elmerfem/include" 
FCPPFLAGS=" -I$ELMER_HOME/elmerfem/include" 
CFLAGS="-g -O2 -I$ELMER_HOME/elmerfem/include" 
CCFLAGS="-g -O2 -I$ELMER_HOME/elmerfem/include" 
CXXFLAGS="-g -O2 -I$ELMER_HOME/elmerfem/include"
FCFLAGS=" -I$ELMER_HOME/elmerfem/include" 

modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem" 
for m in $modules; do
cd $m ;
echo; echo CONFIGURING ELMER MODULE $m; echo; 
autogen.sh ;
./configure --prefix=$ELMER_HOME/elmerfem --with-64bits=yes ;
if [ "$m" == "fem" ]; then
    echo "Modify Makefile"
    cp src/Makefile ./temporary_file ;
    sed -e "s|soname|dylib_install_name|g" -e "s|EXTRA_LIBS =    -L/sw/lib|EXTRA_LIBS = -L/sw/lib -lstdc++|g" temporary_file > src/Makefile ;
fi
echo; echo BUILDING ELMER MODULE $m; echo; 
#uncomment next line if the configuration has changed
#make clean   
make -j 3 ;
echo; echo INSTALLING ELMER MODULE $m; echo; 
make install ;
cd .. ;
done
exit
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: installation fails on mac OS 10.9

Post by raback »

Hi

Thank you for the script and bug report! The bugs have now been fixed on the svn version. Apparently just some compilers failed on them.

-Peter
Post Reply