Opened 3 years ago

Last modified 3 years ago

#62241 assigned defect

Undefined symbols for architecture x86_64: "__Z13SuiteSparseQRISt7complexIdEElidlP21cholmod_sparse_structPS3_PPlS4_S6_PP20cholmod_dense_structP21cholmod_common_struct", referenced from: __ZN6octave4math9sparse_qrI19SparseComplexMatrixE13sparse_qr_repC1ERKS2_i in libnumeric.a(libnumeric_la-sparse-qr.o)

Reported by: dbl001 (dbl) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.6.4
Keywords: Cc:
Port: SuiteSparse_SPQR

Description

I am running into a name mangling (decoration) issue building Octave with SuiteSparse_SPQR.

-liconv   -Wl,-framework -Wl,CoreFoundation -lm 
libtool: link: g++ -dynamiclib  -o liboctave/.libs/liboctave.8.dylib  liboctave/.libs/liboctave_la-liboctave-build-info.o liboctave/.libs/liboctave_la-version.o   -Wl,-force_load,liboctave/array/.libs/libarray.a -Wl,-force_load,liboctave/external/blas-xtra/.libs/libxerbla.a -Wl,-force_load,liboctave/external/ranlib/.libs/libranlib.a -Wl,-force_load,liboctave/external/.libs/libexternal.a -Wl,-force_load,liboctave/numeric/.libs/libnumeric.a -Wl,-force_load,liboctave/operators/.libs/liboperators.a -Wl,-force_load,liboctave/system/.libs/libsystem.a -Wl,-force_load,liboctave/util/.libs/libutil.a -Wl,-force_load,liboctave/wrappers/.libs/libwrappers.a -Wl,-force_load,libgnu/.libs/libgnu.a  -L/opt/local/lib -L/opt/local/libexec/qt5/lib -lcurl -lcholmod -lumfpack -lamd -lcamd -lcolamd -lccolamd -lcxsparse -lsuitesparseconfig -lspqr -larpack -lqrupdate -lfftw3_threads -lfftw3 -lfftw3f_threads -lfftw3f -lopenblas -lreadline -lncurses -lpcre -ldl -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin19/10.2.0 -L/opt/local/lib/gcc10/gcc/x86_64-apple-darwin19/10.2.0/../../.. -lgfortran -lquadmath -liconv -lm  -pthread -fopenmp -g -O2 -Wl,-framework -Wl,CoreFoundation   -pthread -fopenmp -install_name  /usr/local/lib/octave/7.0.0/liboctave.8.dylib -compatibility_version 9 -current_version 9.0 -Wl,-single_module
Undefined symbols for architecture x86_64:
  "__Z13SuiteSparseQRISt7complexIdEElidlP21cholmod_sparse_structPS3_PPlS4_S6_PP20cholmod_dense_structP21cholmod_common_struct", referenced from:
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE13sparse_qr_repC1ERKS2_i in libnumeric.a(libnumeric_la-sparse-qr.o)
  "__Z19SuiteSparseQR_qmultISt7complexIdEEP20cholmod_dense_structiP21cholmod_sparse_structS3_PlS3_P21cholmod_common_struct", referenced from:
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE13sparse_qr_rep1CERK13ComplexMatrixb in libnumeric.a(libnumeric_la-sparse-qr.o)
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE13sparse_qr_rep1QEb in libnumeric.a(libnumeric_la-sparse-qr.o)
  "__Z22SuiteSparseQR_min2normISt7complexIdEEP20cholmod_dense_structidP21cholmod_sparse_structS3_P21cholmod_common_struct", referenced from:
      __ZN6octave4math9sparse_qrI12SparseMatrixE14min2norm_solveI6MArrayISt7complexIdEE13ComplexMatrixEET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE14min2norm_solveI6MArrayISt7complexIdEE13ComplexMatrixEET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE14min2norm_solveI6MArrayIdE13ComplexMatrixEET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
  "__Z22SuiteSparseQR_min2normISt7complexIdEEP21cholmod_sparse_structidS3_S3_P21cholmod_common_struct", referenced from:
      __ZN6octave4math9sparse_qrI12SparseMatrixE14min2norm_solveI19SparseComplexMatrixS5_EET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE14min2norm_solveIS2_S2_EET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
      __ZN6octave4math9sparse_qrI19SparseComplexMatrixE14min2norm_solveI12SparseMatrixS2_EET0_RKS2_RKT_Rxi in libnumeric.a(libnumeric_la-sparse-qr.o)
ld: symbol(s) not found for architecture x86_64

Demangled names:

SuiteSparse (Macport)
_long SuiteSparseQR<double>(int, double, long, int, cholmod_sparse_struct*, cholmod_sparse_struct*, cholmod_dense_struct*, cholmod_sparse_struct**, cholmod_dense_struct**, cholmod_sparse_struct**, long**, cholmod_sparse_struct**, long**, cholmod_dense_struct**, cholmod_common_struct*)

Octave:
_long SuiteSparseQR<std::complex<double> >(int, double, long, cholmod_sparse_struct*, cholmod_sparse_struct**, long**, cholmod_sparse_struct**, long**, cholmod_dense_struct**, cholmod_common_struct*)

Configure:

