bugGNU Octave - Bugs: bug #41636, mkoctfile doesn't accept...

 
 

bug #41636: mkoctfile doesn't accept -std=c++11 option

Submitted by:  Falk Tannhäuser <fata>
Submitted on:  Wed 19 Feb 2014 12:14:14 AM UTC  
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Falk Tannhäuser Open/Closed:  Closed
Release:  3.8.0 Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 14 Feb 2015 06:44:51 AM UTC, comment #3: 

I checked in a change to pass through unrecognized options beginning with '-' to the underlying compiler.  See this cset (http://hg.savannah.gnu.org/hgweb/octave/rev/b59aabc08e63).  This should work now.  Closing report.

Rik <rik5>
Project Administrator
Wed 19 Feb 2014 09:38:49 AM UTC, comment #2: 

OK, that works for me for the time being. Just have to remember not to leave some wrong options in one of the 45 environment variables that control the behavior of mkoctfile :-]

Falk Tannhäuser <fata>
Wed 19 Feb 2014 12:55:50 AM UTC, comment #1: 

The most straightforward way currently is through the use of environment variables. If you're running mkoctfile from a shell, something like

$ CXXFLAGS="$(mkoctfile -p CXXFLAGS) -std=c++11" mkoctfile ...

should work. If you're using the Octave function, then maybe something like

octave:1> setenv ("CXXFLAGS", [octave_config_info.CXXFLAGS " -std=c++11"]);
octave:2> mkoctfile ...

Does that work for you or do you still have the need to pass -std options as options to mkoctfile?

Mike Miller <mtmiller>
Project Administrator
Wed 19 Feb 2014 12:14:14 AM UTC, original submission:  

Platform: MS Windows 8.1, Cygwin64, g++ (GCC) 4.8.2
I would like to use the great new C++ 2011 features for generating .oct files. Unfortunately, there doesn't seem to be a straightforward way to pass the option "-std=c++11" or "-std=c++0x" to g++ through mkoctfile.
I found the possibility

$ mkoctfile -v -Wall -Wextra -W\ -std=c++11 foo.cpp
g++ -c   -I/usr/include/octave-3.8.0/octave/.. -I/usr/include/octave-3.8.0/octave  -ggdb -O2 -pipe   -Wall -Wextra -W -std=c++11   foo.cpp -o foo.o
g++ -shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc  -Wall -Wextra -W -std=c++11 -o foo.oct  foo.o   -L/usr/lib/octave/3.8.0 -loctinterp -loctave

but it looks weird and leaves a stray "-W" (an obsolete synonym for "-Wall" which is probably harmless) on the g++ command line.

Falk Tannhäuser <fata>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by fata (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-14 rik5 StatusNeed Info => Fixed
        Open/ClosedOpen => Closed
    2014-02-19 mtmiller StatusNone => Need Info
        Operating SystemMicrosoft Windows => Any

    Back to the top


    Powered by Savane 3.5