math/fftw3 - Variable CFLAGS is recursive.

Output from make -V (while not in the fftw3 directory):
Code:
# make -V CFLAGS
-O2 -fno-strict-aliasing -pipe -march=opteron

However, any make command issued from inside /usr/ports/math/fftw3/ returns:
Code:
# make -V CFLAGS
Variable CFLAGS is recursive.
And therefore, math/fftw3 is unable to be processed.
 
Can you post the exact commands you're using to build the port and the important parts of the output when things go wrong.
 
sure:
Code:
cd /usr/ports/math/fftw3
make install clean
which outputs
Code:
Variable CFLAGS is recursive.
 
Yep.. it's in the first post, but I will say it again.
Code:
# make -V CFLAGS
-O2 -fno-strict-aliasing -pipe -march=opteron

And, for the record, that was set in make.conf before I installed fftw3 the -first- time on this system. The latest update to ports appears to have broken something for me.
 
if you want the actual lines in my make.conf:

Code:
CPUTYPE?=opteron
CFLAGS= -O2 -fno-strict-aliasing -pipe
 
The port has an option OPTIMIZED_CFLAGS that should do the same, set that and try again without the CFLAGS line in /etc/make.conf. In general, avoid setting CFLAGS in /etc/make.conf, especially as a global override.

# cd /usr/ports/math/fftw3
# make config
# make install clean
 
if the port now fails to build because of having -anything- set in CFLAGS, when it compiled fine at one time, with the exact same options, that is indicative of a problem with the port's makefile.

Besides, when I comment out CFLAGS, it still fails to build, with the exact same error.. I must also comment out "CPUTYPE" in order to get it to build.

This needs to be fixed in the port, since it appears to be the only one with this issue. Why should I therefore make a change that affects every other port on my system, as a workaround for one broken one?
 
After much fiddling with the Makefile for fftw3, I think I've found the offending lines, by commenting out the following line:

Code:
#CFLAGS+=       ${CFLAGS_3DNOW}

This, however, disables some of the optimizations for 3Dnow..
 
Ok.. I think I fixed it now.
I changed the above offending line to be:
Code:
CFLAGS:=        ${CFLAGS_3DNOW}
And now the Makefile is correctly parsed, with all optimizations seeming to be correctly applied, without modifying my /etc/make.conf.
 
Same here. Thanks for the fix I'll test it right away :) . Btw contact the porter and let him know about this.

Regards.
 
IMHO the problem is not with conflicting CFLAGS in /etc/make.conf, but has rather been caused by this commit from PR ports/157936, which, indeed, unintentionally introduced a recursion in the Makefile of math/fftw3:
Code:
CFLAGS_3DNOW=   ${CFLAGS:N-O:N-O*} [I][color="Gray"][...snip...][/color][/I]
[I][color="Gray"][...snip...][/color][/I]
CFLAGS+=        ${CFLAGS_3DNOW}
Unsurprisingly, the two slave ports, math/fftw3-float & math/fftw3-long, have also been affected. I've submitted a followup to the PR.
 
Back
Top