Comments (21)
I find that tone not that helpful or motivating and will close this accordingly.
from rcpparmadillo.
Just use the /usr/bin/env trampoline. People have used this solution for 2+ decades, and it works fine. Check the portability section of https://en.m.wikipedia.org/wiki/Shebang_(Unix) if you don't believe me.
from rcpparmadillo.
Sigh. Can't you just install bash, please? Even my Debian builds did not complain about that, and there too only /bin/sh
can be assumed. Which does not exclude also having /bin/bash
. And too bad that you just missed a release window.
You can also tell how little that script does so feel to adapt it locally in the meantime.
I'll look into into. It would help if you told if it worked once you did the s/bash/sh
.
from rcpparmadillo.
I have no trouble depending on bash. My system has a bash! But it doesn't have it at /bin/bash. The solution you want is to rely on $PATH to find the binary instead of hard-coding a location, i.e. by using "/usr/bin/env bash".
from rcpparmadillo.
Would you consider having that debate elsewhere? It is now 2019, not 2014 when this ticket was openend, and we have no use of /usr/bin/env
here. And have not for years. Cool?
from rcpparmadillo.
Well but that breaks when the next guy comes along who has /bin/env
instead. This isn't a standards-compliant tool in a fixed location either, or is it? I'd be happy to learn if it was, but I am rather reluctant to remove what works for thousands with a band aid for you.
Just thinking out loud here: could you add a softlink providing /bin/bash
?
from rcpparmadillo.
You are commenting on a five year old bug report for an issue we no longer have -- these days configure
is autoconf
generated rather than a shell script with the a shebang line calling bash
via env
.
from rcpparmadillo.
I just did a naive test of replacing /bin/bash
with /bin/sh
which immediately whined:
./configure: 3: [: /usr/lib/R: unexpected operator
* checking LAPACK_LIBS: ./configure: 16: [: unexpected operator
./configure: 20: [: yes: unexpected operator
If you want a non-bash sh, could you please help with a port and test? I am more likely to just make bash an installation requirement (as I am a little short on time for testing this). Could you?
from rcpparmadillo.
Else I need to bite the bullet and rewrite the if [ ... ]
tests which an older sh
-compatible approach.
from rcpparmadillo.
I rewrote it for /bin/dash which is my laptop's /bin/sh. Consider sending a patch next time.
from rcpparmadillo.
Well, I did not intend to come across as impolite. Please accept my apologies if I did.
from rcpparmadillo.
The env
trick has been known for about as long as Python exists. I was trying to ask a legitimate question as to whether /usr/bin/env
was in fact a POSIX (or FHS or ..) sanctioned location. Just because we both have seen it there won't make this resilient.
Using a dumber /bin/sh is more resilient. I am now at work but I'll ping you when I committed the change and I would appreciate it if you could test it.
from rcpparmadillo.
As far as I know, env is mandated by POSIX, but the standard doesn't specify a specific location for the tool, so a system could offer /bin/env and still be POSIX-compliant.
I'd say that the env trampoline is not perfect , but it works far more reliably than /bin/bash will.
Have a simple bourne script that /bin/sh can interpret is the best possible solution, though, and I'm glad you decided to go that route. Let me know when the fix is in Git, and I'll gladly test it.
from rcpparmadillo.
It's been committed as d85be88 -- let me know if that works for you.
from rcpparmadillo.
Unfortunately, the script still refers to /bin/bash
, and that path doesn't exist on NixOS, so the script cannot be run. IMHO, everything would be fine if that first line would refer to #! /bin/sh
instead.
from rcpparmadillo.
That was an oversight. I tested on a distinct copy from which I carried over changes, and I promptly forgot the shebang line. Fixed now -- could you test again?
from rcpparmadillo.
With that latest patch applied, the package builds just fine on NixOS. Thank you very much for the fix!
from rcpparmadillo.
Thanks for testing and confirming.
from rcpparmadillo.
I reverted this change because of side-effects with other CRAN installations.
You are now assumed to have /bin/bash
installed.
If you do not, open the source tarball, run the test in the short script configure by hand and adjust RcppArmadilloLapack.h.in
accordingly (which will in most cases just be a straight copy to ``RcppArmadilloLapack.hand run
R CMD INSTALL` etc by hand.
from rcpparmadillo.
on nixos anyone know how to add bash so that /usr/bin/env
can find it? I have this error:
env: can't execute 'bash': No such file or directory
which results from using a hashbang like:
#!/usr/bin/env bash
from rcpparmadillo.
@eddelbuettel I am taking about the more general context - a shell script with that hashbang does not seem to work on nixos at all
from rcpparmadillo.
Related Issues (20)
- Problems in installing RcppArmadillo on macOS Monterey HOT 3
- Missing distr_param argument in randu HOT 8
- no matching function for call to βarma::Cube<double>::insert_slices(arma::uword&, arma::mat&) HOT 2
- Deprecating old initialization code in packages using RcppArmadillo HOT 17
- Is `ARMA_64BIT_WORD` supported in RcppArmadillo? HOT 4
- NaN output from arma::uvec compared to arma::vec HOT 4
- Planning to potentially (re)move some legacy internal header files
- Deprecating old stderr stream setting code in packages using RcppArmadillo HOT 12
- Fails to compile vs HOT 3
- Question about SIMD Optimization HOT 3
- package compilation failure HOT 20
- Two failures in test_cube.R on PowerPC HOT 33
- Armadillo 12.0.0 regressions HOT 2
- `RCPP_ARMADILLO_RETURN_ANYVEC_AS_VECTOR` in an R package? HOT 2
- using namespace arma; HOT 1
- Issue on call by reference with a NA matrix HOT 1
- Update indMatrix->arma::SpMat and pMatrix->arma::SpMat for Matrix 1.5-5 HOT 2
- install issue HOT 3
- [DOCS] - Review DESCRIPTION's Date HOT 2
- Failed to install RcppArmadillo on Linux Hyper Cluster HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcpparmadillo.