packaging: update os x packaging script

time-shift
Houtan Bastani 2014-08-01 17:46:26 +02:00
parent 19e02acd0b
commit 5bb994fd19
1 changed files with 17 additions and 82 deletions

View File

@ -1,37 +1,34 @@
#!/bin/bash
set -ex
VERSION=4.4.3
TOP_DIR=/Users/Houtan/Documents/DYNARE/PACKAGES
TOP_DYN_DIR=$TOP_DIR/dynare
TOP_DYN_DIR=$TOP_DIR/dynare-$VERSION
VERSION=4.3
INSTALLDIRNAME=dynare-$VERSION-osx
INSTALLDIR=$TOP_DIR/$INSTALLDIRNAME
rm -rf $INSTALLDIRNAME
mkdir $INSTALLDIRNAME
INSTALLDIR=$TOP_DIR/$INSTALLDIRNAME
########################
# UPDATE DYNARE SOURCE #
########################
cd $TOP_DYN_DIR
autoreconf -si
########################
# BEGIN MAKING PACKAGE #
########################
# create directories
mkdir "$INSTALLDIR/scripts"
mkdir "$INSTALLDIR/dynare++"
mkdir -p "$INSTALLDIR/doc/dynare++"
mkdir "$INSTALLDIR/doc/dynare.html"
mkdir "$INSTALLDIR/dynare++"
mkdir -p "$INSTALLDIR/contrib/ms-sbvar/TZcode"
mkdir -p "$INSTALLDIR/mex/octave"
mkdir -p "$INSTALLDIR/mex/matlab/osx64"
mkdir "$INSTALLDIR/mex/matlab/osx32-7.4"
mkdir "$INSTALLDIR/mex/matlab/osx32-7.5-7.11"
# top level
cp $TOP_DYN_DIR/scripts/dynare.el $INSTALLDIR/scripts
cp $TOP_DYN_DIR/license.txt $INSTALLDIR
@ -43,17 +40,15 @@ cp -r $TOP_DYN_DIR/contrib/ms-sbvar/TZcode/MatlabFiles $INSTALLDIR/con
# examples
cp -r $TOP_DYN_DIR/examples $INSTALLDIR
##########################################################
# FIRST BUILD 32 BIT EVERYTHING, 32 BIT MATLAB < 7.5 MEX #
##########################################################
./configure FFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' CPPFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' --with-matlab=/Applications/MATLAB_OLD/R2007a MATLAB_VERSION=7.4 --with-slicot=/usr/local32 --disable-octave --with-matio=/usr/localStatic --with-gsl=/usr/localStatic
./configure FFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' CPPFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' --disable-octave --with-matlab=/Applications/MATLAB_OLD/R2007a MATLAB_VERSION=7.4 --with-gsl=/usr/local32 --with-slicot=/usr/local32 --with-matio=/usr/local32
cd $TOP_DYN_DIR/doc
texi2dvi --pdf --batch --build-dir=dynare.t2p dynare.texi
cd $TOP_DYN_DIR
make pdf
make html
cd $TOP_DYN_DIR/preprocessor
make
@ -64,7 +59,6 @@ make
cd $TOP_DYN_DIR/mex/build/matlab
make
# Matlab
# Must come after configure because matlab/dynare_version.m is created by configure script
cp -r $TOP_DYN_DIR/matlab $INSTALLDIR
@ -75,19 +69,8 @@ cp -r $TOP_DYN_DIR/matlab $INSTALLDIR
# compiled preprocessor
cp $TOP_DYN_DIR/preprocessor/dynare_m $INSTALLDIR/matlab
# Matlab
cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/estimation/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.4
# Matlab Mex
cp $TOP_DYN_DIR/mex/matlab/* $INSTALLDIR/mex/matlab/osx32-7.4
# dynare++
cp $TOP_DYN_DIR/dynare++/src/dynare++ $INSTALLDIR/dynare++
@ -116,77 +99,27 @@ cp $TOP_DYN_DIR/dynare++/kord/kord.pdf
##############################################
# RETURN TO BUILD 32 BIT MATLAB 7.5 & UP MEX #
##############################################
make clean
cd $TOP_DYN_DIR/mex/build/matlab
./configure FFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' CPPFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' --with-matlab=/Applications/MATLAB_OLD/MATLAB_R2009b_32bit/MATLAB_R2009b.app MATLAB_VERSION=7.9 MEXEXT='mexmaci' --with-slicot=/usr/local32 --with-matio=/usr/localStatic --with-gsl=/usr/localStatic
make clean
./configure FFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' CPPFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' LDFLAGS='-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -arch i386' --with-matlab=/Applications/MATLAB_OLD/MATLAB_R2009b_32bit/MATLAB_R2009b.app MATLAB_VERSION=7.9 MEXEXT='mexmaci' --with-slicot=/usr/local32 --with-matio=/usr/local32 --with-gsl=/usr/local32
make
# Matlab
cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/estimation/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci $INSTALLDIR/mex/matlab/osx32-7.5-7.11
# Matlab Mex
cp $TOP_DYN_DIR/mex/matlab/* $INSTALLDIR/mex/matlab/osx32-7.5-7.11
#####################################
# RETURN TO BUILD 64 BIT MATLAB MEX #
#####################################
make clean
cd $TOP_DYN_DIR/mex/build/matlab
make clean
./configure --with-matlab=/Applications/MATLAB_OLD/MATLAB_R2009b.app MATLAB_VERSION=7.9 MEXEXT=mexmaci64 --with-matio=/usr/localStatic --with-gsl=/usr/localStatic
make
# Matlab
cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/estimation/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci64 $INSTALLDIR/mex/matlab/osx64
#####################################
# RETURN TO BUILD 64 BIT OCTAVE MEX #
#####################################
make clean
cd $TOP_DYN_DIR/mex/build/octave
./configure CC="gcc" CXX="g++" --with-matio=/usr/localStatic --with-gsl=/usr/localStatic
make
# Octave
cp $TOP_DYN_DIR/mex/build/octave/block_kalman_filter/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/bytecode/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/dynare_simul_/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/estimation/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/gensylv/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/k_order_perturbation/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/kalman_steady_state/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/kronecker/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/linsolve/*.oct $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/local_state_space_iterations/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/mjdgges/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/ms_sbvar/*.mex $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/ordschur/*.oct $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/qzcomplex/*.oct $INSTALLDIR/mex/octave
cp $TOP_DYN_DIR/mex/build/octave/sobol/*.mex $INSTALLDIR/mex/octave
# Matlab Mex
cp $TOP_DYN_DIR/mex/matlab/* $INSTALLDIR/mex/matlab/osx64
# clean everything
cd $TOP_DYN_DIR
make distclean
# remove .DS_Store files
cd $INSTALLDIR
@ -196,3 +129,5 @@ find . -name *.DS_Store -type f -exec rm {} \;
chmod -R g+w $INSTALLDIR
echo DONE
# NEED TO BUILD DYNARE.HTML DOCUMENTION ON DEBIAN
# AND INCLUDE IN DISTRIBUTION BY HAND