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

Get homebrew package for tauthon #70

Open
naftaliharris opened this issue Feb 24, 2017 · 13 comments
Open

Get homebrew package for tauthon #70

naftaliharris opened this issue Feb 24, 2017 · 13 comments

Comments

@naftaliharris
Copy link
Owner

No description provided.

@naftaliharris naftaliharris changed the title Get homebrew packages for tauthon Get homebrew package for tauthon Feb 24, 2017
@torgil
Copy link

torgil commented Feb 26, 2017

Is anyone working on this?

Trying just to do "python setup.py build" from homebrew and run the produced "python.exe" has a number of missing build-dependencies (I run Sierra 10.12.3) :

$ python --version
Python 2.7.13
$ which python
/usr/local/bin/python
$ ls -l /usr/local/bin/python
/usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python
$ git rev-parse HEAD
8e4dc294920bad1cd54cac8f8e1bd9d26d38d8ed

Issue1: link-error for 'cmath' and 'math' extenstions

clang: error: no such file or directory: 'Modules/_math.o'

I fixed this with just building the offending object manually:

clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Mac/Include -I. -IInclude -I./Include -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ./Modules/_math.c -o ./Modules/_math.o

Issue2: missing symbol in operator.so _PyNumber_InPlaceMatrixMultiply
Here I found that the missing symbol was defined in Objects/abstracts.c so I just linked manually with that object:

clang -bundle -undefined dynamic_lookup ./Modules/operator.o ./Objects/abstract.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -o build/lib.macosx-10.12-x86_64-2.7/operator.so

Issue 3: runtime error directly when starting python

$ ./python.exe
...
ImportError: No module named _sysconfigdata

I didn't fix this I just copied the file from homebrew Python2.7:

$ cp /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.py Lib/

Issue4:

>>> import functools
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/torgil/src/python/tauthon/Lib/functools.py", line 10, in <module>
    from _functools import partial, reduce
ImportError: No module named _functools

I stopped here, I guess a workaround for this isn't as easy as copying from Python2.7..

@naftaliharris
Copy link
Owner Author

Is anyone working on this?

No, but I'd love help on it! :-)

Trying just to do "python setup.py build" from homebrew and run the produced "python.exe" has a number of missing build-dependencies (I run Sierra 10.12.3) :

I believe you're building tauthon incorrectly. (It's the interpreter, not a python package, so has a different build mechanism). Instead do:

$ brew install openssl xz
$ CPPFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" MACOSX_DEPLOYMENT_TARGET=10.6 ./configure
$ make

(This is also the way to build the ordinary CPython interpreter).

@torgil
Copy link

torgil commented Feb 27, 2017

After getting ranlib: Cannot find plugin 'liblto_plugin.so' and tried numerous compilers with various errors and options I finally figured out to do rm /usr/local/bin/ranlib (mismatching binaries in my toolchain) and got it working with your config.

Binary is now "tauthon.exe" and your examples work. Awesome! Thanks!

I'll dig in to the world of ruby and try to get a homebrew package working. If someone with homebrew knowledge wants a package (maybe a former Python maintainer), please jump ahead and don't wait for me.

@naftaliharris
Copy link
Owner Author

Excellent, thank you! :-)

Let me know if/when you need me to cut a release, (i.e. tar up the project and peg a version number to it).

@proteasome
Copy link

proteasome commented Feb 27, 2017

open new issue instead concerning numpy failure

@torgil
Copy link

torgil commented Feb 27, 2017

A strategic question before I start:
Are we aiming for python2 replacement here (eg link /usr/local/bin/python -> /usr/local/Cellar/tauthon/... ) or should we stay with tauthon and let those who want this do the link?
I could go either way as I probably want to get accustomed to "tauthon" (or alias "tau") anyway.

If we stay with "tauthon", what naming should we use for "idle", "pip" etc?

@torgil
Copy link

torgil commented Feb 27, 2017

proteasome: it'll be very hard to replace python itself with pip. You could lobby on Continuum to move to "tauthon" instead of "python2". That'd be awesome for windows users!

@naftaliharris
Copy link
Owner Author

Are we aiming for python2 replacement here (eg link /usr/local/bin/python -> /usr/local/Cellar/tauthon/... ) or should we stay with tauthon and let those who want this do the link?

tauthon should be a new executable, (/usr/local/bin/python should not be changed to link to it). Not sure what to do about pip, though. Ideas?

@proteasome
Copy link

when building on OSX, i'm surprised to get tauthon.exe instead of just tauthon, especially since i don't have any python.exe executable files in my usual python builds, just python. i'm .exe is windows only, or am i missing something here? (i'm NOT using brew, so i may have mangled something). certainly the tuthon.exe works(mostly). so it 's not a showstopper

@torgil
Copy link

torgil commented Feb 27, 2017

I looked at Ubuntu handling of idle today and maybe there isn't a big issue here. idle is installed to idle-python2.7 and idle-python3.5
we could just install it to idle-tauthon2.8
There were no symlinks from idle3 or idle (they were copies) but they should have been idle -> idle-python2.7 and idle3 -> python3.5. Then every user can use update-alternatives to change which idle they want.

Maybe we should have a convenience-link to latest tauthon or claim "idle" if python2 is not installed but it's not an urgent question I think.

@naftaliharris
Copy link
Owner Author

when building on OSX, i'm surprised to get tauthon.exe instead of just tauthon, especially since i don't have any python.exe executable files in my usual python builds, just python.

Yeah, I'm not sure why this is, but CPython also gives the OSX executable a ".exe" extension when you build it. Although if you install it with "make install", I believe the ".exe" extension should be dropped in the installed binary?

@proteasome
Copy link

yep. it was an artifact of using only "make altinstall". which only creates a local tauthon.exe and no tauthon.

however, using "make install" steps on my python2 (2.7.13):

"""
$ which -a tauthon.exe
$
$ ls -l which -a tauthon
lrwxr-xr-x 1 enzyme admin 7 Feb 27 11:00 /usr/local/bin/tauthon -> python2
$ ls -l /usr/local/bin/python2
lrwxr-xr-x 1 enzyme admin 9 Feb 27 11:00 /usr/local/bin/python2 -> python2.8
"""
i didn;t notice at first since i'm using anaconda, however, i'd rather not have it stepped on
"""
└─╼ which -a python2
/Users/enzyme/anaconda/bin/python2
/usr/local/bin/python2
"""

this will probably be fixed when the the other python refs are changed to tauthon.

not sure if "make altinstall" for vanilla python create only .exe

@n3h3m
Copy link

n3h3m commented Dec 20, 2019

Where are we with this? I would like to see tauthon to be installed Homebrew at the earliest :)

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

4 participants