Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 348964 - fortran openmp checks in toolchain-funcs.eclass
Summary: fortran openmp checks in toolchain-funcs.eclass
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on: 320215
Blocks: 339465
  Show dependency tree
 
Reported: 2010-12-17 18:22 UTC by Sébastien Fabbro (RETIRED)
Modified: 2011-06-21 09:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
toolchain-funcs.diff (toolchain-funcs.diff,1.51 KB, text/plain)
2010-12-17 18:23 UTC, Sébastien Fabbro (RETIRED)
Details
toolchain-funcs.diff (toolchain-funcs.diff,1.48 KB, text/plain)
2010-12-17 21:35 UTC, Sébastien Fabbro (RETIRED)
Details
toolchain-funcs.diff (toolchain-funcs.diff,2.05 KB, text/plain)
2010-12-21 00:58 UTC, Sébastien Fabbro (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sébastien Fabbro (RETIRED) gentoo-dev 2010-12-17 18:22:38 UTC
the toolchain-funcs.eclass:
* tc-has-openmp will die if the selected compiler is not gcc (-fopenmp is gcc only)
* does not support fortran openmp

patch follows
Comment 1 Sébastien Fabbro (RETIRED) gentoo-dev 2010-12-17 18:23:02 UTC
Created attachment 257435 [details]
toolchain-funcs.diff
Comment 2 SpanKY gentoo-dev 2010-12-17 18:44:33 UTC
assuming file names are *gcc* isnt an improvement.  also, i'm not entirely sure you've tested this.  `$($(tc-getCC) "$@")` makes no sense.
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2010-12-17 21:35:29 UTC
Created attachment 257441 [details]
toolchain-funcs.diff

here is the proper patch. *gcc* is an improvement. only gcc compiles/links with option -fopenmp. checking every compiler openmp option is out of question, so at least dont do it if the user does not set CC/FC not as gcc/gfortran.
Comment 4 Justin Lecher (RETIRED) gentoo-dev 2010-12-18 12:49:44 UTC
How about not only reducing to gcc, but at least supporting icc/ifort?
So if icc or ifort is detected just returning true? This would reduce the checks in the ebuilds for only testing for openmp support if gcc/gfortran is used. And intel compilers are provided as an ebuild in the tree, so we should support them rudimentary. 
Comment 5 SpanKY gentoo-dev 2010-12-19 22:43:56 UTC
these issues were raised in the original bug 320215 already.  i'm not entirely sold that this code even existing is the right thing as it means people try to get us to start merging/maintaining a whole lot of compiler-specific crap.  which is exactly what you guys are trying to do right now.

then it gets worse ... once we start making these functions available, ebuild authors thinks its ok to use this crap instead of fixing the packages themselves to do the detection.

the only valid reason for this code to be merged in the first place was to give the user a nice message about trying to wrongly enable USE=openmp when they first havent set up their toolchain correctly.

which means the only logic i can think of that should be added is to have tc-has-openmp see if the compiler is gcc and if it isnt, just lie and say "openmp support exists".
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2010-12-20 07:32:40 UTC
(In reply to comment #5)
> which means the only logic i can think of that should be added is to have
> tc-has-openmp see if the compiler is gcc and if it isnt, just lie and say
> "openmp support exists".
> 

this would perfectly fit to what I want. Probably we should warn the user, that he/she should take care of the openmp support and that there is no support other then for gcc.
Comment 7 Justin Lecher (RETIRED) gentoo-dev 2010-12-20 19:51:59 UTC
Perhaps you want to add what Sébastien suggested earlier
http://bugs.gentoo.org/show_bug.cgi?id=320215#c11
Comment 8 SpanKY gentoo-dev 2010-12-20 20:53:50 UTC
no, i dont, as i said in comment #2.  we should not make filename assumptions.  those would break if the string is anywhere in $CHOST.  or if someone is using `cc` rather than `gcc`.
Comment 9 Sébastien Fabbro (RETIRED) gentoo-dev 2010-12-21 00:58:52 UTC
Created attachment 257649 [details]
toolchain-funcs.diff

would something in the lines of this patch work? what are the tests one could use to check the compiler is actually gcc?

i also dont particularly like the fact we are actually doing what the package should be doing, but we do have the openmp use flag enabled by default for a lot of profiles.
in any case the current tc-has-openmp is only useful in a few cases and should be changed or ditched
Comment 10 SpanKY gentoo-dev 2010-12-21 08:09:30 UTC
having USE=openmp on by default isnt a reason for expanding toolchain coverage.  if anything, it's a reason to drop these completely and rely only on USE=openmp.

do you actually need to test different frontends ?  isnt one "tc-has-openmp" sufficient ?

to prevent proliferation of these functions into packages, for now i'd inline the gcc test in tc-has-openmp.

you dont need the awk since the bash operator supports globbing:
[[ $(...) == gcc* ]]

although, to support pretty much all frontends, perhaps we grep for the FSF copyright line:
... --version 2>&1 | grep -qs 'Copyright .* Free Software Foundation, Inc'

hopefully no other toolchain is assigning its copyright to the FSF ...
Comment 11 Sébastien Fabbro (RETIRED) gentoo-dev 2010-12-21 15:26:01 UTC
(In reply to comment #10)
> having USE=openmp on by default isnt a reason for expanding toolchain coverage.
>  if anything, it's a reason to drop these completely and rely only on
> USE=openmp.

there are many science users using intel crap, external fortran compilers, or g77 while having gcc-4.4 selected. mostly for compatibility for other distros .
 
> do you actually need to test different frontends ?  isnt one "tc-has-openmp"
> sufficient ?

one frontend would be perfect if you find a way to make sure fortran and C do have enabled openmp. we would have to get rid of the small compilation tests and rely on a unique gcc version test?

> you dont need the awk since the bash operator supports globbing:
> [[ $(...) == gcc* ]]

you need either awk or something else as tail or grep. this is gcc -v, not gcc --version.
 
Comment 12 Justin Lecher (RETIRED) gentoo-dev 2011-06-21 09:19:07 UTC
Obsolete, now included in fortran-2.eclass