Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 280642

Summary: sci-libs/mathgl-1.8.1 request gcc to have been build with openmp
Product: Gentoo Linux Reporter: François Bissey <frp.bissey>
Component: New packagesAssignee: Andrey Grozin <grozin>
Status: RESOLVED WONTFIX    
Severity: normal CC: sci
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Andrey Grozin patch to correct the behavior
better patch to enable autoconfiguration of openmp rather than just disabling it.
patch to mathgl-1.8.1.ebuild to include openmp useflag.
patch to add the openmp useflag to the ebuild
openmp m4 macro
patch configure.ac and mgl/Makefile.am to add openmp configurability

Description François Bissey 2009-08-07 11:12:55 UTC
The mathgl makefile hardcode the use of -openmp -lgomp in its makefile
causing the compilation to fails on systems where gcc has been built without
this features (because I have an antique system with only one CPU).
I already reported the problem to the maintainer previously and a patch
is ready to remove the compulsory behavior but was never applied to the tree.
I just stumbled on the issue again.

Reproducible: Always

Steps to Reproduce:
1. USE="-openmp" emerge -v gcc
2. emerge -v mathgl
3. Failure
Comment 1 François Bissey 2009-08-07 11:14:57 UTC
Created attachment 200486 [details, diff]
Andrey Grozin patch to correct the behavior

This is a patch sent to me by the maintainer of mathgl to correct the problem
a few month back.
Comment 2 François Bissey 2009-08-12 12:19:05 UTC
Created attachment 201021 [details, diff]
better patch to enable autoconfiguration of openmp rather than just disabling it.

Patch configure.ac and mgl/Makefile.am - openmp can now be enabled
with --enable-openmp. 
It has to be tested on an openmp enabled machine.
Patched ebuild to follow shortly.
Comment 3 François Bissey 2009-08-12 12:20:02 UTC
Created attachment 201022 [details, diff]
patch to mathgl-1.8.1.ebuild to include openmp useflag.
Comment 4 Sébastien Fabbro (RETIRED) gentoo-dev 2009-08-26 06:55:26 UTC
The patch should not be gcc specific. The user might want to build with another openmp able compiler. See fftw package for an example (or many other openmp packages).
Comment 5 François Bissey 2009-09-22 12:19:20 UTC
OK, after failing miserably at patching 1.8.1 properly as suggested
by bicatali, I managed to do something for version 1.9.
The upgrade to libtool 2.2 helped as it showed why the previous attempt had
failed. So a bit of summary:
I looked at fftw as suggested and used the m4 macro shipped with it as patched 
in the fftw ebuild. I put it in config rather than a m4 folder as it would
conflict with an option in Makefile.am (thanks libtool 2.2).
I followed flameeyes autotool mythbusters guideline to add an openmp configure
option "on" by default so that it would cause minimum disruption for upstream.
I included a detailed compiler check in the ebuild as well.
Patch to follow. 
Comment 6 François Bissey 2009-09-22 12:20:57 UTC
Created attachment 204914 [details, diff]
patch to add the openmp useflag to the ebuild
Comment 7 François Bissey 2009-09-22 12:21:32 UTC
Created attachment 204915 [details]
openmp m4 macro
Comment 8 François Bissey 2009-09-22 12:22:20 UTC
Created attachment 204917 [details, diff]
patch configure.ac and mgl/Makefile.am to add openmp configurability
Comment 9 François Bissey 2009-09-22 12:23:23 UTC
Aaaaa further note I have no openmp enabled machine at the moment, so
it needs testing with one.
Comment 10 Justin Lecher (RETIRED) gentoo-dev 2010-06-30 22:18:50 UTC
No omp support anymore