-----Original Message-----
From: Richard Crozier [mailto:address@hidden
Sent: Thursday, June 25, 2015 12:41 PM
To: JohnD; address@hidden
Subject: Re: Using the mkoctfile -W and -Wl options
On 25/06/15 17:27, JohnD wrote:
Message: 1
Date: Thu, 25 Jun 2015 14:38:44 +0100
From: Richard Crozier <address@hidden>
To: address@hidden
Subject: Using the mkoctfile -W and -Wl options
Message-ID: <address@hidden>
Content-Type: text/plain; charset=utf-8; format=flowed
Hello,
Could someone possibly provide an example of using the -W and -Wl
arguments
for mkoctfile?
"
'-Wl,...'
Pass flags though the linker like "-Wl,-rpath=...". The
quotes are needed since commas are interpreted as command
separators.
'-W...'
Pass flags though the compiler like "-Wa,OPTION".
"
For example, I tried building the provided helloworld example from
the
octave
manual and passing the -v parameter like so:
>> mkoctfile helloworld.c "-Wv"
gcc: error: unrecognized command line option ?-Wv?
warning: mkoctfile exited with failure status
warning: called from
mkoctfile at line 171 column 5
>> mkoctfile helloworld.c "-W,-v"
gcc: error: unrecognized command line option ?-W,-v?
warning: mkoctfile exited with failure status
warning: called from
mkoctfile at line 171 column 5
>> mkoctfile helloworld.c -Wv
gcc: error: unrecognized command line option ?-Wv?
warning: mkoctfile exited with failure status
warning: called from
mkoctfile at line 171 column 5
obviously in reality I want to do more than pass this parameter, can
someone
explain the right way to do these please, or point me to a more
detailed resource on this?
Thanks,
Richard
The resource would be the documentation for gcc - you are passing gcc
-W commands to gcc at that point.
ok, I see, so is the '-W' flag only for passing gcc options that start
with '-W', i.e.
the warning flags?
The octave manual implies the W option is for passing any parameters to
the
compiler, but it's probably obvious to someone experienced that it's only
referring to warning options.
How would I then, as an example, pass the '-O2' parameter to gcc via
mkoctfile?
Or how exactly should I call mkoctfile and pass it the '-v'
option etc?
Richard
--
The University of Edinburgh is a charitable body, registered in Scotland,
with
registration number SC005336.
The -v command for the gcc version ? or -v for mkoctfile version?
I guess the real question is what options are you really trying to send? If
you want -O2, just pass it as one of the args of mkoctfile, although chances
are it is already included :
mkoctfile -p CFLAGS