Skip to contentSkip to conversation

beecrypt: enable OpenMP if Buildroot GCC supports it

PATCH New Stefan Fröberg 3 participants 8 messages Oct 12, 2012 – Oct 13, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

---
 package/beecrypt/beecrypt.mk |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
package/beecrypt/beecrypt.mk +6 -0
index d165aee..101d0df 100644
@@ -18,6 +18,12 @@ BEECRYPT_CONF_OPT = \
 		--without-java \
 		--without-python
 
+ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
+BEECRYPT_CONF_OPT += --enable-openmp
+else
+BEECRYPT_CONF_OPT += --disable-openmp
+endif
+
 ifeq ($(BR2_PACKAGE_ICU),y)
 # C++ support needs icu
 BEECRYPT_DEPENDENCIES += icu
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

Quoted 11 lines · Stefan Fr?berg
---
  package/beecrypt/beecrypt.mk |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
package/beecrypt/beecrypt.mk +0 -0
index d165aee..101d0df 100644

package/beecrypt/beecrypt.mk BEECRYPT_CONF_OPT = \ · line 26

Quoted 9 lines
package/beecrypt/beecrypt.mk +6 -0
@@ -18,6 +18,12 @@ BEECRYPT_CONF_OPT = \
  		--without-java \
  		--without-python
 
+ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
+BEECRYPT_CONF_OPT += --enable-openmp
+else
+BEECRYPT_CONF_OPT += --disable-openmp
+endif
+

This doesn't solve the underlying issue that -lgomp isn't included. In
addition, it would only enable openmp for internal toolchains, while it may be present for ct-ng or external toolchains as well. I think the automatic detection works well in this case.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#2 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

13.10.2012 12:29, Arnout Vandecappelle kirjoitti:

Quoted 15 lines · Stefan Fr?berg
Quoted 14 lines
---
  package/beecrypt/beecrypt.mk |    6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)
package/beecrypt/beecrypt.mk +0 -0
index d165aee..101d0df 100644
@@ -18,6 +18,12 @@ BEECRYPT_CONF_OPT = \
          --without-java \
          --without-python
 
Quoted 14 lines

package/beecrypt/beecrypt.mk BEECRYPT_CONF_OPT = \ · line 26

Quoted 6 lines
package/beecrypt/beecrypt.mk +6 -0
+ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
+BEECRYPT_CONF_OPT += --enable-openmp
+else
+BEECRYPT_CONF_OPT += --disable-openmp
+endif
+

This doesn't solve the underlying issue that -lgomp isn't included. In
addition, it would only enable openmp for internal toolchains, while it may
be present for ct-ng or external toolchains as well. I think the automatic
detection works well in this case.

Yeah, but how do you test the presence of OpenMP in case of external toolchain ?
Checking if /usr/lib/libgomp.so.* are present ?
Parsing the output of external toolchain "gcc -v" ? (there is not even configure switch for OpenMP in current gcc)

There are just too many variables and corner cases when it comes for testing various features of buildroot external toolchains.

And the automatic detection didn't work for Alexander and he was even using the internal toolchain
(if Im not wrong he uses ARM version of internal buildroot toolchain ?)

Best regards
Stefan

Quoted 2 lines

Regards,
Arnout

#3 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

Quoted 2 lines · Stefan Fr?berg

And the automatic detection didn't work for Alexander and he was even using the internal toolchain

The automatic detection did work (and it's part of autoconf, BTW). However,
beecrypt uses the OPENMP_CFLAGS given by autoconf to determine if OpenMP is available or not - but OPENMP_CFLAGS may be empty if OpenMP is already enabled without any CFLAGS. So it should instead check on ac_cv_prog_c_openmp.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

13.10.2012 16:29, Arnout Vandecappelle kirjoitti:

Quoted 12 lines · Stefan Fr?berg
Quoted 2 lines

And the automatic detection didn't work for Alexander and he was even using the internal toolchain

The automatic detection did work (and it's part of autoconf, BTW).
However,
beecrypt uses the OPENMP_CFLAGS given by autoconf to determine if OpenMP is
available or not - but *OPENMP_CFLAGS may be empty if OpenMP is already enabled
without any CFLAGS*. So it should instead check on ac_cv_prog_c_openmp.

Quoted 2 lines

Regards,
Arnout

Isn't that ac_cv_prog_c_openmp in configure file the same as AC_OPENMP macro ?

And from:
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html

/"If the current language is C, the macro //|AC_OPENMP|//sets the variable //|OPENMP_CFLAGS|//to the C compiler flags needed for supporting OpenMP. /*/|OPENMP_CFLAGS|/**/is set to empty if the compiler already supports OpenMP, if it has no way to activate OpenMP support, or if the user rejects OpenMP support by invoking ?/**/configure/**/? with the ?/**/--disable-openmp/*/*? option.* //"//
/
So from that:
1 ) If compiler *supports* OpenMP it set's OPENMP_CFLAGS to empty. No OpenMP for you.
2 ) If compiler has no clue how to activate OpenMP, it will set OPENMP_CFLAGS to empty. No OpenMP for you.
3 ) If user refuses to use OpenMP with --disable-openmp (like in that my patch) it will set OPENMP_CFLAGS to empty. No OpenMP for you.

