Re: Installation issues on Mac OS X 10.11.2
Posted by Ikeuchi on Dec 30, 2016; 9:58pm
URL: http://quantlib.414.s1.nabble.com/Installation-issues-on-Mac-OS-X-10-11-2-tp17214p17952.html
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.