Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install issue on Mac #65

Closed
BlueCollarWorker opened this issue Sep 16, 2014 · 6 comments
Closed

Install issue on Mac #65

BlueCollarWorker opened this issue Sep 16, 2014 · 6 comments

Comments

@BlueCollarWorker
Copy link

Hi guys,

I have an install issue on Mac (Mac OS 10.9.4). I've installed QuantLib 1.3 and it works fine (example runs). Its located under opt/local, so I've added the opt/local/include and opt/local/lib directories into the setup.py file.

I then 'make build' and 'make install', and the pyql seems to install under my site-packages folder. It installs under a folder called quantlib-0.1-py2.7-macosx-10.5-x86_64.egg (bunch of .so files under a subfolder called quantlib). If I try to import currency (or any other module) it does not find it. However, if I supplement the pythonpath to go insider the folder mentioned above, and then import currency, I get the following message:

ImportError: dlopen(/Users/barnarson/anaconda/lib/python2.7/site-packages/quantlib-0.1-py2.7-macosx-10.5-x86_64.egg/quantlib/currency.so, 2): Symbol not found: _ZN8QuantLib8Currency4DataC1ERKSsS3_iS3_S3_iRKNS_8RoundingES3_RKS0
Referenced from: /Users/barnarson/anaconda/lib/python2.7/site-packages/quantlib-0.1-py2.7-macosx-10.5-x86_64.egg/quantlib/currency.so
Expected in: flat namespace
in /Users/barnarson/anaconda/lib/python2.7/site-packages/quantlib-0.1-py2.7-macosx-10.5-x86_64.egg/quantlib/currency.so

Can you give me any hint as to what might have gone wrong?

P.S. I appreciate your work, the project is outstanding.

@dpinte
Copy link
Member

dpinte commented Sep 16, 2014

@BlueCollarWorker What is the output of otool -L on one of the built extensions.

Here is mine on the currency.so

DP-MBP:quantlib dpinte (fix-win-build) $ otool -L currency.so
currency.so:
    /usr/local/lib/libQuantLib.0.dylib (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

@BlueCollarWorker
Copy link
Author

Here is what I get:

otool -L currency.so

currency.so:

/opt/local/lib/libQuantLib.0.dylib (compatibility version 1.0.0, current
version 1.0.0)

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
60.0.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
1197.1.1)

I'll try to compile one module with few dependencies directly and see if I
get the same.

2014-09-16 18:07 GMT+02:00 Didrik Pinte notifications@github.com:

@BlueCollarWorker https://github.com/BlueCollarWorker What is the
output of otool -L on one of the built extensions.

Here is mine on the currency.so

DP-MBP:quantlib dpinte (fix-win-build) $ otool -L currency.so
currency.so:
/usr/local/lib/libQuantLib.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)


Reply to this email directly or view it on GitHub
#65 (comment).

@dpinte
Copy link
Member

dpinte commented Sep 17, 2014

@BlueCollarWorker The flat namespace just reminded me of something. How did you compile QuantLib? You need to make sure that you used the correct stdlib with clang otherwise, it will not work. From the installation notes (http://quantlib.org/install/macosx.shtml):

A note on Mac OS X 10.9 (Mavericks)

Users have reported linking problems under Mac OS X 10.9; the solution (thanks to Albert Azout for 
pointing it out) seems to be to set the environment flags CXXFLAGS and LDFLAGS to 
-stlib=libstdc++ -mmacosx-version-min=10.6
before compiling.

@BlueCollarWorker
Copy link
Author

I thought I followed the very same instructions. QuantLib examples work, so
it seems to be installed ok. I will nonetheless try to re-install it using
http://stackoverflow.com/questions/23591929/installing-quantlib-on-ios-10-9
to make sure flags are set appropriately.

@BlueCollarWorker
Copy link
Author

Just got it to work...

I installed all from scratch. In my first attempt, I installed boost using brew, but now from source. I also noticed that the INCLUDE_DIRS in the setup file had '..sources/boost/1_55_0' whereas my boost version is 1_56_0, so I changed the 55 to 56. In any case, it seems to be working well now. Thank's a lot for your help.

@dpinte
Copy link
Member

dpinte commented Sep 22, 2014

Great! Closing now.

@dpinte dpinte closed this as completed Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants