Menu

#163 OS X pkg-config.cmake error: string REGEX REPLACE needs 6 arguments

None
closed-fixed
None
5
2017-07-24
2015-05-14
No

When configuring PLplot 5.11.0 from pkgsrc using a private pkgsrc plplot package definition on OS X Yosemite using CMake 3.0.2, I get the following error:

CMake Error at cmake/modules/pkg-config.cmake:202 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  cmake/modules/pkg-config.cmake:355 (pkg_config_link_flags)
  bindings/c++/CMakeLists.txt:83 (pkg_config_file)

I think the problem is that the ${link_flags} argument is not quoted, and if it's empty, then Cmake doesn't see it as an argument. If I quote it, then the configure succeeds. Attached is a patch against the 5.11.0 release to fix this problem.

Initially reported on the plplot-devel mailing list in message 20150417153110.GA9862@bass.imca.aps.anl.gov.

1 Attachments

Discussion

  • Alan W. Irwin

    Alan W. Irwin - 2015-05-22

    Thanks for your report.

    You have confirmed (on the plplot-devel mailing list) this issue has been fixed in the git version of PLplot which will form the basis of the next release. Therefore, I am closing this with the status of "closed-fixed".

     
  • Alan W. Irwin

    Alan W. Irwin - 2015-05-22
    • status: open --> closed-fixed
    • assigned_to: Alan W. Irwin
    • Group: -->
     
  • OpenCoarrays Dev

    A similar bug still happens in 5.12 when building the Fortran bindings:
    https://github.com/Homebrew/homebrew-core/issues/15851

    This is the CMake error message I am getting:

    CMake Error at cmake/modules/pkg-config.cmake:228 (string):
      string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
      command.
    Call Stack (most recent call first):
      cmake/modules/pkg-config.cmake:419 (pkg_config_link_flags)
      bindings/f95/CMakeLists.txt:205 (pkg_config_file)
    

    This is a regression and did not happen in 5.11.

     
  • OpenCoarrays Dev

    Yes it appears this fix never made it into master or the 5.12 branch... I opened a new issue: https://sourceforge.net/p/plplot/bugs/186/

     
  • Alan W. Irwin

    Alan W. Irwin - 2017-07-24

    I agree the last argument of string(REGEX REPLACE ...) must be quoted for those cases where the argument is empty. I thought I had gotten all of these before, but I have just now looked again, and there was one unquoted instance (only affecting Mac OS X platforms) still left in pkg-config.cmake. (This issue was present in 5.11.0 on line 202, but it is a different line in the modern version of PLplot). I have fixed this issue in commit 6819eb3 on our master branch which will be the basis of the imminent PLplot-5.13.0 release.

     

    Last edit: Alan W. Irwin 2017-07-24
    • OpenCoarrays Dev

      Great, glad to hear the fix will sneak into the next release! I've had a
      patch accepted to homebrew which fixes this issue for 5.12 in the mean time
      On Mon, Jul 24, 2017 at 5:45 PM Alan W. Irwin airwin@users.sf.net wrote:

      I agree the last argument of string(REGEX REPLACE ...) must be quoted for
      those cases where the argument is empty. I thought I had gotten all of
      these before, but I have just now looked again, and there was one unquorted
      instance (only affecting Mac OS X platforms) still left in
      pkg-config.cmake. (This issue was present in 5.11.0 on line 202, but it is
      a different line in the modern version of PLplot). I have fixed this issue
      in commit 6819eb3 on our master branch which will be the basis of the
      imminent PLplot-5.13.0 release.


      Status: closed-fixed
      Group:
      Created: Thu May 14, 2015 03:16 PM UTC by J. Lewis Muir

      Last Updated: Mon Jul 24, 2017 02:52 PM UTC

      Owner: Alan W. Irwin
      Attachments:

      When configuring PLplot 5.11.0 from pkgsrc using a private pkgsrc plplot
      package definition on OS X Yosemite using CMake 3.0.2, I get the following
      error:

      CMake Error at cmake/modules/pkg-config.cmake:202 (string):
      string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
      command.
      Call Stack (most recent call first):
      cmake/modules/pkg-config.cmake:355 (pkg_config_link_flags)
      bindings/c++/CMakeLists.txt:83 (pkg_config_file)

      I think the problem is that the ${link_flags} argument is not quoted, and
      if it's empty, then Cmake doesn't see it as an argument. If I quote it,
      then the configure succeeds. Attached is a patch against the 5.11.0 release
      to fix this problem.

      Initially reported on the plplot-devel mailing list in message
      20150417153110.GA9862@bass.imca.aps.anl.gov
      http://sourceforge.net/p/plplot/mailman/message/33868184/.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/plplot/bugs/163/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.