Opened 17 months ago

Last modified 12 months ago

#67355 assigned defect

Compiling hdf5 with +gcc12 — at Initial Version

Reported by: jvianalopes (João Manuel Viana Parente Lopes) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: hdf5

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:

"ZN2H510H5Location12iterateElemsERKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiPFixPKcPvESC_", referenced from:

And the compiled libhdf5_cpp.a has:

ZN2H510H5Location12iterateElemsERKNSt3112basic_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

Change History (0)

Note: See TracTickets for help on using tickets.