script to create snapshot for macOS

time-shift
Houtan Bastani 2019-09-16 18:28:34 +02:00
parent 5dffae1b63
commit 2113deb0db
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
11 changed files with 139 additions and 257 deletions

3
.gitignore vendored
View File

@ -144,6 +144,7 @@ windows/zip/
# MacOS stuff
.DS_Store
macOS/pkg/
# Emacs stuff
scripts/dynare.elc
@ -169,4 +170,4 @@ octave-workspace
# VERSION generated file
VERSION
matlab/supported_octave_version.m
matlab/supported_octave_version.m

View File

@ -28,7 +28,7 @@ EXTRA_DIST = \
CONTRIBUTING.md \
windows/dynare.nsi \
windows/README.txt \
osx \
macOS \
examples \
scripts \
.dir-locals.el

24
macOS/Makefile Normal file
View File

@ -0,0 +1,24 @@
# Copyright © 2019 Dynare Team
#
# This file is part of Dynare.
#
# Dynare is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Dynare is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Dynare. If not, see <http://www.gnu.org/licenses/>.
.PHONY: all clean
all:
./build.sh
clean:
rm -rf pkg

BIN
macOS/background.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

93
macOS/build.sh Executable file
View File

@ -0,0 +1,93 @@
#!/usr/bin/env bash
set -ex
##
## Clone Dynare
##
ROOTDIR=$(pwd)/..
if [[ -z $VERSION ]]; then
VERSION=$(grep '^AC_INIT(' ../configure.ac | sed 's/AC_INIT(\[dynare\], \[\(.*\)\])/\1/')
if [[ -d ../.git/ ]]; then
SHA=$(git rev-parse --short HEAD)
VERSION_READ="$VERSION-$SHA"
VERSION=$VERSION-$(date +%Y-%m-%d-%H%M)-"$SHA"
fi
fi
##
## Compile Dynare
##
cd "$ROOTDIR"
[[ -f configure ]] || autoreconf -si
CC=gcc-9 CXX=g++-9 ./configure --with-matlab=/Applications/MATLAB_R2016b.app MATLAB_VERSION=R2016b --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local --disable-octave PACKAGE_VERSION="$VERSION" PACKAGE_STRING="dynare $VERSION"
make -j
make -j pdf
make -j html
##
## Create package
##
NAME=dynare-"$VERSION"
PKGFILES="$ROOTDIR"/macOS/pkg/"$NAME"
mkdir -p "$PKGFILES"/mex/matlab/maci64-8.7-9.3
mkdir "$PKGFILES"/mex/matlab/maci64-9.4-9.7
mkdir -p "$PKGFILES"/doc/dynare++
mkdir "$PKGFILES"/dynare++
mkdir "$PKGFILES"/scripts
mkdir "$PKGFILES"/contrib
cp -p "$ROOTDIR"/NEWS "$PKGFILES"
cp -p "$ROOTDIR"/COPYING "$PKGFILES"
cp -p "$ROOTDIR"/VERSION "$PKGFILES"
cp -p "$ROOTDIR"/license.txt "$PKGFILES"
cp -pr "$ROOTDIR"/matlab "$PKGFILES"
cp -pr "$ROOTDIR"/examples "$PKGFILES"
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-8.7-9.3
cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts
cp -pr "$ROOTDIR"/contrib/ms-sbvar "$PKGFILES"/contrib
cp -pr "$ROOTDIR"/contrib/jsonlab "$PKGFILES"/contrib
cp "$ROOTDIR"/doc/*.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/doc/gsa/gsa.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/doc/parallel/parallel.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/doc/dseries-and-reporting/dseriesReporting.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/preprocessor/doc/preprocessor/preprocessor.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/preprocessor/doc/macroprocessor/macroprocessor.pdf "$PKGFILES"/doc
cp "$ROOTDIR"/doc/manual/build/latex/dynare-manual.pdf "$PKGFILES"/doc
cp -r "$ROOTDIR"/doc/manual/build/html "$PKGFILES"/doc/dynare-manual.html
cp "$ROOTDIR"/dynare++/doc/*.pdf "$PKGFILES"/doc/dynare++
cp "$ROOTDIR"/dynare++/src/dynare++ "$PKGFILES"/dynare++
##
## Create mex for Matlab le 2018a
##
cd "$ROOTDIR"/mex/build/matlab
make clean
CC=gcc-9 CXX=g++-9 ./configure --with-matlab=/Applications/MATLAB_R2019b.app MATLAB_VERSION=R2019b --with-matio=/usr/local --with-gsl=/usr/local --with-slicot=/usr/local PACKAGE_VERSION="$VERSION" PACKAGE_STRING="dynare $VERSION"
make -j
cd "$ROOTDIR"/macOS
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-9.4-9.7
##
## Make package
##
cd "$ROOTDIR"/macOS/pkg
pkgbuild --root "$PKGFILES" --identifier com.cepremap.dynare --version "$VERSION" --install-location /Applications/Dynare/"$VERSION" "$NAME".pkg
sed "s/VERSION_READ/$VERSION_READ/g" "$ROOTDIR"/macOS/distribution_template.xml > distribution_tmp.xml
sed "s/VERSION_NO_SPACE/$VERSION/g" distribution_tmp.xml > distribution.xml
ln -s "$ROOTDIR"/COPYING "$ROOTDIR"/macOS/
productbuild --distribution distribution.xml --resources "$ROOTDIR"/macOS --package-path ./"$NAME".pkg "$NAME"-new.pkg
rm -f *.xml
rm -rf "$PKGFILES"
rm "$ROOTDIR"/macOS/COPYING
mv "$NAME"-new.pkg "$NAME".pkg

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<pkg-ref id="com.cepremap.dynare"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="com.cepremap.dynare"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="com.cepremap.dynare" visible="false">
<pkg-ref id="com.cepremap.dynare"/>
</choice>
<pkg-ref id="com.cepremap.dynare" version="VERSION_NO_SPACE" onConclusion="none">dynare-VERSION_NO_SPACE.pkg</pkg-ref>
<title>Dynare VERSION_READ</title>
<background file="background.png" scaling="tofit" mime-type="image/png" alignment="topleft" />
<background-darkAqua file="background.png" scaling="tofit" mime-type="image/png" alignment="topleft" />
<license file="COPYING" mime-type="text/plain" />
</installer-gui-script>

View File

@ -1,136 +0,0 @@
Dynare
======
For information about how to use Dynare, you should have a look at the
documentation located in the 'doc' subdirectory of your Dynare installation (you
should have a shortcut in your Start Menu to access it directly).
Beginners should start with the Dynare user guide (under PDF format in
'UserGuide.pdf'). There is also a complete reference manual documenting all
Dynare functions (under HTML format in 'dynare.html/index.html', under PDF
format in 'dynare.pdf').
You can also get more information on the web, on Dynare homepage:
http://www.dynare.org
Or on Dynare Wiki:
http://www.dynare.org/DynareWiki
NOTE: To uninstall Dynare, simply drag the Dynare installation directory to the
Trash.
Using Dynare with MATLAB (R)
----------------------------
Dynare works on all versions of MATLAB (R) for Intel Macs.
To use Dynare, you just have to add the 'matlab' subdirectory of your Dynare
installation to MATLAB (R) path. You have two options for doing that:
* Use the addpath command, by typing the following (assuming that you have
installed Dynare at the standard location, and replacing '4.x.y' by correct
version number):
addpath /Applications/Dynare/4.x.y/matlab
MATLAB (R) will not remember this setting next time you run it, and you will
have to do it again.
* Select the "Set Path..." entry in the "File" menu, then click on "Add
Folder...", and select the 'matlab' subdirectory of your Dynare
installation. Note that you SHOULD NOT use "Add with Subfolders...". Apply
the settings by clicking on "Save". Note that MATLAB (R) will remember this
setting next time you run it.
You can test your installation by typing 'dynare' at the MATLAB (R)
prompt. This should give you an error message complaining that you did not
specify a MOD file.
Using Dynare with Octave
------------------------
Dynare also works on top of GNU Octave, a free clone of MATLAB (R) (see
<http://www.octave.org>).
This version of Dynare is compiled for Octave 3.6.2, and may not work
with other versions of Octave. You can download Octave through the Homebrew
package manager:
http://mxcl.github.com/homebrew
Every time you run Octave, you should type the two following commands (assuming
that you have installed Dynare at the standard location, and replacing '4.x.y'
by correct version number):
addpath /Applications/Dynare/4.x.y/matlab
NOTE: if you don't want to type this command every time you run Octave, you can
put it in a file called '.octaverc' in your home directory ('/Users/USERNAME').
This file is run by Octave at every startup.
You can test your installation by typing 'dynare' at the Octave prompt. This
should give you an error message complaining that you did not specify a MOD
file.
Dynamic Loadable Libraries
--------------------------
For better performance, some parts of Dynare are written in the C++ language,
which is faster than standard M-files. These parts are compiled and distributed
as shared libraries, located in the 'mex' subdirectory of your Dynare installation.
If the libraries are correctly detected by MATLAB (R) or Octave, the following should
be displayed when you launch Dynare:
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
On the contrary, if the libraries are not detected, Dynare will fallback on
slower alternatives written in M-files (which exist for some of the libraries),
and display the following:
Configuring Dynare ...
[m] Generalized QZ.
[m] Sylvester equation solution.
[m] Kronecker products.
[m] Sparse kronecker products.
[m] Local state space iteration (second order).
[no] Bytecode evaluation.
[no] k-order perturbation solver.
[no] k-order solution simulation.
[no] Quasi Monte-Carlo sequence (Sobol).
In this last case, Dynare will run correctly on the basic features,
but with suboptimal speed, and some features will be missing. There
could be several reasons for MATLAB (R) or Octave failing to detect
the libraries:
* Your path settings may be wrong. Make sure that the 'matlab' subdirectory of
your Dynare installation is the only Dynare directory present in the path
variable.
* Your MATLAB (R) or Octave version may be incompatible with the provided
binaries.
* You may have a custom M-file in your search path with the same name as one of
the Dynare libraries, thereby overriding it.
Credits
-------
MATLAB (R) is a registered trademark of The Mathworks, Inc.

View File

@ -1,107 +0,0 @@
#!/bin/bash
set -ex
VERSION=4.5.0
TOP_DIR=/Users/houtanb/Documents/DYNARE/package
TOP_DYN_DIR=$TOP_DIR/dynare-$VERSION
INSTALLDIRNAME=dynare-$VERSION-osx
INSTALLDIR=$TOP_DIR/$INSTALLDIRNAME
rm -rf $INSTALLDIR
mkdir $INSTALLDIR
########################
# UPDATE DYNARE SOURCE #
########################
cd $TOP_DYN_DIR
########################
# BEGIN MAKING PACKAGE #
########################
# create directories
mkdir "$INSTALLDIR/scripts"
mkdir "$INSTALLDIR/dynare++"
mkdir -p "$INSTALLDIR/doc/dynare++"
mkdir "$INSTALLDIR/doc/dynare.html"
mkdir -p "$INSTALLDIR/contrib/ms-sbvar/TZcode"
mkdir -p "$INSTALLDIR/mex/matlab/osx"
# top level
cp $TOP_DYN_DIR/scripts/dynare.el $INSTALLDIR/scripts
cp $TOP_DYN_DIR/NEWS $INSTALLDIR
cp $TOP_DYN_DIR/COPYING $INSTALLDIR
cp $TOP_DYN_DIR/license.txt $INSTALLDIR
# TZ Matlab
cp -r $TOP_DYN_DIR/contrib/ms-sbvar/TZcode/MatlabFiles $INSTALLDIR/contrib/ms-sbvar/TZcode
# examples
cp -r $TOP_DYN_DIR/examples $INSTALLDIR
#############
# CONFIGURE #
#############
./configure FFLAGS='-mmacosx-version-min=10.8' CPPFLAGS='-mmacosx-version-min=10.8' LDFLAGS='-mmacosx-version-min=10.8' \
--with-matlab=/Volumes/Storage/MATLAB/MATLAB_R2009b.app MATLAB_VERSION=7.9 MEXEXT=mexmaci64 --disable-octave \
--with-matio=/usr/local/static --with-gsl=/usr/local/static --with-slicot=/usr/local/static
make clean
###########
# COMPILE #
###########
cd $TOP_DYN_DIR/doc
texi2dvi --pdf --batch --build-dir=dynare.t2p dynare.texi
cd $TOP_DYN_DIR
make
make pdf
###########################
# COMPOSE BULK OF PACKAGE #
###########################
# Matlab
# Must come after configure because matlab/dynare_version.m is created by configure script
cp -r $TOP_DYN_DIR/matlab $INSTALLDIR
# compiled preprocessor
cp $TOP_DYN_DIR/preprocessor/dynare_m $INSTALLDIR/matlab
# dynare++
cp $TOP_DYN_DIR/dynare++/src/dynare++ $INSTALLDIR/dynare++
cp $TOP_DYN_DIR/dynare++/extern/matlab/dynare_simul.m $INSTALLDIR/dynare++
# doc
cp $TOP_DYN_DIR/doc/bvar-a-la-sims.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/dr.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/dynare.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/guide.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/macroprocessor/macroprocessor.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/parallel/parallel.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/preprocessor/preprocessor.pdf $INSTALLDIR/doc
cp $TOP_DYN_DIR/doc/gsa/gsa.pdf $INSTALLDIR/doc
# doc (dynare++)
cp $TOP_DYN_DIR/dynare++/doc/dynare++-tutorial.pdf $INSTALLDIR/doc/dynare++
cp $TOP_DYN_DIR/dynare++/doc/dynare++-ramsey.pdf $INSTALLDIR/doc/dynare++
cp $TOP_DYN_DIR/dynare++/sylv/sylvester.pdf $INSTALLDIR/doc/dynare++
cp $TOP_DYN_DIR/dynare++/tl/cc/tl.pdf $INSTALLDIR/doc/dynare++
cp $TOP_DYN_DIR/dynare++/integ/cc/integ.pdf $INSTALLDIR/doc/dynare++
cp $TOP_DYN_DIR/dynare++/kord/kord.pdf $INSTALLDIR/doc/dynare++
# Matlab Mex
cp $TOP_DYN_DIR/mex/matlab/* $INSTALLDIR/mex/matlab/osx
# clean everything
cd $TOP_DYN_DIR
# remove .DS_Store files
cd $INSTALLDIR
find . -name *.DS_Store -type f -exec rm {} \;
# Change permissions
chmod -R g+w $INSTALLDIR
echo DONE
# NEED TO BUILD DYNARE.HTML DOCUMENTION ON DEBIAN
# AND INCLUDE IN DISTRIBUTION BY HAND

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
<pkgref spec="1.12" uuid="66C2C542-B090-43DB-8FA9-872786A8CE4B"><config><identifier>com.dynare.4.2.2.pkg</identifier><version>4.2.2</version><description/><post-install type="none"/><requireAuthorization/><installFrom>/Users/Houtan/Documents/DYNARE/packages/tmp/dynare-4.2.2</installFrom><installTo mod="true" relocatable="true">/Applications/Dynare/4.2.2</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"/><mod>installTo</mod><mod>relocatable</mod><mod>requireAuthorization</mod><mod>identifier</mod><mod>version</mod><mod>parent</mod><mod>installTo.path</mod></config><contents><file-list>01dynare-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

View File

@ -1,10 +0,0 @@
<pkmkdoc spec="1.12"><properties><title>Dynare 4.2.2</title><build>/Users/Houtan/Documents/DYNARE/packages/tmp/dynare-4.2.2.pkg</build><organization>com.dynare</organization><userSees ui="both"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>Dynare 4.2.2</description><contents><choice title="dynare-4.2.2" id="choice0" tooltip="Dynare 4.2.2" description="Dynare 4.2.2" starts_selected="true" starts_enabled="true" starts_hidden="false"><customLoc mod="true" allowAltVol="true">/Applications/Dynare/4.2.2</customLoc><pkgref id="com.dynare.4.2.2.pkg"/></choice></contents><resources bg-scale="proportional" bg-align="bottomleft"><locale lang="en"><resource mod="true" type="background">/Users/Houtan/Downloads/dynareblue.png</resource><resource mime-type="text/rtf" kind="embedded" type="license"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf100
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
\f0\fs26 \cf0 Dynare is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\
\
Dynare is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\
\
You should have received a copy of the GNU General Public License along with Dynare. If not, see <http://www.gnu.org/licenses/>.}]]></resource></locale></resources><flags/><item type="file">01dynare.xml</item><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>description</mod></pkmkdoc>