Changes between Initial Version and Version 1 of Ticket #67355


Ignore:
Timestamp:
May 2, 2023, 1:48:38 PM (13 months ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #67355

    • Property Owner set to eborisch
    • Property Status changed from new to assigned
  • Ticket #67355 – Description

    initial v1  
    1 I am running the last version of MacPorts and I installed with success hdf5 wiht +gcc12 +cxx.
    2 My problem is that I need to compile a program in c++  the linking fails because it fails to find objects.
     1I am running the last version of MacPorts and I installed with success hdf5 wiht +gcc12 +cxx. \\
     2My problem is that I need to compile a program in c++  the linking fails because it fails to find objects. \\
    33As an example:
     4{{{
    45Undefined symbols for architecture x86_64:
    56  "__ZN2H510H5Location12iterateElemsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPiPFixPKcPvESC_", referenced from:
     
    78And the compiled libhdf5_cpp.a has:
    89   __ZN2H510H5Location12iterateElemsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEPiPFixPKcPvESD_
    9 
     10}}}
    1011Compiling by hand the source with the ./configure options used in the compiled version of macports:
     12{{{
    1113./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
    12 
     14}}}
    1315generates an object that has the same problem because it uses clang to compile.
    1416
    1517but adding CC and CXX variables:
     18{{{
    1619CXX=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
     20}}}
    1721It already generates a library that has the objects.
    1822
    19 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.
    20 Do you have suggestions to fix this problem?
    21 Thanks in advance
     23My 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. \\
     24Do you have suggestions to fix this problem? \\
     25Thanks in advance \\
    2226João