help-octave
[Top][All Lists]
Advanced

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

Re: Using the mkoctfile -W and -Wl options


From: Richard Crozier
Subject: Re: Using the mkoctfile -W and -Wl options
Date: Thu, 25 Jun 2015 21:54:07 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0



On 25/06/15 20:01, JohnD wrote:


-----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




I'm really trying to modify mex.m so that it can accept all the extra options like Matlab's mex, e.g. CFLAGS, OPTIMFLAGS, LDFLAGS etc. To make it more compatible. I planned to parse them in mex.m before passing them to mkoctfile in the appropriate way

Richard



--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




reply via email to

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