Login  Register

Re: Installation issues on Mac OS X 10.11.2

Posted by Alexander Zvyagin on Jan 02, 2017; 1:21pm
URL: http://quantlib.414.s1.nabble.com/Installation-issues-on-Mac-OS-X-10-11-2-tp17214p17958.html

Hi,

I have a working QuantLib environment with:

- OS X version 10.11.6
- Quantlib-1.9 and QuantLib-SWIG-1.9 (only the Python part of SWIG)
compiled from sources by
- g++ 6.3.0
- Python 2.7.13 installed by homebrew

If I remember correctly, the recommendations from Internet it were
- NOT to use Xcode and native C++ compiler of OSX (which means I have
installed the latest g++ 6.3.0)
- NOT to use python from OSX (and again, I had to install python from homebrew)

$ which python
/usr/local/bin/python

$ python
Python 2.7.13 (default, Dec 17 2016, 23:03:43)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
User startup file was loaded
>>> import QuantLib as ql
>>> ql.__file__
'/usr/local/lib/python2.7/site-packages/QuantLib/__init__.pyc'
>>> ql.__version__
'1.9'
>>> ql.Date(2,1,2017)
Date(2,1,2017)

With best wishes,
Alexander


On 31/12/2016, Ikeuchi <[hidden email]> wrote:

> Hi, just as a note, I compiled for QuantLib 1.9 and Python 2.7.12 (El
> Capitan
> 10.11.6). I installed QuantLib using macports (sudo port install QuantLib),
> then I spent a lot of time trying to understand the SWIG compilation error.
> Do as follows (steps for the layman):
>
> 1) Ignore the ./configure and make steps
> 2) Go straight for the Python folder
> 3) run: python setup.py build
> 4) after complaining about the i386 crap and x86_64, run the following
> (compile again):
>
> g++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g
> -fwrapv -O3 -Wall -Wstrict-prototypes
> -I/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.6-intel-2.7/QuantLib/quantlib_wrap.o -Wno-unused
>
> 5) Link again:
>
> g++ -bundle -undefined dynamic_lookup -arch x86_64 -g
> build/temp.macosx-10.6-intel-2.7/QuantLib/quantlib_wrap.o -L/opt/local/lib
> -L/opt/local/lib -lQuantLib -o
> build/lib.macosx-10.6-intel-2.7/QuantLib/_QuantLib.so
>
> 6) DON'T USE python setup.py install
>
> 7) Run python setup.py test, check if it works
>
> 8) copy the QuantLib folder in build/lib.macosx-10.6-intel-2.7/ to python
> site-packages
> (Frameworks/Python.framework/Versions/2.7/lib/Python2.7/site-packages
>
> Test it in the interpreter. Things that others can pursuit:
>
> Honestly, I don't know the reason for the two arch flags in the build
> process (-arch i386 -arch x86_64), but I know that this is the problem for
> linking the libs. I checked everything in the setup.py and the environment
> variables, I don't know where it is set. Also, I don't know why the sudo
> python setup.py install fails to move properly the files.
>
>
>
> --
> View this message in context:
> http://quantlib.10058.n7.nabble.com/Installation-issues-on-Mac-OS-X-10-11-2-tp17214p17952.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users