Error compiling Elmer on Solaris 10 (SPARC)

Discussion about building and installing Elmer
Post Reply
acicuta
Posts: 6
Joined: 13 Feb 2015, 11:35
Antispam: Yes

Error compiling Elmer on Solaris 10 (SPARC)

Post by acicuta » 24 Feb 2015, 22:30

Hi,

I am trying to compile Elmer on a Sun Blade 2500 with the compilers from Solaris Studio 12.4

I have been able to run cmake (which I installed from OpenCSW). It appears to run correctly.

However, when I run make the compilations stops at 73% ([ 73%] Building Fortran object fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o) with the following errors:

Code: Select all

            PROCEDURE(ElmerRealArrFn), POINTER :: pptr
                                                  ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 392, Column = 51: ERROR: "PPTR" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(ElmerSolverFn), POINTER :: pptr
                                                 ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 418, Column = 50: ERROR: "PPTR" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(ElmerSimulationFn), POINTER :: pptr
                                                     ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 474, Column = 54: ERROR: "PPTR" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(ElmerLocalFn), POINTER :: pptr
                                                ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 532, Column = 49: ERROR: "PPTR" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(ElmerLocalAssemblyFn), POINTER :: pptr
                                                        ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 566, Column = 57: ERROR: "PPTR" is typed CHARACTER*(*); it must be a dummy argument or named constant.

                SUBROUTINE itercall_c(fptr, x, b, ipar, dpar, work, &
                                            ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 647, Column = 45: WARNING: Procedure "ITERCALL_C" is defined at line 617 (/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90).  The actual argument type does not agree with the type of dummy argument "X".
                                               ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 647, Column = 48: WARNING: Procedure "ITERCALL_C" is defined at line 617 (/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90).  The actual argument type does not agree with the type of dummy argument "B".

            PROCEDURE(mv_iface_d), POINTER :: mvfun
                                              ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 679, Column = 47: ERROR: "MVFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(pc_iface_d), POINTER :: pcondfun, pcondrfun
                                              ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 680, Column = 47: ERROR: "PCONDFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.
                                                        ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 680, Column = 57: ERROR: "PCONDRFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(huti_itercall_d), POINTER :: iterfun
                                                   ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 684, Column = 52: ERROR: "ITERFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            dotfun => NULL()
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 690, Column = 1: ERROR: A procedure expression or procedure pointer is expected

            PROCEDURE(mv_iface_z), POINTER :: mvfun
                                              ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 735, Column = 47: ERROR: "MVFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(pc_iface_z), POINTER :: pcondfun, pcondrfun
                                              ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 736, Column = 47: ERROR: "PCONDFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.
                                                        ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 736, Column = 57: ERROR: "PCONDRFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

            PROCEDURE(huti_itercall_z), POINTER :: iterfun
                                                   ^
"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 740, Column = 52: ERROR: "ITERFUN" is typed CHARACTER*(*); it must be a dummy argument or named constant.

"/home/alex/tank/storage/elmer/elmerfem-devel/fem/src/LoadMod.F90", Line = 690, Column = 1: INTERNAL: PRINTMSG received a zero line number.  The message number to print is 2456.  The column number is 0.
gmake[3]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o] Error 1
gmake[2]: *** [fem/src/CMakeFiles/elmersolver.dir/LoadMod.F90.o.provides] Error 2
gmake[1]: *** [fem/src/CMakeFiles/elmersolver.dir/all] Error 2
gmake: *** [all] Error 2
Unfortunately I don't know fortran so I don't know how to fix this error.

Do you have any suggestion?

A.Cicuta

annier
Posts: 1113
Joined: 27 Aug 2013, 13:51
Antispam: Yes

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by annier » 24 Feb 2015, 23:05

Hi Alex Cicuta,
-What is your fortran version?

Code: Select all

$gfortran -v
Elmer uses gfortran of versions 4.8 or later.

-If gfortran is not installed, you have to install in your system
For example in ubuntu, gfortran is installed using:

Code: Select all

$sudo apt-get install gfortran

