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
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.
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.
Created attachment 201022 [details, diff] patch to mathgl-1.8.1.ebuild to include openmp useflag.
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).
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.
Created attachment 204914 [details, diff] patch to add the openmp useflag to the ebuild
Created attachment 204915 [details] openmp m4 macro
Created attachment 204917 [details, diff] patch configure.ac and mgl/Makefile.am to add openmp configurability
Aaaaa further note I have no openmp enabled machine at the moment, so it needs testing with one.
No omp support anymore