Bug 25938

Summary: [4.2 regression] libgomp installs header files in version and target independent location
Product: gcc Reporter: Gerald Pfeifer <gerald>
Component: libgompAssignee: Joseph S. Myers <jsm28>
Status: RESOLVED FIXED    
Severity: normal CC: dnovillo, gcc-bugs, jakub, pinskia, rth
Priority: P1    
Version: 4.2.0   
Target Milestone: 4.2.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2006-08-25 21:47:05
Bug Depends on:    
Bug Blocks: 346    

Description Gerald Pfeifer 2006-01-24 04:26:40 UTC
libgomp installs the following headers files into $PREFIX/include:

  omp.h
  omp_lib.f90
  omp_lib.h

(if Fortran is not build, more if Fortran is built).

This does not allow one to install several versions of GCC into the
same prefix using --program-suffix.

Note that the C++ headers, for example, handle this very nicely, by
using $PREFIX/include/c++/4.2.0/.

This is a regression introduced with the addition of libgomp.
Comment 1 Andrew Pinski 2006-01-24 04:29:00 UTC
Confirmed.
Comment 2 Jakub Jelinek 2006-01-24 08:34:45 UTC
I'm using in the Fedora Core gcc following patch:
2005-11-24  Jakub Jelinek  <jakub@redhat.com>

        * lang-specs.h: Unless -nostdinc, append -I .../finclude to f951
        command line options.

--- gcc/fortran/lang-specs.h.jj 2005-11-24 13:24:32.000000000 +0100
+++ gcc/fortran/lang-specs.h    2005-11-24 19:13:29.000000000 +0100
@@ -15,7 +15,7 @@ This file is licensed under the GPL.  */
       %{E|M|MM:%(cpp_debug_options)}\
       %{!M:%{!MM:%{!E: -o %|.f |\n\
     f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\
-      %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+      %{!nostdinc:-I finclude%s} %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
 {".F90", "@f95-cpp-input", 0, 0, 0},
 {".F95", "@f95-cpp-input", 0, 0, 0},
 {"@f95-cpp-input",
@@ -23,13 +23,13 @@ This file is licensed under the GPL.  */
       %{E|M|MM:%(cpp_debug_options)}\
       %{!M:%{!MM:%{!E: -o %|.f95 |\n\
     f951 %|.f95 %(cc1_options) %{J*} %{I*}\
-      %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+      %{!nostdinc:-I finclude%s} %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
 {".f90", "@f95", 0, 0, 0},
 {".f95", "@f95", 0, 0, 0},
 {"@f95", "%{!E:f951 %i %(cc1_options) %{J*} %{I*}\
-         %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
+         %{!nostdinc:-I finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
 {".f",   "@f77", 0, 0, 0},
 {".for", "@f77", 0, 0, 0},
 {".FOR", "@f77", 0, 0, 0},
 {"@f77", "%{!E:f951 %i %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\
-         %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},
+         %{!nostdinc:-I finclude%s} %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0},

and move the files manually.
When Fortran OpenMP support is merged in, I'll take care of this as well.
Comment 3 Andrew Pinski 2006-02-02 23:45:31 UTC
Can you instead fix this now as this is a regression and really regressions should not be left to the last minute any more.
Comment 4 Jakub Jelinek 2006-02-15 07:46:44 UTC
Subject: Bug 25938

Author: jakub
Date: Wed Feb 15 07:46:39 2006
New Revision: 111018

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111018
Log:
	PR libgomp/25938
	PR libgomp/25984
fortran/
	* Make-lang.in (install-finclude-dir): New goal.
	(fortran.install-common): Depend on install-finclude-dir.
	* lang-specs.h: If not -nostdinc, add -I finclude.
libgomp/
	* Makefile.am (fincludedir): New variable.
	(nodist_include_HEADERS): Remove Fortran files.
	(nodist_finclude_HEADERS): New variable.
	* Makefile.in: Regenerated.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/Make-lang.in
    trunk/gcc/fortran/lang-specs.h
    trunk/libgomp/ChangeLog
    trunk/libgomp/Makefile.am
    trunk/libgomp/Makefile.in

Comment 5 Andrew Pinski 2006-02-15 14:50:46 UTC
Only the fortran part of this bug is fixed.
omp.h is still broken.

Most likely what should be done is install omp.h inside the include directory where libobjc installs theirs.
Comment 6 Gerald Pfeifer 2006-02-21 21:40:24 UTC
Thanks, Jakub!

I can confirm Andrew's findings: the Fortran include files are now fixed
indeed.

include/gomp.h is the only one remaining now!
Comment 7 Gerald Pfeifer 2006-04-12 20:01:22 UTC
RTH, Jakub, would you mind having a look at this regression?
Comment 8 Mark Mitchell 2006-06-04 17:26:15 UTC
This is a show-stopper; an installation problem like this would be embarassing.
Comment 9 Steven Bosscher 2006-07-23 18:05:40 UTC
Jakub, ping.
Comment 10 Joseph S. Myers 2006-08-25 21:47:05 UTC
Working on a fix.
Comment 11 Joseph S. Myers 2006-08-26 18:30:53 UTC
Subject: Bug 25938

Author: jsm28
Date: Sat Aug 26 18:30:44 2006
New Revision: 116475

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116475
Log:
	PR libgomp/25938
	* Makefile.am (libsubincludedir): New.
	(nodist_include_HEADERS): Rename to nodist_libsubinclude_HEADERS.
	* Makefile.in: Regenerate.

Modified:
    trunk/libgomp/ChangeLog
    trunk/libgomp/Makefile.am
    trunk/libgomp/Makefile.in

Comment 12 Andrew Pinski 2006-08-26 20:46:25 UTC
Fixed.