-
Notifications
You must be signed in to change notification settings - Fork 18
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
cannot find hdf5.h when installing into a conda env (windows). #126
Comments
Hi @littlemingone, thanks for your question. I won't have access to a windows computer for the next two weeks so I probably won't be able to make fixes myself to support installation within conda on windows until after then. One other option available for windows is to install a pre-built binary package: install.packages("BPCells", repos = c("https://bnprks.r-universe.dev", "https://cloud.r-project.org")) I haven't tested the windows build recently, but there's a good chance it will work. I was not even aware that conda offered a non-standard R package installation process, so the current In the mean time, I'd suggest either trying the |
Thanks for the quick reply! The prebuilt version works, in the conda env. I can use it now! 😆 To solve the installing problem, I think the easiest way is to provide prebuilt package on 99.9% of users will only use BPCells on linux, windows and macos. So it shouldn't be a huge work. Also, given the extreme memory requirements for single-cell analysis, I recommend BPCell to everyone analyzing single-cell data. A prebuilt package will help a lot. Back to my problem itself. For more detail infomation, I retry the installing with the DEBUG mode. debug log of BPCells install in conda> Sys.setenv(BPCELLS_DEBUG_INSTALL="true")
Retrying without -lsz flag...
Unable to locate libhdf5. Please install manually or edit compiler flags.
And, for confirming that the problem is not cause by some wired system variables or some uncorrect settings on my computer, I tried on another windows machine. In short, the result are same: Compilation work fine in a normally installed R, but cannot find hdf5.h file in a conda R. debug log of BPCells install in another machine> Sys.setenv(BPCELLS_DEBUG_INSTALL="true")
Retrying without -lsz flag...
Unable to locate libhdf5. Please install manually or edit compiler flags.
Personally, I suspect that the system is not calling the files in rtools correctly. My rtools44 was installed outside the conda env due to conda-forge doesn't provide a rtools package. All I know about how R calling Rtools is by an environment variable names RTOOLS44_HOME. I don't know how other R packages find their needed exe files by I am a pure R user and know nothing about C++ or the detail compiler process, so these are all I can do. |
Glad you've got a version you can use in conda. Thank you for the debug logs and pointing out the problem of paths with spaces. That should be a helpful starting point for me once I am back from vacation and can test out with a Windows machine. I'll post any updates here with what I find |
I've had a chance to do some testing on a windows machine, and I think I've identified a set of environment variables that make the installation work for me. This worked on my machine: old_path <- Sys.getenv("PATH")
conda_path <- Sys.getenv("CONDA_PREFIX")
Sys.setenv(
PATH=paste0("C:/rtools44/usr/bin", old_path),
CPATH=file.path(conda_path, "Library/include"),
LIBRARY_PATH=file.path(conda_path, "Library/lib")
)
remotes::install_github("bnprks/BPCells/r")
This setup also requires having hdf5 installed via conda. Using it for someone else might require adjusting the This has a good chance of also working on your setup, though I can't be sure there's not some critical difference between your setup and mine. This isn't quite as clean a solution as I'd like, but hopefully it allows compilation from within conda on windows. |
The R log
And I think maybe you should put a |
I am a windows user, and tried to install BPCells in a conda r environment. R version 4.4.1, installed from conda-forge.
Rtools44 installed.
error log:
R package
hdf5r
was installed. TheRead10X_h5()
function fromSeurat
worked fine. So I have no idea why it cannot find hdf5.h.I also added path to the hdf5.h file in rtools path
E:\Program\rtools44\x86_64-w64-mingw32.static.posix\include
to the System PATH but it didn't work.conda package
hdf5
was installed. BPCells still cannot find hdf5.h file.I also tried in a non-conda R which was installed by cran r installer and it installed BPCells successfully.
By the way, the
bnprks-BPCells-d409a68/cpp/bpcells-cpp: Can't create '\\\\?\\C:\\Users\\PC\\AppData\\Local\\Temp\\RtmpygrNhm\\remotes43ec8fb7af5\\bnprks-BPCells-d409a68\\cpp\\bpcells-cpp'
warings disappear when I use a terminal with Administrator privileges, so I think it is not the key part.The text was updated successfully, but these errors were encountered: