You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building on FreeBSD fails due to an issue in configure created in #3974 when "pkg-config --libs zlib" only contains "-lz" and the expression is not guarded in some way, e.g., with "--" or prepending fixed text such as "x"
** using staged installation expr: illegal option -- l expr: usage: expr [-e] expression
expr: illegal option -- l expr: usage: expr [-e] expression
For me, pkg-config --libs zlib contains only -lz on my machine; i.e. it returns -lz only. Could you explain a little more please? Why doesn't that work on FreeBSB? What does pkg-config --libs zlib return for you?
There are some differences in the Linux expr and FreeBSD. From the FreeBSD man page:
Compatibility with previous implementations
Unless FreeBSD 4.x compatibility is enabled, this version of expr adheres
to the POSIX Utility Syntax Guidelines, which require that a leading
argument beginning with a minus sign be considered an option to the
program. The standard -- syntax may be used to prevent this
interpretation. However, many historic implementations of expr,
The "failure" occurred in 1.12.8 as well, but the end result was a successful build because the src/Makevars file exists in the tree, whereas in 1.13.0 the failure to find zlib causes the configure script to exit before src/Makevars is generated from src/Makevars.in. Perhaps that unconditional exit needs to be reconsidered, given that the OpenMP tests follow it. I don't know how universal the "--" guard for expr is, so perhaps prepending with a string is more portable?
Thanks, Morgan! Helps a lot, especially the aspect of not creating Makevars which also occurs in #4640. The Makevars started to be generated in #3984.
What I had really wanted to do originally was pass the result of pkg-config --libs zlib (i.e. -lz) through to R CMD build somehow. But I didn't know how to do that. So I put the -lz in Makevars (fixed, hardcoded) and added output to configure to tell us if it ever isn't "-lz", or if zlib isn't available, so that users know what to install. But if we're generating Makevars now, then maybe we have a way to pass it through. That would avoid needing to test for "-lz" at all, we could echo the value.
Thanks again, I think I understand what's going on now.
Activity
mattdowle commentedon Jul 28, 2020
Thanks.
So we're talking about these two lines in configure:
For me,
pkg-config --libs zlibcontains only-lzon my machine; i.e. it returns-lzonly. Could you explain a little more please? Why doesn't that work on FreeBSB? What doespkg-config --libs zlibreturn for you?wesnm commentedon Jul 28, 2020
There are some differences in the Linux expr and FreeBSD. From the FreeBSD man page:
Compatibility with previous implementations
Unless FreeBSD 4.x compatibility is enabled, this version of expr adheres
to the POSIX Utility Syntax Guidelines, which require that a leading
argument beginning with a minus sign be considered an option to the
program. The standard -- syntax may be used to prevent this
interpretation. However, many historic implementations of expr,
On my FreeBSD machine:
On a Linux machine:
The "failure" occurred in 1.12.8 as well, but the end result was a successful build because the
src/Makevarsfile exists in the tree, whereas in 1.13.0 the failure to find zlib causes the configure script to exit beforesrc/Makevarsis generated fromsrc/Makevars.in. Perhaps that unconditional exit needs to be reconsidered, given that the OpenMP tests follow it. I don't know how universal the "--" guard for expr is, so perhaps prepending with a string is more portable?patch.txt
mattdowle commentedon Jul 28, 2020
Thanks, Morgan! Helps a lot, especially the aspect of not creating Makevars which also occurs in #4640. The Makevars started to be generated in #3984.
What I had really wanted to do originally was pass the result of
pkg-config --libs zlib(i.e.-lz) through toR CMD buildsomehow. But I didn't know how to do that. So I put the-lzin Makevars (fixed, hardcoded) and added output to configure to tell us if it ever isn't "-lz", or if zlib isn't available, so that users know what to install. But if we're generating Makevars now, then maybe we have a way to pass it through. That would avoid needing to test for "-lz" at all, we could echo the value.Thanks again, I think I understand what's going on now.