-
Notifications
You must be signed in to change notification settings - Fork 36
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
Installation on older Linux releases with older cmake #119
Comments
Which version of Note that you sidestep
Of course, depending on which Debian release you use these may be older. A new version of |
Thanks for the immediate reply: cat /etc/issue I followed the suggestion to use apt. and r-api-3.5 install did also fail (see below).
Running does also error.
|
Ok, now we know you have Debian 10. Good. What you didn't say is that you also switched to a newer R (likely via the Debian backport) so that In that case you can still try installing |
On a "fresh install" (to be more precise, on a new instance using a Google deep learning image), I get a similar (same) error.
|
There was a recent change made by @astamm, namely 9f42e4d, which aimed to restore something on macOS, it seems like it creates problems on Linux. You could try to revert it. But as demonstrated below, it works for me in both settings so I do not see how / where it is wrong now. One other key issue is that your
which leads us down the road of having to build NLopt from source. I just tried in a current Debian via the
In the first case of a system
In the second case with a local
So I cannot reproduce this for you. Sorry. |
Yes,
In fact, everything is old on Buster because Buster is old! But as is so often true in the software industry, being stuck on an ancient distro is just the way it is because there are a million dependencies and so many considerations. /rant. Perhaps an option is to, after attempting to build |
Sure. But then please also contend yourself with the working version of Around CRAM we are all (generally) volunteer package maintainers who work rather hard at keeping everything working and well-oiled according to CRAN tests so if you need current packages it simply works better on current resources. The most recent change was needed to address a macOS issue blocking (AFAIK) all users on macOS (by no longer having binaries). So your best bet is to locally hack this. Get your the |
I totally agree. I think we are saying the same thing -- it makes sense to me to support or not support a fallback to an older version of the library. At some point, any project has to move on. What that point is up to the development team. And yes, users on Buster etc. can simply install from the archives -- I am so familiar with this strategy that was exactly the first thing I tried. :-) |
Sorry for the dumb question, but I'm having the same problem in Ubuntu 18. I'm successfully installing nloptr v 2.0.1, but then when I try to install something with a dependency on nloptr it tries to install 2.0.2 and fails. Is my only option to use dependencies as False, or do you know of some better way to handle it? |
From context it sounds you are using an installer that defaults to updating related packages? I don't -- I content myself with Or maybe you tried to install a package with a versioned dependency on |
OK, thanks; yes, I was using install.packages for something else. Just wondering if I was missing something obvious. |
The R package manager does not have a 'hold' or 'pin' feature. That is the way it is. But sometimes we want (or must) stick with an older version. One solution I have deployed once is to keep a "hidden" or "cache" library directory somewhere where the scripts or code that need it know to access it, but the "normal" R use does not. That way you can continue to enjoy A simple implementation of that scheme is in my helper script |
Well, I got my code working for the moment, so I thought I'd share in case it helps others.
At least for the moment that's working. |
You re-invented |
There's the possibility the answer to that is that I don't know the cleanest way to do things in R - I haven't worked with it a lot since grad school but have found a niche helping people deploy their R code to our cloud environment. We wind up needing to precompile things to make it work, which seems more about understanding Linux than R. |
Speaking of pre-compile, I did some related work recently I need to promote a bit to get the word out: 19,000 binaries (all of CRAN and a little over 200 from BioConductor) for Ubuntu 20,04 and 22.04. Intro tweets (with "demos") were https://twitter.com/eddelbuettel/status/1522220397357244416 and Anyway, glad you have a workaround! |
As always, thanks for all the work. The project looks great! |
Building and installing |
You are not giving enough details for us to reproduce your problem. |
I also failed to upgrade to nloptr 2.0.2 recently on Ubuntu 18.04 with R-4.2.0 , which has libnlopt-dev 2.4.2. As for the failure to compile embedded nlopt. I found scripts used to compile and install embedded nlopt tools/cmake_call.sh and src/scripts/nlopt_install.sh use cmake's command line options (at least -B, -S and --install) that are not available for the older (3.10.2) cmake installed on Ubuntu 18.04. I am not an expert of cmake so that I do not have any proposal for use of older version of cmake. |
I edited tools/cmake_call.sh and src/scripts/nlopt_install.sh to make cmake command options compatible with cmake 3.10.2 which is the version Ubuntu 18.04 installed. They are posted here. They worked for me, though edited scripts are not clean as compared with the originals. |
That is a good idea, and a good initiative. We may need a bit more generalization though. Line 11 looks off, there is a dangling This also seems to conflate the use of |
Oops! Line 11 was contaminated when and copied and pasted codes to gists. |
@astamm Might be a good idea to retitle this one too to, say, 'Problem installing in Debian 10 or Ubuntu 18.04' as the use of an unqualified 'Problem' is not correct. |
I posted updated edited cmake_call.sh and nlopt_install.sh here |
The current Debian release still under support:
|
All of you are making a good point. We will consider this in the next release. |
The error to link nlopt/lib/libblopt.a by calling following commands
is probably because g++ searched In bose cases although cmake did not finish properly and failed to write (nloptr/src/)nlopt/lib/libnlopt.a, I guess, this error could be occur on macos, too, if the version of cmake installed is older enough. |
Ok. So if I am understanding you correctly, the linking issue would reflect a failure from |
Yes, My idea is that failure of cmake at different stages depending on the versions of cmake prevented from creation of include files and libnlopt.a to the proper location (more precisely search path for library files for libnlopt.a) of g++. I have not yet checked precisely though for versions 2.0.0 and 2.0.1 of nlopt, on Ubuntu 18.04, cmake failed to create libnlopt.a As I mentioned, lack of some newly implemented options of cmake that are used in the two scripts should be the cause of the error reported in the 1st post of this issue as well as the error on Ubuntu 18.04. Those new options enable to write the scripts shorter. On the other hand, as I demonstrated, it is possible to modify those scripts to be able to run with older versions of cmake (at least newer than 3.10). Speaking to nlopt, its CMakeLists.txt only requires cmake newer than 3.2 which is old enough. I do not think, increasing backward compatibility to the older versions of cmake cause further problem. The key challenge would be to control the location of includes and library created by nlopt to make them accessible from g++ |
In addition, I was able to install nloptr 2.0.2 with replacing original cmake_call.sh and nlopt_install.sh with modified version I put on gist on macOS 12.5 with R4.20 (installed using the homebrew formula available at here and cmake 3.23.1 from homebrew. I do think, older syntax of cmake is compatible with the latest version of cmake |
I think that maybe this should work and would be simpler:
avoiding at all the |
Yes, that looks good from a first glance. |
I just pushed a commit with this, adjusting various files including documentation which states minimal version requirement for |
Would it be ok if I renamed the issue into Required support for older cmake versions shipped with some popular unix systems or something like that? |
Maybe just 'Installation on older Linux releases with older cmake' ? That is to me where the issue comes from. |
I just ran a quick test of your updated branch on Ubuntu 20.04 with |
Changes in 9852921 pass all my checks and seem to fix this issue. Let me know if that works for you too. |
I just ran a second test of your updated branch on Ubuntu 18.04 with But I have no time for other releases where I cannot get the thirty (!!!) dependencies of |
Thanks a lot @eddelbuettel. |
I am pretty sure it should work as I recall using |
@astamm and @eddelbuettel , thank you for your patience. |
I will close this issue then. Don't hesitate to reach out if the fix is not sufficient. |
Might be worthwhile to toss this in the direction of Vienna as a 2.0.3, maybe in a few days to see if anything else comes up? |
Hi,
Installation fails with:
The text was updated successfully, but these errors were encountered: