* [gentoo-commits] repo/proj/guru:master commit in: dev-util/fpm/
@ 2022-11-26 10:54 Florian Schmaus
0 siblings, 0 replies; 2+ messages in thread
From: Florian Schmaus @ 2022-11-26 10:54 UTC (permalink / raw
To: gentoo-commits
commit: 0e12c2266a4dd55e9df23841d9f430d69e5a2a05
Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Sat Nov 26 07:12:51 2022 +0000
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sat Nov 26 07:12:51 2022 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=0e12c226
dev-util/fpm: add USE=openmp to build targets in parallel where possible
Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
dev-util/fpm/fpm-0.7.0.ebuild | 24 +++++++++++++++++++++---
dev-util/fpm/metadata.xml | 3 +++
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/dev-util/fpm/fpm-0.7.0.ebuild b/dev-util/fpm/fpm-0.7.0.ebuild
index 2d1f62b6a..60e532ebc 100644
--- a/dev-util/fpm/fpm-0.7.0.ebuild
+++ b/dev-util/fpm/fpm-0.7.0.ebuild
@@ -19,7 +19,7 @@ SRC_URI="
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE="doc"
+IUSE="openmp doc"
RESTRICT="test"
CDEPEND="
@@ -48,9 +48,27 @@ PATCHES="${FILESDIR}/${P}_fpm_toml.patch"
BSDIR="build/bootstrap" # Bootstrap directory path
+pkg_pretend() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+set_omp_flag() {
+ OMPFLAG=""
+ if use openmp ; then
+ case $(tc-getFC) in
+ *gfortran* )
+ OMPFLAG="-fopenmp" ;;
+ * )
+ die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
+ esac
+ fi
+}
+
pkg_setup() {
+ [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
fortran-2_pkg_setup
python-any-r1_pkg_setup
+ set_omp_flag
}
src_prepare() {
@@ -70,7 +88,7 @@ src_compile() {
"$(tc-getFC)" -J "${BSDIR}" -o "${BSDIR}"/fpm "${BSDIR}/${P}.F90" || die
# Use the bootstrap binary to build the feature complete fpm version
- "${BSDIR}"/fpm build --compiler "$(tc-getFC)" --flag "${FCFLAGS} -I/usr/include/toml-f -I/usr/include/m_cli2" \
+ "${BSDIR}"/fpm build --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/m_cli2" \
--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
--archiver="$(tc-getAR)" --link-flag "${LDFLAGS}"
@@ -84,7 +102,7 @@ src_compile() {
src_install() {
# Set prefix and pass all used env flags to avoid recompiling with default values
"${BSDIR}"/fpm install --prefix "${ED}/usr" \
- --compiler "$(tc-getFC)" --flag "${FCFLAGS} -I/usr/include/toml-f -I/usr/include/m_cli2" \
+ --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/m_cli2" \
--c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
--cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
--archiver="$(tc-getAR)" --link-flag "${LDFLAGS}"
diff --git a/dev-util/fpm/metadata.xml b/dev-util/fpm/metadata.xml
index f45acb901..fac9ec00a 100644
--- a/dev-util/fpm/metadata.xml
+++ b/dev-util/fpm/metadata.xml
@@ -5,6 +5,9 @@
<email>torokhov-s-a@yandex.ru</email>
<name>Sergey Torokhov</name>
</maintainer>
+ <use>
+ <flag name="openmp">OpenMP support to build targets in parallel where possible</flag>
+ </use>
<upstream>
<remote-id type="github">fortran-lang/fpm</remote-id>
</upstream>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/proj/guru:master commit in: dev-util/fpm/
@ 2023-04-19 7:32 Florian Schmaus
0 siblings, 0 replies; 2+ messages in thread
From: Florian Schmaus @ 2023-04-19 7:32 UTC (permalink / raw
To: gentoo-commits
commit: cafd796f3a477cddfbcbf9c9bfb0e61702e9fb5b
Author: Sergey Torokhov <torokhov-s-a <AT> yandex <DOT> ru>
AuthorDate: Tue Apr 18 23:05:31 2023 +0000
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Tue Apr 18 23:57:48 2023 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=cafd796f
dev-util/fpm: replace repetitive build flags with BUILD_FLAGS array
Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
dev-util/fpm/fpm-0.7.0-r2.ebuild | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/dev-util/fpm/fpm-0.7.0-r2.ebuild b/dev-util/fpm/fpm-0.7.0-r2.ebuild
index fba8f63c4..38cc9186d 100644
--- a/dev-util/fpm/fpm-0.7.0-r2.ebuild
+++ b/dev-util/fpm/fpm-0.7.0-r2.ebuild
@@ -52,7 +52,7 @@ pkg_pretend() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}
-set_omp_flag() {
+set_build_flags() {
OMPFLAG=""
if use openmp ; then
case $(tc-getFC) in
@@ -62,13 +62,19 @@ set_omp_flag() {
die "Sorry, only GNU gfortran is currently supported in the ebuild" ;;
esac
fi
+
+ BUILD_FLAGS=( --compiler "$(tc-getFC)"
+ --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2"
+ --c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}"
+ --cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}"
+ --archiver "$(tc-getAR)" --link-flag "${LDFLAGS}" )
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
fortran-2_pkg_setup
python-any-r1_pkg_setup
- set_omp_flag
+ set_build_flags
}
src_prepare() {
@@ -88,10 +94,7 @@ src_compile() {
"$(tc-getFC)" -J "${BSDIR}" -o "${BSDIR}"/fpm "${BSDIR}/${P}.F90" || die
# Use the bootstrap binary to build the feature complete fpm version
- "${BSDIR}"/fpm build --verbose --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
- --c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
- --cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
- --archiver "$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+ "${BSDIR}"/fpm build --verbose "${BUILD_FLAGS[@]}" || die
if use doc ; then
einfo "Build API documentation:"
@@ -100,19 +103,12 @@ src_compile() {
}
src_test() {
- "${BSDIR}"/fpm test --verbose --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
- --c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
- --cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
- --archiver="$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+ "${BSDIR}"/fpm test --verbose "${BUILD_FLAGS[@]}" || die
}
src_install() {
# Set prefix and pass all used env flags to avoid recompiling with default values
- "${BSDIR}"/fpm install --prefix "${ED}/usr" \
- --compiler "$(tc-getFC)" --flag "${FCFLAGS} ${OMPFLAG} -I/usr/include/toml-f -I/usr/include/M_CLI2" \
- --c-compiler "$(tc-getCC)" --c-flag "${CFLAGS}" \
- --cxx-compiler "$(tc-getCXX)" --cxx-flag "${CXXFLAGS}" \
- --archiver="$(tc-getAR)" --link-flag "${LDFLAGS}" || die
+ "${BSDIR}"/fpm install --prefix "${ED}/usr" "${BUILD_FLAGS[@]}" || die
use doc && HTML_DOCS=( "${S}"/fpm-doc/. )
einstalldocs
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-19 7:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-26 10:54 [gentoo-commits] repo/proj/guru:master commit in: dev-util/fpm/ Florian Schmaus
-- strict thread matches above, loose matches on Subject: below --
2023-04-19 7:32 Florian Schmaus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox