Bug 135974 - FFLAGS ignored on building project
Summary: FFLAGS ignored on building project
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: All build tools (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-19 17:41 UTC by kbugger
Modified: 2007-01-03 21:09 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kbugger 2006-10-19 17:41:07 UTC
Version:           3.5.5 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
Compiler:          ifort , g77 
OS:                Linux

I set -O2 -funroll-loops in Project configure options.

when I run "automake and friends" I see these included but when I build the project it gets compiled with -g -c and not the options I set.

I realise I cannot step the code without -g  but that may not be what I require. 

If I set options I expect them to be used.
Comment 1 Matt Rogers 2006-11-04 16:17:42 UTC
which tab of the project configuration options do you set the CFLAGS in?
Comment 2 kbugger 2006-11-04 16:41:55 UTC
Project Option | configure options | Fortan tab | compiler options FFLAGS

thanks.
Comment 3 kbugger 2006-11-04 16:59:45 UTC
Having a new look at this I added to both CFLAGS and FFLAGS , both seem to be taking into account when running automake:

cd '/svn/ifc/newtest' && FFLAGS="-O2 -ffast-math -fomit-frame-pointer" CFLAGS="-fomit-frame-pointer -ffast-math " "/svn/ifc/newtest/configure"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

but if I run make clean and then rebuild the project there is no sign of them begin used. Also the execution time indicates that they are no being used.

Thanks again.
cd '/svn/ifc/newtest' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake 
gmake all-recursive
Making all in src
gfortran -g -O2 -c -o int_sin90.o int_sin90.f90
gfortran -g -O2 -o newtest int_sin90.o 
*** Success ***
Comment 4 Andreas Pakulat 2007-01-03 15:47:43 UTC
It turns out this is a problem of autotools. For CFLAGS and CXXFLAGS it works properly, i.e. configure puts the given flags into the Makefile's. This is the intended way of doing this and thus you have to file a bugreport with autoconf or automake.

Closing as invalid.
Comment 5 kbugger 2007-01-03 18:33:39 UTC
Thanks, can you clarify this statement:
>>This is the intended way of doing this

do you mean that using CFALGS is the intended way and I am is wrong, or I am right in using FFLAGS and kdevelop provides me with an interface that currently serves no purpose?

would it be more appropriate for you to file the bug upstream since you clearly understand where the problem is , rather than me posting a half baked bug report because I dont clearly know what is going on behind the interface in kdevelop.

thanks again for looking into this.
Comment 6 Andreas Pakulat 2007-01-03 21:09:08 UTC
CFLAGS are flags to be set for gcc, i.e. the C Compiler. CXXFLAGS for the C++ Compiler and FFLAGS are meant to be used for the fortran compiler.

The intended way of doing things for autotools projects is to pass these flags to the configure call as environment variables and configure will put them (together with some other values for these flags) into the generated Makefile.

Unfortunately it seems the configure script doesn't do this for FFLAGS. Now kdevelop has absolutely no control over the configure script, its completely generated from autotools based on defaults and the macros you specify in configure.in.in or configure.ac (or whatever you use).

As for the upstream report: I have no account for autotools bugzilla and I don't even know where it is. I have no idea about autotools except some basic stuff and I certainly don't have the time to hunt down a bug I can't easily reproduce because I have no idea about fortran either. Sorry.

As for what kdevelop does behind the scenes: You can see that in the output windows, i.e. it just runs FFLAGS="Whatever you set them to" configure <configure flags that you have set>. You should have the same problem (i.e. missing you FFLAGS values in the generated Makefile's) if you run configure from a shell.

Andreas