Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build examples/ on Ubuntu with gfortran / fort77 / ifx with current BLAS / LAPACK libraries #19

Open
flor1an42 opened this issue Nov 15, 2024 · 0 comments

Comments

@flor1an42
Copy link

With the following modifications on make_Unix, I got the receip lib for building slicot.a and lpkaug.a sucessfully compiled, but the receipe example failed.

make -f makefile_Unix lib
make -f makefile_Unix example

FORTRAN = gfortran
OPTS = -O3 -shared -fPIC -llapacke -llapack -lrefblas -lgfortran -lopenblas -lopenlapack -lblas
BLASLIB      = /usr/lib/x86_64-linux-gnu/blas/libblas.a
LAPACKLIB    = /usr/lib/x86_64-linux-gnu/lapack/liblapack.a

Without the modified OPTS flags, the compiler gets stuck on ./TAB01ND <AB01ND.dat >AB01ND.exa .

With the gfortran and fort77 I get the following error output:

( cd examples; make -f makefile_Unix )
make[1]: Entering directory '/mnt/c/Workspace/Slycot/slycot/src/SLICOT-Reference/examples'
gfortran  -o TAB01MD TAB01MD.o ../slicot.a ../lpkaux.a /usr/lib/x86_64-linux-gnu/lapack/liblapack.a /usr/lib/x86_64-linux-gnu/blas/libblas.a
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x1b): undefined reference to `main'
/usr/bin/ld: TAB01MD.o: in function `MAIN__':
TAB01MD.f:(.text+0x35): undefined reference to `for_set_fpe_'
/usr/bin/ld: TAB01MD.f:(.text+0x41): undefined reference to `for_set_reentrancy'
/usr/bin/ld: TAB01MD.f:(.text+0x77): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0xa8): undefined reference to `for_read_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0xe5): undefined reference to `for_read_seq_lis'
/usr/bin/ld: TAB01MD.f:(.text+0x112): undefined reference to `for_read_seq_lis_xmit'
/usr/bin/ld: TAB01MD.f:(.text+0x14a): undefined reference to `for_read_seq_lis_xmit'
/usr/bin/ld: TAB01MD.f:(.text+0x213): undefined reference to `for_read_seq_lis'
/usr/bin/ld: TAB01MD.f:(.text+0x28c): undefined reference to `for_read_seq_lis'
/usr/bin/ld: TAB01MD.f:(.text+0x332): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0x3d7): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0x47d): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0x556): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.f:(.text+0x5f0): undefined reference to `for_write_seq_fmt'
/usr/bin/ld: TAB01MD.o:TAB01MD.f:(.text+0x635): more undefined references to `for_write_seq_fmt' follow
/usr/bin/ld: TAB01MD.o: in function `MAIN__':
TAB01MD.f:(.text+0x653): undefined reference to `for_stop_core_quiet'
collect2: error: ld returned 1 exit status
make[1]: *** [makefile_Unix:330: TAB01MD] Error 1
make[1]: Leaving directory '/mnt/c/Workspace/Slycot/slycot/src/SLICOT-Reference/examples'
make: *** [makefile_Unix:51: example] Error 2

and with the ifx fortran compiler the following:

( cd examples; make -f makefile_Unix )
make[1]: Entering directory '/mnt/c/Workspace/Slycot/slycot/src/SLICOT-Reference/examples'
ifx  -o TAB01MD TAB01MD.o ../slicot.a ../lpkaux.a /usr/lib/x86_64-linux-gnu/lapack/liblapack.a /usr/lib/x86_64-linux-gnu/blas/libblas.a
ld: /usr/lib/x86_64-linux-gnu/lapack/liblapack.a(xerbla.o): in function `xerbla_':
(.text+0x76): undefined reference to `_gfortran_st_write'
ld: (.text+0x81): undefined reference to `_gfortran_string_len_trim'
ld: (.text+0x98): undefined reference to `_gfortran_transfer_character_write'
ld: (.text+0xa8): undefined reference to `_gfortran_transfer_integer_write'
ld: (.text+0xb0): undefined reference to `_gfortran_st_write_done'
ld: (.text+0xbb): undefined reference to `_gfortran_stop_string'
make[1]: *** [makefile_Unix:330: TAB01MD] Error 1
make[1]: Leaving directory '/mnt/c/Workspace/Slycot/slycot/src/SLICOT-Reference/examples'
make: *** [makefile_Unix:51: example] Error 2

My conclusion is that ifx has an implementation of for_set_fpe_ which is not available at gfortran and fort77.
Also all three fortran compiles lacks of _gfortran_st_write.

I think long time ago the Fortran compiler got this routines, and (possibly newer?) Fortran compilers lacks of them.
It may be the case that also there is a missing flag in the compiler options.
Another idea is that there is a incompatibility with the newer LAPACK library version.

My apt versions are on Ubuntu 24.04.1 LTS

Package: libblas-dev Version: 3.12.0-3build1.1
Package: liblapack-dev Version: 3.12.0-3build1.1

Is there a compiler known which compiles and runs the example in a clean way? Which Fortran compiler (with version number) and corresponding BLAS and LAPACK version is known to run properly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant