Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.77k stars 12.45k forks source link

`brew install --with-fortran plplot` fails due to CMake errors #15851

Closed zbeekman closed 7 years ago

zbeekman commented 7 years ago

Please always follow these steps:

To help us debug your issue please explain:

Command and output

$ brew reinstall --with-fortran plplot
==> Reinstalling plplot --with-fortran
==> Using the sandbox
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://downloads.sourceforge.net/project/plplot/plplot/5.12.0%20Source/plplot-5.12.0.tar.gz
Already downloaded: /Users/ibeekman/Library/Caches/Homebrew/plplot-5.12.0.tar.gz
==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/plplot/5.12.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST
Last 15 lines from /Users/ibeekman/Library/Logs/Homebrew/plplot/01.cmake:
ENABLE_octave:      OFF
ENABLE_pdl:     OFF
ENABLE_python:      OFF
ENABLE_qt:      OFF
ENABLE_pyqt4:       OFF
ENABLE_pyqt5:       OFF
ENABLE_tcl:     OFF
ENABLE_itcl:        OFF
ENABLE_tk:      OFF
ENABLE_itk:     OFF
ENABLE_wxwidgets:   OFF

-- Configuring incomplete, errors occurred!
See also "/tmp/plplot-20170721-90537-12dsjv7/plplot-5.12.0/plplot-build/CMakeFiles/CMakeOutput.log".
See also "/tmp/plplot-20170721-90537-12dsjv7/plplot-5.12.0/plplot-build/CMakeFiles/CMakeError.log".

READ THIS: http://docs.brew.sh/Troubleshooting.html

When running in verbose mode the issue appears to be something with the plplot build system:

...
-- WARNING concerning spurious warning messages generated by the gfortran compiler.
   The new Fortran binding is known to generate some ~50 "marked
   PRIVATE" warning messages when building the plplotf95 target with the
   gfortran Fortran compiler.  A typical example of such a warning
   message is

   Warning: Symbol 'interface_plcont' at (1) is marked PRIVATE but has been given the binding label 'c_plcont'

   It appears these warnings (which do not occur if using the ifort or
   nagfor Fortran compilers) are due to a gfortran bug (see
   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111> and
   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64861>), i.e., they
   are spurious warnings concerning completely valid use of the
   private attribute for interface blocks describing C routines.
   There appear to be no known negative consequences of this gfortran
   bug other than the spurious warnings themselves.  Until this gfortran
   bug is fixed, these ~50 "marked PRIVATE" warnings should just be
   ignored for those using gfortran.
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)

-- TEST_ENVIRONMENT = EXAMPLES_DIR=/tmp/plplot-20170721-88373-1jjuurk/plplot-5.12.0/plplot-build/examples SRC_EXAMPLES_DIR=/tmp/plplot-20170721-88373-1jjuurk/plplot-5.12.0/examples OUTPUT_DIR=/tmp/plplot-20170721-88373-1jjuurk/plplot-5.12.0/plplot-build/ctest_examples_output_dir VC_CTEST_DIRECTORY=
...
ilovezfs commented 7 years ago

@zbeekman the option works with 5.11.1 but seems never to have worked with 5.12.0. This'll need to be reported upstream.

zbeekman commented 7 years ago

OK I've reported this upstream: https://sourceforge.net/p/plplot/bugs/186/ It looks like this was supposed to be fixed, judging by https://sourceforge.net/p/plplot/bugs/163/.

I have created a patch here: https://gist.github.com/zbeekman/7e958baf7f3271083209caaf4b0f9af5 following the instructions here: https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md#creating-the-diff

I'm wondering how I should submit a PR to update the formula and include this patch. Should I put the patch after __END__ or do I need to open up a PR against https://github.com/Homebrew/formula-patches?

ilovezfs commented 7 years ago

__END__ will be fine for this

zbeekman commented 7 years ago

PR submitted, so this can probably be closed, unless you want to wait for PR to be merged first.

ilovezfs commented 7 years ago

Closed via https://github.com/Homebrew/homebrew-core/pull/15983.

Thanks for reporting this and the PR!