-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fail to compile with R 3.4.0 (homebrew) under Mac OS #191
Comments
Looks like you are not linking to the standard C++ library, so maybe your R installation is broken? CAn you install other packages with C++ code? |
For the record, this is not caused by a faulty R installation. igraphs is currently the only R package failing to link with gcc7 on this machine (Bioconductor successfully installed). On another machine of mine, running Fedora Linux, installation is successful. As this forum shows other unattended reports of failing igraphs installations in the same circumstances, I think that closing this thread without further discussion is premature. |
I also ran into this issue installing from CRAN using homebrew R 3.4.0_1 on OSX with gcc-7, due to the reverse dependency from lintr. Even installing the binary package yields an error when I try to load the package. Other packages (devtools, xgboost, bartMachine, glmnet, dplyr, randomForest, etc.) install from source just fine. install.packages("igraph")
No benefit from trying the dev version: devtools::install_github("gaborcsardi/pkgconfig")
devtools::install_github("igraph/rigraph")
|
This remains very puzzling. I have now followed the instructions found here, i.e, removed @gaborcsardi, would it be possible that some system libraries, outside of the R installation tree, need to be recompiled in order to satisfy |
In addition, the binary version of the package does not install as well:
@ck37, did I read correctly that the binary version installs properly on your system? |
@gtms you're right, I can install it without error but I do get that error message when I load the package :/ |
Update: the solution is just to modify ~/.R/Makevars to temporarily use clang for this package, then it will compile fine. I had to do the same thing for magick (ropensci/magick#54). |
Thanks @ck37, success. For future reference, I'm posting my
@gaborcsardi, closed. |
It's still a bug that gcc doesn't work though - recommend keeping this open.
… On Jun 5, 2017, at 3:15 AM, Gil Tomás ***@***.***> wrote:
Thanks @ck37, success.
For future reference, I'm posting my ~/.R/Makevars:
LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include
# CC=/usr/local/Cellar/gcc/7.1.0/bin/gcc-7
CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
# CXX=/usr/local/Cellar/gcc/7.1.0/bin/g++-7
CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
# CXX1X=/usr/local/bin/g++-7
CXX1X=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
SHLIB_CXXLD=/usr/local/Cellar/gcc/7.1.0/bin/g++-7
FC=/usr/local/Cellar/gcc/7.1.0/bin/gfortran-7
F77=/usr/local/Cellar/gcc/7.1.0/bin/gfortran-7
MAKE=make -j8
SHLIB_OPENMP_CFLAGS=-fopenmp
SHLIB_OPENMP_CXXFLAGS=-fopenmp
SHLIB_OPENMP_FCFLAGS=-fopenmp
SHLIB_OPENMP_FFLAGS=-fopenmp
@gaborcsardi, closed.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
How do I actually open and modify the Makevars file? |
Use a text editor: in the Terminal type `open ~/.R/Makevars`
…On Wed, Jun 7, 2017 at 9:57 AM, omarparr ***@***.***> wrote:
How do I actually open and modify the Makevars file?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#191 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AADGUvjaAEu81f_QgkXSjRghNtUyoCzcks5sBtZugaJpZM4NYRLj>
.
|
The compilation of igraph 1.1.1 fails also on Windows 8 with the latest R (3.4.1) and Rtools (3.4.0.1964). |
did y'all install using homebrew? I am also running into this same issue installing the qgraph package. somehow doing the following managed to fix it (stolen from homebrew-php)
then retrying c.f. stack overflow and homebrew-php github |
I have noticed that R.framework is missing on /Library/Frameworks when installed through homebrew (I was using R 3.4.2, Homebrew Homebrew 1.3.6-169-g2af9813). I uninstalled everything and installed R from CRAN (the .pkg installer. I attempted to install it through brew, but I got an error), as well as XQuartz. Then igraph installed without a hitch. |
I have the same issue. Any updates or resolve? |
None of the solutions provided here worked for me. |
got the same error, any helps, thanks |
Can confirm that installing
|
This does not work on 3.6.1 either, and on my system (macOS 10.14.6), there is no ~/.R/Makevars to edit. Creating one and adding the CC, CXX flags does not help. |
Ran into similar issues, and can confirm setting |
After running
and with this content of
I still see the fortran error:
I've looked into https://stackoverflow.com/questions/35999874/mac-os-x-r-error-ld-warning-directory-not-found-for-option, but updated the gcc version to |
❯ ls -la /usr/local/bin/gfortran*
lrwxr-xr-x 1 tamas admin 33 Sep 1 00:13 /usr/local/bin/gfortran -> ../Cellar/gcc/11.2.0/bin/gfortran*
lrwxr-xr-x 1 tamas admin 36 Sep 1 00:13 /usr/local/bin/gfortran-11 -> ../Cellar/gcc/11.2.0/bin/gfortran-11* Do these symlinks exist for you? Does |
@ntamas thanks for your comment. I would also much rather have homebrew in The syllinks in fact do not exist and `gfortran -v´ gives me the following
I think I'll try to start over with a fresh setup of homebrew so that things live where they belong UPDATESeems that
(taken from https://docs.brew.sh/Installation) |
This is just a stab in the dark, but maybe the PATH that R is using when compiling packages is different from your system PATH and does not include Incidentally, @szhorvat is struggling with similar issues on macOS when he tries to compile igraph; in his case, |
FWIW, I also had R doing that to me, so it's good to check |
You don't run macOS though, do you @iosonofabio? Are you saying you get the same problem with missing |
@ntamas thanks again for your follow up suggestions! In my pursuit of sorting this mess out somewhat systematically, I wiped homebrew and Xcode completely and reinstalled everything from scratch "by the book". This is where I stand currently: The known knowns by now
The known unknowns
The things I thought about trying next
UPDATE 2021-10-01 10:24
|
This is a misleading error message; it typically happens when the
On my machine it is nonexistent. As far as I know it is meant to contain customizations to the stock build system configuration that ships with R, and on my machine things work without any customizations. I would first try with removing
It's in the temporary build folder that R creates during the installation (and deletes subsequently). If you want to take a look at it, maybe the easiest way is to download the source package directly from CRAN, extracting it to a folder and then running |
So, for everyone who tries to set up a custom C or Fortran compiler in
The commit that fixes the problem in |
@ntamas thanks, that sounds very promising! However, I cannot piece everything together yet as makevars & Co. are completely new to me. Would you mind writing down a short "recipe for dummies" on what to do exactly, step by step? 😬 I installed the dev version of This would be so much appreciated :-) |
If you just want to compile igraph, you don't need to. It is sufficient to have the dev version of
My
This is just an example. The principle is:
There is a risk of incompatibility if you don't use the same compilers that were used to compile R itself. See the compilers which are used by the official R distribution. I am not sure how high the risk is with Fortran, but to be safe, it might make sense to only specify the Fortran compiler in |
@szhorvat thanks so much, that was the missing piece! Based on your After some troubleshooting (the evolution of which can be followed by looking at the commented-out vars and me trying to understand why that particular line didn't work), this is the version that got me through a clean install both via
Remaining known unknownsApparently I still don't understand the following things:
|
@ntamas looked into After extracting the package source code, running Below I posted those parts of Apparently there are still a couple of warnings and errors even though the build went through per se 👉 should these bother me? Also tried
|
No, these are fine - the C core was released quite a long while ago, and newer compilers tend to be pickier than older ones so there are a few warnings that did not appear before. |
From the console:
Also fails to install development version:
Any hints?
The text was updated successfully, but these errors were encountered: