the command:

gfortran -static -fopenmp -o xomp xomp.f

works OK, but I when executing xomp it segfaults:

export OMP_NUM_THREADS=2
./xomp
Segmentation fault

if compiling with:
gfortran -static -fopenmp -o xomp xomp.f

everything is OK. This happens with any OpenMP program. Here is a simple
example:

      PROGRAM OMPSTATIC
!$OMP PARALLEL PRIVATE(n, p)
      p = omp_get_thread_num()
      n = OMP_GET_NUM_THREADS()
      write(*,*)'n,p=',n,p
!$OMP END PARALLEL
      END PROGRAM

I am using this:

[EMAIL PROTECTED] ~/proj/g03 $ ~/gcc/bin/gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /home/milan/gcc-src/gcc-4.3-20070119/configure
 --prefix=/home/milan/gcc
 --disable-altivec --enable-nls --without-included-gettext --with-system-zlib
 --disable-checking --disable-werror --enable-secureplt
 --disable-libunwind-exceptions --disable-multilib --disable-libmudflap
 --disable-libssp --disable-libgcj --enable-shared --enable-threads=posix
 --enable-bootstrap --enable-__cxa_atexit --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.3.0 20070119 (experimental)


-- 
           Summary: gfortran -fopenmp -static produces bad executable
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: milan at cmm dot ki dot si


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30613

Reply via email to