public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Fortran-related libgomp failures in case of -fno-openmp
@ 2009-06-01 17:59 Gerald Pfeifer
  2009-06-01 18:14 ` Steve Kargl
  0 siblings, 1 reply; 4+ messages in thread
From: Gerald Pfeifer @ 2009-06-01 17:59 UTC (permalink / raw)
  To: fortran, gcc; +Cc: Janis Johnson

On i386-unknown-freebsd7.1 we see the following tests fail:

  FAIL: libgomp.fortran/condinc2.f  -O  (test for excess errors)
  WARNING: libgomp.fortran/condinc2.f  -O  compilation failed to produce executable
  FAIL: libgomp.fortran/condinc4.f90  -O  (test for excess errors)
  WARNING: libgomp.fortran/condinc4.f90  -O  compilation failed to produce executable
  FAIL: libgomp.fortran/omp_cond2.f  -O  (test for excess errors)
  WARNING: libgomp.fortran/omp_cond2.f  -O  compilation failed to produce executable
  FAIL: libgomp.fortran/omp_cond4.F90  -O  (test for excess errors)
  WARNING: libgomp.fortran/omp_cond4.F90  -O  compilation failed to produce executable

Looking into the log files, the pattern is the same in all cases:

  Excess errors:
  /pfeifer/OBJ-0531-2252/i386-unknown-freebsd7.1/./libgomp/.libs/libgomp.so:
  undefined reference to `pthread_create'

And what all of these three testcases have in common is

  { dg-options "-fno-openmp" }

So, it seems -fno-openmp in combination with an attempt to still link
libgomp.so leads to this failure.


Is it possible this is an issue with the testsuite rather than with
the code on FreeBSD?

Gerald

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran-related libgomp failures in case of -fno-openmp
  2009-06-01 17:59 Fortran-related libgomp failures in case of -fno-openmp Gerald Pfeifer
@ 2009-06-01 18:14 ` Steve Kargl
  2009-06-01 19:49   ` Janis Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Kargl @ 2009-06-01 18:14 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: fortran, gcc, Janis Johnson

On Mon, Jun 01, 2009 at 07:59:15PM +0200, Gerald Pfeifer wrote:
>   Excess errors:
>   /pfeifer/OBJ-0531-2252/i386-unknown-freebsd7.1/./libgomp/.libs/libgomp.so:
>   undefined reference to `pthread_create'
> 
> And what all of these three testcases have in common is
> 
>   { dg-options "-fno-openmp" }
> 
> So, it seems -fno-openmp in combination with an attempt to still link
> libgomp.so leads to this failure.
> 
> 
> Is it possible this is an issue with the testsuite rather than with
> the code on FreeBSD?
> 

The code is fine.  The problem is with the testsuite.  When
-fopenmp is used on FreeBSD, the additional option -pthread
is added to the list of options.

REMOVE:kargl[28] gfortran -v -fopenmp -c d.f90
Using built-in specs.
Target: i386-portbld-freebsd8.0
Configured with: ./..//gcc-4.3-20081120/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local --program-suffix=43 --libdir=/usr/local/lib/gcc-4.3.3 --with-gxx-include-dir=/usr/local/lib/gcc-4.3.3/include/c++/ --disable-rpath --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc43 --build=i386-portbld-freebsd8.0
Thread model: posix
gcc version 4.3.3 20081120 (prerelease) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-fopenmp' '-c' '-mtune=i386' '-pthread'

If someone uses -fno-openmp and still tries to link to libgomp,
then the -pthread option is missing and hence the test fail
because -lpthread is not included.  On FreeBSD, libgomp.so.1
does not show a dependency on libpthread, so the dynamic linker
can't automagically work.

REMOVE:kargl[30] ldd /usr/home/kargl/work/lib/libgomp.so.1
/usr/home/kargl/work/lib/libgomp.so.1:
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x481a8000)
        libc.so.7 => /lib/libc.so.7 (0x4808c000)

-- 
Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran-related libgomp failures in case of -fno-openmp
  2009-06-01 18:14 ` Steve Kargl
