Re: [R] if zlib version >= 1.2.5... no

2022-05-30 Thread David Winsemius
Pasting a prior posted thread on the R-Mac list:

Ah, well, I see now that libR.dylib was not built or linked in
tools.so simply because I had not configured with --enable-R-shlib
... 'make' succeeds but only when I build R as a shared library.

The dlopen error isn't seen in the nightly builds, which also use
--enable-R-shlib. It would be good to know if others are able to
reproduce the error when configuring in the _default_ way, i.e.,
without --enable-R-shlib.

Mikael

> On 2022-02-10 4:30 pm, Mikael Jagan wrote:
>> On 2022-02-10 1:42 pm, Mikael Jagan wrote:
>> It seems my first message to mailing list, which had all of the attachments,
>> was caught in the spam filter. In case it helps, I've dumped the config.site,
>> config.log, and build.out on GitHub:
>> 
>> https://github.com/jaganmn/attachments/tree/6a7257014792f5e8cf7bb0bcd3bb27c7fabf7577/r-sig-mac/2022-02-10
>>  
>> 
>>> On 2022-02-10 1:11 pm, Prof Brian Ripley wrote:
 On 10/02/2022 17:28, Mikael Jagan wrote:
 Oops - forgot to mention: I am trying to build R-devel, currently at 
 r81706.
 
 Mikael
 
> On 2022-02-10 12:13 pm, Mikael Jagan wrote:
> Hello,
> 
> I am running Big Sur on an M1 Mac and trying to build R from sources.
> Some system details:
> 
> R> sessionInfo()
>  > Platform: aarch64-apple-darwin20 (64-bit)
>  > Running under: macOS Big Sur 11.6.3
> 
> $ clang --version
>  > Apple clang version 13.0.0 (clang-1300.0.29.30)
>  > Target: arm64-apple-darwin20.6.0
> 
> $ /opt/R/arm64/gfortran/bin/gfortran --version
>  > GNU Fortran (GCC) 11.0.0 20201219 (experimental)
> 
> It has been a few months since I last built R on this machine.
> At the time, I was building with LLVM clang rather than Apple clang
> to obtain OpenMP support. I was recently nudged about the OpenMP
> runtime library made available here:
> 
> https://mac.r-project.org/openmp/
> 
> which would allow me to build "normally" with Apple clang.
> I am trying now to make the switch.
> 
> I have installed all of the binaries hosted here
> 
> https://mac.r-project.org/bin/darwin20/arm64/
> 
> rather than those hosted here
> 
> https://mac.r-project.org/libs-arm64/
> 
> which I had previously installed. (Though: the first URL is missing
> binaries for gfortran, pandoc, tcl, tk, and tkTable. I obtained
> these from the second URL. _Both_ URLs are missing a zlib binary,
> so I reluctantly obtained zlib from Homebrew.)
>>> 
>>> zlib is part of the OS.  For pkg-config you need the zlib stub available 
>>> from https://mac.r-project.org/libs-4/.  That *is* in the R-admin manual.  
>>> Also, that tcl, tk, and tkTable can be installed as part of an R binary 
>>> installation.
>> 
>> Thanks - I wasn't sure whether that zlib stub was suitable for my system.
>> 
>>> 
>>> For pandoc I use the official Intel builds under emulation without any 
>>> problems (including checking all of CRAN).  But you don't need pandoc to 
>>> build R.
>>> 
>>> I understand that the transition to https://mac.r-project.org/bin is work 
>>> in progress, but its newer versions of libs are preferred.
>>> 
> 
> Anyway, I'm running into trouble now... I have attached my
> config.site, config.log, and build.out (from 'make >&') ...
> config.log seems completely normal, but in build.out I see
> many linker warnings of the form
> 
>  > ld: warning: could not create compact unwind for _dchdc_: registers 72 
> and 73 not saved contiguously in frame
>  > ld: warning: could not create compact unwind for _dpoco_: registers 72 
> and 73 not saved contiguously in frame
>  > ld: warning: object file (/opt/R/arm64/lib/libreadline.a(history.o)) 
> was built for newer macOS version (20.0) than being linked (11.0)
>  > ld: warning: object file 
> (/opt/R/arm64/lib/liblzma.a(liblzma_la-alone_decoder.o)) was built for 
> newer macOS version (20.0) than being linked (11.0)
>>> 
>>> Hmm, that's about a binary liblzma.  I'd download again (maybe try both 
>>> sites), and if it is still wrong, build from the sources.
>> If you search build.out, you'll find that this warning is issued
>> for _every_ binary obtained from
>> 
>> https://mac.r-project.org/bin/darwin20/arm64/
>> 
>> I'll try the old site again.
> Reverting to the old binaries resolves all of the version mismatch warnings,
> so perhaps there is just a glitch in the way the new binaries were built.
>> 
> And the build eventually fails for a seemingly unrelated
> reason:
> 
>  > clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names 
> -undefined dynamic_lookup -single_module -multiply_defined suppress 
> -falign-functions=64 -g -O2 -Wall -pedantic 
> -Wno-implicit-function-declaration -flto=thin -fPIC -Wl,-mllvm,-threads=4 
> -L/opt/homebrew/opt/zlib/lib -L/opt/R/arm64/lib -L/usr/local/lib -lomp -o 

