Compiling on MacOsX 10.7.3 (Lion)

Discussion about building and installing Elmer
Post Reply
zoidberg
Posts: 1
Joined: 12 Mar 2012, 12:18
Antispam: Yes

Compiling on MacOsX 10.7.3 (Lion)

Post by zoidberg »

Hi everybody, I'm new here!

I'm trying to compile Elmer on a MacBook Air late 2011 (OsX Lion, 10.7.3), with the following script

Code: Select all

# Compile Elmer moduels and install it 
# 
 
export CC=gcc 
export CXX=g++ 
export FC=gfortran 
export F77=gfortran 
 
export HOME=/opt/elmer 
 
CFLAGS="-g -O2 -I$HOME/elmerfem/include -I/usr/local/include" 
FCPPFLAGS="-I/$HOME/elmerfem/include -I/usr/local/include" 
CPPFLAGS="-I/$HOME/elmerfem/include -I/usr/local/include" 
CXXFLAGS="-g -O2 -I/$HOME/elmerfem/include -I/usr/local/include" 
FCFLAGS="-g -O2 -I/$HOME/elmerfem/includei -I/usr/local/include " 
LIBS="-L$HOME/elmerfem/lib -L/usr/local/lib -lgfortran" 
 
modules="matc umfpack mathlibs elmergrid meshgen2d eio hutiter fem" 
 
for m in $modules; do 
  cd $m 
   ./configure --prefix=/opt/elmer --with-64bits=yes --with-blas="/usr/lib/librefblas.a" --with-lapack="/usr/lib/liblapack.a" 
     make clean 
       make 
        make install 
       cd .. 
     done

Everything works fine up until the module fem, upon which make hangs with the following error

Code: Select all

gfortran -O   -I. -Ibinio -c iso_varying_string.f90
iso_varying_string.f90:66.21:

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

     module procedure op_concat_VS_VS
                     1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
iso_varying_string.f90:68.21:

     module procedure op_concat_CH_VS
                     1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
iso_varying_string.f90:69.21:

     module procedure op_concat_VS_CH
                     1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
iso_varying_string.f90:70.5:

  end interface operator(
     1
Error: Expecting END MODULE statement at (1)
iso_varying_string.f90:261.21:

  public :: operator(
                     1
Error: Syntax error in generic specification at (1)
iso_varying_string.f90:1898.42:

    ins_string = var_str(string(:start_-1)
                                          1
Error: Syntax error in argument list at (1)
iso_varying_string.f90:1952.45:

       rem_string = var_str(string(:start_-1)
                                             1
Error: Syntax error in argument list at (1)
iso_varying_string.f90:2130.45:

       rep_string = var_str(string(:start_-1)
                                             1
Error: Syntax error in argument list at (1)
make[2]: *** [iso_varying_string.o] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
The attached file is the config.log file relative to the fem package.
Can anyone help, please?

In another forum discussion (I will post the link as soon as I find it) a Mac user stated that gfortran doen't compile elmer properly, and that he succeded in doing so with g95. So I gave g95 a try, but the result is pretty much the same, aside from the fact that g95 doesn't find my LAPACK library...

Thanks to anyone who will try and help.
Andrea
Attachments
config.log
(74.82 KiB) Downloaded 297 times
campbead
Posts: 1
Joined: 13 Mar 2013, 03:44
Antispam: Yes

Re: Compiling on MacOsX 10.7.3 (Lion)

Post by campbead »

Andrea,

Did you ever get this fixed? I'm trying to install Elmer on my iMac running Mountain Lion. I'm getting this exact same error message at the same point in the installation. Any help would be great.

-Adam
chris
Posts: 1
Joined: 20 Mar 2013, 01:47
Antispam: Yes

Re: Compiling on MacOsX 10.7.3 (Lion)

Post by chris »

Hello,

I've encountered the same problem on my Mac (must be a Mac peculiarity):
Although I'm no Fortran programmer, it seems like preprocessing the .src files with the C preprocessor (cpp) leads to // in the original source being treated as C++ style line comments, and therefore be removed ... which in turn leads to partially garbled source files. It should probably be investigated why this problem appears on Macs ...

For me, setting

Code: Select all

FCPPFLAGS=-ansi
helped. If you need other FCPPFLAGS, just add -ansi to them. This sets cpp in ANSI C mode, which is devoid of // as a line comment prefix, and will result in proper sources being generated (some (or all?) .f90 files are made on the fly from .src files ...).
Please note that in my case the makefiles didn't automatically recreate the .f90 file, so in Andrea's case it will probably be necessary to remove the iso_varying_string.f90 file from fem/src; it will be recreated from iso_varying_string.src by cpp on the next make call.

Regards,
Christian
Post Reply