[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Feature request: per-file compilation flags

From: Manoj Rajagopalan
Subject: Feature request: per-file compilation flags
Date: Tue, 30 Mar 2010 18:04:20 -0400
User-agent: KMail/1.9.10


   I am using automake 1.10.1 on KUbuntu 8.04/i686.

   I have been using autotools for a while and per-file compilation flags is 
something I miss quite often. Would it be possible to introduce this feature 
so that each file can be given custom compilation flags if required? For a 
target mumble to be built from files foo.c bar.cpp and baz.f, for example, 
variables foo_CFLAGS, bar_CXXFLAGS, and baz_FFLAGS could be used.  The final 
variable order passed to the compile foo.c should then be, for example,

   $(foo_CFLAGS) $(mumble_CFLAGS) $(CFLAGS)

   A typical use case for me is when one particular function that resides in a 
file by itself must be compiled without optimizations so that some 
machine-specific numerical information can be calculated accurately. With C++ 
the volatile keyword pre-empts this requirement but C and FORTRAN lack this 
capability. So far my option is to create a convenience library for each file 
that requires special compilation flags.

   Another use case that we might commonly see in future is when bundling GPU 
code with CPU code, using say nvcc from the CUDA SDK. GPU-bound code will 
require separate flags than CPU-bound code.

Manoj Rajagopalan
CSE, University of Michigan, Ann Arbor

reply via email to

[Prev in Thread] Current Thread [Next in Thread]