parasail-python icon indicating copy to clipboard operation
parasail-python copied to clipboard

Bioconda recipe for macosx-arm64?

Open a-munoz-rojas opened this issue 1 year ago • 8 comments

Can't install parasail-python using conda in a Mac with the arm64 chip - the package is missing from bioconda. I know some bioconda recipes are missing for arm64. Not sure if I should post this here or if someone else has created the bioconda recipes for parasail.

a-munoz-rojas avatar Aug 21 '23 15:08 a-munoz-rojas

We have macOS ARM binaries here: https://anaconda.org/nanoporetech/parasail-python/files

bioconda does not make any aarch64 binaries.

cjw85 avatar Oct 02 '23 11:10 cjw85

Hi, Is it possible to make ARM binaries for python 3.9?

DoaneAS avatar Oct 02 '23 16:10 DoaneAS

parasail wheels are python universal. @DoaneAS are you having issue with one of the wheels?

jeffdaily avatar Oct 03 '23 19:10 jeffdaily

Correct, issue is with building wheel.

× python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [91 lines of output]

Happy to provide more output if helpful, but here is where I see the error occuring during build:

$ pip install parasail
...
 × python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [91 lines of output]
    running bdist_wheel
    parasail/libparasail.dylib not found, attempting to build
    Downloading latest parasail master
    Unzipping parasail master archive
    fixing executable bits after unzipping
    Unable to find parasail configure script
    Prepending /usr/bin to PATH
    Running autoreconf -fi from ./parasail-master
    b'This is perl 5, version 30, subversion 3 (v5.30.3) built for darwin-thread-multi-2level'
    b'GNU M4 1.4.6'
    b'autoconf (GNU Autoconf) 2.71'
    b'automake (GNU automake) 1.16.5'
    b'glibtoolize (GNU libtool) 2.4.7'
    b'autoreconf (GNU Autoconf) 2.71'
    configure.ac:13: warning: The macro `AC_CONFIG_HEADER' is obsolete.
    configure.ac:13: You should run autoupdate.
    ./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
    configure.ac:13: the top level
    configure.ac:109: warning: The macro `AC_PROG_CC_C99' is obsolete.
    configure.ac:109: You should run autoupdate.
    ./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
    configure.ac:109: the top level
    configure.ac:109: installing 'build-aux/compile'
    configure.ac:78: installing 'build-aux/config.guess'
    configure.ac:78: installing 'build-aux/config.sub'
    configure.ac:70: installing 'build-aux/install-sh'
    configure.ac:70: installing 'build-aux/missing'
    Makefile.am:22: error: Libtool library used but 'LIBTOOL' is undefined
    Makefile.am:22:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
    Makefile.am:22:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
    Makefile.am:22:   If 'LT_INIT' is in 'configure.ac', make sure
    Makefile.am:22:   its definition is in aclocal's search path.
    Makefile.am: installing 'build-aux/depcomp'
    parallel-tests: installing 'build-aux/test-driver'
    autoreconf: error: automake failed with exit status: 1
    autoreconf -fi exited with return code 1
    ```
    
thanks

DoaneAS avatar Oct 08 '23 17:10 DoaneAS

A work around for the time being on macosx-arm64 is to install parasail using homebrew, then:

PARASAIL_SKIP_BUILD=TRUE
PARASAIL_LIBPATH=/opt/homebrew/Cellar/parasail/2.4.2/lib
pip install parasail

From this I am able to import the library and run the example code.

DoaneAS avatar Oct 08 '23 18:10 DoaneAS

@DoaneAS,

The error autoreconf -fi exited with return code 1 likely stems from not having all the build tools required when you ran the pip install. I received this error when the tool aclocal was not present. To build from the pip source distribution you would need to do the following first:

brew install automake autoconf libtool

(although I note that the setup.py script appears to download an compile some of these tools, but leaves aclocal missing).

cjw85 avatar Oct 09 '23 14:10 cjw85

@cjw85,

I have automake, autoconf, and libtool installed via brew, however I think the issue is the path brew is using on M1 macs. Brew installs everything into /opt/homebrew for M1 macs (see their FAQ for more info).

My $PATH includes /opt/homebrew paths, but I suspect these are being superseded by the mamba environment or search paths specified by the parasail-python installer. E.g. prepending /usr/local/bin or similar. Do you think this is possible?

In any case, after installing parasail via brew install parasail and adding the path to parasail libraries PARASAIL_LIBPATH=/opt/homebrew/Cellar/parasail/2.4.2/lib, I can install parasail-python from source by cloning this repo and pip install ..

DoaneAS avatar Oct 10 '23 00:10 DoaneAS

The setup.py of parasail-python detects that you are running on a mac and then contorts the names of various tools to be equivalents that are expected to be installed through homebrew setup.py#L165. (Incidentally the conda builds of parasail-python patch the setup.py to not have this bahaviour).

By building parasail outside of the Python package one of the things you are accomplishing is sidestepping all the logic in the setup.py. Otherwise the build within the Python pacakge is pretty identical to prebuilding parasail.

FYI, its not that difficult to build the conda package using conda build, if you want the more authentic conda experience. You need only the files from: https://github.com/bioconda/bioconda-recipes/tree/master/recipes/parasail-python and run conda build.

cjw85 avatar Oct 10 '23 11:10 cjw85