[Pkg-octave-commit] [SCM] dynare branch, master, updated. 19c9d5e371654c572bbb2fbb7e9b5e395bfee775

Sébastien Villemot sebastien.villemot at ens.fr
Sun May 31 21:53:48 UTC 2009


The following commit has been merged in the master branch:
commit e6b6eaf5e9beaaa73ac370a8d4d8c510b302f82a
Author: Sébastien Villemot <sebastien.villemot at ens.fr>
Date:   Sun May 31 23:22:44 2009 +0200

    Created dynare-matlab package

diff --git a/debian/README.Debian b/debian/README.Debian
index 8245d6a..155984b 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -41,11 +41,9 @@ In particular, some specificities of Dynare for Octave are discussed on:
 Note for MATLAB users
 ---------------------
 
+You should install the 'dynare-matlab' package, which will recompile the MEX
+files on your machine, using your copy of MATLAB.
+
 Before using Dynare on MATLAB, you need to type the following:
 
   addpath /usr/share/dynare/matlab
-
-Note that the Debian package currently doesn't provide MEX files for
-MATLAB. However, it provides substitution functions in M-files. Therefore this
-package is fully function on MATLAB, but doesn't run at full speed. We hope to
-provide soon a helper for compilation of MEX files under MATLAB.
diff --git a/debian/changelog b/debian/changelog
index 1291d1d..04749c3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,13 @@
 dynare (4.0.3-2) UNRELEASED; urgency=low
 
+  [ Rafael Laboissiere ]
   * debian/control: Switch the Vcs-* fields to the new Git repository
 
+  [ Sébastien Villemot ]
+  * dynare-matlab: new contrib binary package aimed at MATLAB users. Contains
+    the MEX files source code. The postinst script builds them on the user
+    machine.
+
  -- Rafael Laboissiere <rafael at debian.org>  Mon, 25 May 2009 21:44:20 +0200
 
 dynare (4.0.3-1) unstable; urgency=low
diff --git a/debian/control b/debian/control
index 56dc7d0..872ff13 100644
--- a/debian/control
+++ b/debian/control
@@ -61,3 +61,20 @@ Description: documentation for Dynare
  .
  This package contains full Dynare documentation, including a user
  guide and the reference manual.
