bugGNU Octave - Bugs: bug #66472, undefined reference to lapack...

 
 

bug #66472: undefined reference to lapack library

Submitter:  Stefano <ste3191>
Submitted:  Thu 21 Nov 2024 04:36:54 PM UTC
   
 
Category:  GUI Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * 9.2.0 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 29 Nov 2024 03:39:27 PM UTC, comment #10: 

Unless you are providing the information that you were asked for, it is unlikely anyone will be able to help.

Markus Mützel <mmuetzel>
Group administrator
Fri 29 Nov 2024 02:56:07 PM UTC, comment #9: 

I tried setting LDFLAGS only and same issue. I tried CFLAGS as well only and the same.

I read that <string.h> might be the issue, should I replace all of them with <string> ? it sounds overkill to me.

Any thoughts?

Stefano <ste3191>
Thu 28 Nov 2024 05:56:33 PM UTC, comment #8: 

I agree with Markus in comment #7.  First, the configure script should figure out the correct compiling and linking flags for something as basic as the C++ STL.  Intervening in that selection is likely to cause more problems rather than less.  Second, for Fortran or for C programs, you shouldn't link in the C++ standard library.  In the case of Fortran it doesn't make any sense.  For a C program you would need to link in libc, not stdc++.

Can you try without those additions?

Also, from comment #4, can you capture the output of configure and upload that to this bug report?  That will help us check whether the flags are set correctly.

Rik <rik5>
Group administrator
Thu 28 Nov 2024 04:01:24 PM UTC, comment #7: 

Setting `CFLAGS="-lstdc++"` or `FFLAGS="-lstdc++ -std=c++11"` doesn't make sense to me.
In most cases, you shouldn't need to link to the STL manually. But if you really need to for some odd reason, the most reasonable flag for that would be `LDFLAGS=-lstdc++`.
Adding `-std=c++11` to the Fortran compiler flags doesn't make sense at all. I'm surprised that this doesn't cause compiler errors or warnings for you.

That linker error is odd. Could it be that you are trying to mix compilers, binutils and/or STL implementations that don't belong to each other?

Are you using GCC as your compilers? Which version? Which linker?

Markus Mützel <mmuetzel>
Group administrator
Thu 28 Nov 2024 09:12:21 AM UTC, comment #6: 

Hi,

A bit of progress here. I managed to remove the linking errors about Lapack libraries (at least for now) by specifying variables along configure command as shown below:

./configure CFLAGS="-lstdc++" FFLAGS="-lstdc++ -std=c++11" LDFLAGS="-L/path_to/fftw-3.3.10/lib -L/path_to/openblas-0.2.20/lib" CPPFLAGS="-I/path_to/fftw-3.3.10/include -I/path_to/openblas-0.2.20/include" --prefix=/path_to/octave-9.2.0 --with-qt=5 --with-blas="-lopenblas" --with-lapack="-llapack" --without-curl --disable-docs --without-z

However I still get the error:

/bin/ld: libinterp/.libs/liboctinterp.so: undefined reference to `std::ios_base_library_init()'

Any hint? Hope it is the last one.

Stefano



Stefano <ste3191>
Mon 25 Nov 2024 07:57:54 PM UTC, comment #5: 

I think I would recommend installing flatpak (that would require root, so ask your admin) and than flatpak package of octave.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 25 Nov 2024 07:47:47 PM UTC, comment #4: 

A little bit of progress.  It does seem that the linker is not able to find an adequate library with the correct functions.

Could you run your configure script and capture stdout/stderr and upload the file?  In particular, the configure script finishes by printing a list of the flags that it has determined are necessary for compilation.  I want to see that those are correct for your situation.

Since it is the linker, rather than runtime, that is failing I think the solution will not be with LD_LIBRARY_PATH.  It might be with LIBS or LDLIBS.  According to the documentation for make, the default linker command is


‘$(CC) $(LDFLAGS) n.o $(LOADLIBES) $(LDLIBS)’


So, it would seem that extra libraries, such as '-lm' for math, would be put in LDLIBS variable.  LOADLIBES is deprecated and sholdn't be used.

Rik <rik5>
Group administrator
Mon 25 Nov 2024 07:34:41 PM UTC, comment #3: 

Runtime linker should have a path to your libraries.
So yes, LD_LIBRARY_PATH should help.
Since you have so many custom libraries, perhaps you should add a modern zlib as well.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 25 Nov 2024 07:05:01 PM UTC, comment #2: 

Using --without-z I don't see the error about uncompress2, thanks for helping on this. However, the other two errors persist, the one about lapack functions and the one about std::ios_base_library_init()

How can I debug this? Should I specify LD_LIBRARY_PATH and LIBS with the directories of the openblas library?

Stefano <ste3191>
Mon 25 Nov 2024 05:06:47 PM UTC, comment #1: 

RedHat 7 is standard so I'm surprised compilation is an issue.

It would be helpful to go one step at a time.  Could you run configure with the options you have set except exclude the '--with-z' options and include '--without-z'.  This will disable using zlib which will have some small consequences such as disabling saving in Matlab v7 format.  However, I just want to know if this solves the issues related to uncompress2.

The missing function in liboctave, 'zgetri', is supposed to be in the LAPACK library.  I think this might be a separate issue to debug.

Rik <rik5>
Group administrator
Thu 21 Nov 2024 04:36:54 PM UTC, original submission:  

I am trying to install Octave 9.2.0 in a specific directory since I'm not root, including BLAS, LAPACK and FFT3W. I work on RedHat 7.

The BLAS and LAPACK libraries are available under openblas which I have.(It's a system library and is found by ./configure command).

I've manually installed the FFT3W libraries under a specific directory, so these are available too. They are found by ./configure command)

The command to configure Octave is the following:

./configure --prefix=/path_to/octave-9.2.0 --with-qt=5 --with-blas=/path_to/openblas-0.2.20/lib/libopenblas.so --with-lapack=/path_to/openblas-0.2.20/lib/libopenblas.so --with-fftw3-includedir=/path_to/fftw-3.3.10/include --with-fftw3-libdir=/path_to/fftw-3.3.10/lib --with-fltk=/path_to/fltk-1.3.8 --with-fftw3f-includedir=/path_to/fftw-3.3.10/include --with-fftw3f-libdir=/path_to/fftw-3.3.10/lib --with-z-includedir=/path_to/zlib-1.2.11/include --with-z-libdir=/path_to/zlib-1.2.11/lib --without-curl --disable-docs

If I don't specify the zlib library I will get an error about the function "uncompress2" during the make process.

Below the errors after typing make

/bin/ld: liboctave/.libs/liboctave.so: undefined reference to `zgetri_'

..other libraries...

/bin/ld: libinterp/.libs/liboctinterp.so: undefined reference to `std::ios_base_library_init()'

/bin/ld: libinterp/.libs/liboctinterp.so: undefined reference to `uncompress2@ZLIB_1.2.9'

I tried checking: ldd libinterp/.libs/liboctinterp.so and ldd liboctave/.libs/liboctave.so and I don't see any lib missing.

Stefano <ste3191>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by ste3191 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-11-25 rik5 CategoryNone GUI
        Item GroupNone Unexpected Error or Warning
        StatusNone Need Info

    Back to the top

    Powered by Savane 3.14-f13d.
    Corresponding source code