Commit 382ab96c authored by Stéphane Adjemian (Charybdis)'s avatar Stéphane Adjemian (Charybdis)
Browse files

Added the Slicot library (distributed under the GNU General Public Licence at ...

Added the Slicot library (distributed under the GNU General Public Licence at  www.slicot.org). This library provides routines
for the design and analysis of control systems. Adapted the building system to handle fortran 77 source files.
parent e614227c
......@@ -33,6 +33,7 @@ case ${MATLAB_ARCH} in
MATLAB_DEFS="$MATLAB_DEFS -D_GNU_SOURCE -DNDEBUG"
MATLAB_CFLAGS="-ansi -fexceptions -fPIC -pthread -g -O2"
MATLAB_CXXFLAGS="-ansi -fPIC -pthread -g -O2"
MATLAB_FFLAGS="-fPIC -g -O2 -fexceptions"
MATLAB_LDFLAGS="-shared -Wl,--version-script,$MATLAB/extern/lib/${MATLAB_ARCH}/mexFunction.map -Wl,--no-undefined -Wl,-rpath-link,$MATLAB/bin/${MATLAB_ARCH} -L$MATLAB/bin/${MATLAB_ARCH}"
MATLAB_LIBS="-lmx -lmex -lmat -lm -lstdc++ -lmwlapack"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
......@@ -50,6 +51,7 @@ case ${MATLAB_ARCH} in
win32 | win64)
MATLAB_CFLAGS="-fexceptions -g -O2"
MATLAB_CXXFLAGS="-g -O2"
MATLAB_FFLAGS="-fexceptions -g -O2"
AX_COMPARE_VERSION([$MATLAB_VERSION], [eq], [7.0.1], [AC_MSG_ERROR([MATLAB version 7.0.1 (R14SP1) is buggy (LAPACK library missing for MSVC), and can't be used for compiling MEX files])])
MATLAB_DEFS="$MATLAB_DEFS -DNDEBUG"
# Note that static-libstdc++ is only supported since GCC 4.5 (but generates no error on older versions)
......@@ -72,6 +74,7 @@ case ${MATLAB_ARCH} in
MATLAB_LDFLAGS="-L$MATLAB/bin/${MATLAB_ARCH} -Wl,-twolevel_namespace -undefined error -arch $ARCHS -Wl,-syslibroot,$SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -bundle -Wl,-exported_symbols_list,\$(top_srcdir)/mexFunction-MacOSX.map"
MATLAB_LIBS="-lmx -lmex -lmat -lstdc++ -lmwlapack"
MATLAB_CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -isysroot $SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -O2"
MATLAB_CXXFLAGS="-fexceptions -fbackslash -g -O2"
# Starting from MATLAB 7.5, BLAS and LAPACK are in distinct libraries
AX_COMPARE_VERSION([$MATLAB_VERSION], [ge], [7.5], [MATLAB_LIBS="${MATLAB_LIBS} -lmwblas"])
ax_mexopts_ok="yes"
......
vpath %.f $(top_srcdir)/../../sources/libslicot
noinst_LIBRARIES = libslicot.a libauxslicot.a
SLICOT_SRC = \
AB01MD.f \
AB01ND.f \
AB01OD.f \
AB04MD.f \
AB05MD.f \
AB05ND.f \
AB05OD.f \
AB05PD.f \
AB05QD.f \
AB05RD.f \
AB05SD.f \
AB07MD.f \
AB07ND.f \
AB08MD.f \
AB08MZ.f \
AB08ND.f \
AB08NX.f \
AB08NZ.f \
AB09AD.f \
AB09AX.f \
AB09BD.f \
AB09BX.f \
AB09CD.f \
AB09CX.f \
AB09DD.f \
AB09ED.f \
AB09FD.f \
AB09GD.f \
AB09HD.f \
AB09HX.f \
AB09HY.f \
AB09ID.f \
AB09IX.f \
AB09IY.f \
AB09JD.f \
AB09JV.f \
AB09JW.f \
AB09JX.f \
AB09KD.f \
AB09KX.f \
AB09MD.f \
AB09ND.f \
AB13AD.f \
AB13AX.f \
AB13BD.f \
AB13CD.f \
AB13DD.f \
AB13DX.f \
AB13ED.f \
AB13FD.f \
AB13MD.f \
AB8NXZ.f \
AG07BD.f \
AG08BD.f \
AG08BY.f \
AG08BZ.f \
AG8BYZ.f \
BB01AD.f \
BB02AD.f \
BB03AD.f \
BB04AD.f \
BD01AD.f \
BD02AD.f \
DE01OD.f \
DE01PD.f \
delctg.f \
DF01MD.f \
DG01MD.f \
DG01ND.f \
DG01NY.f \
DG01OD.f \
DK01MD.f \
FB01QD.f \
FB01RD.f \
FB01SD.f \
FB01TD.f \
FB01VD.f \
FD01AD.f \
IB01AD.f \
IB01BD.f \
IB01CD.f \
IB01MD.f \
IB01MY.f \
IB01ND.f \
IB01OD.f \
IB01OY.f \
IB01PD.f \
IB01PX.f \
IB01PY.f \
IB01QD.f \
IB01RD.f \
IB03AD.f \
IB03BD.f \
MA01AD.f \
MA02AD.f \
MA02BD.f \
MA02BZ.f \
MA02CD.f \
MA02CZ.f \
MA02DD.f \
MA02ED.f \
MA02FD.f \
MA02GD.f \
MA02HD.f \
MA02ID.f \
MA02JD.f \
MB01MD.f \
MB01ND.f \
MB01PD.f \
MB01QD.f \
MB01RD.f \
MB01RU.f \
MB01RW.f \
MB01RX.f \
MB01RY.f \
MB01SD.f \
MB01TD.f \
MB01UD.f \
MB01UW.f \
MB01UX.f \
MB01VD.f \
MB01WD.f \
MB01XD.f \
MB01XY.f \
MB01YD.f \
MB01ZD.f \
MB02CD.f \
MB02CU.f \
MB02CV.f \
MB02CX.f \
MB02CY.f \
MB02DD.f \
MB02ED.f \
MB02FD.f \
MB02GD.f \
MB02HD.f \
MB02ID.f \
MB02JD.f \
MB02JX.f \
MB02KD.f \
MB02MD.f \
MB02ND.f \
MB02NY.f \
MB02OD.f \
MB02PD.f \
MB02QD.f \
MB02QY.f \
MB02RD.f \
MB02RZ.f \
MB02SD.f \
MB02SZ.f \
MB02TD.f \
MB02TZ.f \
MB02UD.f \
MB02UU.f \
MB02UV.f \
MB02VD.f \
MB02WD.f \
MB02XD.f \
MB02YD.f \
MB03MD.f \
MB03MY.f \
MB03ND.f \
MB03NY.f \
MB03OD.f \
MB03OY.f \
MB03PD.f \
MB03PY.f \
MB03QD.f \
MB03QX.f \
MB03QY.f \
MB03RD.f \
MB03RX.f \
MB03RY.f \
MB03SD.f \
MB03TD.f \
MB03TS.f \
MB03UD.f \
MB03VD.f \
MB03VY.f \
MB03WA.f \
MB03WD.f \
MB03WX.f \
MB03XD.f \
MB03XP.f \
MB03XU.f \
MB03YA.f \
MB03YD.f \
MB03YT.f \
MB03ZA.f \
MB03ZD.f \
MB04DD.f \
MB04DI.f \
MB04DS.f \
MB04DY.f \
MB04GD.f \
MB04ID.f \
MB04IY.f \
MB04IZ.f \
MB04JD.f \
MB04KD.f \
MB04LD.f \
MB04MD.f \
MB04ND.f \
MB04NY.f \
MB04OD.f \
MB04OW.f \
MB04OX.f \
MB04OY.f \
MB04PA.f \
MB04PB.f \
MB04PU.f \
MB04PY.f \
MB04QB.f \
MB04QC.f \
MB04QF.f \
MB04QU.f \
MB04TB.f \
MB04TS.f \
MB04TT.f \
MB04TU.f \
MB04TV.f \
MB04TW.f \
MB04TX.f \
MB04TY.f \
MB04UD.f \
MB04VD.f \
MB04VX.f \
MB04WD.f \
MB04WP.f \
MB04WR.f \
MB04WU.f \
MB04XD.f \
MB04XY.f \
MB04YD.f \
MB04YW.f \
MB04ZD.f \
MB05MD.f \
MB05MY.f \
MB05ND.f \
MB05OD.f \
MB05OY.f \
MB3OYZ.f \
MB3PYZ.f \
MC01MD.f \
MC01ND.f \
MC01OD.f \
MC01PD.f \
MC01PY.f \
MC01QD.f \
MC01RD.f \
MC01SD.f \
MC01SW.f \
MC01SX.f \
MC01SY.f \
MC01TD.f \
MC01VD.f \
MC01WD.f \
MC03MD.f \
MC03ND.f \
MC03NX.f \
MC03NY.f \
MD03AD.f \
MD03BA.f \
MD03BB.f \
MD03BD.f \
MD03BF.f \
MD03BX.f \
MD03BY.f \
NF01AD.f \
NF01AY.f \
NF01BA.f \
NF01BB.f \
NF01BD.f \
NF01BE.f \
NF01BF.f \
NF01BP.f \
NF01BQ.f \
NF01BR.f \
NF01BS.f \
NF01BU.f \
NF01BV.f \
NF01BW.f \
NF01BX.f \
NF01BY.f \
SB01BD.f \
SB01BX.f \
SB01BY.f \
SB01DD.f \
SB01FY.f \
SB01MD.f \
SB02CX.f \
SB02MD.f \
SB02MR.f \
SB02MS.f \
SB02MT.f \
SB02MU.f \
SB02MV.f \
SB02MW.f \
SB02ND.f \
SB02OD.f \
SB02OU.f \
SB02OV.f \
SB02OW.f \
SB02OX.f \
SB02OY.f \
SB02PD.f \
SB02QD.f \
SB02RD.f \
SB02RU.f \
SB02SD.f \
SB03MD.f \
SB03MU.f \
SB03MV.f \
SB03MW.f \
SB03MX.f \
SB03MY.f \
SB03OD.f \
SB03OR.f \
SB03OT.f \
SB03OU.f \
SB03OV.f \
SB03OY.f \
SB03PD.f \
SB03QD.f \
SB03QX.f \
SB03QY.f \
SB03RD.f \
SB03SD.f \
SB03SX.f \
SB03SY.f \
SB03TD.f \
SB03UD.f \
SB04MD.f \
SB04MR.f \
SB04MU.f \
SB04MW.f \
SB04MY.f \
SB04ND.f \
SB04NV.f \
SB04NW.f \
SB04NX.f \
SB04NY.f \
SB04OD.f \
SB04OW.f \
SB04PD.f \
SB04PX.f \
SB04PY.f \
SB04QD.f \
SB04QR.f \
SB04QU.f \
SB04QY.f \
SB04RD.f \
SB04RV.f \
SB04RW.f \
SB04RX.f \
SB04RY.f \
SB06ND.f \
SB08CD.f \
SB08DD.f \
SB08ED.f \
SB08FD.f \
SB08GD.f \
SB08HD.f \
SB08MD.f \
SB08MY.f \
SB08ND.f \
SB08NY.f \
SB09MD.f \
SB10AD.f \
SB10DD.f \
SB10ED.f \
SB10FD.f \
SB10HD.f \
SB10ID.f \
SB10JD.f \
SB10KD.f \
SB10LD.f \
SB10MD.f \
SB10PD.f \
SB10QD.f \
SB10RD.f \
SB10SD.f \
SB10TD.f \
SB10UD.f \
SB10VD.f \
SB10WD.f \
SB10YD.f \
SB10ZD.f \
SB10ZP.f \
SB16AD.f \
SB16AY.f \
SB16BD.f \
SB16CD.f \
SB16CY.f \
select.f \
SG02AD.f \
SG03AD.f \
SG03AX.f \
SG03AY.f \
SG03BD.f \
SG03BU.f \
SG03BV.f \
SG03BW.f \
SG03BX.f \
SG03BY.f \
TB01ID.f \
TB01IZ.f \
TB01KD.f \
TB01LD.f \
TB01MD.f \
TB01ND.f \
TB01PD.f \
TB01TD.f \
TB01TY.f \
TB01UD.f \
TB01VD.f \
TB01VY.f \
TB01WD.f \
TB01XD.f \
TB01XZ.f \
TB01YD.f \
TB01ZD.f \
TB03AD.f \
TB03AY.f \
TB04AD.f \
TB04AY.f \
TB04BD.f \
TB04BV.f \
TB04BW.f \
TB04BX.f \
TB04CD.f \
TB05AD.f \
TC01OD.f \
TC04AD.f \
TC05AD.f \
TD03AD.f \
TD03AY.f \
TD04AD.f \
TD05AD.f \
TF01MD.f \
TF01MX.f \
TF01MY.f \
TF01ND.f \
TF01OD.f \
TF01PD.f \
TF01QD.f \
TF01RD.f \
TG01AD.f \
TG01AZ.f \
TG01BD.f \
TG01CD.f \
TG01DD.f \
TG01ED.f \
TG01FD.f \
TG01FZ.f \
TG01HD.f \
TG01HX.f \
TG01ID.f \
TG01JD.f \
TG01WD.f \
UD01BD.f \
UD01CD.f \
UD01DD.f \
UD01MD.f \
UD01MZ.f \
UD01ND.f \
UE01MD.f
SLICOT_AUX = \
dcabs1.f \
dhgeqz.f \
dtgsy2.f
nodist_libslicot_a_SOURCES = \
$(SLICOT_SRC)
nodist_libauxslicot_a_SOURCES = \
$(SLICOT_AUX)
\ No newline at end of file
......@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I ../../../m4
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ logposterior logMHMCMCposterior
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ logposterior logMHMCMCposterior libslicot
if HAVE_GSL
SUBDIRS += swz
endif
......
......@@ -38,6 +38,7 @@ if test "x$ax_enable_matlab" = "xyes"; then
CFLAGS="$MATLAB_CFLAGS"
CXXFLAGS="$MATLAB_CXXFLAGS"
FFLAGS="$MATLAB_FFLAGS"
fi
case ${host_os} in
......@@ -49,8 +50,10 @@ case ${host_os} in
esac
CFLAGS="$CFLAGS -Wall"
FFLAGS="$FFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
AC_PROG_F77
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
......@@ -130,6 +133,7 @@ AC_CONFIG_FILES([Makefile
dynare_simul_/Makefile
swz/Makefile
logposterior/Makefile
logMHMCMCposterior/Makefile])
logMHMCMCposterior/Makefile
libslicot/Makefile])
AC_OUTPUT
include ../mex.am
include ../../libslicot.am
......@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I ../../../m4
# libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_
if DO_SOMETHING
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ logposterior logMHMCMCposterior qzcomplex ordschur
SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ logposterior logMHMCMCposterior qzcomplex ordschur libslicot
if HAVE_GSL
SUBDIRS += swz
endif
......
......@@ -28,12 +28,15 @@ if test "x$MKOCTFILE" != "x"; then
CC=`$MKOCTFILE -p CC`
CXX=`$MKOCTFILE -p CXX`
CFLAGS=`$MKOCTFILE -p CFLAGS`
FFLAGS=`$MKOCTFILE -p FFLAGS`
CXXFLAGS=`$MKOCTFILE -p CXXFLAGS`
fi
CFLAGS="$CFLAGS -Wall"
FFLAGS="$FFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
AC_PROG_F77
AC_PROG_CC
AC_PROG_CXX
AC_PROG_RANLIB
......@@ -104,6 +107,7 @@ AC_CONFIG_FILES([Makefile
logposterior/Makefile
logMHMCMCposterior/Makefile
qzcomplex/Makefile
ordschur/Makefile])
ordschur/Makefile
libslicot/Makefile])
AC_OUTPUT
EXEEXT = .mex
include ../mex.am
include ../../libslicot.am
SUBROUTINE AB01MD( JOBZ, N, A, LDA, B, NCONT, Z, LDZ, TAU, TOL,
$ DWORK, LDWORK, INFO )
C
C SLICOT RELEASE 5.0.
C
C Copyright (c) 2002-2009 NICONET e.V.
C
C This program is free software: you can redistribute it and/or
C modify it under the terms of the GNU General Public License as
C published by the Free Software Foundation, either version 2 of
C the License, or (at your option) any later version.
C
C This program is distributed in the hope that it will be useful,
C but WITHOUT ANY WARRANTY; without even the implied warranty of
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
C GNU General Public License for more details.
C
C You should have received a copy of the GNU General Public License
C along with this program. If not, see
C <http://www.gnu.org/licenses/>.
C
C PURPOSE
C
C To find a controllable realization for the linear time-invariant
C single-input system
C
C dX/dt = A * X + B * U,
C
C where A is an N-by-N matrix and B is an N element vector which
C are reduced by this routine to orthogonal canonical form using
C (and optionally accumulating) orthogonal similarity
C transformations.
C
C ARGUMENTS
C
C Mode Parameters
C
C JOBZ CHARACTER*1
C Indicates whether the user wishes to accumulate in a
C matrix Z the orthogonal similarity transformations for
C reducing the system, as follows:
C = 'N': Do not form Z and do not store the orthogonal
C transformations;
C = 'F': Do not form Z, but store the orthogonal
C transformations in the factored form;
C = 'I': Z is initialized to the unit matrix and the
C orthogonal transformation matrix Z is returned.