KxSystems / pyq

PyQ — Python for kdb+
http://code.kx.com/q/interfaces
Apache License 2.0
191 stars 49 forks source link

Unable to install pyq on macOS 10.14 #102

Closed ppatel26 closed 5 years ago

ppatel26 commented 5 years ago

Questions

Steps to reproduce the issue

Expected result

Should Install pyq

Actual result

error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
        char *str = PyUnicode_AsUTF8AndSize(obj, psize);
              ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:1337:17: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                    PY_SET_SN(dest[i], obj)
                    ^~~~~~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:103:19: note: expanded from macro 'PY_SET_SN'
                char *str = PyUnicode_AsUTF8AndSize(obj, &size); \
                      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:1343:13: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                PY_SET_SN(xs, obj)
                ^~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:103:19: note: expanded from macro 'PY_SET_SN'
                char *str = PyUnicode_AsUTF8AndSize(obj, &size); \
                      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:2515:13: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
                PY_SET_SN(xS[i], o)
                ^~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:103:19: note: expanded from macro 'PY_SET_SN'
                char *str = PyUnicode_AsUTF8AndSize(obj, &size); \
                      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/pyq/_k.c:4031:9: error: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
            PY_SET_SN(s, obj);
            ^~~~~~~~~~~~~~~~~
    src/pyq/_k.c:103:19: note: expanded from macro 'PY_SET_SN'
                char *str = PyUnicode_AsUTF8AndSize(obj, &size); \
                      ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

5 errors generated
error: command 'gcc' failed with exit status 1

Workaround

If you know workaround, please provide it here.

sashkab commented 5 years ago
  • Changes in steup.py #80

Why was this required — are you using Python 3.7?

sashkab commented 5 years ago

This is being tracked in internal-1028.

ppatel26 commented 5 years ago
  • Changes in steup.py #80

Why was this required — are you using Python 3.7?

@sashkab Yes using 3.7

I finally go it working after removing all the CFLAGS as recommended by @sitsang

Now every time I sun >pyq I get the following error

Welcome to kdb+ 32bit edition
For support please see http://groups.google.com/d/forum/personal-kdbplus
Tutorials can be found at http://code.kx.com
To exit, type \\
To remove this startup msg, edit q.q
'2019.01.29T21:08:09.241 dlopen(/Users/parvpatel/q/m32/p.so, 2): no suitable image found.  Did find:
    /Users/parvpatel/q/m32/p.so: mach-o, but wrong architecture
    /Users/parvpatel/q/m32/p.so: mach-o, but wrong architecture
  [4]  /Users/parvpatel/q/p.k:3: (`p 2:(`p_init;1))python_dll
sashkab commented 5 years ago

/Users/parvpatel/q/m32/p.so: mach-o, but wrong architecture

Most likely you're using 64-bit python with 32-bit kdb+.

You need 32-bit python in order to use 32-bit kdb+.

sashkab commented 5 years ago

Warnings which were treated as errors reported above were resolved and will be part of 4.2.0 release. Second part is seems to be user error(32-bit kdb+, 64-bit Python), therefore I'm closing. If you still have issues installing PyQ on macOS — please open a new issue.