bnprks / BPCells

Scaling Single Cell Analysis to Millions of Cells
https://bnprks.github.io/BPCells
Other
166 stars 17 forks source link

Install was not friendly when HDF5 was not installed via RPM in standard location #84

Open kgweiss opened 7 months ago

kgweiss commented 7 months ago

Greetings,

One of my users requested help installing BPCells on our cluster. We use LMOD modules to manage our software. The install configure for BPCells was having a difficult time finding my HDF5 installation. We used the .R/Makevars file and were able to install BPCells after providing the following compiler flags:

CFLAGS=-I/path/to/hdf5/install/include CXXFLAGS=-I/path/to/hdf5/install/include LDFLAGS=-L/path/to/hdf5/install/lib HDF5_CFLAGS=-I/path/to/hdf5/install/include HDF5_LIBS=/path/to/hdf5/install/lib LD_LIBRARY_PATH=/path/to/hdf5/install/lib INCLUDE=/path/to/hdf5/install/include

FYI, we are using HDF5 version 1.10.8 and GCC version 10.3.0.

Just wanted to pass this along in case other users encounter install issues.

Cheers, Ken

bnprks commented 7 months ago

Hi Ken, thanks for the report! I'll also link #44 here, which might have some useful related discussion. One of the issues in that thread was that LD_LIBRARY_PATH on their cluster setup had more than one hdf5 version present which caused dynamic linking errors. The configure file has the logic for finding hdf5 versions.

In most cases I've seen, hdf5 issues are caused by some slightly non-standard setup on the user's end, such as a conda environment messing with library path resolution. Running Sys.setenv(BPCELLS_DEBUG_INSTALL="true") before installation will help print out what test-compilation commands are being run with any errors that are popping up.

But in the event of issues, your approach of modifying ~/.R/Makevars is a good way to brute-force R finding the correct library paths. Just FYI, I think only setting CFLAGS, CXXFLAGS, and LDFLAGS should be sufficient for BPCells but setting some additional ones as you did probably doesn't hurt.