From ripley at stats.ox.ac.uk  Sat Jun  8 15:54:42 2013
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 08 Jun 2013 14:54:42 +0100
Subject: [Rd] Compile error with gfortran-4.6
In-Reply-To: <1370699019.63835.YahooMailNeo@web120803.mail.ne1.yahoo.com>
References: <1370699019.63835.YahooMailNeo@web120803.mail.ne1.yahoo.com>
Message-ID: <51B337A2.3080900@stats.ox.ac.uk>

This is not gfortran-help, but note that you are not doing this 
correctly.  See 'Writing R Extensions' ?1.2.1.  The linking step needs a 
flag too.

Beyond that, you failed to tell us your OS, and in fact there are no 
such versions of gfortran (4.6.0 != 4.6).  The posting guide does ask 
you to be accurate in your version numbers (and not to send HTML).

On 08/06/2013 14:43, Fabio Mathias Corr?a wrote:
> Dears,
>
> I am writing a code in Fortran using OpenMP directives.
>
> When compiling the code in gfortran 4.4 does not occur any problem.
>
> When compiling the code in gfortran 4.6, an error message appears.
>
> In other compilers the error does not occur.
>
>
> A small example.
>
>
> ## Code in Fortran

You declare this to be Fortran 90.
>
>         subroutine hello()
>         implicit none
>         integer :: nthreads, tid
>         integer :: omp_get_num_threads, omp_get_thread_num
>         integer :: omp_get_max_threads, omp_set_num_threads
>
>         print *, 'M?ximo de threads', omp_get_max_threads()
>
>         !$omp parallel
>         tid = omp_get_thread_num()
>         print *, 'Hello World from thread = ', tid
>         print *, 'Number of threads =', omp_get_thread_num()
>         !$omp end parallel
>         end subroutine hello
>
>
> ### Compiling and testing
>
> system("R CMD COMPILE hello.f90 FCFLAGS=-fopenmp")
> system("R CMD SHLIB hello.o")
>
> dyn.load("hello.so")
>
> .Fortran("hello")
>
> ### Error message
>
> /home/fmcron/Documentos/Fortran/OpenMP/exemplos/hello.so: undefined symbol: _gfortran_transfer_character_write
>
>
>
> Thanks
>
>
>          F?bio Mathias Corr?a
>
>
>     Universidade Estadual de Santa Cruz
> Departamento de Ci?ncias Exatas e da Terra - DCET
>
>
> Campus Soane Nazar? de Andrade, km 16 Rodovia Ilh?us-Itabuna
> CEP 45662-900. Ilh?us-Bahia
> 	[[alternative HTML version deleted]]
>
>
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] Compile error with gfortran-4.6
Prof Brian Ripley