Login  Register

Re: Getting Python bindings in QuantLib-SWIG-1.4 to work in OS X?

Posted by Richard Stanton on Apr 28, 2014; 4:44pm
URL: http://quantlib.414.s1.nabble.com/Getting-Python-bindings-in-QuantLib-SWIG-1-4-to-work-in-OS-X-tp15105p15218.html

I'm afraid not. I eventually gave up. Has anyone got this to work on OS X 10.9?


From: "'luigi. com'" <[hidden email]>
Date: Monday, April 28, 2014 at 5:46 AM
To: Richard Stanton <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [Quantlib-users] Getting Python bindings in QuantLib-SWIG-1.4 to work in OS X?

Richard,
    apologies for dropping the ball on this one. Did you have any success?

Luigi



On Thu, Apr 3, 2014 at 9:49 AM, Richard Stanton <[hidden email]> wrote:
I'll try it out. I assumed this was about getting QuantLib to install at all, and that worked fine on my machine, but maybe this is more about linking with other programs? I couldn't tell. However, the fact that the same installation strategy on another machine, running OS X 10.8.5, seemed to work fine, does suggest it's something Mavericks-specific.

Also, I think there may be a minor typo in those compilation flags – should it say –stdlib instead of –stlib? 

Oh, one more thing – if I set those flags for compiling QuantLib, does that also mean I need to recompile Boost? 

Thanks.

Richard

From: "'luigi. com'" <[hidden email]>
Date: Thursday, April 3, 2014 12:25 AM
To: Richard Stanton <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Subject: Re: [Quantlib-users] Getting Python bindings in QuantLib-SWIG-1.4 to work in OS X?

Not sure if it applies, but there's a note in <http://quantlib.org/install/macosx.shtml> about a few compilation flags needed in Mavericks. Do they help?

Luigi



On Tue, Apr 1, 2014 at 7:58 PM, Richard Stanton <[hidden email]> wrote:
I've compiled both QuantLib-1.4 and QuantLib-SWIG-1.4 (Python bindings) on
my Mac, but get errors when I try to run the Python test code. Has anyone
got this to work? Here are the details:

- Machine is running OS X 10.9.2, Xcode 5.1, and "gcc --version" reports

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

   - Install Mac Ports boost 1.55.0 using "sudo port install boost"
   - Download and extract Quantlib-1.4
   - Following instructions at http://quantlib.org/install/macosx.shtml,
run

   ./configure --enable-static --with-boost-include=/opt/local/include/
--with-boost-lib=/opt/local/lib/ --prefix=/opt/local/

   make

   - Compilation completes fine. Running test suite, it tells me it's
running 567 test cases, and completes with no errors.

So far so good. Quantlib seems to be running fine. Now to install
quantlib-SWIG-1.4:

   - Download and extract
   - cd to Python subdirectory.
- After making sure the compiler/linker can find the ql header files and
libQuantLib.a, run "python setup.py build".
- Compiles and links (apparently) fine.
   - Now run "python setup.py test"

running test
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "setup.py", line 239, in <module>
    'build_ext': my_build_ext
  File "/Users/stanton/anaconda/lib/python2.7/distutils/core.py", line
152, in setup
    dist.run_commands()
  File "/Users/stanton/anaconda/lib/python2.7/distutils/dist.py", line
953, in run_commands
    self.run_command(cmd)
  File "/Users/stanton/anaconda/lib/python2.7/distutils/dist.py", line
972, in run_command
    cmd_obj.run()
  File "setup.py", line 58, in run
    module = __import__('QuantLibTestSuite', globals(), locals(), [''])
  File "test/QuantLibTestSuite.py", line 22, in <module>
    from date import DateTest
  File "test/date.py", line 18, in <module>
    import QuantLib
  File "build/lib.macosx-10.5-x86_64-2.7/QuantLib/__init__.py", line 24,
in <module>
    from QuantLib import *
  File "build/lib.macosx-10.5-x86_64-2.7/QuantLib/QuantLib.py", line 28,
in <module>
    _QuantLib = swig_import_helper()
  File "build/lib.macosx-10.5-x86_64-2.7/QuantLib/QuantLib.py", line 24,
in swig_import_helper
    _mod = imp.load_module('_QuantLib', fp, pathname, description)
ImportError:
dlopen(build/lib.macosx-10.5-x86_64-2.7/QuantLib/_QuantLib.so, 2): Symbol
not found: __ZThn112_N8QuantLib19CappedFlooredCoupon6updateEv
  Referenced from: build/lib.macosx-10.5-x86_64-2.7/QuantLib/_QuantLib.so
  Expected in: dynamic lookup

Has anyone got this working on the same setup?

Thanks.

Richard Stanton


------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users