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
- routines/interf/intmgetl.f some versions of g77 on sparc will compile intmgetl.f but the code does not execute properly.
routines/control/hqror2.f routines/control/comqr3.f routines/control/tql2.f routines/control/imtql3.f routines/control/dsvdc.f routines/control/wsvdc.f routines/control/pade.f According to compiler, do not optimize the following files
routines/calelm/icopy.f routines/calelm/unsfdcopy.f according to compiler, do not optimize the following files
- routines/lapack/dlamch.f
List in Scilab 5
IO : modules/io/sci_gateway/fortran/intmgetl.f some versions of g77 on sparc will compile intmgetl.f but the code does not execute properly.
Elementaries Functions : In modules/elementaries_functions/src/fortran/, qror2.f comqr3.f pade.f unsfdcopy.c icopy.f According to compiler, do not optimize the following files (tql2.f imtql3.f dsvdc.f wsvdc.f have been removed). dbesjg.f has some problems with -O0 on linux 64 bits.
Lapack : libs/lapack/dlamch.f
data_structures : src/fortran/intl_e.f (bug 1604)
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