-
Notifications
You must be signed in to change notification settings - Fork 193
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
Can't build pyql on Mac #62
Comments
@linkedrank Do you have QuantLib installed in |
Hi Joris - thanks for the response. I was able to successfully build the library after I fixed the path issue by modifying setup.py with the proper include and library paths. I was also able to run the examples in place in the original directory but when I copy or link the quantlib directory to my project directory, I get import errors. Any idea? I'm guessing I'm doing something stupid. (Obviously it's finding the directory itself and getting to quantlib.instruments.api but having trouble importing some of the classes)
File "/Users/marywilliamson1/Documents/projects/pnlbooker/server/app/american_option.py", line 10, in |
There should be no need to move the quantlib folder, you can just run |
Thanks a lot - that worked. |
Hello -
I get the error below. Can you help? I have setuptools installed, cython, and a c++ compiler (as I was able to compile and run the QuantLib example as specified here: http://quantlib.org/install/macosx.shtml
python setup.py build_ext --inplace
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'cython_directives'
warnings.warn(msg)
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'pyrex_directives'
warnings.warn(msg)
missing cimport in module 'quantlib.time': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/credit_default_swap.pyx
missing cimport in module 'quantlib.pricingengines': quantlib/instruments/option.pyx
running build_ext
building 'quantlib.cashflow' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/local/include -I/Users/marywilliamson1/Downloads/QuantLib-1.4 -I. -I./cpp_layer -I/Users/marywilliamson1/Documents/projects/pnlbooker/virtualenv/lib/python2.7/site-packages/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c quantlib/cashflow.cpp -o build/temp.macosx-10.9-intel-2.7/quantlib/cashflow.o
In file included from quantlib/cashflow.cpp:361:
/Users/marywilliamson1/Downloads/QuantLib-1.4/ql/time/date.hpp:276:30: warning: implicit
conversion loses integer precision: 'long' to 'Day' (aka 'int') [-Wshorten-64-to-32]
return serialNumber_ - yearOffset(year());
~~~~~~ ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
quantlib/cashflow.cpp:2083:18: warning: implicit conversion loses integer precision:
'size_type' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
__pyx_v_size = __pyx_v_leg.size();
~ ^~~~~~~~~~~~~~~~~~
quantlib/cashflow.cpp:2585:18: warning: implicit conversion loses integer precision:
'size_type' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
__pyx_v_size = __pyx_v_self->_thisptr->get()->size();
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
quantlib/cashflow.cpp:4778:28: warning: unused function '__Pyx_PyObject_AsString'
[-Wunused-function]
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
^
quantlib/cashflow.cpp:4775:32: warning: unused function '__Pyx_PyUnicode_FromString'
[-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
quantlib/cashflow.cpp:427:29: warning: unused function '__Pyx_Py_UNICODE_strlen'
[-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE _u)
^
quantlib/cashflow.cpp:4897:33: warning: unused function '__Pyx_PyIndex_AsSsize_t'
[-Wunused-function]
static CYTHON_INLINE Py_ssize_t _Pyx_PyIndex_AsSsize_t(PyObject b) {
^
quantlib/cashflow.cpp:4926:33: warning: unused function '__Pyx_PyInt_FromSize_t'
[-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
quantlib/cashflow.cpp:3613:27: warning: unused function '__Pyx_ErrFetch' [-Wunused-function]
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject *_type, PyObject *_value, PyObject *_tb) {
^
quantlib/cashflow.cpp:3956:32: warning: unused function '__Pyx_GetItemInt_List_Fast'
[-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
^
quantlib/cashflow.cpp:3970:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast'
[-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
^
quantlib/cashflow.cpp:4169:26: warning: function '__Pyx_PyInt_As_int' is not needed and will
not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
^
quantlib/cashflow.cpp:4295:27: warning: function '__Pyx_PyInt_As_long' is not needed and will
not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
^
13 warnings generated.
quantlib/cashflow.cpp:4778:28: warning: unused function '_Pyx_PyObject_AsString'
[-Wunused-function]
static CYTHON_INLINE char __Pyx_PyObject_AsString(PyObject* o) {
^
quantlib/cashflow.cpp:4775:32: warning: unused function '__Pyx_PyUnicode_FromString'
[-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
^
quantlib/cashflow.cpp:427:29: warning: unused function '__Pyx_Py_UNICODE_strlen'
[-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE _u)
^
quantlib/cashflow.cpp:4897:33: warning: unused function '__Pyx_PyIndex_AsSsize_t'
[-Wunused-function]
static CYTHON_INLINE Py_ssize_t _Pyx_PyIndex_AsSsize_t(PyObject b) {
^
quantlib/cashflow.cpp:4926:33: warning: unused function '__Pyx_PyInt_FromSize_t'
[-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
^
quantlib/cashflow.cpp:3613:27: warning: unused function '__Pyx_ErrFetch' [-Wunused-function]
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject *_type, PyObject *_value, PyObject **tb) {
^
quantlib/cashflow.cpp:3956:32: warning: unused function '__Pyx_GetItemInt_List_Fast'
[-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
^
quantlib/cashflow.cpp:3970:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast'
[-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
^
quantlib/cashflow.cpp:4169:26: warning: function '__Pyx_PyInt_As_int' is not needed and will
not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
^
quantlib/cashflow.cpp:4295:27: warning: function '__Pyx_PyInt_As_long' is not needed and will
not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
^
10 warnings generated.
c++ -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -mmacosx-version-min=10.6 build/temp.macosx-10.9-intel-2.7/quantlib/cashflow.o -L/usr/local/lib -lQuantLib -o /Users/marywilliamson1/Downloads/pyql-master/quantlib/cashflow.so -stdlib=libstdc++ -mmacosx-version-min=10.6
ld: library not found for -lQuantLib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1
(virtualenv)marys-mbp:pyql-master marywilliamson1$ c++
clang: error: no input files
The text was updated successfully, but these errors were encountered: