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

Configure fails on macOS #35

Closed
abalkin opened this issue Feb 16, 2018 · 2 comments
Closed

Configure fails on macOS #35

abalkin opened this issue Feb 16, 2018 · 2 comments

Comments

@abalkin
Copy link
Contributor

abalkin commented Feb 16, 2018

$ ./configure
KDB+ 3.5 2017.06.19 Copyright (C) 1993-2017 Kx Systems
m32/ 20()core 65536MB a a-imacpro.ny0.nln 10.166.1.30 NONEXPIRE

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: sequence item 0: expected str instance, int found
'os
  [3]  /Users/a/Work/KxSystems/embedPy/configure.q:4: py:{system string[$[count w;pp first w;e`python]]," -c \"",x,"\""}
                                                          ^
q))

I am using Python 3.6:

$ python -V
Python 3.6.4

Here is so more information. The failing python command is

q))-1 string[$[count w;pp first w;e`python]]," -c \"",x,"\""
python3 -c "import sysconfig as c,os,sys;v=c.get_config_var;first=lambda x:len(x) and x[0];d=v('LDLIBRARY');P,p=sys.exec_prefix,sys.prefix;w=lambda x:first([a[0] for a in os.walk(x) if d in a[2]]);L=w(P+'/lib')or w(v('LIBDIR'));I=c.get_path('include');print('\n'.join([L,d,P,p,I]))"

Running it with inspect mode in python gives

$ python3 -i -c "import sysconfig as c,os,sys;v=c.get_config_var;first=lambda x:len(x) and x[0];d=v('LDLIBRARY');P,p=sys.exec_prefix,sys.prefix;w=lambda x:first([a[0] for a in os.walk(x) if d in a[2]]);L=w(P+'/lib')or w(v('LIBDIR'));I=c.get_path('include');print('\n'.join([L,d,P,p,I]))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: sequence item 0: expected str instance, int found
>>> import pdb; pdb.pm()
[0] > <string>(1)<module>()
(Pdb++) L
0

So the culprit is the "walk" function:

(Pdb++) P
'/Users/a/.virtualenvs/3/bin/..'
(Pdb++) v('LIBDIR')
'/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib'
(Pdb++) w(P+'/lib')
0
(Pdb++) w(v('LIBDIR'))
0

Python dynamic library can be found in the following directory on my system:

$ ls /usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython*
/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6.a
/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6.dylib
/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.a
/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin/libpython3.6m.dylib

This directory is correctly reported by python-config:

$ python-config --ldflags
-L/usr/local/opt/python36/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin -lpython3.6m -ldl -framework CoreFoundation
@abalkin
Copy link
Contributor Author

abalkin commented Feb 16, 2018

Hmm. It looks like I reported this before. See #13.

@jhanna-kx
Copy link
Collaborator

Configure is no longer required as there is no compile time dependency on python, so closing out

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