Skip to content

Problem with gfortran-4.6

1 message · Fabio Mathias Corrêa

#
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

? ? ? ?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


Tel.: 73-3680-5076?