./configure  LD_LIBRARY_PATH="-L/opt/local/lib  -L/opt/local/libexec/qt5/lib" LDFLAGS="-L/opt/local/lib -L/opt/local/libexec/qt5/lib" CPPFLAGS="-I/opt/local/include" --with-libiconv-prefix=/opt/local/lib --with-suitesparseconfig-includedir=/opt/local/include/ 

$ gcc --version
gcc (MacPorts gcc10 10.2.0_5) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Any idea what I am doing wrong?

Attachments (1)

config.log (2.8 MB) - added by dbl001 (dbl) 3 years ago.

Change History (5)

Changed 3 years ago by dbl001 (dbl)

Attachment: config.log added

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: SuiteSparse removed
Owner: set to MarcusCalhoun-Lopez
Status: newassigned

I am not clear about whether you are encountering the problem when building a port in MacPorts (which port?), or when building software yourself outside of MacPorts (which software?) but using libraries provided by MacPorts ports.

I see a reference to /usr/local/lib/octave/7.0.0/liboctave.8.dylib in your output. Note our stance on having things in /usr/local.

I see that you appear to be building whatever it is with g++. Note that you cannot mix and match C++ compilers. You must either compile everything (including dependencies) with g++ or with clang++, not with a combination of the two.

MacPorts ports will build with clang++, except in unusual circumstances. There is no supported method to request MacPorts to build with g++ instead. We recommend using clang++. The octave and SuiteSparse ports in MacPorts do appear to be unusual in that they offer you variants to let you choose which compiler to use.

comment:2 Changed 3 years ago by dbl001 (dbl)

I am trying to build Octave with MacPort's SuiteSparse.

So,

  1. even though

"The octave and SuiteSparse ports in MacPorts do appear to be unusual in that they offer you variants to let you choose which compiler to use."

the MacPort versions of

$ port list SuiteSparse SuiteSparse @5.7.2 math/SuiteSparse $ port list SuiteSparse_SPQR SuiteSparse_SPQR @2.0.9 math/SuiteSparse

were built with clang++,

  1. there is now MacPort's supported way to built SuiteSparse with g++,
  2. I should try to build octave with clang++,

-or- build SuiteSparse with g++ from source.

Yes?

comment:3 Changed 3 years ago by dbl001 (dbl)

Is there a way I can inspect the build configuration parameters for the Octave port? E.g. -

octave @6.1.0 math/octave

comment:4 Changed 3 years ago by dbl001 (dbl)

I inspected the MacPort build of Octave 6.2. There are differences between MacPort Octave 6.2 and my octave build in ~/octave-current/.build/liboctave/wrappers/.deps/libwrappers_la-iconv-wrappers.Plo E.g.

<   libgnu/iconv.h /opt/local/include/iconv.h \
---
>   /opt/local/include/iconv.h \

In addition, the MacPorts Octave build has the following files in libgnu which are missing from my build of octave:

-rw-r--r--   1 davidlaxer  staff   11393 Mar 14 09:20 iconv.c
-rw-r--r--   1 davidlaxer  staff   27099 Mar 14 09:41 iconv.h
-rw-r--r--   1 davidlaxer  staff    4301 Mar 14 09:20 iconv.in.h
-rw-r--r--   1 davidlaxer  staff    1312 Mar 14 09:20 iconv_close.c
-rw-r--r--   1 davidlaxer  staff    1701 Mar 14 09:20 iconv_open-aix.gperf
-rw-r--r--   1 davidlaxer  staff   10435 Mar 14 09:20 iconv_open-aix.h
-rw-r--r--   1 davidlaxer  staff    1843 Mar 14 09:20 iconv_open-hpux.gperf
-rw-r--r--   1 davidlaxer  staff   12539 Mar 14 09:20 iconv_open-hpux.h
-rw-r--r--   1 davidlaxer  staff    1477 Mar 14 09:20 iconv_open-irix.gperf
-rw-r--r--   1 davidlaxer  staff    8019 Mar 14 09:20 iconv_open-irix.h
-rw-r--r--   1 davidlaxer  staff    1747 Mar 14 09:20 iconv_open-osf.gperf
-rw-r--r--   1 davidlaxer  staff   11437 Mar 14 09:20 iconv_open-osf.h
-rw-r--r--   1 davidlaxer  staff    1594 Mar 14 09:20 iconv_open-solaris.gperf
-rw-r--r--   1 davidlaxer  staff    7148 Mar 14 09:20 iconv_open-solaris.h
-rw-r--r--   1 davidlaxer  staff    1915 Mar 14 09:20 iconv_open-zos.gperf
-rw-r--r--   1 davidlaxer  staff   13648 Mar 14 09:20 iconv_open-zos.h
-rw-r--r--   1 davidlaxer  staff    5611 Mar 14 09:20 iconv_open.c
-rw-r--r--   1 davidlaxer  staff    1225 Mar 14 09:20 iconveh.h

I have installed MacPort libiconv 1.16 (which appears to be the latest.)

 port list libiconv
libiconv                       @1.16           textproc/libiconv
(base) MacBook-Pro:~ davidlaxer$ 

Is there something I missed in the bootstrap step which adds iconv to libgnu?

Note: See TracTickets for help on using tickets.