An example of this can be found in the wifi device, and the approach
could be copied. Some files in src/devices/wifi depend on GNU
Scientific Library (GSL), and when GSL is installed, we want to use it.
We want -lgsl -lm -lgslcblas to be appended. In the
src/devices/wifi/wscript, you can see this:
> if bld.env['ENABLE_GSL']:
> obj.uselib = 'GSL GSLCBLAS M'
>
where ENABLE_GSL is set in the top-level wscript (search for "have_gsl"
in the top wscript where the configuration check is done).
I think that these can be changed by environment variables at configure
time:
http://code.google.com/p/waf/wiki/EnvironmentVariables
- Tom
Hi Tom,
Unlike gsl, apparently lapack does not come with a pkgconfig
file (i.e. a corresponding ".pc" file). Using the following link, I
was able to get lapack up and running (i.e. sudo ./waf configure was
successful with no errors). Thank you.
http://cblfs.cross-lfs.org/index.php/ATLAS
With reference to your previous link, I assumed that these flags
should be set in the top level "wscript (near line 387)" file (NB. I
have no experience with flags in WAF). I added the 5 following lines,
but my source files are not able to locate the LUSOLVER macro defined
in the top level wscript file.
# append user defined flags after all our ones
1 CXXFLAGS = "-Wall -O3 -fopenmp"
2 CPPFLAGS = "-DLAPACK -DLUSOLVER=LAPACK"
3 LINKFLAGS ="-llapack -L/home/asydney/local -lblas -Lsrc/common -
lthyme"
for (confvar, envvar) in [['CCFLAGS', 'CCFLAGS_EXTRA'],
['CXXFLAGS', 'CXXFLAGS_EXTRA'],
['LINKFLAGS', 'LINKFLAGS_EXTRA'],
4 ['LINKFLAGS', 'LDFLAGS_EXTRA'],
5 ['CPPFLAGS', 'CPPFLAGS_EXTRA']]:
if envvar in os.environ:
value = shlex.split(os.environ[envvar])
conf.env.append_value(confvar, value)
First of all, am I inserting these flags correctly? Secondly, am I
inserting them in the right file?
Thanks Tom!
Syd
On Feb 4, 11:33 pm, Tom Henderson <t...@tomh.org> wrote:
> On 02/04/2011 05:20 PM, Syd wrote:
>
> > Thanks for your help.
>
> > One other thing, how do I set the other flags like:
> > -Wall -O3 -fopenmp -DLAPACK -DLUSOLVER=LAPACK
>
> I think that these can be changed by environment variables at configure
> time:http://code.google.com/p/waf/wiki/EnvironmentVariables
>
> - Tom
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
Hi Gustavo,
Thanks for your previous response. With reference to your
previous reply, my source files are ".cpp" and below is the setup for
my "LINKFLAGS" within "wscript". My model included additional headers
in the following directory and so I added "-I/home/asydney/adevs/trunk/
include" to "LINKFLAGS" below.
conf.env.append_value("LINKFLAGS", ["-llapack", "-L/usr/local/src/
GotoBLAS2", "-lblas", "-L/home/asydney/ns-allinone-3.10/ns-3.10/src/
common", "-lthyme", "-I/home/asydney/adevs/trunk/include"])
However, when I run "sudo ./waf --check" WAF is unable to locate the
headers within the "adevs" directory that I specified above. For this
reason, I get a list of errors like the following:
debug/ns3/adevs.h:23:29: error: adevs_exception.h: No such file or
directory
PS. I have ensured that all the header files indeed exist in the
specified directory above.
Can you kindly point out my errors? Do I have to copy all the header
files from the "include" directory into "ns-3.10/src/common" and then
update the "wscript" file within this folder with the header names?
Thank you.
Gustavo, could you also use the extra environment variables such as
CXXFLAGS_EXTRA, LINKFLAGS_EXTRA, as long as you don't care if they are
applied to all of the build?
- Tom
- Tom
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
Hi Tom, Gustavo,
With your instructions, I have been able to add the necessary
flags. However, WAF keeps throwing an "openmp" related error:
sudo CXXFLAGS_EXTRA="-fopenmp" ./waf build