Opened 18 months ago
Last modified 13 months ago
#67355 assigned defect
Compiling hdf5 with +gcc12 — at Version 1
Reported by: | jvianalopes (João Manuel Viana Parente Lopes) | Owned by: | eborisch (Eric A. Borisch) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | hdf5 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
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
Change History (1)
comment:1 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Owner: | set to eborisch |
Status: | new → assigned |