or,
  • 1.Open Ubuntu Software Center
    2.Type gfortran
    3.Click install for gfortran
    4.gfortran will be installed in Ubuntu
And, for CentOS, gfortran is installed using:

Code: Select all

$yum install gfortran

-If doing above steps helps in complete installation of Elmer, the installation is successful. If other type of fortran is also installed in your system and gfortran is bypassed; measures should be taken for calling gfortran. Elmer installation in linux with cmake has been made compatible with gfortran. In order to make sure that gfortran is called on during elmer compilation using cmake command, you may need to perform this command:

Code: Select all

$export FC=gfortran 
-The following threads can be useful for you:
1. Elmer Installation in CentOS
2. Elmer Installation in Ubuntu

The elmer installation in Red Hat,RHEL,and Fedora systems are related to CentOS system and that for Debian system is related to Ubuntu system.


Yours
Anil Kunwar
Anil Kunwar
Department of Materials Engineering, KU Leuven, Belgium

acicuta
Posts: 6
Joined: 13 Feb 2015, 11:35
Antispam: Yes

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by acicuta » 24 Feb 2015, 23:53

Thank you for your answer.

As I stated, I am currently using the Solaris Studio 12.4 compilers, not the GNU toolchain.

I have successfully compiled a previous version of Elmer, without using cmake and using the GNU toolchain (from OpenCSW). The process had been a bit difficult because I wanted to link against the Sun Performance Library.

I was hoping that with cmake I would have been able to use the Solaris Studio 12.4 compilers.

Is it absolutely necessary to use gfortran?

A. Cicuta

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

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by raback » 25 Feb 2015, 14:38

Hi, You can of course use any fortran compiler which has sufficient capabilities. I think that the error complaints are used to lack of ISO C bindings. They are part of Fortran 2003 standard and available in gfortran since version 4.8 or so. -Peter

acicuta
Posts: 6
Joined: 13 Feb 2015, 11:35
Antispam: Yes

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by acicuta » 26 Feb 2015, 16:22

Thank you for your answer.

According to the solaris studio 12.4 user's guide, the fortran compiler that I am using has a module called ISO_C_BINDING and the attribute BIND(C) to have interoperability with C.

Also, according to another source, it seems that the Solaris Studio fortran compiler (version 8.7) should be able to interoperate with C as gfortran (version 4.8).

I will have to look better into this as the official documentation say that are included only "the majority of Fortran 2003 features".

I noticed how similar looked the RECURSIVE FUNCTION and the RECURSIVE SUBROUTINE in LoadMod.F90 but I don't know fortran so I don't understand the differences. However it seems that the compiler throws an error only with RECURSIVE SUBROUTINE.

A. Cicuta

acicuta
Posts: 6
Joined: 13 Feb 2015, 11:35
Antispam: Yes

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by acicuta » 25 Mar 2015, 23:12

I'm happy to report that I have been able to compile elmer with gcc version 4.9.2 from OpenCSW and link it against the Sun Performance Library.

The process wasn't straightforward but everything seems to work fine. Elmer fails more tests that I think it should in a similar way as reported here viewtopic.php?f=2&t=3823&sid=5ea56608c8 ... bcc6b2c649 but the result of the simulations I ran are in accordance with the results obtained on other machines.

I will try to understand the reason why the solaris studio 12.4 compiler wasn't able to compile it.

A.Cicuta

acicuta
Posts: 6
Joined: 13 Feb 2015, 11:35
Antispam: Yes

Re: Error compiling Elmer on Solaris 10 (SPARC)

Post by acicuta » 29 May 2015, 19:40

After downloading the source code of elmer version 8 revision 5016809 i think I finally understand why the Solaris Studio 12.4 isn't able to compile elmer.

During the configuration, cmake gave me an error earlier than in my previous attempts: "Fortran compiler does not seem to support the PROCEDURE statement."

It seems from some posts from the OpenMPI mailing list that the Solaris Studio fortran compiler doesn't implement TS 29113 subclause 8.1 which I think that means that I will have to wait for Oracle to fix the compiler before trying again to use it to compile elmer.

A.Cicuta

Post Reply