jeffdaily / parasail-python

Python bindings for the parasail C library.
Other
87 stars 17 forks source link

trouble pip installing on os x #24

Open tlambert03 opened 5 years ago

tlambert03 commented 5 years ago

Having difficulty with the pip installer on mac (10.13.6). following along in setup.py, it looks like it fails to find the parasail configuration script, prepends /usr/bin to the path... succeeds in finding everything but libtool:

  Unable to find parasail configure script
  Prepending /usr/bin to PATH
  PATH=/usr/bin:/Users ...
  Running autoreconf -fi from ./parasail-master
  b'This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level'
  b'GNU M4 1.4.6'
  b'autoconf (GNU Autoconf) 2.69'
  b'automake (GNU automake) 1.16.1'
  libtool --version failed
  b'autoreconf (GNU Autoconf) 2.69'

then tries to download/install everything in build_autotools(), but this time m4 fails:

  Building autotools
  Downloading http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
  Expanding m4-1.4.17.tar.gz
  configuring m4
  making and installing m4
  Downloading http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
  Expanding autoconf-2.69.tar.gz
  configuring autoconf
  making and installing autoconf
  Downloading http://ftp.gnu.org/gnu/automake/automake-1.15.1.tar.gz
  Expanding automake-1.15.1.tar.gz
  configuring automake
  making and installing automake
  Downloading http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
  Expanding libtool-2.4.6.tar.gz
  configuring libtool
  making and installing libtool
  Running autoreconf -fi from ./parasail-master
  b'This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level'
  m4 --version failed
  b'autoconf (GNU Autoconf) 2.69'
  b'automake (GNU automake) 1.15.1'
  b'libtool (GNU libtool) 2.4.6'
  b'autoreconf (GNU Autoconf) 2.69'

while I don't yet know why the downloaded m4 fails, I gather that the first libtool failure is related to the glibtool/libtool naming issue on OS X. On my system, calling libtool --version on the command line errs with:

error: /Library/Developer/CommandLineTools/usr/bin/libtool: unknown option character `-' in: --version

whereas glibtool --version works fine (though I did have to install it with homebrew). Anyway, ultimately if I downloaded the parasail source (instead of using pip) and change libtool to glibtool in setup.py, I was able to get it to install and import and ran a couple alignments.

I'm not sure whether there's something specifically screwed up with my system or whether that's something that could be fixed in setup.py... just wanted to let you know though. I suppose figuring out the m4 issue would be just as good, but I haven't gotten to that yet...

thanks!

tlambert03 commented 5 years ago

additional info regarding the m4 problem: if I manually download and install m4 at http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz, then running m4 --version fails with Abort trap: 6 ... however, the built in m4 at /usr/bin/m4 works fine (version = 1.4.6). I've tried this on two different macs (both 10.13.6)

karadaharu commented 5 years ago

Same here. Thank you for the workaround.

jeffdaily commented 5 years ago

I just committed b0a6d0bf74b9a54072ea12ee0976dd19f69c1553. I haven't waited to verify the travis build log, but I have attempted to force the use of glibtool and glibtoolize on OSX.

tlambert03 commented 5 years ago

yep, that worked. I'll try to play a bit more with it and make sure it still works with a variety of environments (brew installs, etc...), but it looks to be working. Thanks!

tlambert03 commented 5 years ago

was installing on a new computer today and have a bit more info: this fix requires already having the autoconf and automake tools already installed (i did this with homebrew: brew install autoconf automake libtool) ... otherwise, setup.py will fail with

Running autoreconf -fi from ./parasail-master
b'This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level'
b'GNU M4 1.4.6'
autoconf not found
automake not found
glibtool not found
autoreconf not found

and when it attempts to install those tools, it also attempts to install m4, and in doing so no longer uses the version at /usr/bin/m4 that works. so the next time it runs m4 --version it fails and aborts installation

qmffkem commented 1 year ago

Hello, i was encountering this issue today. Would it be possible to make the automatic installation of the autoconf and automake if the system does not have it?

jeffdaily commented 1 year ago

This might be related to #65. I was trying to push out a quick release while also switching over from very old travis-ci automation to github actions, and the osx wheel builds were failing.

a-munoz-rojas commented 10 months ago

I think this issue is still present today - pip fails to build wheels for parasail, and it seems to be related to the same issue with m4 and automake. My system is running macOSX with the arm64 chip.

jeffdaily commented 10 months ago

Do you have homebrew? For Intel OSX wheels, doing brew install automake is how I get past this in the github action workflow.

Your request got me curious if I could cross-compile from the Intel OSX github action runner to an M1 target. I'm struggling. IIUC, M1 should have neon vector intrinsics but I can see from CI logs that it's still picking up Intel AVX instead of ARM neon.

Hopefully if you can resolve the brew automake suggestion, your pip install will work okay.

a-munoz-rojas commented 10 months ago

Thanks for the quick reply. Yeah I found that suggestion in one of the previous issues - it was actually failing because of libtools as well, but worked when I did brew install libtools. So at least we know this solution works with M1/M2 chips. I think it was failing when it was searching from glibtoolize which was absent. Thanks!

Ge0rges commented 8 months ago

Hello,

Just want to note that I also encountered this issue on an M1 Mac and it was fixed by the brew install commands listed above, had to include libtools as well.