[MacPorts] #62912: netcdf-cxx @4.2: ../version:1:1: error: expected external declaration (was: Failed to build netcdf-cxx at 4.2 under Big Sur 11.3.1)

MacPorts noreply at macports.org
Mon May 17 20:57:30 UTC 2021


#62912: netcdf-cxx @4.2: ../version:1:1: error: expected external declaration
-------------------------+----------------------
  Reporter:  Cathysige   |      Owner:  tenomoto
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.4
Resolution:              |   Keywords:
      Port:  netcdf-cxx  |
-------------------------+----------------------
Changes (by ryandesign):

 * status:  new => assigned
 * owner:  (none) => tenomoto
 * keywords:  netcdf =>
 * port:  bash => netcdf-cxx


Old description:

> Attached is the error log
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build ../version:1:2: error: unknown type name 'n'
> :info:build ../version:1:4: error: expected unqualified-id
> :info:build ../version:1:1: error: expected external declaration
> :info:build fatal error: too many errors emitted, stopping now [-ferror-
> limit=]
> :info:build ../version:1:1: error: expected external declaration
> :info:build fatal error: too many errors emitted, stopping now [-ferror-
> limit=]
> :info:build 20 errors generated.
> :info:build make[2]: *** [libnetcdf_c___la-ncvalues.lo] Error 1
> :info:build 20 errors generated.
> :info:build make[2]: *** [libnetcdf_c___la-netcdf.lo] Error 1
> :info:build make[1]: *** [all-recursive] Error 1
> :info:build make: *** [all] Error 2
> :error:build Failed to build netcdf-cxx: command execution failed
> :debug:build Error code: CHILDSTATUS 3868 2
> :error:build See
> /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports
> .org_macports_release_tarballs_ports_science_netcdf-cxx/netcdf-
> cxx/main.log for details.

New description:

 Attached is the error log
 {{{
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build ../version:1:2: error: unknown type name 'n'
 :info:build ../version:1:4: error: expected unqualified-id
 :info:build ../version:1:1: error: expected external declaration
 :info:build fatal error: too many errors emitted, stopping now [-ferror-
 limit=]
 :info:build ../version:1:1: error: expected external declaration
 :info:build fatal error: too many errors emitted, stopping now [-ferror-
 limit=]
 :info:build 20 errors generated.
 :info:build make[2]: *** [libnetcdf_c___la-ncvalues.lo] Error 1
 :info:build 20 errors generated.
 :info:build make[2]: *** [libnetcdf_c___la-netcdf.lo] Error 1
 :info:build make[1]: *** [all-recursive] Error 1
 :info:build make: *** [all] Error 2
 :error:build Failed to build netcdf-cxx: command execution failed
 :debug:build Error code: CHILDSTATUS 3868 2
 :error:build See
 /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports
 .org_macports_release_tarballs_ports_science_netcdf-cxx/netcdf-
 cxx/main.log for details.
 }}}

--

Comment:

 You didn't attach the main.log, but the portion of it that you copied into
 the ticket description is enough to figure out that this is the familiar
 problem where you are using a C++20-capable compiler on a case-insensitive
 filesystem and the project you are trying to compile includes a VERSION
 file and it add a `-I` flag pointing to the directory containing the
 VERSION file (which then conflicts with the C++20 "version" header). See
 https://bugs.llvm.org/show_bug.cgi?id=42540

 It's an upstream issue that should be reported to and fixed by the
 developers of netcdf-cxx.

 The best solution is for the project to change its build system so that a
 `-I` flag for the directory containing the VERSION file is not added.
 Usually the VERSION file is in the top level directory and usually source
 files are in a subdirectory like "src" so adding an include path for the
 root directory isn't necessary. Often though projects by default write
 something like a config.h to the root directory, which causes the problem.
 If this is what's going on here, then the project can avoid the problem by
 writing config.h to a different directory.

 An alternative is to move or rename the VERSION file, for example to
 VERSION.txt. If the VERSION file is referenced by other files, those
 references need to be updated.

-- 
Ticket URL: <https://trac.macports.org/ticket/62912#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list