Re: [R] if zlib version >= 1.2.5... no

2017-01-04 Thread David Winsemius

> On Jan 4, 2017, at 8:09 AM, bastl73  wrote:
> 
> Configuring R

Which "R" would that be?


> with zlib-1.2.10 I get this error:
> 
> checking for zlib.h... yes
> checking if zlib version >= 1.2.5... no
> checking whether zlib support suffices... configure: error: zlib library and 
> headers 
> are required
> 
> So I asked Mark from zlib about this problem and he wrote back:
> 
>> exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
> 
> strcmp("1.2.10", "1.2.5") will indicate incorrectly that the 1.2.10 is *less* 
> than 
> 1.2.5. This is why there is ZLIB_VERNUM, which is a number that can be 
> compared. So 
> it should be simply:
> 
>exit(ZLIB_VERNUM < 0x1250);

I'm thinking this must be the world's shortest attempt at a bug report. I can 
find that code in a couple of places with a Google search:

A copy of material labelled as "part of R"

https://github.com/rho-devel/rho/blob/master/m4/R.m4

A diff file submitted by Ingo Feinerer to bsdports:

https://marc.info/?l=openbsd-ports=146229312201237=2

And using the Google advanced search function (since Google does not apparently 
index the R source):

https://svn.r-project.org/R/trunk/m4/R.m4

It appears the current version already has the code suggested as the correction:

https://svn.r-project.org/R/trunk/m4/R.m4

A bit below the section header :

## R_ZLIB

We see this code (which appears to be exactly the suggested edit by your 
correspondent.)

int main() {
#ifdef ZLIB_VERNUM
  if (ZLIB_VERNUM < 0x1250) {
exit(1);
  }
  exit(0);

So you should check that you are working with the most recent version of R. If 
you are, and you still think this is a bug, then you should post a much, much 
more complete "trial bug report" to the r-de...@r-project.org mailing list. It 
should include a complete description of what you are attempting and full log 
files. Posting bug reports to r-help is just the wrong place and posting 
incorrect bug reports to bugzilla just annoys the maintainers.


> 
> bastl
> 

-- 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] if zlib version >= 1.2.5... no

2017-01-04 Thread peter dalgaard
This was fixed (independently?) in r-devel today:

Peter-Dalgaards-MacBook-Air:R pd$ svn log m4/R.m4 | head

r71889 | lawrence | 2017-01-04 04:57:31 +0100 (Wed, 04 Jan 2017) | 4 lines

R_ZLIB macro tests ZLIB_VERNUM to handle zlib 1.2.10 (6 chars)

Thanks to George Hartzell for the fix.
---

-pd


> On 04 Jan 2017, at 17:09 , bastl73  wrote:
> 
> Configuring R with zlib-1.2.10 I get this error:
> 
> checking for zlib.h... yes
> checking if zlib version >= 1.2.5... no
> checking whether zlib support suffices... configure: error: zlib library and 
> headers 
> are required
> 
> So I asked Mark from zlib about this problem and he wrote back:
> 
>> exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
> 
> strcmp("1.2.10", "1.2.5") will indicate incorrectly that the 1.2.10 is *less* 
> than 
> 1.2.5. This is why there is ZLIB_VERNUM, which is a number that can be 
> compared. So 
> it should be simply:
> 
>exit(ZLIB_VERNUM < 0x1250);
> 
> 
> bastl
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd@cbs.dk  Priv: pda...@gmail.com

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] if zlib version >= 1.2.5... no

2017-01-04 Thread bastl73
Configuring R with zlib-1.2.10 I get this error:

checking for zlib.h... yes
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and 
headers 
are required

So I asked Mark from zlib about this problem and he wrote back:

>  exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);

strcmp("1.2.10", "1.2.5") will indicate incorrectly that the 1.2.10 is *less* 
than 
1.2.5. This is why there is ZLIB_VERNUM, which is a number that can be 
compared. So 
it should be simply:

exit(ZLIB_VERNUM < 0x1250);


bastl

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.