-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
igraph failing to compile due to missing libgfortran.so.4 (Arch based Linux) #275
Comments
Haven't had any luck solving this. Is it an issue with the igraph lib, or with R itself? (I've been able to install other packages successfully, however) |
|
I thought this was included in gcc, but anyway did you try installing
gfortran? sudo apt-get install gfortran
…On Thu, May 24, 2018 at 7:08 AM, Oscar South ***@***.***> wrote:
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Manjaro Linux
Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblas_sandybridgep-r0.2.20.so
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.5.0
>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#275 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AEwlHNGxnSm0fIfPl1-jAXGRZmxDFoywks5t1pSsgaJpZM4UJMfH>
.
|
Thanks for the assistance. I made sure that it’s installed on my system (as you say, it’s included with gcc, and I also double checked carefully). I think that the issue is that gcc 8 bumped it up from libgfortran.so.4 to libgfortran.so.5 and igraph has a dependency on the former. Since the newer dependency isn’t fulfilling the requirement and downgrading gcc isn’t exactly a good idea, I can’t see an easy solution. I could be wrong about this, but from a few hours of unsuccessful troubleshooting, this is what it looks like to me. Not sure if it’s something to fix on my end or a case of waiting for an igraph update that fixes the dependency. |
I have essentially this same problem with ubuntu based linux 16.04. Can confirm that I have gfortran installed, as well as all of the dependencies for devtools, but when I run:
I also am unable to use igraph or install anything that depends on igraph in this case. |
I had the same problem on Manjaro Linux. |
@ShotaOchi Thanks but in this case the issue is caused by a mismatched version dependency — gcc-fortran comes with libgfortran.so.5 while igraph requires the outdated libgfortran.so.4 which is not provided by the up to date gcc-fortran version. |
no, it does not. igraph works with any version. |
@OscarSouth I think you have a broken installation. Your R installation was built with libgfortran.so.5 and your igraph installation or package was built with libgfortran.so.4. Did you compile igraph yourself? Then you need to re-install (=recompile) it from the source R package. If you installed it from a binary package provided by your platform, then that package is broken, see if there is a new version of it, or install from the source R package. |
@gaborcsardi Thanks for the insight here. The discussion available through google search is a bit misleading on this issue if that is the case. I installed R from repository using the pacman command and attempted to install igraph with the install.packages() tool inside R. Is this what you mean by the source R package, or should I attempt to install it by another method? |
Yes, then you built from a source package, so I am not sure why it was broken. I would try to just re-install it. You can use the
and then try to load it:
If loading fails, check which libs the igraph shared lib links to:
|
Thanks for the assistance. This is the results of
This is the results of
This is the results of
|
I think either you have an older gfortran on your system, or some other library links to libgfortran.so.4. |
@gaborcsardi I did some exploration into that when I first experienced this issue. As far as I can tell based on what I can determine from my system and the experience I could uncover of others who've had similar issues, it's because igraph expects an earlier version of libgfortran than the most up to date gcc distribution provides.
I read into gcc and the dependencies that it provides and libgfortran.so.4 is not included in the newer versions of gcc. That's as deep as I managed to go on personal exploration and intuition. The only solutions that I could find presented were suggestions to downgrade an earlier version of gcc which provides the earlier version of libgfortran that igraph is asking for here, but I expect that would cause a lot more troubles than it'd solve. |
I am still not sure why you think that. It is definitely not the case. I think you might have an earlier libgfortran lying around, e.g. from another package, and R finds that one while installing igraph, but then it does not find it while you are loading it. |
@gaborcsardi I’m definitely not convinced on that situation, that’s just the most realistic I got from the related stack overflow questions that I read on it. I’m glad to hear another perspective and a potential opportunity to solve the issue. Do you know of any way I can check for the existence of the situation which you propose? (Or solve it) Thanks for the help so far, much appreciated |
Look for libgfortran* files on you machine. |
Pulled at this string and finally managed to get it to install by creating a
then running
Cheers for pointing me in the right direction! |
Hi @OscarSouth, may I know where I should create .R/Makevars? |
Same problem here on Arch, still not solved unless I preload libgfortran.so.4 from some other places first or softlink one |
Solved by renaming libgfortran.so.4.0.0 in the local anaconda3 directory to something else, and recompile
Still not sure why this happened since other packages that depend on gccfortran are able to find and use the libgfortran.so.5 on the system. |
same problem when you installing igraph in Ubuntu 16 |
@cls3415 |
@danielee0707 I tried that out myself (rebuilt some packages today including igraph) and it also worked for me |
I have the same issue. But editing the Makevars did not work for me. Do I maybe leave out the "#" before each line? If you have other idea @OscarSouth , please let me know! Thanks Edit: Never mind, I set up a new instance and used the rutter R 3.5 package list and it worked. |
My preferred solution in the end is that suggested by @danielee0707 |
@danielee0707 's strategy worked for me. I found there were about four versions of libgfortran.so.4.0.0. Navigating to my anacondas directory and running then
` Some things that didn't work, in my case: I had removed the Makevars file suggested by @OscarSouth @chengarthur 's suggestion of running
did not seem to help |
I just had the same problem installing igraph in Ubuntu 16.04 on R 3.5.2. I can confirm that this issue is due to the package installer trying to use the shared object library for libgfortran in Anaconda3 when compiling the igraph package. A very quick and dirty work around for this is to temporarily break your Anaconda installation by moving it to a .bak folder, install igraph in R, and then move Anaconda back to its original directory name.
Now if you load igraph with NB: You do not need sudo in the above command if you have Anaconda installed in your home directory. |
igraph 1.2.7 was just released a few days ago. However, there are no binary packages for Linux served by CRAN, so people still need to compile it.
Could you elaborate on this? I would assume that conda sets the paths correctly when activating an environment. Python also has the same problem; on most platforms there is also a system Python available. With Python I never experienced path problems between conda and system Python though. Does this work differently for R somehow? |
Some comments. I actually did not manage to reproduce this. I used Ubuntu 18.04 with stock R, downloaded Anaconda with Python 3.8, activated it, and igraph installed just fine. This said, it is not hard to see how things can go wrong. conda comes with all of its dependencies included, probably because they don't want to rely on the system and want you to use Which is fine, except that when you want to compile or use non-conda software, e.g. R from Ubuntu, you need to deactivate conda, otherwise your non-conda software will depend on a mixture of the conda libraries and the system libraries. This might work depending on what versions of what libraries are installed in conda and the system, but often it won't. It will typically fail if conde is much older or much newer than the system you are running it on. E.g. when you compile igraph with an active conda you'll see things like
so igraph will use libxml2 from conda. This will work if the system libraries are compatible with that, otherwise it won't. Moreover conda's
which basically means that the libraries in conda are preferred over the system libraries. Not good. In summary, R relies on the system libraries, and when conda is active it will override a subset of the system libraries. The resulting mixture of libraries might not work together properly. This is not specific to R, an active conda might break any non-conda compilation or usage this way. Again, the solution is to deactivate conda. I also don't see what igraph can do about this. Maybe we can give a loud warning when conda is active but you are using non-conda R, and tell people to deactivate conda? I am not sure how to detect this, but it is probably possible. r-igraph is already on Conda, AFAICT most popular R packages are. |
This comment has been minimized.
This comment has been minimized.
This illustrates well the unpredictability of the situation: Whether the conflicts happen will also depend on what is installed in the currently active Conda environment (which constantly change as the users adds/removes/updated conda packages). To reiterate: Always fully deactivate all conda environments before compiling igraph, or any other software. This is the right solution. If your igraph depends on libraries within your Anaconda installation then you're on thin ice for the reasons detailed in Gábor's comment.
This is dangerous. Please just do not do that. |
To elaborate, this will make all your system software (including R) potentially depend on the conda libs, even when you deactivate conda. So it is better not to do that. |
Okay thanks I understand now! I hid my own reply so that people won't be tempted to copy paste :) |
Sorry, I was not aware it was already available. |
I was only able to find this, which is an older version: https://anaconda.org/r/r-igraph However, as far as I understood, no one in this thread was asking to use R/igraph within the Anaconda ecosystem. People tried to compile igraph either with the official R distribution, or their Linux distro's R, not Anaconda's R. It just happened to be the case that the most common cause of failure was interference from an active conda environment. I think the best solution here might be less conda, not more conda (i.e. just deactivate conda when compiling igraph). |
I don't think it is old. Older than the release 10 days ago, sure, but otherwise there hasn't been anything new in the R package: https://github.com/igraph/rigraph/blob/dev/inst/NEWS.md |
Installing igraph in RStudio with no active Conda environment solved the problem for me. I think this is the easiest and safest solution. |
Just want to add that this solution work worked for me too, on PopOS! 20.04. |
@TheRealDrDre What does |
|
@TheRealDrDre Do you use Anaconda? Did you have any conda environment active when you tried to install igraph? Also, can you post the exact error message that you got when you tried to compile igraph? We are looking to write a troubleshooting document for the most common installation issues. It would help to better understand what exactly is happening. My working hypothesis is that basically all complaints about a missing |
Hi @szhorvat . I do have anaconda. I had dactivated the conda environment before and tried to install igraph unsuccessfully. With the conda environment deactivated and the .R/Makevars in place, |
Thanks! It works |
Both errors linked to "libgfortran.so.4.0.0" and "libmkl_rt.so.1" happend to me. Solutions mentionned to rename all those files found in miniconda worked for me.
And then install igraph: |
Don't do that. Instead, always deactivate any conda environments before compiling igraph or any other software. Conda has the potential to create conflicts, as you just experienced. Troubleshooting information is here: https://github.com/igraph/rigraph/wiki/Installation-Troubleshooting |
Yeah it would be the good thing to do if only i add a conda environment activate, but this is not the case :-/ ... So how is it possible to prevent R from checking for librairies in conda folders ? |
Are you certain that you do not have any environment active, not even the base environment? What does Also check your |
Yes i'm sure, But anyway, I accord you that the solution isn't pretty, but at least it works ! Can't ask more with this deadly R langage. |
This is very likely the source of the problem. That directory contains all executables installed into the base environment. Inly You may want to edit your profile and delete the line that adds
This is not really related to R. Expect trouble when building/installing any software that uses Fortran or BLAS. |
In my case it was resolved doing
|
@igorkf This is not the correct solution, as you are not addressing the true cause of the problem, and you are risking further issues. Please see the troubleshooting document: https://github.com/igraph/rigraph/wiki/Installation-Troubleshooting |
it works!!!!!!!!Thank you |
Check |
This worked for me and is a much better suggestion than what the igraph installation troubleshooter offers. |
A broken dependency for igraph is preventing me from installing many R libraries which depend on igraph.
I attempted to install with
install.packages()
and with devtools, both failed in same manner:libgfortran.so.5 is showing up here:
R version 3.5.0 (2018-04-23)
gcc (GCC) 8.1.0
I've tried all the solutions I can find from Google. Is there any solution to this at present?
Thanks!
The text was updated successfully, but these errors were encountered: