0

I'm having an issue with a linked library.

I installed a version of it via brew but I later found out that I needed to add environmental flags to the build:

CXXFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6" \
            LDFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6"

so I installed another version at opt/local/lib that was built using the flags. My issue is that the os is still using the brew installed version. I've searched but can't find out how to have the os link to the properly built library or build the brew version with the flags.

The reason I believe this is the issue, is that when building quantlib-swig for ruby I'm getting the following errors which a couple forums said are related to the environmental flags:

creating Makefile
compiling quantlib_wrap.cpp
In file included from quantlib_wrap.cpp:2647:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4035:59: error: 
      'value_type' is a private member of
      'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >'
    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
                                                          ^
quantlib_wrap.cpp:8228:23: note: while substituting deduced template arguments
      into function template 'operator<<' [with _Expr =
      boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >]
                    s << (*self)[i][j];
                      ^
In file included from quantlib_wrap.cpp:2647:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/quantlib.hpp:47:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/all.hpp:35:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/all.hpp:4:
In file included from /usr/local/Cellar/quantlib/1.6.1/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:46: error: 
      'value_type' is a private member of
      'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator<double
      *> >'
               __scalar_expr<typename _Expr::value_type>, _Expr> >
                                             ^
2 errors generated.
make: *** [quantlib_wrap.o] Error 1
Curt
  • 325
  • 1
  • 3
  • 12

1 Answers1

0

Regarding the latter part of your question, how to build the brew version with the flags, you can build the quantlib homebrew recipe on OSX using ENV.append in the install function:

def install
  ...
  if MacOS.version >= :mavericks && ENV.compiler == :clang
    ENV.append "CXXFLAGS", "-stdlib=libstdc++ -mmacosx-version-min=10.6"
    ENV.append "LDFLAGS", "-stdlib=libstdc++ -mmacosx-version-min=10.6"
  end
  ...
  system "make", "install"
end
mmizutani
  • 317
  • 2
  • 9