Login  Register

Re: Installing Quantlib on OS EI Capitan

Posted by quantengineer on Jun 15, 2016; 4:49pm
URL: http://quantlib.414.s1.nabble.com/Installing-Quantlib-on-OS-EI-Capitan-tp17505p17529.html

Luigi

Everything works until upto point 6 so far.

I then downloaded QuantLib-Swig, got into the Python directory and run

python setup.py build

got the following

charless-MacBook-Pro-2:Python charles$ python setup.py build
running build
running build_py
file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found
file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found
running build_ext
building 'QuantLib._QuantLib' extension
/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
clang: error: no such file or directory: 'QuantLib/quantlib_wrap.cpp'
clang: error: no input files
error: command '/usr/bin/clang' failed with exit status 1


i run python setup.py test and got

running test
running build
running build_py
file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found
file QuantLib/QuantLib.py (for module QuantLib.QuantLib) not found
running build_ext
building 'QuantLib._QuantLib' extension
/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
clang: error: no such file or directory: 'QuantLib/quantlib_wrap.cpp'
clang: error: no input files
error: command '/usr/bin/clang' failed with exit status 1
charless-MacBook-Pro-2:Python charles$ 


















I have 
On 15 Jun 2016, at 17:35, Luigi Ballabio <[hidden email]> wrote:

They kind of make sense. Step 5 is no longer required. Step 10 is supposed to install the module where Anaconda can find it, but it seems dependent on where you have installed anaconda, so I'm not sure that on your system it would work as it is (by the way, do you use Anaconda at all?)

Anyway: in a previous mail, you said you had the error while running "make -C Python" from QuantLib-SWIG. Does that work now? (In this mail you say you've followed http://quantlib.org/install/macosx.shtml, which only covers QuantLib installation, not QuantLib-SWIG). After that worked, did you also run "sudo make -C Python install"?

Luigi



On Wed, Jun 15, 2016 at 11:33 AM quantengineer <[hidden email]> wrote:
I installed 1.60 still i can’t call the library in ipython. However after following all instructions on 


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="<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;amp;node=17519&amp;amp;i=0" class="">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="<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;amp;node=17519&amp;amp;i=1" class="">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="<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;amp;node=17519&amp;amp;i=2" class="">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="<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;amp;node=17519&amp;amp;i=3" class="">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="<a href="x-msg://6/user/SendEmail.jtp?type=node&amp;amp;node=17519&amp;amp;i=4" class="">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



View this message in context: Re: Installing Quantlib on OS EI Capitan
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. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381_______________________________________________
QuantLib-users mailing list
[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. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users