-
Notifications
You must be signed in to change notification settings - Fork 14
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 install BPCells on Mac #6
Comments
It looks like your Makevars file accidentally assigns both In any case, I'd keep working on getting your |
Dear @bnprks , I then realized that my Mac is with ARM 64 M1 chip. Therefore, I did the following things to fix the issue:
After the above steps, I am able to get pkgbuild::check_build_tools() to pass! However, the installation of BPCells is still not successful (please see log + Session-Info in the attached file). Do you have any idea what is the problem here based on the log file? In the meantime, I will try to install BPCells using an Intel-chip Mac tonight, and see if this is an issue specific to M1-chip Mac or not. Many thanks in advance. |
The third line of your log file is: If you are able to resolve this yourself, please do leave a comment to help out future M1 users. In the mean time I'll see if I can find an M1 computer to check that the installation works in my hands. For what it's worth, I have successfully installed BPCells on ARM linux computers, so it should be compatible with the CPU architecture |
Hi @bnprks , |
Hi longmanz, I just got my hands on an M1 mac to test. I pushed a couple code changes that seemed to have bugs specific to compilation with the MacOS version of clang, so that may also make a difference for you. To clarify, the suggestions in #3 were specific to old versions of MacOS that lacked full support for C++17 features. It should be fine to use the Apple-provided compilers on all the versions of MacOS that the M1 macs come with. The installation steps that worked for me in my test were:
And the version information I was running with:
Hope that helps -- in general if you get a compiler error that happens while BPCells is actively installing (e.g. after you see the first command printed starting with |
Dear bnprks, To briefly summarize @bnprks 's suggestions for installing BPCells on Mac:
In addition, if anyone with M1 chip is following 2, please make sure to remove the ~/.R/Makevars if you have previously created/altered it, so that R will not use the wrong compilers. Again, many thanks for bnprks's help on this. |
One slight clarification -- the special instructions you linked for Intel Macs should only be necessary if you're running OS X 10.14 Mojave (2018) and older. The Apple-provided compilers work fine in the newer OS versions. |
Hi, I am having trouble downloading BPCells:
Any suggestions? |
The error message is stating it's having trouble locating the hdf5 dependency. I believe on Macs the most reliable way to install hdf5 for BPCells is via homebrew: If all that fails, this comment thread gives some information on how to enable additional debug messages to help diagnose the issue. If you do need to include a long debug message, consider following these instructions to put it in a collapsible section. |
Installing with homebrew worked. Much appreciated. |
Hi, I'm wondering if it is possible to install BPCells with R for x86 (not ARM64) on a Mac M1 because many bioconductor R packages are not compatible with ARM64, so I've been using x86 via rosetta, and I'd like to be able to continue using these. The full error message is in the collapsed section and attached. error from (remotes::install_github("bnprks/BPCells"))
~/.R/Makevars is
Any help with this would be appreciated! Thank you in advance for your time. |
I'm not aware of an easy and reliable option yet to get an x86 installation on an M1 Mac. The main difficulty is the installation of the hdf5 library which BPCells depends on. Homebrew appears to be a reliable source on Mac, but it defaults to ARM as you've noticed. For whatever reason, installing hdf5 through conda on an ARM mac seems to be very finicky and cause compiler issues I don't know how to fix. The next option I might suggest trying would be to try getting hdf5 from the x86 version of homebrew (instructions). This would probably involve uninstalling hdf5 from your existing homebrew install, then installing under the x86 version of homebrew. The other possibility is that the hdf5 website seems to offer downloads with the creation of a free account. Unfortunately I don't have an M1 mac to test on, so I can't tell you for sure if these options will work. But I think they are the next logical direction to try, and hopefully you can give an update if something works (or doesn't) for you. |
Success! Thank you so much for your quick response! What I did:
For x86, brew installs llvm and brew in /usr/local, so they must be there. Thanks again for your help!! |
Glad it's working for you, and thanks for providing the detailed steps of what you did to make it work |
I installed hdf5 using brew, but R still fails to install BPCells: Retrying with pkg-config flags... Any suggestions? P.S. I've removed ~/.R/Makevars and restarted RStudio after installing hdf5 |
Hi @bhayete-empress, to get more complete debugging information, I'd suggest you try running For M1/M2 Mac users, having mismatched x86 and ARM binaries is a frequent source of errors, e.g. homebrew installs ARM-based hdf5 by default, but if you have x86-based R I think this will generate errors. If you're on an M1/M2 mac, could you also confirm that your R is running on ARM (check the "Platform" section when running Those tips plus some googling might be enough to get you fixed, but feel free to post back the results of both the |
Hi I am having issues with installing BPCells. I verified both hdf5 and R are ARM. I installed hdf5 via homebrew. Looks like unable to find hdf5. any suggestions? Thank you in advance! Parallel HDF5: no
Searching for hdf5 in a conda env...
Unable to locate libhdf5. Please install manually or edit compiler flags.
|
Thanks @antholee for reaching out and providing the detailed error log. The core of the problem is due to not finding the hdf5 header files at compile time (visible from this line):
I'm not exactly sure why this happened for you, but it should be possible to circumvent with a little manual intervention. I'd try the following options in order to see if one of them works for you:
All these options are aiming to tell the compiler where to find the hdf5 libraries + headers, and are given in order of most likely to improve all things you compile to most specific to just the homebrew-installed hdf5 libraries. Let me know if any of them work for you, and also which version of MacOS you're running so I can update the installation instructions for users with your setup. |
Hi @bnprks , I was having similar issues as antholee with hdf5 on M2 Mac and your option (3) above seemed to work however now I'm getting the below error. Thank you. Error output* checking for file ‘/private/var/folders/rx/0rmp3h8x26gghc7lh0p70gxc0000gq/T/RtmpTXNVqQ/remotes2ee07ae60f0/bnprks-BPCells-ac4376d/DESCRIPTION’ ... OK * preparing ‘BPCells’: * checking DESCRIPTION meta-information ... OK * cleaning src * running ‘cleanup’ * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories * building ‘BPCells_0.1.0.tar.gz’ Testing hdf5 by compiling example program... Found working hdf5 HDF5_CFLAGS='' HDF5_LIBS='-lhdf5'Testing architecture flag support support...'-march=native' succeeded sessionInfo()R version 4.3.1 (2023-06-16) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Sonoma 14.0Matrix products: default locale: time zone: America/Los_Angeles attached base packages: loaded via a namespace (and not attached): |
Hi @kkelley85, a couple notes from your helpfully attached logs:
Could you double-check that there is not any other error output produced during compilation? (Perhaps if you are running in RStudio some errors might be in a different output tab). Otherwise, could you include the contents of the file |
Hi @bnprks, thanks for responding to figure this out. For some reason, when I installed your package by accessing R via the Mac terminal the installation worked. But I kept getting errors when trying to install using the R GUI. Anyways, thanks again. |
Hi @bnprks, I'm seeing an issue similar to the commenters above. I added Error
Retrying with pkg-config flags...
Searching for config information with h5cc -showconfig and h5cc -show...
General Information:
Compiling Options:
Linking Options:
Statically Linked Executables: Languages:
Features:
Parallel Filtered Dataset Writes: no General Information:
Compiling Options:
Linking Options:
Statically Linked Executables: Languages:
Features:
Parallel Filtered Dataset Writes: no
Testing architecture flag support support...+ for ARCH_FLAG in '"-march=native"' '""'
sessionInfo()
R version 4.3.2 (2023-10-31) Matrix products: default locale: time zone: America/Los_Angeles attached base packages: loaded via a namespace (and not attached): I see the same error in both Terminal and RStudio. The CFLAGS line above is the sole content of Makevars. Appreciate the help! |
Hi @DevBioCode, I think you might also need to add Details on what I think was happening in your log (thanks for including)It looks like the initial attempt at finding the hdf5 library failed (hence my LDFLAGS suggestion), so it fell back to running `h5cc` to detect compilation flags for hdf5 (worked during config, but not later during package compilation). Then, I see at the end of your log the command that hit the error (starting with `clang++ -arch arm64`) didn't actually include the compiler flag you tried to add via CFLAGS. I might have mixed this up and only CXXFLAGS is important here.Could you test if adding CXXFLAGS to Makevars fixes your issue? I'd appreciate if you can report back if that works so we can update the Mac instructions |
Hi @bnprks, it's up and running! Having only
in Makevars led to successful installation, and I've checked that it's running fine too. Setting Thanks again for your help, and for making possible these analyses on personal machines! |
I have to see it is very frustrating to install this BPcell package. I hope someone could improve it. My Mac consitantly tell me Hdf4 is not able to find, though I did lots of troubleshooting. Very sad!!!!! |
Hi @mainyanghr, I'm usually happy to volunteer my time to help troubleshoot people's installation issues, as you can see from the above thread. If you're having trouble, feel free to chime in with what you've tried and what errors you're getting, or open a new dedicated issue. If you're not comfortable with the command line, you might be able to install a pre-built binary from my r-universe account with this line: If figuring out installation is too much of a challenge for you, then you'll probably prefer to wait until BPCells is available through CRAN. If you do want to post more details on your issue, I will have to ask that you try to keep a polite and professional tone |
Hi @bnprks,
Thank you for developing BPCells.
I still cannot install BPCells on Mac, even following your suggestions at #3 (comment).
I have installed clang, hdf5, using Conda. I also generated an R Makevars file as below:
![Screen Shot 2023-03-15 at 1 33 17 PM](https://user-images.githubusercontent.com/8408639/225394175-0fb47c35-6804-4541-bfb7-006ea36ec975.png)
However, when installing BPCells, I encounter the following issue:
![Screen Shot 2023-03-15 at 2 08 05 PM](https://user-images.githubusercontent.com/8408639/225403220-2f8c45dc-5834-43c8-aea1-25d23b51094d.png)
I am using macOS 12.4 (M1 chip). R is 4.2.2.
Do you have any idea what is going on here? Many thanks in advance.
The text was updated successfully, but these errors were encountered: