diff mbox

[libgomp] libgomp.fortran/fortran.exp - add -fintrinsic-modules-path ${blddir}

Message ID 50D1DF81.1090300@net-b.de
State New
Headers show

Commit Message

Tobias Burnus Dec. 19, 2012, 3:38 p.m. UTC
The attached patch adds
    -fintrinsic-modules-path ${blddir}
otherwise, the compiler might have trouble finding the libraries using 
"use, INTRINSIC :: omp_lib". Without "intrinsic" it searches the "-I" 
directories.

(The compiler supports multiple -fintrinsic-modules-path, cf. 
gfc_add_intrinsic_modules_path; however, the only physically existing 
intrinsic .mod files are those of libgomp. ISO_C_binding and 
ISO_Fortran_env do only virtually exist in the compiler.)

Tested on x86-64-gnu-linux.
OK?

Tobias

Comments

Jakub Jelinek Dec. 19, 2012, 3:46 p.m. UTC | #1
On Wed, Dec 19, 2012 at 04:38:41PM +0100, Tobias Burnus wrote:
> 2012-12-19  Tobias Burnus  <burnus@net-b.de>
> 
> 	* testsuite/libgomp.fortran/fortran.exp: Set
> 	-fintrinsic-modules-path.

Okay.

	Jakub
Thomas Schwinge July 2, 2014, 5:57 p.m. UTC | #2
Hi!

Reopening this oldie:

On Wed, 19 Dec 2012 16:38:41 +0100, Tobias Burnus <burnus@net-b.de> wrote:
> The attached patch adds
>     -fintrinsic-modules-path ${blddir}
> otherwise, the compiler might have trouble finding the libraries using 
> "use, INTRINSIC :: omp_lib". Without "intrinsic" it searches the "-I" 
> directories.
> 
> (The compiler supports multiple -fintrinsic-modules-path, cf. 
> gfc_add_intrinsic_modules_path; however, the only physically existing 
> intrinsic .mod files are those of libgomp. ISO_C_binding and 
> ISO_Fortran_env do only virtually exist in the compiler.)
> 
> Tested on x86-64-gnu-linux.

> 2012-12-19  Tobias Burnus  <burnus@net-b.de>
> 
> 	* testsuite/libgomp.fortran/fortran.exp: Set
> 	-fintrinsic-modules-path.
> 
> diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
> index 5fa42f4..68440d18 100644
> --- a/libgomp/testsuite/libgomp.fortran/fortran.exp
> +++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
> @@ -14,6 +14,7 @@ set quadmath_library_path "../libquadmath/.libs"
>  dg-init
>  
>  if { $blddir != "" } {
> +    lappend ALWAYS_CFLAGS "additional_flags=-fintrinsic-modules-path ${blddir}"
>      # Look for a static libgfortran first.
>      if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
>          set lang_test_file "${lang_library_path}/libgfortran.a"

Doing build-tree testing, this results in several test becoming
UNSUPPORTED (instead of PASS), in particular those that do things like
»dg-require-effective-target tls_runtime« or »dg-do run { target
vect_simd_clones }«, and we then run into:

    spawn [...]/build/gcc/xgcc -B[...]/build/gcc/ -B[...]/build/x86_64-unknown-linux-gnu/./libgomp/ -B[...]/build/x86_64-unknown-linux-gnu/./libgomp/.libs -I[...]/build/x86_64-unknown-linux-gnu/./libgomp -I[...]/source/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -fopenmp -fintrinsic-modules-path=[...]/build/x86_64-unknown-linux-gnu/./libgomp -B[...]/build/x86_64-unknown-linux-gnu/./libgomp/../libquadmath/.libs/ -O2 -mavx -B[...]/build/x86_64-unknown-linux-gnu/./libgomp/../libgfortran/.libs -c -o avx32186.o avx32186.c
    cc1: warning: command line option '-fintrinsic-modules-path=[...]/build/x86_64-unknown-linux-gnu/./libgomp' is valid for Fortran but not for C
    output is:
    cc1: warning: command line option '-fintrinsic-modules-path=[...]/build/x86_64-unknown-linux-gnu/./libgomp' is valid for Fortran but not for C
    
    UNSUPPORTED: libgomp.fortran/declare-simd-1.f90
    UNSUPPORTED: libgomp.fortran/declare-simd-2.f90

Is there any obvious cure for this?  (Obviously, reverting that change
isn't the solution, because then libgomp.fortran/use_intrinsic_1.f90
FAILs.)


I think this issue also is part of what has been reported in
<http://gcc.gnu.org/PR55884>, but not yet properly addressed.


Grüße,
 Thomas
diff mbox

Patch

2012-12-19  Tobias Burnus  <burnus@net-b.de>

	* testsuite/libgomp.fortran/fortran.exp: Set
	-fintrinsic-modules-path.

diff --git a/libgomp/testsuite/libgomp.fortran/fortran.exp b/libgomp/testsuite/libgomp.fortran/fortran.exp
index 5fa42f4..68440d18 100644
--- a/libgomp/testsuite/libgomp.fortran/fortran.exp
+++ b/libgomp/testsuite/libgomp.fortran/fortran.exp
@@ -14,6 +14,7 @@  set quadmath_library_path "../libquadmath/.libs"
 dg-init
 
 if { $blddir != "" } {
+    lappend ALWAYS_CFLAGS "additional_flags=-fintrinsic-modules-path ${blddir}"
     # Look for a static libgfortran first.
     if [file exists "${blddir}/${lang_library_path}/libgfortran.a"] {
         set lang_test_file "${lang_library_path}/libgfortran.a"