+
+Package: dynare-matlab
+Architecture: all
+Section: contrib/math
+Depends: ${misc:Depends}, debconf | debconf-2.0, sudo
+Description: MEX files for MATLAB users of Dynare
+ Dynare is a pre-preprocessor and a collection of GNU Octave and
+ MATLAB routines which can solve, simulate and estimate non-linear
+ models with forward looking variables.
+ .
+ In particular, in the field of computational economics, it is used
+ for solving and estimating dynamic stochastic general equilibrium
+ (DSGE) models.
+ .
+ This package is only useful to users having MATLAB installed on their
+ machine. It contains the source of the MEX files and will recompile
+ them using the existing MATLAB installation.
diff --git a/debian/dynare-matlab.config b/debian/dynare-matlab.config
new file mode 100644
index 0000000..505cdc7
--- /dev/null
+++ b/debian/dynare-matlab.config
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+. /usr/share/debconf/confmodule
+db_input high dynare-matlab/matlab-path || true
+db_input high dynare-matlab/matlab-user || true
+db_input medium dynare-matlab/rename-libs || true
+db_go || true
diff --git a/debian/dynare-matlab.install b/debian/dynare-matlab.install
new file mode 100644
index 0000000..90d9fc1
--- /dev/null
+++ b/debian/dynare-matlab.install
@@ -0,0 +1,9 @@
+mex/sources/build_matlab.m              /usr/src/dynare-matlab
+mex/sources/mjdgges/*.c                 /usr/src/dynare-matlab/mjdgges
+mex/sources/gensylv/cc/*.cpp            /usr/src/dynare-matlab/gensylv/cc
+mex/sources/gensylv/cc/*.h              /usr/src/dynare-matlab/gensylv/cc
+mex/sources/gensylv/matlab/*.cpp        /usr/src/dynare-matlab/gensylv/matlab
+mex/sources/kronecker/*.cc              /usr/src/dynare-matlab/kronecker
+mex/sources/simulate/*.cc               /usr/src/dynare-matlab/simulate
+mex/sources/simulate/*.hh               /usr/src/dynare-matlab/simulate
+preprocessor/include/CodeInterpreter.hh /usr/src/dynare-matlab/simulate
diff --git a/debian/dynare-matlab.postinst b/debian/dynare-matlab.postinst
new file mode 100644
index 0000000..334c815
--- /dev/null
+++ b/debian/dynare-matlab.postinst
@@ -0,0 +1,51 @@
+#!/bin/sh
+set -e
+. /usr/share/debconf/confmodule
+
+db_get dynare-matlab/matlab-path
+MATLAB_PATH=$RET
+
+MATLAB="$MATLAB_PATH/bin/matlab"
+
+if [ ! -x "$MATLAB" ]
+then
+  echo "Can't find MATLAB in $MATLAB_PATH. Please run 'dpkg-reconfigure dynare-matlab'."
+  exit 0
+fi
+
+# Rename GCC libraries shipped with MATLAB which conflicts with those of Debian
+
+db_get dynare-matlab/rename-libs
+
+if [ "$RET" = "true" ]
+then
+    for f in $MATLAB_PATH/sys/os/glnx86/libgcc_s.so.1 $MATLAB_PATH/sys/os/glnx86/libstdc++.so.6 \
+        $MATLAB_PATH/sys/os/glnxa64/libgcc_s.so.1 $MATLAB_PATH/sys/os/glnxa64/libstdc++.so.6
+    do
+        if [ -e $f ]
+        then
+            echo "Renaming $f to $f.bak."
+            mv $f $f.bak
+        fi
+    done
+fi
+
+# Build the MEX files
+
+mkdir /usr/lib/dynare/mex/2007a /usr/lib/dynare/mex/2007b
+
+db_get dynare-matlab/matlab-user
+MATLAB_USER=$RET
+
+cd /usr/src/dynare-matlab
+
+if [ -z "$MATLAB_USER" ]
+then
+    $MATLAB -nodisplay -r build_matlab
+else
+    db_input critical dynare-matlab/license-manager || true
+    db_go || true
+    chown -R $MATLAB_USER /usr/lib/dynare/mex/2007a /usr/lib/dynare/mex/2007b
+    sudo -u $MATLAB_USER $MATLAB -nodisplay -r build_matlab
+    chown -R root:root /usr/lib/dynare/mex/2007a /usr/lib/dynare/mex/2007b
+fi
diff --git a/debian/dynare-matlab.prerm b/debian/dynare-matlab.prerm
new file mode 100644
index 0000000..1e68af6
--- /dev/null
+++ b/debian/dynare-matlab.prerm
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+rm -rf /usr/lib/dynare/mex/2007a /usr/lib/dynare/mex/2007b
diff --git a/debian/dynare-matlab.templates b/debian/dynare-matlab.templates
new file mode 100644
index 0000000..69a619d
--- /dev/null
+++ b/debian/dynare-matlab.templates
@@ -0,0 +1,42 @@
+Template: dynare-matlab/matlab-path
+Type: string
+Description: Absolute path to MATLAB installation:
+ Please enter the directory where you have installed MATLAB.
+ .
+ For example, if MATLAB executable is in "/usr/local/matlab76/bin/matlab",
+ please enter "/usr/local/matlab76".
+
+Template: dynare-matlab/matlab-user
+Type: string
+Description: UNIX user account able to launch MATLAB:
+ If your MATLAB installation is such that only one or a limited set of UNIX
+ user accounts can launch MATLAB, please indicate here the login of such an
+ account.
+ .
+ If every UNIX user account (including root) is allowed to launch MATLAB,
+ please leave this field empty.
+
+Template: dynare-matlab/license-manager
+Type: note
+Description: Please make sure that MATLAB license manager is running
+ You have specified a UNIX user account for running MATLAB.
+ .
+ This probably means that your MATLAB installation uses a license manager.
+ .
+ If the license manager is not running, MEX files compilation will fail.
+
+Template: dynare-matlab/rename-libs
+Type: boolean
+Default: true
+Description: Rename MATLAB files conflicting with Dynare ?
+ A MATLAB installation is shipped with copies of GCC dynamic loadable
+ libraries, which typically come from an old version of GCC.
+ .
+ This creates a conflict which makes Dynare fail when running the preprocessor.
+ .
+ If you accept it, the installation process will rename the conflicting
+ files using a ".bak" extension. These files are located in the "sys/os/glnx86"
+ or "sys/os/glnxa64" subdirectory of your MATLAB installation.
+ .
+ Otherwise, Dynare will probably fail to run, and you will need to manually
+ hack your MATLAB installation.
diff --git a/debian/patches/build-matlab b/debian/patches/build-matlab
new file mode 100644
index 0000000..c4289ff
--- /dev/null
+++ b/debian/patches/build-matlab
@@ -0,0 +1,32 @@
+Fix paths to reflect structure of Debian packaging
+--- a/mex/sources/build_matlab.m
++++ b/mex/sources/build_matlab.m
+@@ -17,7 +17,7 @@
+ % You should have received a copy of the GNU General Public License
+ % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
+ 
+-addpath '../../matlab'; % For matlab_ver_less_than
++addpath '/usr/share/dynare/matlab'; % For matlab_ver_less_than
+ 
+ MATLAB_PATH = matlabroot;
+ 
+@@ -66,9 +66,9 @@
+ end
+ 
+ if matlab_ver_less_than('7.5')
+-    OUTPUT_DIR = '../2007a';
++    OUTPUT_DIR = '/usr/lib/dynare/mex/2007a';
+ else
+-    OUTPUT_DIR = '../2007b';
++    OUTPUT_DIR = '/usr/lib/dynare/mex/2007b';
+ end
+ 
+ % Comment next line to suppress compilation debugging info
+@@ -104,4 +104,6 @@
+        'gensylv/cc/Vector.cpp ' ...
+        BLAS_PATH ' ' LAPACK_PATH ]);
+ disp('Compiling simulate...')
+-eval([ COMPILE_COMMAND ' -Isimulate -I../../preprocessor/include simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc' ]);
++eval([ COMPILE_COMMAND ' -Isimulate simulate/simulate.cc simulate/Interpreter.cc simulate/Mem_Mngr.cc simulate/SparseMatrix.cc' ]);
++
++exit
diff --git a/debian/patches/series b/debian/patches/series
index 7d56348..26ae828 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fhs-compliance
 bashisms-in-makefiles
 table-name-clash
 rows-name-clash
+build-matlab

-- 
dynare



More information about the Pkg-octave-commit mailing list