ccan.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Annoying warning, a.k.a. how to add to CFLAGS
@ 2017-09-01  3:23 Ian Zimmerman
  2017-09-01  5:11 ` David Gibson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ian Zimmerman @ 2017-09-01  3:23 UTC (permalink / raw)
  To: ccan

When I checkout current master, run ./tools/configurator/configurator >
config.h and then make, I get exactly 1 warning for the whole thing:

ccan/strgrp/strgrp.c: In function ‘grp_for’:
ccan/strgrp/strgrp.c:296:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
     #pragma omp parallel for schedule(dynamic)

I figured out that I can silence that by adding -fopenmp to my CFLAGS.
But how to do that permanently?  I don't want to specify that on the
command line every time, and I also don't want to set it in the
environment because sometimes I compile other things than ccan ;-)

Is there a reason why this is not in the master Makefile?

-- 
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
Do obvious transformation on domain to reply privately _only_ on Usenet.
_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

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

* Re: Annoying warning, a.k.a. how to add to CFLAGS
  2017-09-01  3:23 Annoying warning, a.k.a. how to add to CFLAGS Ian Zimmerman
@ 2017-09-01  5:11 ` David Gibson
  2017-09-01 11:46 ` Rhys Ulerich
  2017-09-04  0:57 ` Rusty Russell
  2 siblings, 0 replies; 5+ messages in thread
From: David Gibson @ 2017-09-01  5:11 UTC (permalink / raw)
  To: ccan


[-- Attachment #1.1: Type: text/plain, Size: 1274 bytes --]

On Thu, Aug 31, 2017 at 08:23:50PM -0700, Ian Zimmerman wrote:
> When I checkout current master, run ./tools/configurator/configurator >
> config.h and then make, I get exactly 1 warning for the whole thing:
> 
> ccan/strgrp/strgrp.c: In function ‘grp_for’:
> ccan/strgrp/strgrp.c:296:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
>      #pragma omp parallel for schedule(dynamic)
> 
> I figured out that I can silence that by adding -fopenmp to my CFLAGS.
> But how to do that permanently?  I don't want to specify that on the
> command line every time, and I also don't want to set it in the
> environment because sometimes I compile other things than ccan ;-)
> 
> Is there a reason why this is not in the master Makefile?

Because working out how to make module specific CFLAGS additions in
the Makefile isn't entirely trivial.  Working out how to do so in a
reasonably portable fashion is even harder - I don't expect -fopenmp
will work for all compilers, so applying it there would change a
cosmetic warning into a compile failure.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

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

* Re: Annoying warning, a.k.a. how to add to CFLAGS
  2017-09-01  3:23 Annoying warning, a.k.a. how to add to CFLAGS Ian Zimmerman
  2017-09-01  5:11 ` David Gibson
@ 2017-09-01 11:46 ` Rhys Ulerich
  2017-09-04  0:57 ` Rusty Russell
  2 siblings, 0 replies; 5+ messages in thread
From: Rhys Ulerich @ 2017-09-01 11:46 UTC (permalink / raw)
  To: ccan


[-- Attachment #1.1: Type: text/plain, Size: 330 bytes --]

ccan/strgrp/strgrp.c: In function ‘grp_for’:
ccan/strgrp/strgrp.c:296:0: warning: ignoring #pragma omp parallel
[-Wunknown-pragmas]
     #pragma omp parallel for schedule(dynamic)


An ifdef might be added to the code:
https://stackoverflow.com/questions/1300180/ignore-openmp-on-machine-that-doesnt-have-it

- Rhys

[-- Attachment #1.2: Type: text/html, Size: 947 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

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

* Re: Annoying warning, a.k.a. how to add to CFLAGS
  2017-09-01  3:23 Annoying warning, a.k.a. how to add to CFLAGS Ian Zimmerman
  2017-09-01  5:11 ` David Gibson
  2017-09-01 11:46 ` Rhys Ulerich
@ 2017-09-04  0:57 ` Rusty Russell
  2017-09-05  1:15   ` Andrew Jeffery
  2 siblings, 1 reply; 5+ messages in thread
From: Rusty Russell @ 2017-09-04  0:57 UTC (permalink / raw)
  To: ccan, Andrew Jeffery

Ian Zimmerman <itz@very.loosely.org> writes:
> When I checkout current master, run ./tools/configurator/configurator >
> config.h and then make, I get exactly 1 warning for the whole thing:
>
> ccan/strgrp/strgrp.c: In function ‘grp_for’:
> ccan/strgrp/strgrp.c:296:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
>      #pragma omp parallel for schedule(dynamic)
>
> I figured out that I can silence that by adding -fopenmp to my CFLAGS.
> But how to do that permanently?  I don't want to specify that on the
> command line every time, and I also don't want to set it in the
> environment because sometimes I compile other things than ccan ;-)

Hmm, well, if you're compiling strgrp, you should be adding CFLAGS
from _info, which sets this correctly.

In this case, we could just test defined(_OPENMP) instead of
HAVE_OPENMP, though, which would automagically work.

Module author CC'd

Cheers,
Rusty.



_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

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

* Re: Annoying warning, a.k.a. how to add to CFLAGS
  2017-09-04  0:57 ` Rusty Russell
@ 2017-09-05  1:15   ` Andrew Jeffery
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Jeffery @ 2017-09-05  1:15 UTC (permalink / raw)
  To: Rusty Russell, ccan


[-- Attachment #1.1: Type: text/plain, Size: 1201 bytes --]

On Mon, 2017-09-04 at 10:27 +0930, Rusty Russell wrote:
> > Ian Zimmerman <itz@very.loosely.org> writes:
> > When I checkout current master, run ./tools/configurator/configurator >
> > config.h and then make, I get exactly 1 warning for the whole thing:
> > 
> > ccan/strgrp/strgrp.c: In function ‘grp_for’:
> > ccan/strgrp/strgrp.c:296:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
> >      #pragma omp parallel for schedule(dynamic)
> > 
> > I figured out that I can silence that by adding -fopenmp to my CFLAGS.
> > But how to do that permanently?  I don't want to specify that on the
> > command line every time, and I also don't want to set it in the
> > environment because sometimes I compile other things than ccan ;-)
> 
> Hmm, well, if you're compiling strgrp, you should be adding CFLAGS
> from _info, which sets this correctly.
> 
> In this case, we could just test defined(_OPENMP) instead of
> HAVE_OPENMP, though, which would automagically work.

Yeah, I was never really happy with what I did with HAVE_OPENMP, and I
don't recall why I did it. I'd be happy with a patch implementing
Rusty's suggestion of #if defined(_OPENMP).

Andrew

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

_______________________________________________
ccan mailing list
ccan@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/ccan

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

end of thread, other threads:[~2017-09-05  1:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01  3:23 Annoying warning, a.k.a. how to add to CFLAGS Ian Zimmerman
2017-09-01  5:11 ` David Gibson
2017-09-01 11:46 ` Rhys Ulerich
2017-09-04  0:57 ` Rusty Russell
2017-09-05  1:15   ` Andrew Jeffery

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).