@ 2009-06-01 19:49   ` Janis Johnson
  2009-06-01 20:21     ` Steve Kargl
  0 siblings, 1 reply; 4+ messages in thread
From: Janis Johnson @ 2009-06-01 19:49 UTC (permalink / raw)
  To: Steve Kargl; +Cc: Gerald Pfeifer, fortran, gcc

On Mon, 2009-06-01 at 11:14 -0700, Steve Kargl wrote:
> On Mon, Jun 01, 2009 at 07:59:15PM +0200, Gerald Pfeifer wrote:
> >   Excess errors:
> >   /pfeifer/OBJ-0531-2252/i386-unknown-freebsd7.1/./libgomp/.libs/libgomp.so:
> >   undefined reference to `pthread_create'
> > 
> > And what all of these three testcases have in common is
> > 
> >   { dg-options "-fno-openmp" }
> > 
> > So, it seems -fno-openmp in combination with an attempt to still link
> > libgomp.so leads to this failure.
> > 
> > 
> > Is it possible this is an issue with the testsuite rather than with
> > the code on FreeBSD?
> > 
> 
> The code is fine.  The problem is with the testsuite.  When
> -fopenmp is used on FreeBSD, the additional option -pthread
> is added to the list of options.
> 
> REMOVE:kargl[28] gfortran -v -fopenmp -c d.f90
> Using built-in specs.
> Target: i386-portbld-freebsd8.0
> Configured with: ./..//gcc-4.3-20081120/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local --program-suffix=43 --libdir=/usr/local/lib/gcc-4.3.3 --with-gxx-include-dir=/usr/local/lib/gcc-4.3.3/include/c++/ --disable-rpath --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc43 --build=i386-portbld-freebsd8.0
> Thread model: posix
> gcc version 4.3.3 20081120 (prerelease) (GCC) 
> COLLECT_GCC_OPTIONS='-v' '-fopenmp' '-c' '-mtune=i386' '-pthread'
> 
> If someone uses -fno-openmp and still tries to link to libgomp,
> then the -pthread option is missing and hence the test fail
> because -lpthread is not included.  On FreeBSD, libgomp.so.1
> does not show a dependency on libpthread, so the dynamic linker
> can't automagically work.

Why doesn't libgomp.so.1 show a depedency on libpthread, isn't
that the bug?

> REMOVE:kargl[30] ldd /usr/home/kargl/work/lib/libgomp.so.1
> /usr/home/kargl/work/lib/libgomp.so.1:
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x481a8000)

Janis

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fortran-related libgomp failures in case of -fno-openmp
  2009-06-01 19:49   ` Janis Johnson
@ 2009-06-01 20:21     ` Steve Kargl
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Kargl @ 2009-06-01 20:21 UTC (permalink / raw)
  To: Janis Johnson; +Cc: Gerald Pfeifer, fortran, gcc

On Mon, Jun 01, 2009 at 12:49:42PM -0700, Janis Johnson wrote:
> On Mon, 2009-06-01 at 11:14 -0700, Steve Kargl wrote:
> > 
> > If someone uses -fno-openmp and still tries to link to libgomp,
> > then the -pthread option is missing and hence the test fail
> > because -lpthread is not included.  On FreeBSD, libgomp.so.1
> > does not show a dependency on libpthread, so the dynamic linker
> > can't automagically work.
> 
> Why doesn't libgomp.so.1 show a depedency on libpthread, isn't
> that the bug?
> 

I've never looked at how the authors of libgomp wrote the
build glue nor have I tried to decipher why one would specifically
suppress OpenMP with the -fno-openmp option yet still try to
link to its runtime library.  It does appear that libgomp/configure
looks to see if -pthread (or -lpthread) is required, but then it
may not use that result in actually building libgomp.so.1

-- 
Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-01 20:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-01 17:59 Fortran-related libgomp failures in case of -fno-openmp Gerald Pfeifer
2009-06-01 18:14 ` Steve Kargl
2009-06-01 19:49   ` Janis Johnson
2009-06-01 20:21     ` Steve Kargl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).