[Contents] [TitleIndex] [WordIndex

Files with optimisation issues

In Scilab, some fortran files have problem if they are compiled with optimisation flags on some computer.

List in Scilab 4

List in Scilab 5

Solution

Using the autotools, the mechanism is to create a "temporary" library for the file(s) which causes the problem.

# Define a "fake" temporary library
noinst_LTLIBRARIES = libdummy-lapack.la
# List of the files which should be be optimised
libdummy_lapack_la_SOURCES = dlamch.f slamch.f
# The trick which will remove the optimisation
libdummy_lapack_la_FFLAGS = `echo "@FFLAGS@"| sed -e 's|-O[0-9+]|-O0|'`
# Include the fake library into the real one
liblapack_la_LIBADD = libdummy-lapack.la
# Override the compilation rules
libdummy_lapack_la-dlamch.lo: dlamch.f
        $(LIBTOOL) --tag=F77 --mode=compile $(F77) $(libdummy_lapack_la_FFLAGS) -c -o libdummy_lapack_la-dlamch.lo `test -f 'dlamch.f' || echo '$(srcdir)/'`dlamch.f
libdummy_lapack_la-slamch.lo: slamch.f
        $(LIBTOOL) --tag=F77 --mode=compile $(F77) $(libdummy_lapack_la_FFLAGS) -c -o libdummy_lapack_la-slamch.lo `test -f 'slamch.f' || echo '$(srcdir)/'`slamch.f

2022-09-08 09:27