------- Comment #2 from fxcoudert at gcc dot gnu dot org 2006-07-24 19:29 ------- > All statically linked OpenMP Fortran programs cause segment fault when > executed > on i686-pc-linux-gnu platform.
To help making further progress on this PR, could you report the different glibc version numbers on which you experienced that bug? It works fine for me with RedHat's glibc-2.4-8 and Debian testing glibc 2.3. $ cat hello.f PROGRAM HELLO INTEGER NTHREADS, TID, OMP_GET_NUM_THREADS, + OMP_GET_THREAD_NUM C Fork a team of threads giving them their own copies of variables !$OMP PARALLEL PRIVATE(NTHREADS, TID) C Obtain thread number TID = OMP_GET_THREAD_NUM() PRINT *, 'Hello World from thread = ', TID C Only master thread does this IF (TID .EQ. 0) THEN NTHREADS = OMP_GET_NUM_THREADS() PRINT *, 'Number of threads = ', NTHREADS END IF C All threads join master thread and disband !$OMP END PARALLEL END quatramaran /tmp $ ./irun/bin/gfortran -static hello.f -fopenmp quatramaran /tmp $ file ./a.out ./a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, statically linked, for GNU/Linux 2.4.1, not stripped $ OMP_NUM_THREADS=4 ./a.out Hello World from thread = 0 Number of threads = 4 Hello World from thread = 1 Hello World from thread = 2 Hello World from thread = 3 -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28465