-
Notifications
You must be signed in to change notification settings - Fork 16
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
libgd and libpng out-of-date? #107
Comments
Yeah, it's linked against somewhat older libraries mainly because some of the computer clusters I use are on somewhat older Centos versions without the latest lib versions. I'm building it for *nix, but am by no means an expert. Do you know if there is a more generic way to build against libraries so we don't have version issues like this? |
I'm not sure. It might be solved by specifying compiler flags differently? This thread looks promising. |
Hmm. Does your setup have |
I have looked both on my local system as well as within a docker container. Both have |
So no major gain on |
Ultimately, I wish we could move away from ifort and move to gfortran and just create an easily built package for *nix users. |
Could this be dockerized? Would that violate ifort terms of service? |
No clue. But I did setup something similar on a Travis build for GLM. General steps for installing, setting up, and using ifort to build GLM is here. |
@lawinslow: I just posted issue #122 about GLMr on Debian before noticing this issue, and I do hae libpng. Technically, I have libpng-dev, libpng-tools, libpng16-16, and libpng16-16:i386 installed.. I don't have either libpng or libpng12 available to me on Debian Stretch. |
@bharris-fs Did you try my solution above symlinking
|
@jsta No, I did not. When I do something like that, I tend to forget about it and then end up with a bit of a jumble. Besides, the computer I really plan to use with GLMr runs W7 or Windows 201 6 Server. |
Okay, I got a free moment and tried:
Then I went back to the same GLMr session:
The good news? It got farther, but does this mean it also checked the version of "libpng12.so.0"? @lawiinslow: There's maybe a bit of good news.: there's a libpng.so in the above that's linked to the current version of that library, so, at least on Debian, your hope might work. I thought it would not, because I simply looked at Debian packages, not what gets installed. Any way around the version PNG12_0 problem? |
Hmmm, there is most certainly way around the problem. Just not sure the easiest, or most universal option. My naive understanding is that its often easier just to build every binary locally on *nix systems because of the challenge of linked libraries. Its best to have everything just linked to local versions of dynamic libraries. You can see it here. The issue you are seeing is that one of the dynamic libraries I've included in GLMr (libgd) is looking for a specific version of libpng. Just thinking off the cuff here. More permanent options include:
We could try the above num 3 as a first cut. It might solve this issue as-is for a little while. Thoughts? |
@lawinslow, yes, there can be advantages to building locally, I think. From your four choices, here's my mildly-informed response:
I'm curious: why is this a problem here? Is it because existing Fortran code in GLM needs something special? Is there anything to be done in figuring out why GLMr has this issue but most other R packages do not? You probably know. I don't, but GLMr looks tantalizingly close to something I could make use of right now. Thanks for thinking about solutions together! Do you have more thoughts? |
The issue here 99% lies in difficulty building GLM. It's not setup at the moment to just throw standard tooling at it and get a nicely built binary. If that option were available to us, then we could easily just have GLM built as part of the GLMr build process (something many R packages do) and directly link with the locally-available shared libraries. This is one of the reasons CRAN enforces a basically 100% open-source distributed codebase. The primary culprit is the requirement to use the Intel Fortran compiler (ifort; instead of say gFortran). This is not free, or commonly available to be used for building on most systems. If we could fully build via gFortran, then there would be no problem. My understanding is the missing Fortran 2008 features in gFortran are what is holding back a fully open-source build process. But because we must pre-compile GLM on a build machine with ifort, we then get these dependency issues. For Windows and Mac, it isn't quite as large an issue as we largely re-distribute the majority of linked dynamic libraries (though this has recently caused all sorts of issues with latest mac releases, sigh). Hence my thought # 3 above. Distributing more libraries isn't as much of an issue was it might sound either, considering the libraries will not be available on your path and therefore not conflict with anything else installed on the system (beyond when used for GLM). |
Thank you for the clear explanation. I should have figured it was something like that; there seems to be little reason to go to the complexity of included libraries if you don't have to. I'd say that you should do exactly what you think you should do for GLM, which sounds like option 3. At this point, I'm still evaluating my alternatives, so don't regard anything I've written as equivalent to "If you add this capability, I will use GLMr." |
I am having trouble running
GLMr
. It installs without error but I am getting the following error:> devtools::install_github("GLEON/GLMr")
> GLMr::glm_version()
Update Summary
I think I was able to solve this issue by symlinking as follows:
$ ln -s /usr/lib/x86_64-linux-gnu/libgd.so.3 /usr/lib/x86_64-linux-gnu/libgd.so.2
$ ln -s /usr/lib/x86_64-linux-gnu/libpng16.so /usr/lib/x86_64-linux-gnu/libpng12.so.0
Misc
$ ldconfig -p | grep libgd
$ ln -s /usr/lib/x86_64-linux-gnu/libgd.so.3 /usr/lib/x86_64-linux-gnu/libgd.so.2
$ Rscript -e "GLMr::glm_version()"
$ ldconfig -p | grep libpng
$ ln -s /usr/lib/x86_64-linux-gnu/libpng16.so /usr/lib/x86_64-linux-gnu/libpng12.so.0
$ Rscript -e "GLMr::glm_version()"
> sessionInfo()
Docker Image
https://hub.docker.com/r/jsta/glm-test/
The text was updated successfully, but these errors were encountered: