CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

How to enable C++11 in wmake?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2017, 14:35
Default How to enable C++11 in wmake?
  #1
New Member
 
Lukas Lebovitz
Join Date: Mar 2017
Location: Zürich, Switzerland
Posts: 25
Rep Power: 9
lukas.lebo is on a distinguished road
I'm trying to compile a boundary condition that uses some C++11 features.

When using "wmake" I get the error:

Quote:
/cluster/apps/gcc/4.8.2/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
I don't have permission to change the wmake rules in the installation directory. Can I just enable support with the Make/options file?

What do you add to it?
lukas.lebo is offline   Reply With Quote

Old   April 27, 2017, 15:28
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

You can add -std=c++11 to EXE_INC variable in Make/options. Are you trying to compile BC for OpenFOAM 2.x? Since in 4.x -std=c++0x flag (though deprecated) is in rules.
alexeym is offline   Reply With Quote

Old   April 27, 2017, 16:30
Default
  #3
New Member
 
Lukas Lebovitz
Join Date: Mar 2017
Location: Zürich, Switzerland
Posts: 25
Rep Power: 9
lukas.lebo is on a distinguished road
Thanks I just got it to work with
Quote:
EXE_INC = \
$(CPP_DEP)\
Then using the commands:

Quote:
export CPP_DEP='-std=c++11'
wmake
Though now I'm facing like 10 new problems which are no longer related to this title/post. Hurray!

By the way I'm on 2.4.0.

Last edited by lukas.lebo; April 27, 2017 at 17:38.
lukas.lebo is offline   Reply With Quote

Old   May 3, 2019, 14:28
Default
  #4
New Member
 
Hao Li
Join Date: May 2017
Posts: 7
Rep Power: 8
haolee0928 is on a distinguished road
Hello, I am setting boundary conditions by means of codeStream and the same error appear. Could you tell me: in which Make/options should I add the "-std=c++11"?


Thanks a lot













Quote:
Originally Posted by alexeym View Post
Hi,

You can add -std=c++11 to EXE_INC variable in Make/options. Are you trying to compile BC for OpenFOAM 2.x? Since in 4.x -std=c++0x flag (though deprecated) is in rules.
haolee0928 is offline   Reply With Quote

Old   May 3, 2019, 15:33
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
There is not Make/options for codeStream, there is codeOptions section. See example here: https://cpp.openfoam.org/v6/classFoa...odeStream.html.
alexeym is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 08:48
Problems Installing OF 1.6 32 bit bucksfan OpenFOAM Installation 19 August 4, 2009 01:36
OpenFOAM15 installables are incomplete problem with paraFoam tryingof OpenFOAM Bugs 17 December 7, 2008 04:41
Problem of compilation OF 14Allwmake command not found erik_d OpenFOAM Bugs 13 September 13, 2008 21:45
[OpenFOAM] ParaFoam error message joey ParaView 1 October 2, 2006 13:28


All times are GMT -4. The time now is 22:56.