Login  Register

Re: Installing Quantlib on OS EI Capitan

Posted by quantengineer on Jun 14, 2016; 2:24pm
URL: http://quantlib.414.s1.nabble.com/Installing-Quantlib-on-OS-EI-Capitan-tp17505p17520.html

I installed 1.60 still i can’t call the library in ipython. However after following all instructions on 

http://quantlib.org/install/macosx.shtml

the example compiles

only problem is i can’t call the library from ipython get an error which says 

--------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-7585f083cf27> in <module>()
      1 
----> 2 import QuantLib as ql

ImportError: No module named QuantLib




I found this on the net….. does it make sense? 


To install Quantlib and Quantlib-SWIG on Mac OS 10.11.2 (El Capitan) and get it to work on Anaconda and pyCharm, I’ve followed the steps below:

  1. Install Xcode 7.2, Apple’s Command Line Developer Tools and Macports
  2. Install boost with  sudo port install boost
  3. Download Quantlib 1.7 from source forge and extracted it in /Users/my_account
  4. Run ./configure –enable-static –with-boost-include=/opt/local/include/ –with-boost-lib=/opt/local/lib/ –prefix=/opt/local/ CXXFLAGS=”-stdlib=libstdc++ -mmacosx-version-min=10.6″ LDFLAGS=”-stdlib=libstdc++ -mmacosx-version-min=10.6″
  5. Remove “-lboost_thread” from Examples/FRA/Makefile.in
  6. Run make && sudo make install
  7. Download Quantlib-SWIG from SF and untar
  8. Go into Python directory
  9. Run python setup.py build, python setup.py test
  10. Run python python setup.py install –prefix //anaconda/envs/your_virtual_env

Then you should be able to “import QuantLib as ql” in pyCharm, or any python IDE


 
On 14 Jun 2016, at 14:18, Luigi Ballabio [via QuantLib] <[hidden email]> wrote:

You probably need a newer version. 1.43 is kind of old, and I think the compiler from El Capitan no longer compiles it correctly.

Luigi


On Tue, Jun 14, 2016 at 3:20 PM Charles <<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=17519&amp;i=0" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
boost 1.43


On 14 Jun 2016, at 11:19, Luigi Ballabio <<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=17519&amp;i=1" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:

What version of Boost are you using?

On Fri, Jun 10, 2016 at 9:39 PM quantengineer <<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=17519&amp;i=2" target="_top" rel="nofollow" link="external" class="">[hidden email]> wrote:
Ok this is what i have done now.....

1. QuantLib-1.8 Installation

cd /usr/local/lib/QuantLib-1.2.1
sudo ./configure
sudo make
sudo make install

this has worked ....


2.  QuantLib-SWIG-1.1 Installation

cd /usr/local/lib/QuantLib-SWIG-1.1
sudo ./configure
sudo make -C Python

At this point i get the error

charless-MacBook-Pro-2:QuantLib-SWIG-1.7 charles$ sudo make -C Python
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
CXXFLAGS="-g -O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized
-Wno-sign-compare -Wno-write-strings" /opt/local/bin/python setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.11-x86_64-2.7
creating build/lib.macosx-10.11-x86_64-2.7/QuantLib
copying QuantLib/__init__.py -> build/lib.macosx-10.11-x86_64-2.7/QuantLib
copying QuantLib/QuantLib.py -> build/lib.macosx-10.11-x86_64-2.7/QuantLib
running build_ext
building 'QuantLib._QuantLib' extension
creating build/temp.macosx-10.11-x86_64-2.7
creating build/temp.macosx-10.11-x86_64-2.7/QuantLib
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -pipe -Os -fwrapv
-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o
build/temp.macosx-10.11-x86_64-2.7/QuantLib/quantlib_wrap.o -Wno-unused -g
-O2 -fno-strict-aliasing -Wno-unused -Wno-uninitialized -Wno-sign-compare
-Wno-write-strings
In file included from QuantLib/quantlib_wrap.cpp:3940:
In file included from /opt/local/include/ql/quantlib.hpp:47:
In file included from /opt/local/include/ql/math/all.hpp:38:
In file included from /opt/local/include/ql/math/matrixutilities/all.hpp:4:
In file included from
/opt/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4036:59:
error:
      'value_type' is a private member of

'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator&lt;double
      *> >'
    __val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
                                                          ^
QuantLib/quantlib_wrap.cpp:7271:23: note: while substituting deduced
template
      arguments into function template 'operator<<' [with _Expr =

boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator&lt;double
      *> >]
                    s << (*self)[i][j];
                      ^
In file included from QuantLib/quantlib_wrap.cpp:3940:
In file included from /opt/local/include/ql/quantlib.hpp:47:
In file included from /opt/local/include/ql/math/all.hpp:38:
In file included from /opt/local/include/ql/math/matrixutilities/all.hpp:4:
In file included from
/opt/local/include/ql/math/matrixutilities/basisincompleteordered.hpp:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/valarray:4037:46:
error:
      'value_type' is a private member of

'boost::iterators::detail::operator_brackets_proxy<QuantLib::step_iterator&lt;double
      *> >'
               __scalar_expr<typename _Expr::value_type>, _Expr> >
                                             ^
2 errors generated.
error: command '/usr/bin/clang' failed with exit status 1
make[1]: *** [.build-stamp] Error 1
make: *** [all] Error 2
charless-MacBook-Pro-2:QuantLib-SWIG-1.7 charles$




--
View this message in context: http://quantlib.10058.n7.nabble.com/Installing-Quantlib-on-OS-EI-Capitan-tp17505p17512.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=17519&amp;i=3" target="_top" rel="nofollow" link="external" class="">[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
QuantLib-users mailing list
<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;node=17519&amp;i=4" target="_top" rel="nofollow" link="external" class="">[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



If you reply to this email, your message will be added to the discussion below:
http://quantlib.10058.n7.nabble.com/Installing-Quantlib-on-OS-EI-Capitan-tp17505p17519.html
To unsubscribe from Installing Quantlib on OS EI Capitan, click here.
NAML