title: Compiling library in g++ using C++11
body: <p>I'm been attempting to compile an open-source C++ library (QuantLib-1.7) on my mac for several days but I seem to be encountering some kind of C++11 compatibility issue.</p>
  
  <p>When I run <code>make &amp;&amp; sudo make install</code> from the terminal the compilation seems to work except for a bunch of errors of the form</p>
  
  <pre><code>Making all in BermudanSwaption
  g++ -DHAVE_CONFIG_H -I. -I../../ql  -I../.. -I../.. -I/opt/local/include  -g -O2 -MT BermudanSwaption.o -MD -MP -MF .deps/BermudanSwaption.Tpo -c -o BermudanSwaption.o BermudanSwaption.cpp
  In file included from BermudanSwaption.cpp:22:
  In file included from ../../ql/quantlib.hpp:43:
  In file included from ../../ql/experimental/all.hpp:25:
  In file included from ../../ql/experimental/volatility/all.hpp:21:
  In file included from ../../ql/experimental/volatility/zabr.hpp:31:
  In file included from ../../ql/math/statistics/incrementalstatistics.hpp:35:
  In file included from /opt/local/include/boost/accumulators/statistics/stats.hpp:14:
  In file included from /opt/local/include/boost/accumulators/statistics_fwd.hpp:12:
  /opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization
    of non-static data member is a C++11 extension [-Wc++11-extensions]
  const int m_x = 1 / (sizeof(T) - sizeof(T));
                ^
  1 warning generated.
  </code></pre>
  
  <p>I'm guessing this has something to do with g++ not being correctly configured for C++11. I'm familiar with the fact that C++11 can be invoked by compiling with <code>g++ -std=c++11</code>. However, despite a lot of googling I can't find a way to modify the makefile such that <code>-std=c++11</code> is called when I run <code>make &amp;&amp; sudo make install</code>.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>Here is the section of the makefile which I believe is relevant:</p>
  
  <pre><code>BOOST_INCLUDE = -I/opt/local/include
  BOOST_LIB = -L/opt/local/lib
  BOOST_THREAD_LIB = 
  BOOST_UNIT_TEST_DEFINE = -DQL_WORKING_BOOST_STREAMS
  BOOST_UNIT_TEST_LIB = boost_unit_test_framework-mt
  BOOST_UNIT_TEST_MAIN_CXXFLAGS = -DBOOST_TEST_DYN_LINK
  CC = gcc
  CCDEPMODE = depmode=gcc3
  CFLAGS = -g -O2
  CPP = gcc -E
  CPPFLAGS =  -I/opt/local/include
  CXX = g++
  CXXCPP = g++ -E
  CXXDEPMODE = depmode=gcc3
  CXXFLAGS = -g -O2
  </code></pre>
  
  <p>Here is the output from running "g++ -v":</p>
  
  <pre><code>Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
  Apple LLVM version 7.0.0 (clang-700.1.76)
  Target: x86_64-apple-darwin14.5.0
  Thread model: posix
  </code></pre>
  
  <p>Makefile.am: <a href="https://www.dropbox.com/s/v5j7qohwfup81od/Makefile.am?dl=0" rel="nofollow">https://www.dropbox.com/s/v5j7qohwfup81od/Makefile.am?dl=0</a></p>
  
  <p>Makefile.in: <a href="https://www.dropbox.com/s/t92hft9ea2ar1zw/Makefile.in?dl=0" rel="nofollow">https://www.dropbox.com/s/t92hft9ea2ar1zw/Makefile.in?dl=0</a></p>
  
  <p>QuantLib-1.7 directory: <a href="https://www.dropbox.com/sh/ulj0y68m8x35zg8/AAA-w7L2_YWIP8_KnwURErzYa?dl=0" rel="nofollow">https://www.dropbox.com/sh/ulj0y68m8x35zg8/AAA-w7L2_YWIP8_KnwURErzYa?dl=0</a></p>
  
  <p>Full error log: <a href="https://www.dropbox.com/s/g09lcnma8skipv7/errors.txt?dl=0" rel="nofollow">https://www.dropbox.com/s/g09lcnma8skipv7/errors.txt?dl=0</a></p>