manodeep / Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.
https://corrfunc.readthedocs.io
MIT License
165 stars 50 forks source link

CFLAGS is ignored #137

Closed rainwoodman closed 6 years ago

rainwoodman commented 6 years ago

CFLAGS is ignored by the Makefile because common.mk purges it at the top with :=.

This choice is unconventional. Is it intentional? Is there a way to add arguments to the compiler options?

manodeep commented 6 years ago

If you want to add anything to CFLAGS, then simply edit that line in common.mk. Other potential option is to set CFLAGS ?=. That way even command-line options are honoured

rainwoodman commented 6 years ago

common.mk could have used CFLAGS ?= -- then CFLAGS is honored by default as usually done in packages. I remember autotools decided to use AM_CFLAGS internally to avoid messing with user supplied CFLAGS completely -- might be useful to follow a similar pattern here? Similar arguments were made for LDFLAGS too.

manodeep commented 6 years ago

I remember having had that previously but something didn't work quite correctly. But I didn't find anything this time. Does this work for you? Since the CC variable is often set to an old /usr/bin/cc, Corrfunc does not honour the CC variable by default. Let me know if this solves your issue.

Corrfunc uses a different CLINK variable for linker flags and does not use the LDFLAGS variable at all.

manodeep commented 6 years ago

@rainwoodman - is it okay to close this issue?

rainwoodman commented 6 years ago

Sure!