hoffmangroup / genomedata

The Genomedata format for storing large-scale functional genomics data.
https://genomedata.hoffmanlab.org/
GNU General Public License v2.0
2 stars 1 forks source link

Compatibility with Mac #65

Open BradBalderson opened 1 year ago

BradBalderson commented 1 year ago

Hi there,

Thankyou for making a very useful tool and keeping it maintained for such a long period!

I am working on an M2 apple mac, and had a few issues getting it installed.

The most pertinent issue was within the source code of genomedata, specifically include statements for error.h and argp.h in src/_c_load_data.c.

Once I commented these out, as per my fork below, I could get it installed: https://github.com/BradBalderson/genomedata/blob/master/src/_c_load_data.c

I am testing it today to see if this causes run time issues, but the python API imports fine.

Wondering how necessary these libraries are, and if perhaps I should put in a pull request, and send you guys the install steps I used for docs?

Cheers!

EricR86 commented 1 year ago

We're glad you managed to get it to compile on Mac! That's a big reason why we do a source release is to allow determined people like yourself to get the software working on unsupported platforms.

I don't think a pull request makes too much sense since it implies that we officially support a Mac port. We would like to support one, but we do not have any infrastructure to verify ourselves or any in-lab use cases for it. If others come for help we wouldn't be able to troubleshoot.

I think keeping this issue open though to demonstrate to others the steps necessary is quite helpful.

Saying all of that, we have no way of really telling how necessary those libraries are. I suspect they are not but that's just my best guess. A long time ago there was a lot of work done trying to get Genomedata to work on Mac targets but there was also issues of GNU C compliance vs the standard C libraries shipped with Mac. There were scripts to get GNU C libraries, and there were some internally kept in source control so odds are, if things have improved, those libraries are now redundant. Not only that but the source code inside the c file has been simplified. Truly though I have no idea what the current state of that is so it's been largely untouched to hopefully keep alive the dream of allowing others such as yourself to get a source build working if they need to.

BradBalderson commented 1 year ago

Thanks alot Eric, that makes complete sense.

Just for reference for others, on my M2 mac using miniforge conda, these were the installation steps I used, with a forked version of genomedata with the aforementioned C library imports commented out:

    conda env create -n gendata_env python=3.8
    arch -arm64 brew install hdf5
    conda install pytables
    git clone https://github.com/BradBalderson/genomedata
    cd genomedata
    pip install .

Python API imports fine with: from genomedata import Genome

Will post updates if I run into any issues :)

Cheers!