[MacPorts] #67355: Compiling hdf5 with +gcc12

MacPorts noreply at macports.org
Tue May 2 13:48:38 UTC 2023


#67355: Compiling hdf5 with +gcc12
--------------------------+----------------------
  Reporter:  jvianalopes  |      Owner:  eborisch
      Type:  defect       |     Status:  assigned
  Priority:  Normal       |  Milestone:
 Component:  ports        |    Version:
Resolution:               |   Keywords:
      Port:  hdf5         |
--------------------------+----------------------
Changes (by ryandesign):

 * owner:  (none) => eborisch
 * status:  new => assigned


Old description:

> I am running the last version of MacPorts and I installed with success
> hdf5 wiht +gcc12 +cxx.
> My problem is that I need to compile a program in c++  the linking fails
> because it fails to find objects.
> As an example:
> Undefined symbols for architecture x86_64:
> "__ZN2H510H5Location12iterateElemsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiPFixPKcPvESC_",
> referenced from:
>
> And the compiled libhdf5_cpp.a has:
> __ZN2H510H5Location12iterateElemsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPiPFixPKcPvESD_
>
> Compiling by hand the source with the ./configure options used in the
> compiled version of macports:
> ./configure --prefix=/opt/local --with-zlib=yes --disable-silent-rules
> --enable-build-mode=production --disable-fortran --enable-shared
> --enable-static --disable-parallel --disable-threadsafe --with-default-
> plugindir=/opt/local/lib/hdf5 --with-default-api-version=v110 --enable-hl
> --enable-cxx
>
> generates an object that has the same problem because it uses clang to
> compile.
>
> but adding CC and CXX variables:
> CXX=c++-mp-12 CC=gcc-mp-12 CXXFLAGS=-std=c++17 ./configure
> --prefix=/opt/local --with-zlib=yes --disable-silent-rules --enable-
> build-mode=production --disable-fortran --enable-shared --enable-static
> --disable-parallel --disable-threadsafe --with-default-
> plugindir=/opt/local/lib/hdf5 --with-default-api-version=v110 --enable-hl
> --enable-cxx
> It already generates a library that has the objects.
>
> My question is how does macports fix the compiler? Because I used the
> variant +gcc12 but it seems that it is not the same as defining the
> compilers as environment  variables in the configure.
> Do you have suggestions to fix this problem?
> Thanks in advance
> João

New description:

 I am running the last version of MacPorts and I installed with success
 hdf5 wiht +gcc12 +cxx. \\
 My problem is that I need to compile a program in c++  the linking fails
 because it fails to find objects. \\
 As an example:
 {{{
 Undefined symbols for architecture x86_64:
 "__ZN2H510H5Location12iterateElemsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiPFixPKcPvESC_",
 referenced from:

 And the compiled libhdf5_cpp.a has:
 __ZN2H510H5Location12iterateElemsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPiPFixPKcPvESD_
 }}}
 Compiling by hand the source with the ./configure options used in the
 compiled version of macports:
 {{{
 ./configure --prefix=/opt/local --with-zlib=yes --disable-silent-rules
 --enable-build-mode=production --disable-fortran --enable-shared --enable-
 static --disable-parallel --disable-threadsafe --with-default-
 plugindir=/opt/local/lib/hdf5 --with-default-api-version=v110 --enable-hl
 --enable-cxx
 }}}
 generates an object that has the same problem because it uses clang to
 compile.

 but adding CC and CXX variables:
 {{{
 CXX=c++-mp-12 CC=gcc-mp-12 CXXFLAGS=-std=c++17 ./configure
 --prefix=/opt/local --with-zlib=yes --disable-silent-rules --enable-build-
 mode=production --disable-fortran --enable-shared --enable-static
 --disable-parallel --disable-threadsafe --with-default-
 plugindir=/opt/local/lib/hdf5 --with-default-api-version=v110 --enable-hl
 --enable-cxx
 }}}
 It already generates a library that has the objects.

 My question is how does macports fix the compiler? Because I used the
 variant +gcc12 but it seems that it is not the same as defining the
 compilers as environment  variables in the configure. \\
 Do you have suggestions to fix this problem? \\
 Thanks in advance \\
 João

--

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


More information about the macports-tickets mailing list