Quick grepping of beecrypt-4.2.1 configure file shows that OPENMP_CFLAGS=ac_cv_prog_c_openmp

grep -n ac_cv_prog_c configure

configure:17706 OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;

This all sounds soooo messy.

Regards:
Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121013/343d40e4/attachment.html>

#5 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

2012/10/13 Stefan Fr?berg <[email protected]>

Quoted 57 lines

13.10.2012 16:29, Arnout Vandecappelle kirjoitti:

On 13/10/12 15:25, Stefan Fr?berg wrote:

And the automatic detection didn't work for Alexander and he was even using the internal toolchain

The automatic detection did work (and it's part of autoconf, BTW).
However,
beecrypt uses the OPENMP_CFLAGS given by autoconf to determine if OpenMP is
available or not - but *OPENMP_CFLAGS may be empty if OpenMP is already enabled
without any CFLAGS*. So it should instead check on ac_cv_prog_c_openmp.

Regards,
Arnout

Isn't that ac_cv_prog_c_openmp in configure file the same as AC_OPENMP macro ?

And from:

https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html

*"If the current language is C, the macro **AC_OPENMP** sets the variable **OPENMP_CFLAGS** to the C compiler flags needed for supporting OpenMP. ** OPENMP_CFLAGS** is set to empty if the compiler already supports OpenMP, if it has no way to activate OpenMP support, or if the user rejects OpenMP support by invoking ?**configure**? with the ?**--disable-openmp**? option. **"**
*
So from that:
1 ) If compiler *supports* OpenMP it set's OPENMP_CFLAGS to empty. No OpenMP for you.
2 ) If compiler has no clue how to activate OpenMP, it will set OPENMP_CFLAGS to empty. No OpenMP for you.
3 ) If user refuses to use OpenMP with --disable-openmp (like in that my patch) it will set OPENMP_CFLAGS to empty. No OpenMP for you.

Quick grepping of beecrypt-4.2.1 configure file shows that OPENMP_CFLAGS=ac_cv_prog_c_openmp

grep -n ac_cv_prog_c configure

configure:17706 OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;

This all sounds soooo messy.

Regards:
Stefan

Quoted 5 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Use my patch please

http://pastie.org/pastes/5052617/text
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121013/9e124293/attachment-0001.html>

#6 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

13.10.2012 17:54, Alexander Khryukin kirjoitti:

Quoted 66 lines

2012/10/13 Stefan Fr?berg <[email protected] <mailto:[email protected]>>

    13.10.2012 16:29, Arnout Vandecappelle kirjoitti:
Quoted 14 lines · Stefan Fr?berg
Quoted 3 lines

And the automatic detection didn't work for Alexander and he was even
using the internal toolchain

The automatic detection did work (and it's part of autoconf,
BTW). However,
beecrypt uses the OPENMP_CFLAGS given by autoconf to determine if OpenMP is
available or not - but *OPENMP_CFLAGS may be empty if OpenMP is already enabled
without any CFLAGS*. So it should instead check on ac_cv_prog_c_openmp.

Quoted 2 lines

Regards,
Arnout

Isn't that ac_cv_prog_c_openmp in configure file the same as AC_OPENMP macro ?

And from:
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html

/"If the current language is C, the macro //|AC_OPENMP|//sets the variable //|OPENMP_CFLAGS|//to the C compiler flags needed for supporting OpenMP. /*/|OPENMP_CFLAGS|/**/is set to empty if the compiler already supports OpenMP, if it has no way to activate OpenMP support, or if the user rejects OpenMP support by invoking ?/**/configure/**/? with the ?/**/--disable-openmp/*/*? option.* //"// /
So from that:
1 ) If compiler *supports* OpenMP it set's OPENMP_CFLAGS to empty. No OpenMP for you.
2 ) If compiler has no clue how to activate OpenMP, it will set OPENMP_CFLAGS to empty. No OpenMP for you.
3 ) If user refuses to use OpenMP with --disable-openmp (like in that my patch) it will set OPENMP_CFLAGS to empty. No OpenMP for you.

Quick grepping of beecrypt-4.2.1 configure file shows that OPENMP_CFLAGS=ac_cv_prog_c_openmp

grep -n ac_cv_prog_c configure

configure:17706 OPENMP_CFLAGS=$ac_cv_prog_c_openmp ;;

This all sounds soooo messy.

Regards:
Stefan

_______________________________________________
buildroot mailing list
buildroot at busybox.net <mailto:[email protected]>
http://lists.busybox.net/mailman/listinfo/buildroot

Quoted 4 lines

Use my patch please

http://pastie.org/pastes/5052617/text

I would but your patch forces the use of OpenMP in beecrypt, even in case when user's gcc does not have that for his/hers gcc. So it will end to link error for those users.

So the beecrypt should have handled the OpenMP support by autodetecting it (and you do have OpenMP in your gcc) in configure process. But it did not.
And Im curious to know why.

Maybe someone could show what that mysterious AC_OPENMP actually does ...

Regards
Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121013/bc6d4cbd/attachment.html>

#7 lore raw

PATCH 1/1 beecrypt: enable OpenMP if Buildroot GCC supports it

In reply to Alexander Khryukin
Quoted 3 lines · Alexander Khryukin

Use my patch please

http://pastie.org/pastes/5052617/text

That patch adds -lgomp unconditionally, even if OpenMP is not available.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F