Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#27284 closed enhancement (fixed)

spkg-configure.m4 for pcre

Reported by: dimpase Owned by:
Priority: major Milestone: sage-8.8
Component: build: configure Keywords: spkg-configure
Cc: embray, fbissey, mkoeppe Merged in:
Authors: Dima Pasechnik Reviewers: François Bissey
Report Upstream: N/A Work issues:
Branch: 285de31 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges

Description

its only dependency is bzip2, so this should be a breeze - and it's one of deps of R.

Change History (14)

comment:1 Changed 3 years ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually)

comment:2 Changed 3 years ago by dimpase

  • Authors set to Dima Pasechnik
  • Branch set to u/dimpase/packages/pcre-config
  • Cc embray fbissey added
  • Commit set to 285de31b88f3343f68057e418c41809c5e7377fb
  • Status changed from new to needs_review

New commits:

285de31spkg-config for pcre

comment:3 Changed 3 years ago by fbissey

  • Reviewers set to François Bissey
  • Status changed from needs_review to positive_review

LGTM

comment:4 Changed 3 years ago by dimpase

Thanks!

comment:5 Changed 3 years ago by vbraun

  • Branch changed from u/dimpase/packages/pcre-config to 285de31b88f3343f68057e418c41809c5e7377fb
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:6 Changed 3 years ago by jhpalmieri

  • Commit 285de31b88f3343f68057e418c41809c5e7377fb deleted

I just installed pcre on my Mac with ./configure; make; make install, and I get a doctest failure with stats/r.py. If I instead emulate the installation of the Sage pcre package and use ./configure --enable-utf --enable-unicode-properties --enable-jit followed by make; make install, everything works. Should the .m4 file test for the appropriate feature of the system's pcre rather than just the presence of the library?

The doctest failure:

sage -t src/sage/stats/r.py
**********************************************************************
File "src/sage/stats/r.py", line 42, in sage.stats.r.ttest
Failed example:
    a, b = ttest([1,2,3,4,5],[1,2,3,3.5,5.121]); a # abs tol 1e-12
Exception raised:
    Traceback (most recent call last):
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 681, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 1105, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.stats.r.ttest[0]>", line 1, in <module>
        a, b = ttest([Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)],[Integer(1),Integer(2),Integer(3),RealNumber('3.5'),RealNumber('5.121')]); a # abs tol 1e-12
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/stats/r.py", line 48, in ttest
        test = myR.t_test(x,y,conf_level = conf_level, **kw)._sage_()
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/r.py", line 1985, in __call__
        return self._parent.function_call(self._name, args=list(args), kwds=kwds)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/r.py", line 1062, in function_call
        [self._sage_to_r_name(key)+'='+kwds[key].name() for key in kwds ] )))
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 353, in new
        return self(code)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 288, in __call__
        return cls(self, x, name=name)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 701, in __init__
        self._name = parent._create(value, name=name)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 484, in _create
        self.set(name, value)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/r.py", line 1108, in set
        out = self.eval(cmd)
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/sage/interfaces/r.py", line 1321, in eval
        return str(robjects.r(code)).rstrip()
      File "/Users/palmieri/Desktop/Sage_stuff/sage_builds/TESTING/sage-8.8.beta7/local/lib/python2.7/site-packages/rpy2/robjects/robject.py", line 108, in __str__
        self.__show(self)
    RRuntimeError: Error in strsplit(x, "\n[ \t\n]*\n", perl = TRUE) : 
      invalid split pattern '
    [ 	
    ]*
    '

**********************************************************************
1 item had failures:
   1 of   2 in sage.stats.r.ttest
    [2 tests, 1 failure, 0.50 s]

comment:7 Changed 3 years ago by jhpalmieri

It looks like ./configure --enable-utf is good enough, but not plain ./configure.

comment:8 follow-up: Changed 3 years ago by dimpase

Do you mean to say that in 2019 the newest MacOS ships a library without UTF support? Indeed, it seems they do, according to https://opensource.apple.com/source/pcre/pcre-9/Makefile.auto.html

(There is no pcre in Xcode on my OSX 10.13 for some reason)

Thanks Apple, you are the torch of progress... :-)

Well yes, sure, we can add a test for this.

Care to submit a bug report to Apple, as it's really silly of them...

comment:9 Changed 3 years ago by dimpase

  • Cc mkoeppe added
  • Component changed from build to build: configure

what is confusing to me that there is no UTF in the pattern it errors on. Perhaps it's the string that's encoded in UTF that is passed to it...

comment:10 Changed 3 years ago by dimpase

a typical installation of pcre(2) comes with pcretest and/or pcre2test. Does MacOS have them?

If so, what's the output of pcretest -C and pcre2test -C ?

Also, what is the output of pkg-config --modversion libpcre ? (if any)

comment:11 in reply to: ↑ 8 Changed 3 years ago by jhpalmieri

Replying to dimpase:

Do you mean to say that in 2019 the newest MacOS ships a library without UTF support?

No, I mean to say that I downloaded a tarball for pcre and ran ./configure; make; make install, expecting that the default settings for ./configure would be sensible, but instead they lead to the doctest failure I mentioned.

Indeed, it seems they do, according to https://opensource.apple.com/source/pcre/pcre-9/Makefile.auto.html

I wasn't using this.

(There is no pcre in Xcode on my OSX 10.13 for some reason)

Thanks Apple, you are the torch of progress... :-)

Well yes, sure, we can add a test for this.

Care to submit a bug report to Apple, as it's really silly of them...

comment:12 follow-up: Changed 3 years ago by dimpase

Ah, I see. It installed, in /usr/local, I gather? Does it install pcre(2)test too by default?

Cause I don't want to write C code to test for UTF, you know :-)

comment:13 Changed 3 years ago by dimpase

I've opened #27936 to provide these extra tests.

comment:14 in reply to: ↑ 12 Changed 3 years ago by jhpalmieri

Replying to dimpase:

Ah, I see. It installed, in /usr/local, I gather? Does it install pcre(2)test too by default?

Yes, in /usr/local. It installs pcretest by default.

Cause I don't want to write C code to test for UTF, you know :-)

Note: See TracTickets for help on using tickets.