Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
@ 2012-10-12 19:54 Stefan Fröberg
  2012-10-13  9:29 ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Fröberg @ 2012-10-12 19:54 UTC (permalink / raw)
  To: buildroot


Signed-off-by: Stefan Fr?berg <stefan.froberg@petroprogram.com>
---
 package/beecrypt/beecrypt.mk |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/package/beecrypt/beecrypt.mk b/package/beecrypt/beecrypt.mk
index d165aee..101d0df 100644
--- a/package/beecrypt/beecrypt.mk
+++ b/package/beecrypt/beecrypt.mk
@@ -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
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-12 19:54 [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it Stefan Fröberg
@ 2012-10-13  9:29 ` Arnout Vandecappelle
  2012-10-13 13:25   ` Stefan Fröberg
  0 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2012-10-13  9:29 UTC (permalink / raw)
  To: buildroot

On 12/10/12 21:54, Stefan Fr?berg wrote:
>
> Signed-off-by: Stefan Fr?berg<stefan.froberg@petroprogram.com>
> ---
>   package/beecrypt/beecrypt.mk |    6 ++++++
>   1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/package/beecrypt/beecrypt.mk b/package/beecrypt/beecrypt.mk
> index d165aee..101d0df 100644
> --- a/package/beecrypt/beecrypt.mk
> +++ b/package/beecrypt/beecrypt.mk
> @@ -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
-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13  9:29 ` Arnout Vandecappelle
@ 2012-10-13 13:25   ` Stefan Fröberg
  2012-10-13 13:29     ` Arnout Vandecappelle
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Fröberg @ 2012-10-13 13:25 UTC (permalink / raw)
  To: buildroot

13.10.2012 12:29, Arnout Vandecappelle kirjoitti:
> On 12/10/12 21:54, Stefan Fr?berg wrote:
>>
>> Signed-off-by: Stefan Fr?berg<stefan.froberg@petroprogram.com>
>> ---
>>   package/beecrypt/beecrypt.mk |    6 ++++++
>>   1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/package/beecrypt/beecrypt.mk b/package/beecrypt/beecrypt.mk
>> index d165aee..101d0df 100644
>> --- a/package/beecrypt/beecrypt.mk
>> +++ b/package/beecrypt/beecrypt.mk
>> @@ -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.
>

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
>  Regards,
>  Arnout

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13 13:25   ` Stefan Fröberg
@ 2012-10-13 13:29     ` Arnout Vandecappelle
  2012-10-13 14:07       ` Stefan Fröberg
  0 siblings, 1 reply; 8+ messages in thread
From: Arnout Vandecappelle @ 2012-10-13 13:29 UTC (permalink / raw)
  To: buildroot

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
-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13 13:29     ` Arnout Vandecappelle
@ 2012-10-13 14:07       ` Stefan Fröberg
  2012-10-13 14:54         ` Alexander Khryukin
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Fröberg @ 2012-10-13 14:07 UTC (permalink / raw)
  To: buildroot

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


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13 14:07       ` Stefan Fröberg
@ 2012-10-13 14:54         ` Alexander Khryukin
  2012-10-13 15:07           ` Stefan Fröberg
  2012-10-13 20:56           ` Arnout Vandecappelle
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Khryukin @ 2012-10-13 14:54 UTC (permalink / raw)
  To: buildroot

2012/10/13 Stefan Fr?berg <stefan.froberg@petroprogram.com>

>  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
>
>
>
> _______________________________________________
> 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>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13 14:54         ` Alexander Khryukin
@ 2012-10-13 15:07           ` Stefan Fröberg
  2012-10-13 20:56           ` Arnout Vandecappelle
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Fröberg @ 2012-10-13 15:07 UTC (permalink / raw)
  To: buildroot

13.10.2012 17:54, Alexander Khryukin kirjoitti:
>
>
> 2012/10/13 Stefan Fr?berg <stefan.froberg@petroprogram.com
> <mailto:stefan.froberg@petroprogram.com>>
>
>     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
>
>
>
>     _______________________________________________
>     buildroot mailing list
>     buildroot at busybox.net <mailto:buildroot@busybox.net>
>     http://lists.busybox.net/mailman/listinfo/buildroot
>
>
>
> 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>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it
  2012-10-13 14:54         ` Alexander Khryukin
  2012-10-13 15:07           ` Stefan Fröberg
@ 2012-10-13 20:56           ` Arnout Vandecappelle
  1 sibling, 0 replies; 8+ messages in thread
From: Arnout Vandecappelle @ 2012-10-13 20:56 UTC (permalink / raw)
  To: buildroot

On 13/10/12 16:54, Alexander Khryukin wrote:
> Use my patch please
>
> http://pastie.org/pastes/5052617/text

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

  Regards,
  Arnout
-- 
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-13 20:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 19:54 [Buildroot] [PATCH] beecrypt: enable OpenMP if Buildroot GCC supports it Stefan Fröberg
2012-10-13  9:29 ` Arnout Vandecappelle
2012-10-13 13:25   ` Stefan Fröberg
2012-10-13 13:29     ` Arnout Vandecappelle
2012-10-13 14:07       ` Stefan Fröberg
2012-10-13 14:54         ` Alexander Khryukin
2012-10-13 15:07           ` Stefan Fröberg
2012-10-13 20:56           ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox