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

 
 

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

Submitter:  Falk Tannhäuser <fata>
Submitted:  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
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group Member
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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group 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.13-cf05.
    Corresponding source code