-
Notifications
You must be signed in to change notification settings - Fork 17
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
Compilation issues on macOS #3
Comments
BPCells requires a C++17-capable compiler to build, in part to take advantage of the improved portable filesystem APIs introduced in the C++17 standard library. It looks like there's some amount of expanded compiler support I can get through additional compile flags in the Some quick research indicates that compilers older than about 2018 may not have the feature and not be supportable Do you know what compiler version you're building with? |
Sorry for the delay here, just catching up on changes coming back from break. Based on my research, it looks like Apple may just intentionally not be providing support for the C++17 filesystem API in its pre-2019 operating systems, even for versions of Clang that could otherwise support it: https://stackoverflow.com/a/58668083 I can't really fix this on the BPCells side, though once we hit CRAN most Mac users won't need to compile it themselves. As a stopgap measure, I've implemented a clearer error message up-front when an incompatible compiler is detected prior to package installation. Short of upgrading your computer's OS version to a more recent release, the actual fix on your end would be to use a clang / gcc version not distributed by Apple. Just to outline those steps for users who are unsure: Here is an approach that I used successfully on a 2015 iMac running macOS 12.6.4 Monterey. This should only be necessary if your first install attempt gets the error:
Steps I used:
For some reason I had trouble using the conda hdf5 with this setup, so I'd recommend using homebrew for both the compiler and hdf5 installation, and deactivate any conda environment you have active prior to installation. Old instructions prior to 4/29/2023 edit
I'm closing this for now, but feel free to re-open with a comment if this outlined solution doesn't work for you. |
Cool, thanks! |
Sorry to re-open this. I'm having a similar issue but running this on an HPC cluster - not Mac - with more limited permissions - aka no homebrew. The environment uses intel/18.0.2 C++ compilers and I tried setting the link to the compilers in ~/.R/Makevars but I still get the same error. Any advice? |
Hi @Dzhan4, if your issue is not on Mac then I'd suggest filing a new issue so we can try to keep these issue threads more focused. From what you've described so far, my suggestion would be to try seeing if your HPC has any non-intel compilers available. I know BPCells should work with gcc >=8.0 (>=9.1 recommended), or clang >= 7.0 (>= 9.0 recommended). Please re-file a new issue covering your problem if you need more help. |
BPCells fails to compile on macOS; the error happens in multiple C++ files at
The text was updated successfully, but these errors were encountered: