Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 4.3
  • 4.4
  • 4.5
  • 4.6
  • 5.x
  • 6.x
  • asm
  • aux_func
  • benchmark-ec
  • clang+openmp
  • covariance-quadratic-approximation
  • dates-and-dseries-improvements
  • declare_vars_in_model_block
  • dmm
  • dprior
  • dragonfly
  • dynamic-striated
  • dynare_minreal
  • eigen
  • ep-sparse
  • error_msg_undeclared_model_vars
  • estim_params
  • exceptions
  • exo_steady_state
  • filter_initial_state
  • gpm-optimal-policy
  • julia
  • kalman_mex
  • master
  • mex-GetPowerDeriv
  • mr#2134
  • new-samplers
  • newton-quadratic-equation-solver
  • nlf-fixes
  • nlf-fixes-r
  • nls-fixes
  • nonlinear-filter-fixes
  • occbin
  • pac-mce-with-composite-target
  • parfor
  • penalty
  • rebase-1
  • remove-persistent-variables
  • remove-priordens
  • reset-seed-in-unit-tests
  • rmExtraExo
  • sep
  • sep-fixes
  • separateM_
  • silicon
  • silicon-new-samplers
  • slice
  • sphinx-doc-experimental
  • static_aux_vars
  • time-varying-information-set
  • use-dprior
  • various_fixes
  • 3.062
  • 3.063
  • 4.0.0
  • 4.0.1
  • 4.0.2
  • 4.0.3
  • 4.0.4
  • 4.1-alpha1
  • 4.1-alpha2
  • 4.1.0
  • 4.1.1
  • 4.1.2
  • 4.1.3
  • 4.2.0
  • 4.2.1
  • 4.2.2
  • 4.2.3
  • 4.2.4
  • 4.2.5
  • 4.3.0
  • 4.3.1
  • 4.3.2
  • 4.3.3
  • 4.4-beta1
  • 4.4.0
  • 4.4.1
  • 4.4.2
  • 4.4.3
  • 4.5.0
  • 4.5.1
  • 4.5.2
  • 4.5.3
  • 4.5.4
  • 4.5.5
  • 4.5.6
  • 4.5.7
  • 4.6-beta1
  • 4.6.0
  • 4.6.0-rc1
  • 4.6.0-rc2
  • 4.6.1
  • 4.6.2
  • 4.6.3
  • 4.6.4
  • 4.7-beta1
  • 4.7-beta2
  • 4.7-beta3
  • 5.0
  • 5.0-rc1
  • 5.1
  • 5.2
  • 5.3
  • 5.4
  • 5.5
111 results

Target

Select target project
  • giovanma/dynare
  • giorgiomas/dynare
  • Vermandel/dynare
  • Dynare/dynare
  • normann/dynare
  • MichelJuillard/dynare
  • wmutschl/dynare
  • FerhatMihoubi/dynare
  • sebastien/dynare
  • lnsongxf/dynare
  • rattoma/dynare
  • CIMERS/dynare
  • FredericKarame/dynare
  • SumuduK/dynare
  • MinjeJeon/dynare
  • camilomrch/dynare
  • DoraK/dynare
  • avtishin/dynare
  • selma/dynare
  • claudio_olguin/dynare
  • jeffjiang07/dynare
  • EthanSystem/dynare
  • stepan-a/dynare
  • wjgatt/dynare
  • JohannesPfeifer/dynare
  • gboehl/dynare
  • ebenetce/dynare
  • chskcau/dynare-doc-fixes
28 results
Select Git revision
Loading items
Show changes
Showing
with 296 additions and 852 deletions
......@@ -95,6 +95,9 @@ var C $C$ (long_name='Consumption')
r_real ${r^{ann,real}}$ (long_name='Annualized net real interest rate')
y_nat ${y^{nat}}$ (long_name='Natural (flex price) output')
y_gap ${r^{gap}}$ (long_name='Output gap')
@#if Optimal_policy==0
Welfare ${W}$ (long_name='Welfare')
@#endif
;
varexo epsilon ${\varepsilon}$ (long_name='TFP shock')
......@@ -154,6 +157,10 @@ model;
y_nat=exp(Z)*sqrt((theta-1)/theta*(1+tau)/chi);
[name='output gap']
y_gap=log_C-log(y_nat);
@#if Optimal_policy==0
[name='Definition Welfare']
Welfare=log(C)-chi/2*h^2+beta*Welfare(+1);
@#endif
end;
steady_state_model;
......@@ -171,6 +178,10 @@ steady_state_model;
r_real=4*log((1+R)/pi);
y_nat=sqrt((theta-1)/theta*(1+tau)/chi);
y_gap=log_C-log(y_nat);
@#if Optimal_policy==0
Welfare=1/(1-beta)*(log(C)-chi/2*h^2);
@#endif
end;
@# if defined(Ramsey) && Ramsey==1
......@@ -186,7 +197,7 @@ end;
@#if Optimal_policy==0
//use Taylor rule
stoch_simul(order=2) pi_ann log_h R_ann log_C Z r_real y_nat;
stoch_simul(order=2) pi_ann log_h R_ann log_C Z r_real y_nat Welfare;
@#else
@# if !defined(Ramsey) || Ramsey==0
//use OSR Taylor rule
......
......@@ -8,7 +8,7 @@
* - This mod-files allows to simulate a simple New Keynesian Model with Rotemberg price
* adjustment costs under fully optimal monetary under commitment (Ramsey)
*
* - This files shows how to use a userd-defined conditional steady state file in the Ramsey case. It takes
* - This files shows how to use a user-defined conditional steady state file in the Ramsey case. It takes
* the value of the defined instrument R as given and then computes the rest of the steady
* state, including the steady state inflation rate, based on this value. The initial value
* of the instrument for steady state search must then be defined in an initval-block.
......@@ -22,7 +22,7 @@
*/
/*
* Copyright (C) 2019 Dynare Team
* Copyright © 2019-2022 Dynare Team
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dynare
Upstream-Contact: Dynare Team, whose members in 2021 are:
Upstream-Contact: Dynare Team, whose members in 2023 are:
- Stéphane Adjemian <stephane.adjemian@univ-lemans.fr>
- Houtan Bastani <houtan@dynare.org>
- Michel Juillard <michel.juillard@mjui.fr>
......@@ -10,6 +10,7 @@ Upstream-Contact: Dynare Team, whose members in 2021 are:
- Willi Mutschler <willi@mutschler.eu>
- Johannes Pfeifer <jpfeifer@gmx.de>
- Marco Ratto <marco.ratto@ec.europa.eu>
- Normann Rion <normann@dynare.org>
- Sébastien Villemot <sebastien@dynare.org>
Former Dynare Team members include:
- Abdeljabar Benzougar
......@@ -22,14 +23,14 @@ Upstream-Contact: Dynare Team, whose members in 2021 are:
Source: https://www.dynare.org
Files: *
Copyright: 1996-2021 Dynare Team
Copyright: 1996-2023 Dynare Team
License: GPL-3+
Files: matlab/+occbin/IVF_core.m
matlab/+occbin/match_function.m
Copyright: none
License: public-domain-inversion-filter
Original authors: Pablo Cuba-Borda, Luca Guerrieri, and Matteo Iacoviello
Original authors: Pablo Cuba-Borda, Luca Guerrieri, Matteo Iacoviello, and Molin Zhong
Original file downloaded from:
http://www.lguerrieri.com/jae-replication.zip
Adapted for Dynare by Dynare Team.
......@@ -38,7 +39,7 @@ License: public-domain-inversion-filter
However the authors would appreciate acknowledgement of the source by
citation of any of the following papers:
.
Pablo Cuba-Borda, Luca Guerrieri, and Matteo Iacoviello (2019): "Likelihood evaluation of models
Pablo Cuba-Borda, Luca Guerrieri, Matteo Iacoviello, and Molin Zhong (2019): "Likelihood evaluation of models
with occasionally binding constraints", Journal of Applied Econometrics, 34(7), 1073-1085
Files: matlab/+occbin/make_chart.m
......@@ -134,12 +135,12 @@ License: GPL-3+
Files: matlab/commutation.m matlab/duplication.m
Copyright: 1997 Tom Minka <minka@microsoft.com>
2019 Dynare Team
2019-2020 Dynare Team
License: GPL-3+
Files: matlab/allVL1.m
Copyright: 2007-2010 Bruno Luong <brunoluong@yahoo.com>
2019 Dynare Team
2020 Dynare Team
License: GPL-3+
Comment: The original author gave authorization to change
the license from BSD-2-clause to GPL-3+ and redistribute
......@@ -147,7 +148,7 @@ Comment: The original author gave authorization to change
Files: matlab/uperm.m
Copyright: 2014 Bruno Luong <brunoluong@yahoo.com>
2019 Dynare Team
2020 Dynare Team
License: GPL-3+
Comment: The original author gave authorization to change
the license from BSD-2-clause to GPL-3+ and redistribute
......@@ -270,16 +271,21 @@ Copyright: 2005-2010 Pascal Getreuer
License: BSD-2-clause
Files: doc/*.rst doc/*.tex doc/*.svg doc/*.pdf doc/*.bib
Copyright: 1996-2020 Dynare Team
Copyright: 1996-2022 Dynare Team
License: GFDL-NIV-1.3+
Files: doc/dr.tex doc/dr.bib doc/bvar-a-la-sims.tex
Files: doc/dr.tex doc/dr.bib
Copyright: 2007-2011 Sébastien Villemot
License: GFDL-NIV-1.3+
Files: doc/bvar-a-la-sims.tex
Copyright: 2007-2017 Sébastien Villemot
2016-2017 Johannes Pfeifer
License: GFDL-NIV-1.3+
Files: dynare++/*
Copyright: 2004-2011 Ondra Kamenik
2019 Dynare Team
2019-2022 Dynare Team
License: GPL-3+
Files: m4/ax_blas.m4 m4/ax_lapack.m4
......@@ -316,13 +322,13 @@ License: GPL-2+ with Autoconf exception
Files: scripts/dynare.el
Copyright: 2010 Yannick Kalantzis
2019 Dynare Team
2019-2023 Dynare Team
License: GPL-3+
Files: mex/sources/dynare_simul_/dynare_simul_.cc
mex/sources/gensylv/gensylv.cc
Copyright: 2005-2011 Ondra Kamenik
2019 Dynare Team
2019-2020 Dynare Team
License: GPL-3+
Files: mex/sources/sobol/sobol.hh mex/sources/sobol/initialize_v_array.hh
......@@ -331,11 +337,6 @@ Copyright: 2009 John Burkardt
2010-2017 Dynare Team
License: LGPL-3+
Files: macOS/brewfiles/*
Copyright: 2009-2019 Homebrew contributors
2019 Dynare Team
License: BSD-2-clause
Files: preprocessor/m4/ax_boost_base.m4
Copyright: 2008-2009 Thomas Porschberg <thomas@randspringer.de>
2009 Peter Adolphs
......@@ -361,7 +362,7 @@ Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch>
License: LGPL-2.1+
Files: preprocessor/doc/macroprocessor/*
Copyright: 2008-2019 Dynare Team
Copyright: 2008-2021 Dynare Team
License: CC-BY-SA-4.0
Files: preprocessor/doc/preprocessor/*
......@@ -455,33 +456,6 @@ Files: contrib/ms-sbvar/TZcode/MatlabFiles/qplot2.m
Copyright: 1997-2012 Clark A. Burdick
License: GPL-3+
Files: contrib/dmm/*
Copyright: 2010-2014 European Commission
2006-2012 Dynare Team
License: GPL-3+
Files: contrib/dmm/randlib/*
Copyright: none
License: public-domain-dmm
We place the Randlib code that we have written in the public domain.
.
NO WARRANTY
.
WE PROVIDE ABSOLUTELY NO WARRANTY OF ANY KIND EITHER EXPRESSED OR
IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
THIS PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
SERVICING, REPAIR OR CORRECTION.
.
IN NO EVENT SHALL THE UNIVERSITY OF TEXAS OR ANY OF ITS COMPONENT
INSTITUTIONS INCLUDING M. D. ANDERSON HOSPITAL BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA OR
ITS ANALYSIS BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD
PARTIES) THE PROGRAM.
License: BSD-2-clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
......
dnl matlabarch.m4 --- check for MATLAB machine architecture.
dnl
dnl Copyright © 2002, 2003 Ralph Schleicher
dnl Copyright © 2009 Dynare Team
dnl Copyright © 2009-2023 Dynare Team
dnl
dnl This program is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU General Public License as
......@@ -57,6 +57,9 @@ else
*mexmaci64)
ax_cv_matlab_arch=maci64
;;
*mexmaca64)
ax_cv_matlab_arch=maca64
;;
*)
ax_cv_matlab_arch=unknown
;;
......
dnl Copyright © 2009-2021 Dynare Team
dnl Copyright © 2009-2023 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
......@@ -44,6 +44,21 @@ fi
if test -n "$MATLAB_VERSION"; then
dnl Convert a release number (Rnnnnx) into a version number (x.y)
case $MATLAB_VERSION in
*2023b | *2023B)
MATLAB_VERSION="23.2"
;;
*2023a | *2023A)
MATLAB_VERSION="9.14"
;;
*2022b | *2022B)
MATLAB_VERSION="9.13"
;;
*2022a | *2022A)
MATLAB_VERSION="9.12"
;;
*2021b | *2021B)
MATLAB_VERSION="9.11"
;;
*2021a | *2021A)
MATLAB_VERSION="9.10"
;;
......
dnl Copyright © 2009-2021 Dynare Team
dnl Copyright © 2009-2023 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
......@@ -56,7 +56,7 @@ case ${MATLAB_ARCH} in
OPENMP_LDFLAGS="-Wl,-Bstatic,--whole-archive -lgomp -Wl,-Bdynamic,--no-whole-archive"
ax_mexopts_ok="yes"
;;
maci64)
mac[[ai]]64)
MATLAB_DEFS="-DNDEBUG"
MATLAB_CFLAGS="-fno-common -fexceptions"
MATLAB_CXXFLAGS="-fno-common -fexceptions"
......@@ -66,7 +66,7 @@ case ${MATLAB_ARCH} in
# This -L flag is put here, hence later on the linker command line, so as
# to avoid linking against the HDF5 shipped by MATLAB (which would
# otherwise override the HDF5 from Homebrew)
MATLAB_LIBS="-L$MATLAB/bin/maci64 -lmx -lmex -lmat -lmwlapack -lmwblas"
MATLAB_LIBS="-L$MATLAB/bin/${MATLAB_ARCH} -lmx -lmex -lmat -lmwlapack -lmwblas"
ax_mexopts_ok="yes"
;;
*)
......
......@@ -37,7 +37,7 @@ AC_DEFUN([AX_SLICOT],
else
LDFLAGS_SLICOT=""
fi
ac_save_LDFLAGS=$LDFLAGS
my_save_LDFLAGS=$LDFLAGS
# At this point we should add MATLAB_FCFLAGS to FCFLAGS for Windows (which has -fno-underscoring),
# but that does not work. The actual underscore test seems to happen at the very beginning of the
......@@ -47,9 +47,13 @@ AC_DEFUN([AX_SLICOT],
if test "$1" = matlab; then
LDFLAGS="$LDFLAGS $MATLAB_LDFLAGS_NOMAP $LDFLAGS_SLICOT"
# Add MATLAB_CFLAGS to get the -fPIC on Linux/x86_64 (otherwise linking fails)
my_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MATLAB_CFLAGS"
AC_CHECK_LIB([slicot64_pic], [$sb02od], [LIBADD_SLICOT="-lslicot64_pic"], [has_slicot=no], [$MATLAB_LIBS])
CFLAGS=$my_save_CFLAGS
else
LDFLAGS="$LDFLAGS $($MKOCTFILE -p LFLAGS) $LDFLAGS_SLICOT"
LDFLAGS="$LDFLAGS $LDFLAGS_SLICOT"
# Fallback on libslicot_pic if dynamic libslicot not found
AC_CHECK_LIB([slicot], [$sb02od], [LIBADD_SLICOT="-lslicot"],
[
......@@ -58,7 +62,7 @@ AC_DEFUN([AX_SLICOT],
[$($MKOCTFILE -p BLAS_LIBS) $($MKOCTFILE -p LAPACK_LIBS)])
fi
LDFLAGS=$ac_save_LDFLAGS
LDFLAGS=$my_save_LDFLAGS
AC_SUBST(LDFLAGS_SLICOT)
AC_SUBST(LIBADD_SLICOT)
])
# Copyright © 2019 Dynare Team
# Copyright © 2019-2023 Dynare Team
#
# This file is part of Dynare.
#
......@@ -15,22 +15,28 @@
# You should have received a copy of the GNU General Public License
# along with Dynare. If not, see <https://www.gnu.org/licenses/>.
.PHONY: all deps clean-deps clean clean-all build
ARCHS = arm64 x86_64
BUILDS = $(addprefix build-, $(ARCHS))
DEPS = $(addprefix deps-, $(ARCHS))
CLEAN_DEPS = $(addprefix clean-deps-, $(ARCHS))
CLEAN_ALL = $(addprefix clean-all-, $(ARCHS))
NTHREADS=$(shell nproc)
.PHONY: all $(BUILDS) $(DEPS) clean-pkg $(CLEAN_DEPS) $(CLEAN_ALL) clean-all
all: build
all: $(BUILDS)
deps:
make -C deps -j$(NTHREADS)
$(BUILDS): build-%: deps-%
./build.sh $*
clean-deps:
make -C deps clean-all
$(DEPS): deps-%:
make -C deps DEPS_ARCH=$*
clean:
$(CLEAN_DEPS): clean-deps-%:
make -C deps clean-all DEPS_ARCH=$*
clean-pkg:
rm -rf pkg
clean-all: clean-deps clean
$(CLEAN_ALL): clean-all-%: clean-deps-% clean-pkg
build: deps
./build.sh
clean-all: $(CLEAN_ALL)
class Gcc < Formula
desc "GNU compiler collection"
homepage "https://gcc.gnu.org/"
if Hardware::CPU.arm?
# Branch from the Darwin maintainer of GCC with Apple Silicon support,
# located at https://github.com/iains/gcc-darwin-arm64 and
# backported with his help to gcc-11 branch. Too big for a patch.
url "https://github.com/fxcoudert/gcc/archive/refs/tags/gcc-11.1.0-arm-20210504.tar.gz"
sha256 "ce862b4a4bdc8f36c9240736d23cd625a48af82c2332d2915df0e16e1609a74c"
version "11.1.0"
else
url "https://ftp.gnu.org/gnu/gcc/gcc-11.1.0/gcc-11.1.0.tar.xz"
mirror "https://ftpmirror.gnu.org/gcc/gcc-11.1.0/gcc-11.1.0.tar.xz"
sha256 "4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf"
end
license "GPL-3.0-or-later" => { with: "GCC-exception-3.1" }
revision 1
head "https://gcc.gnu.org/git/gcc.git"
livecheck do
# Should be
# url :stable
# but that does not work with the ARM-specific branch above
url "https://ftp.gnu.org/gnu/gcc/gcc-11.1.0"
regex(%r{href=.*?gcc[._-]v?(\d+(?:\.\d+)+)(?:/?["' >]|\.t)}i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "5ad4c157cf19f01c6acfed380db28ff15276f02f4b5d6a20f5a7034583b174aa"
sha256 cellar: :any, big_sur: "4ec68e83ce46f4c686a4c9a7f90a748705543826da81e4c74c78d210b6c66c81"
sha256 cellar: :any, catalina: "c8405807d9bdab853432100e8d85bf3b4c7d4a4123067f099699a492d40a430b"
sha256 cellar: :any, mojave: "cac0a37271b71e40b3df7b9fa83190c11dfcd9640d8b3d02bc2ba2bae5b964ac"
end
# The bottles are built on systems with the CLT installed, and do not work
# out of the box on Xcode-only systems due to an incorrect sysroot.
pour_bottle? only_if: :clt_installed
depends_on "gmp"
depends_on "isl"
depends_on "libmpc"
depends_on "mpfr"
depends_on "zstd"
uses_from_macos "zlib"
on_linux do
depends_on "binutils"
end
# GCC bootstraps itself, so it is OK to have an incompatible C++ stdlib
cxxstdlib_check :skip
def version_suffix
if build.head?
"HEAD"
else
version.major.to_s
end
end
def install
# GCC will suffer build errors if forced to use a particular linker.
ENV.delete "LD"
# We avoiding building:
# - Ada, which requires a pre-existing GCC Ada compiler to bootstrap
# - Go, currently not supported on macOS
# - BRIG
languages = %w[c c++ objc obj-c++ fortran]
languages << "d" if Hardware::CPU.intel?
pkgversion = "Homebrew GCC #{pkg_version} #{build.used_options*" "}".strip
cpu = Hardware::CPU.arm? ? "aarch64" : "x86_64"
args = %W[
--prefix=#{prefix}
--libdir=#{lib}/gcc/#{version_suffix}
--disable-nls
--enable-checking=release
--enable-languages=#{languages.join(",")}
--program-suffix=-#{version_suffix}
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-mpfr=#{Formula["mpfr"].opt_prefix}
--with-mpc=#{Formula["libmpc"].opt_prefix}
--with-isl=#{Formula["isl"].opt_prefix}
--with-zstd=#{Formula["zstd"].opt_prefix}
--with-pkgversion=#{pkgversion}
--with-bugurl=#{tap.issues_url}
]
# libphobos is part of gdc
args << "--enable-libphobos" if Hardware::CPU.intel?
on_macos do
args << "--build=#{cpu}-apple-darwin#{OS.kernel_version.major}"
args << "--with-system-zlib"
# Xcode 10 dropped 32-bit support
args << "--disable-multilib" if DevelopmentTools.clang_build_version >= 1000
# Workaround for Xcode 12.5 bug on Intel
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100340
args << "--without-build-config" if Hardware::CPU.intel? && DevelopmentTools.clang_build_version >= 1205
# System headers may not be in /usr/include
sdk = MacOS.sdk_path_if_needed
if sdk
args << "--with-native-system-header-dir=/usr/include"
args << "--with-sysroot=#{sdk}"
end
# Ensure correct install names when linking against libgcc_s;
# see discussion in https://github.com/Homebrew/legacy-homebrew/pull/34303
inreplace "libgcc/config/t-slibgcc-darwin", "@shlib_slibdir@", "#{HOMEBREW_PREFIX}/lib/gcc/#{version_suffix}"
end
on_linux do
# Fix cc1: error while loading shared libraries: libisl.so.15
args << "--with-boot-ldflags=-static-libstdc++ -static-libgcc #{ENV["LDFLAGS"]}"
# Fix Linux error: gnu/stubs-32.h: No such file or directory.
args << "--disable-multilib"
# Change the default directory name for 64-bit libraries to `lib`
# https://stackoverflow.com/a/54038769
inreplace "gcc/config/i386/t-linux64", "m64=../lib64", "m64="
end
mkdir "build" do
system "../configure", *args
on_macos do
# Use -headerpad_max_install_names in the build,
# otherwise updated load commands won't fit in the Mach-O header.
# This is needed because `gcc` avoids the superenv shim.
system "make", "BOOT_LDFLAGS=-Wl,-headerpad_max_install_names"
system "make", "install"
end
on_linux do
system "make"
system "make", "install-strip"
end
bin.install_symlink bin/"gfortran-#{version_suffix}" => "gfortran"
bin.install_symlink bin/"gdc-#{version_suffix}" => "gdc" if Hardware::CPU.intel?
on_linux do
# Only the newest brewed gcc should install gfortan libs as we can only have one.
lib.install_symlink Dir[lib/"gcc/#{version_suffix}/libgfortran.*"]
end
end
# Handle conflicts between GCC formulae and avoid interfering
# with system compilers.
# Rename man7.
Dir.glob(man7/"*.7") { |file| add_suffix file, version_suffix }
# Even when we disable building info pages some are still installed.
info.rmtree
end
def add_suffix(file, suffix)
dir = File.dirname(file)
ext = File.extname(file)
base = File.basename(file, ext)
File.rename file, "#{dir}/#{base}-#{suffix}#{ext}"
end
def post_install
on_linux do
gcc = bin/"gcc-#{version_suffix}"
libgcc = Pathname.new(Utils.safe_popen_read(gcc, "-print-libgcc-file-name")).parent
raise "command failed: #{gcc} -print-libgcc-file-name" if $CHILD_STATUS.exitstatus.nonzero?
glibc = Formula["glibc"]
glibc_installed = glibc.any_version_installed?
# Symlink system crt1.o and friends where gcc can find it.
crtdir = if glibc_installed
glibc.opt_lib
else
Pathname.new(Utils.safe_popen_read("/usr/bin/cc", "-print-file-name=crti.o")).parent
end
ln_sf Dir[crtdir/"*crt?.o"], libgcc
# Create the GCC specs file
# See https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
# Locate the specs file
specs = libgcc/"specs"
ohai "Creating the GCC specs file: #{specs}"
specs_orig = Pathname.new("#{specs}.orig")
rm_f [specs_orig, specs]
system_header_dirs = ["#{HOMEBREW_PREFIX}/include"]
if glibc_installed
# https://github.com/Linuxbrew/brew/issues/724
system_header_dirs << glibc.opt_include
else
# Locate the native system header dirs if user uses system glibc
target = Utils.safe_popen_read(gcc, "-print-multiarch").chomp
raise "command failed: #{gcc} -print-multiarch" if $CHILD_STATUS.exitstatus.nonzero?
system_header_dirs += ["/usr/include/#{target}", "/usr/include"]
end
# Save a backup of the default specs file
specs_string = Utils.safe_popen_read(gcc, "-dumpspecs")
raise "command failed: #{gcc} -dumpspecs" if $CHILD_STATUS.exitstatus.nonzero?
specs_orig.write specs_string
# Set the library search path
# For include path:
# * `-isysroot #{HOMEBREW_PREFIX}/nonexistent` prevents gcc searching built-in
# system header files.
# * `-idirafter <dir>` instructs gcc to search system header
# files after gcc internal header files.
# For libraries:
# * `-nostdlib -L#{libgcc}` instructs gcc to use brewed glibc
# if applied.
# * `-L#{libdir}` instructs gcc to find the corresponding gcc
# libraries. It is essential if there are multiple brewed gcc
# with different versions installed.
# Noted that it should only be passed for the `gcc@*` formulae.
# * `-L#{HOMEBREW_PREFIX}/lib` instructs gcc to find the rest
# brew libraries.
libdir = HOMEBREW_PREFIX/"lib/gcc/#{version_suffix}"
specs.write specs_string + <<~EOS
*cpp_unique_options:
+ -isysroot #{HOMEBREW_PREFIX}/nonexistent #{system_header_dirs.map { |p| "-idirafter #{p}" }.join(" ")}
*link_libgcc:
#{glibc_installed ? "-nostdlib -L#{libgcc}" : "+"} -L#{libdir} -L#{HOMEBREW_PREFIX}/lib
*link:
+ --dynamic-linker #{HOMEBREW_PREFIX}/lib/ld.so -rpath #{libdir} -rpath #{HOMEBREW_PREFIX}/lib
EOS
end
end
test do
(testpath/"hello-c.c").write <<~EOS
#include <stdio.h>
int main()
{
puts("Hello, world!");
return 0;
}
EOS
system "#{bin}/gcc-#{version_suffix}", "-o", "hello-c", "hello-c.c"
assert_equal "Hello, world!\n", `./hello-c`
(testpath/"hello-cc.cc").write <<~EOS
#include <iostream>
struct exception { };
int main()
{
std::cout << "Hello, world!" << std::endl;
try { throw exception{}; }
catch (exception) { }
catch (...) { }
return 0;
}
EOS
system "#{bin}/g++-#{version_suffix}", "-o", "hello-cc", "hello-cc.cc"
assert_equal "Hello, world!\n", `./hello-cc`
(testpath/"test.f90").write <<~EOS
integer,parameter::m=10000
real::a(m), b(m)
real::fact=0.5
do concurrent (i=1:m)
a(i) = a(i) + fact*b(i)
end do
write(*,"(A)") "Done"
end
EOS
system "#{bin}/gfortran", "-o", "test", "test.f90"
assert_equal "Done\n", `./test`
if Hardware::CPU.intel?
(testpath/"hello_d.d").write <<~EOS
import std.stdio;
int main()
{
writeln("Hello, world!");
return 0;
}
EOS
system "#{bin}/gdc-#{version_suffix}", "-o", "hello-d", "hello_d.d"
assert_equal "Hello, world!\n", `./hello-d`
end
end
end
class Gmp < Formula
desc "GNU multiple precision arithmetic library"
homepage "https://gmplib.org/"
url "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz"
mirror "https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz"
sha256 "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2"
license any_of: ["LGPL-3.0-or-later", "GPL-2.0-or-later"]
livecheck do
url "https://gmplib.org/download/gmp/"
regex(/href=.*?gmp[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "ff4ad8d068ba4c14d146abb454991b6c4f246796ec2538593dc5f04ca7593eec"
sha256 cellar: :any, big_sur: "6a44705536f25c4b9f8547d44d129ae3b3657755039966ad2b86b821e187c32c"
sha256 cellar: :any, catalina: "35e9f82d80708ae8dea2d6b0646dcd86d692321b96effaa76b7fad4d6cffa5be"
sha256 cellar: :any, mojave: "00fb998dc2abbd09ee9f2ad733ae1adc185924fb01be8814e69a57ef750b1a32"
sha256 cellar: :any, high_sierra: "54191ce7fa888df64b9c52870531ac0ce2e8cbd40a7c4cdec74cb2c4a421af97"
end
uses_from_macos "m4" => :build
def install
args = std_configure_args
args << "--enable-cxx"
# Enable --with-pic to avoid linking issues with the static library
args << "--with-pic"
on_macos do
cpu = Hardware::CPU.arm? ? "aarch64" : Hardware.oldest_cpu
args << "--build=#{cpu}-apple-darwin#{OS.kernel_version.major}"
end
on_linux do
args << "--build=core2-linux-gnu"
args << "ABI=32" if Hardware::CPU.is_32_bit?
end
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <gmp.h>
#include <stdlib.h>
int main() {
mpz_t i, j, k;
mpz_init_set_str (i, "1a", 16);
mpz_init (j);
mpz_init (k);
mpz_sqrtrem (j, k, i);
if (mpz_get_si (j) != 5 || mpz_get_si (k) != 1) abort();
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lgmp", "-o", "test"
system "./test"
# Test the static library to catch potential linking issues
system ENV.cc, "test.c", "#{lib}/libgmp.a", "-o", "test"
system "./test"
end
end
class Isl < Formula
desc "Integer Set Library for the polyhedral model"
homepage "http://isl.gforge.inria.fr"
# NOTE: Always use tarball instead of git tag for stable version.
#
# Currently isl detects its version using source code directory name
# and update isl_version() function accordingly. All other names will
# result in isl_version() function returning "UNKNOWN" and hence break
# package detection.
url "http://isl.gforge.inria.fr/isl-0.24.tar.xz"
sha256 "043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad"
license "MIT"
livecheck do
url :homepage
regex(/href=.*?isl[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "cf7f8b77fc0e51bc9c9921306737176e6f9e03062255a525d9ab59cf91ed3d36"
sha256 cellar: :any, big_sur: "d8c7026042e122143e0729bf3a596be77753b8cfeddcae200cd3a3c18176800c"
sha256 cellar: :any, catalina: "f33ee49a23fbde05392be23110d14add72aaed390ffd3aefc400645eeb1772d4"
sha256 cellar: :any, mojave: "34b71567d6bfb7e4cb4aced1d089fe6d72988af02775730be26b5bcea483d065"
end
head do
url "https://repo.or.cz/isl.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "gmp"
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--with-gmp=system",
"--with-gmp-prefix=#{Formula["gmp"].opt_prefix}"
system "make"
system "make", "install"
(share/"gdb/auto-load").install Dir["#{lib}/*-gdb.py"]
end
test do
(testpath/"test.c").write <<~EOS
#include <isl/ctx.h>
int main()
{
isl_ctx* ctx = isl_ctx_alloc();
isl_ctx_free(ctx);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-lisl", "-o", "test"
system "./test"
end
end
class Libmpc < Formula
desc "C library for the arithmetic of high precision complex numbers"
homepage "http://www.multiprecision.org/mpc/"
url "https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz"
mirror "https://ftpmirror.gnu.org/mpc/mpc-1.2.1.tar.gz"
sha256 "17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459"
license "LGPL-3.0-or-later"
bottle do
sha256 cellar: :any, arm64_big_sur: "6a93bd78c1b55f8b29e11fd1e9c68c6c305ffe74aa5b978ba93189b6d84d1451"
sha256 cellar: :any, big_sur: "754667644cc287cd9691fd3215df260aa971562b5a7b6ca65e29b2e15ea1e656"
sha256 cellar: :any, catalina: "8c037df4b551058d00351676dc2c5ec395bd69c88545fac9ccfd0749dadb8ee2"
sha256 cellar: :any, mojave: "c229b6def61f4acc41b4b159d93dbc63a5c77f87f61623c9f7c5399da440cc4f"
sha256 cellar: :any, high_sierra: "939f0ad01d809356e33bdc70a8a8483eb1b021fd5f3723d0e61a2698af00f01b"
end
depends_on "gmp"
depends_on "mpfr"
def install
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--with-gmp=#{Formula["gmp"].opt_prefix}
--with-mpfr=#{Formula["mpfr"].opt_prefix}
]
system "./configure", *args
system "make"
system "make", "check"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <mpc.h>
#include <assert.h>
#include <math.h>
int main() {
mpc_t x;
mpc_init2 (x, 256);
mpc_set_d_d (x, 1., INFINITY, MPC_RNDNN);
mpc_tanh (x, x, MPC_RNDNN);
assert (mpfr_nan_p (mpc_realref (x)) && mpfr_nan_p (mpc_imagref (x)));
mpc_clear (x);
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-L#{Formula["mpfr"].opt_lib}",
"-L#{Formula["gmp"].opt_lib}", "-lmpc", "-lmpfr",
"-lgmp", "-o", "test"
system "./test"
end
end
class Mpfr < Formula
desc "C library for multiple-precision floating-point computations"
homepage "https://www.mpfr.org/"
url "https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.xz"
mirror "https://ftpmirror.gnu.org/mpfr/mpfr-4.1.0.tar.xz"
sha256 "0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f"
license "GPL-3.0"
bottle do
sha256 cellar: :any, arm64_big_sur: "9df11560dd3650ffae35c134cef6e0e91aad0e862f5c8895c568b828cf0598d5"
sha256 cellar: :any, big_sur: "1e8eb0326f62d3461d420d98af6fc088daca481cae89fd77a75b420d2e76d776"
sha256 cellar: :any, catalina: "5fcf57834f58c18761c6c7b0eb961eb7f9fc54325b5361bf3a17c4dee6ebc08a"
sha256 cellar: :any, mojave: "93c0d2ca093819f125300002cd34c1d1b4dfb7a1403729205861bec21388ff12"
sha256 cellar: :any, high_sierra: "77581a1df66fb1ef55ffb19777d08b0b60fbc3d2d7ad491a8aceb3a6a4bf7ffd"
end
depends_on "gmp"
def install
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}",
"--disable-silent-rules"
system "make"
system "make", "check"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <mpfr.h>
#include <math.h>
#include <stdlib.h>
int main() {
mpfr_t x, y;
mpfr_inits2 (256, x, y, NULL);
mpfr_set_ui (x, 2, MPFR_RNDN);
mpfr_root (y, x, 2, MPFR_RNDN);
mpfr_pow_si (x, y, 4, MPFR_RNDN);
mpfr_add_si (y, x, -4, MPFR_RNDN);
mpfr_abs (y, y, MPFR_RNDN);
if (fabs(mpfr_get_d (y, MPFR_RNDN)) > 1.e-30) abort();
return 0;
}
EOS
system ENV.cc, "test.c", "-L#{lib}", "-L#{Formula["gmp"].opt_lib}",
"-lgmp", "-lmpfr", "-o", "test"
system "./test"
end
end
class Zstd < Formula
desc "Zstandard is a real-time compression algorithm"
homepage "https://facebook.github.io/zstd/"
url "https://github.com/facebook/zstd/archive/v1.5.0.tar.gz"
sha256 "0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867"
license "BSD-3-Clause"
head "https://github.com/facebook/zstd.git", branch: "dev"
bottle do
sha256 cellar: :any, arm64_big_sur: "e8962c7923904213f312c86372b670b6b5a7ac7103ee63254ab3d1c349913246"
sha256 cellar: :any, big_sur: "eae17621cfc664d6e527a6d6aa6a000343eced0f60c81b4e2dd9a9aed7b79c3f"
sha256 cellar: :any, catalina: "571d031a8fe1b96f68c4c50c2e72532adbad273c565420cb0825cf4745f512bc"
sha256 cellar: :any, mojave: "8089b1b5c398c95af5eaacea6033829dd8d255c9f32d6fa2f0c436821c902087"
end
depends_on "cmake" => :build
uses_from_macos "zlib"
def install
cd "build/cmake" do
system "cmake", "-S", ".", "-B", "builddir",
"-DZSTD_BUILD_CONTRIB=ON",
"-DCMAKE_INSTALL_RPATH=#{rpath}",
*std_cmake_args
system "cmake", "--build", "builddir"
system "cmake", "--install", "builddir"
end
end
test do
assert_equal "hello\n",
pipe_output("#{bin}/zstd | #{bin}/zstd -d", "hello\n", 0)
assert_equal "hello\n",
pipe_output("#{bin}/pzstd | #{bin}/pzstd -d", "hello\n", 0)
end
end
#!/usr/bin/env bash
# Copyright © 2019-2021 Dynare Team
# Copyright © 2019-2023 Dynare Team
#
# This file is part of Dynare.
#
......@@ -18,21 +18,47 @@
# along with Dynare. If not, see <https://www.gnu.org/licenses/>.
set -ex
#exec > >(tee build-logfile.log) 2>&1 # uncomment for debugging
ROOTDIR=$(pwd)/..
##
## Set settings based on architecture
##
path_remove () { export "$1"="$(echo -n "${!1}" | awk -v RS=: -v ORS=: '$1 != "'"$2"'"' | sed 's/:$//')"; }
path_prepend () { path_remove "$1" "$2"; export "$1"="$2:${!1}"; }
PKG_ARCH=${1:-x86_64} # default to x86_64
if [[ "$PKG_ARCH" == arm64 ]]; then
BREWDIR=/opt/homebrew
# Make sure /opt/homebrew/bin is set first in PATH (as it might come last)
path_prepend PATH /opt/homebrew/bin
MATLAB_ARCH=maca64
# arm64 MATLAB is only available starting with R2023b, no need to distinguish versions
MATLAB_PATH_BASE=/Applications/"$PKG_ARCH"/MATLAB_R2023b.app
else
BREWDIR=/usr/local
# Remove /opt/homebrew/bin from PATH, so it does not intervene with the x86_64 compilations
path_remove PATH /opt/homebrew/bin
MATLAB_ARCH=maci64
# On x86_64 we need to differentiate between older (BASE) and newer (NEW) MATLAB versions due to ABI breaks
MATLAB_PATH_BASE=/Applications/MATLAB_R2016b.app
MATLAB_PATH_NEW=/Applications/"$PKG_ARCH"/MATLAB_R2023b.app
fi
# Append texbin to PATH to access latexmk and friends
path_prepend PATH /Library/TeX/texbin
# Set the GCC version
GCC_VERSION=11
GCC_VERSION=13
# Set the compilers
CC=gcc-$GCC_VERSION
CXX=g++-$GCC_VERSION
CC=gcc-"$GCC_VERSION"
CXX=g++-"$GCC_VERSION"
# Set the number of threads
NTHREADS=$(nproc)
NTHREADS=$(sysctl -n hw.ncpu)
# Set dependency directory
LIB64="$ROOTDIR"/macOS/deps/lib64
LIB64="$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64
##
......@@ -63,6 +89,9 @@ else
# Get the first component, truncate it to 5 characters, and add the date
LOCATION=$(echo "$VERSION" | cut -f1 -d"-" | cut -c 1-5)-"$DATE"
fi
# Add architecture to LOCATION and VERSION
VERSION="$VERSION"-"$PKG_ARCH"
LOCATION="$LOCATION"-"$PKG_ARCH"
## Hack for statically linking libquadmath, similar to the one used in
## deps/Makefile for several libraries (there is no -static-libquadmath flag,
......@@ -73,35 +102,36 @@ fi
## - libgfortran.spec does not include --as-needed on macOS, hence it will link the library anyways
## Also, it does not seem possible to override libgfortran.spec with the --specs option.
QUADMATH_DIR=$(mktemp -d)
ln -s /usr/local/opt/gcc/lib/gcc/$GCC_VERSION/libquadmath.a $QUADMATH_DIR
ln -s "$BREWDIR"/opt/gcc/lib/gcc/"$GCC_VERSION"/libquadmath.a "$QUADMATH_DIR"
##
## Compile Dynare doc, dynare++, preprocessor, mex for MATLAB < 2018a
## Compile Dynare doc, dynare++, preprocessor, mex for MATLAB < 2018a (x86_64) or MATLAB = R2023b (arm64)
##
## NB: In Homebrew, -static-libgfortran is implied by -static-libgcc (see “gfortran -dumpspecs”)
## NB2: We use the hack for libquadmath in LDFLAGS
## NB3: The -Wl,-ld_classic flag is a workaround for a bug in XCode 15
cd "$ROOTDIR"
[[ -f configure ]] || autoreconf -si
./configure \
[[ -f configure ]] || arch -"$PKG_ARCH" autoreconf -si
arch -"$PKG_ARCH" ./configure \
PACKAGE_VERSION="$VERSION" \
PACKAGE_STRING="dynare $VERSION" \
CC=$CC \
CXX=$CXX \
CPPFLAGS=-I/usr/local/include \
LDFLAGS="-static-libgcc -L$QUADMATH_DIR" \
LEX=/usr/local/opt/flex/bin/flex \
YACC=/usr/local/opt/bison/bin/bison \
CC="$CC" \
CXX="$CXX" \
CPPFLAGS=-I"$BREWDIR"/include \
LDFLAGS="-static-libgcc -L$QUADMATH_DIR -Wl,-ld_classic" \
LEX="$BREWDIR"/opt/flex/bin/flex \
YACC="$BREWDIR"/opt/bison/bin/bison \
--with-gsl="$LIB64"/gsl \
--with-matio="$LIB64"/matio \
--with-slicot="$LIB64"/Slicot/with-underscore \
--with-slicot="$LIB64"/slicot/with-underscore \
--disable-octave \
--with-matlab=/Applications/MATLAB_R2016b.app
--with-matlab="$MATLAB_PATH_BASE"
if [[ -z $CI ]]; then
# If not in Gitlab CI, clean the source and build the doc
make clean
make -j"$NTHREADS" pdf html
arch -"$PKG_ARCH" make clean
arch -"$PKG_ARCH" make -j"$NTHREADS" pdf html
fi
make -j"$NTHREADS"
arch -"$PKG_ARCH" make -j"$NTHREADS"
##
......@@ -111,12 +141,16 @@ NAME=dynare-"$VERSION"
PKGFILES="$ROOTDIR"/macOS/pkg/"$NAME"
mkdir -p \
"$PKGFILES"/preprocessor \
"$PKGFILES"/mex/matlab/maci64-8.3-9.3 \
"$PKGFILES"/mex/matlab/maci64-9.4-9.10 \
"$PKGFILES"/doc/dynare++ \
"$PKGFILES"/dynare++ \
"$PKGFILES"/scripts \
"$PKGFILES"/contrib/ms-sbvar/TZcode
if [[ "$PKG_ARCH" == x86_64 ]]; then
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-8.3-9.3 \
"$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-9.4-23.2
else
mkdir -p "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2
fi
if [[ $VERSION == *-unstable* ]]; then
echo "$SHA" > "$PKGFILES"/sha.txt
......@@ -135,7 +169,11 @@ cp -p "$ROOTDIR"/preprocessor/src/dynare-preprocessor "$PKGFILES"
rm -f "$ROOTDIR"/matlab/preprocessor64/dynare_m
ln -sf ../../preprocessor/dynare-preprocessor "$PKGFILES"/matlab/preprocessor64/dynare_m
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-8.3-9.3
if [[ "$PKG_ARCH" == x86_64 ]]; then
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-8.3-9.3
else
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/"$MATLAB_ARCH"-23.2
fi
cp -p "$ROOTDIR"/scripts/dynare.el "$PKGFILES"/scripts
cp -pr "$ROOTDIR"/contrib/ms-sbvar/TZcode/MatlabFiles "$PKGFILES"/contrib/ms-sbvar/TZcode
......@@ -156,28 +194,29 @@ cp "$ROOTDIR"/dynare++/src/dynare++ "$PKGFILES"
cp "$ROOTDIR"/dynare++/dynare_simul/dynare_simul.m "$PKGFILES"/dynare++
mkdir -p "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64
cp -p "$ROOTDIR"/macOS/deps/lib64/x13as/x13as "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64
cp -p "$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64/x13as/x13as "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64
##
## Create mex for MATLAB ≥ 2018a
## Create mex for MATLAB ≥ 2018a (only for x86_64)
##
if [[ "$PKG_ARCH" == x86_64 ]]; then
cd "$ROOTDIR"/mex/build/matlab
make clean
./configure \
arch -"$PKG_ARCH" make clean
arch -"$PKG_ARCH" ./configure \
PACKAGE_VERSION="$VERSION" \
PACKAGE_STRING="dynare $VERSION" \
CC=$CC \
CXX=$CXX \
CPPFLAGS=-I/usr/local/include \
LDFLAGS="-static-libgcc -L$QUADMATH_DIR" \
CC="$CC" \
CXX="$CXX" \
CPPFLAGS=-I"$BREWDIR"/include \
LDFLAGS="-static-libgcc -L$QUADMATH_DIR -Wl,-ld_classic" \
--with-gsl="$LIB64"/gsl \
--with-matio="$LIB64"/matio \
--with-slicot="$LIB64"/Slicot/with-underscore \
--with-matlab=/Applications/MATLAB_R2019b.app
make -j"$NTHREADS"
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/maci64-9.4-9.10
--with-slicot="$LIB64"/slicot/with-underscore \
--with-matlab="$MATLAB_PATH_NEW"
arch -"$PKG_ARCH" make -j"$NTHREADS"
cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"/mex/matlab/$MATLAB_ARCH-9.4-23.2
fi
##
## Make package
......@@ -185,30 +224,31 @@ cp -L "$ROOTDIR"/mex/matlab/* "$PKGFILES"
cd "$ROOTDIR"/macOS/pkg
# Dynare option
pkgbuild --root "$PKGFILES" --identifier org.dynare --version "$VERSION" --install-location /Applications/Dynare/"$LOCATION" "$NAME".pkg
arch -"$PKG_ARCH" pkgbuild --root "$PKGFILES" --identifier org.dynare."$VERSION" --version "$VERSION" --install-location /Applications/Dynare/"$LOCATION" "$NAME".pkg
# Create distribution.xml by replacing variables in distribution_template.xml
sed -e "s/VERSION_NO_SPACE/$VERSION/g" \
-e "s/LOCATION/$LOCATION/g" \
"$ROOTDIR"/macOS/distribution_template.xml > distribution.xml
# GCC option
# Create dummy payload for GCC package; otherwise the size is displayed as 0 bytes in the installer
dd if=/dev/zero of="$ROOTDIR"/macOS/brewfiles/dummy bs=1m count=800
pkgbuild --root "$ROOTDIR"/macOS/brewfiles --identifier org.dynare.gcc --version "$VERSION" --scripts "$ROOTDIR"/macOS/scripts --install-location /Applications/Dynare/"$LOCATION" "$NAME"-gcc.pkg
# Create welcome.html by replacing variables in welcome_template.html
sed -e "s/VERSION_NO_SPACE/$VERSION/g" \
-e "s/DATE/$DATELONG/g" \
-e "s/GCC_VERSION/$GCC_VERSION/g" \
"$ROOTDIR"/macOS/welcome_template.html > "$ROOTDIR"/macOS/welcome.html
# Replace variables in displayed files
sed "s/VERSION_READ/$VERSION/g" "$ROOTDIR"/macOS/distribution_template.xml > distribution_tmp.xml
sed "s/VERSION_NO_SPACE/$VERSION/g" distribution_tmp.xml > distribution.xml
sed "s/GCC_BINARY/$CC/g" "$ROOTDIR"/macOS/welcome_template.html > "$ROOTDIR"/macOS/welcome.html
sed "s/VERSION_NO_SPACE/$VERSION/g" "$ROOTDIR"/macOS/welcome.html > "$ROOTDIR"/macOS/welcome_tmp.html
sed "s/DATE/$DATELONG/g" "$ROOTDIR"/macOS/welcome_tmp.html > "$ROOTDIR"/macOS/welcome.html
# Create conclusion.html by replacing variables in conclusion_template.html
sed -e "s/GCC_VERSION/$GCC_VERSION/g" \
"$ROOTDIR"/macOS/conclusion_template.html > "$ROOTDIR"/macOS/conclusion.html
# Create installer
productbuild --distribution distribution.xml --resources "$ROOTDIR"/macOS --package-path ./"$NAME".pkg "$NAME"-new.pkg
arch -"$PKG_ARCH" productbuild --distribution distribution.xml --resources "$ROOTDIR"/macOS --package-path ./"$NAME".pkg "$NAME"-productbuild.pkg
# cleanup
rm -f ./*.xml
# Cleanup
rm -f ./distribution.xml
rm -rf "$PKGFILES"
rm -f "$NAME"-gcc.pkg
rm -f "$ROOTDIR"/macOS/brewfiles/dummy
rm -f "$ROOTDIR"/macOS/welcome.html
rm -f "$ROOTDIR"/macOS/welcome_tmp.html
rm -f "$ROOTDIR"/macOS/conclusion.html
# Final pkg
mv "$NAME"-new.pkg "$NAME".pkg
mv "$NAME"-productbuild.pkg "$NAME".pkg
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Recommendations</title>
<style>
.center-text {
text-align: center;
}
.bold-text {
font-weight: bold;
}
code {
font-family: "Courier New", Courier, monospace;
}
</style>
</head>
<body>
<header class="center-text">
<h1>Recommendations</h1>
</header>
<main>
<p class="bold-text">Xcode Command Line Tools</p>
<p>Dynare highly benefits from installing Xcode Command Line Tools (an Apple product). To install the Xcode Command Line Tools type the following into Terminal.app:</p>
<code>
xcode-select --install
</code>
<p class="bold-text">Compilation Environment for use_dll option</p>
<p>Dynare ships a compilation environment that can be used with the use_dll option. To install this environment correctly, the Xcode Command Line Tools are sufficient. Check this by running the following command in the MATLAB command window:</p>
<code>
mex -setup
</code>
<p>If you get a warning in MATLAB, that Xcode is installed, but its license has not been accepted, please refer to the <a href="https://www.dynare.org/manual/installation-and-configuration.html#prerequisites-on-macos" target="_blank" rel="noopener noreferrer">manual</a> for a workaround.</p>
<p>Moreover, we recommend making use of optimized compilation flags and for this you need to install GCC via Homebrew.
Follow <a href="https://brew.sh" target="_blank" rel="noopener noreferrer">https://brew.sh</a> to install Homebrew and then type the following into Terminal.app:</p>
<code>
brew install gcc@GCC_VERSION
</code>
<p>If you already have installed GCC, Dynare will automatically prefer it for use_dll if the binaries are either in /opt/homebrew/bin/gcc-GCC_VERSION (arm64) or in /usr/local/bin/gcc-GCC_VERSION (x86_64). Otherwise, it will fall back to Clang in /usr/bin/clang (for both arm64 and x86_64).</p>
</main>
</body>
</html>
\ No newline at end of file
# Copyright © 2019-2021 Dynare Team
# Copyright © 2019-2023 Dynare Team
#
# This file is part of Dynare.
#
......@@ -17,10 +17,18 @@
include versions.mk
# settings for different architectures
DEPS_ARCH ?= x86_64 # use x86_64 by default
BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local)
GCC_VERSION = 13
ROOT_PATH = $(realpath .)
WGET_OPTIONS := --no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error
NTHREADS=$(shell sysctl -n hw.perflevel0.physicalcpu)
.PHONY: all build build-slicot build-x13as \
clean-lib clean-libslicot clean-x13as-bin \
clean-src clean-slicot-src clean-x13as-src \
......@@ -45,85 +53,85 @@ clean-all: clean-lib clean-src clean-tar
# (done to link only to static Matio and GSL libraries)
# Matio
lib64/matio/lib/libmatio.a: /usr/local/lib/libmatio.a
$(DEPS_ARCH)/lib64/matio/lib/libmatio.a: $(BREWDIR)/lib/libmatio.a
mkdir -p $(dir $@) && ln -sf $< $@
lib64/matio/lib/libhdf5.a: /usr/local/lib/libhdf5.a
$(DEPS_ARCH)/lib64/matio/lib/libhdf5.a: $(BREWDIR)/lib/libhdf5.a
mkdir -p $(dir $@) && ln -sf $< $@
lib64/matio/lib/libsz.a: /usr/local/lib/libsz.a
$(DEPS_ARCH)/lib64/matio/lib/libsz.a: $(BREWDIR)/lib/libsz.a
mkdir -p $(dir $@) && ln -sf $< $@
lib64/matio/include/matio.h: /usr/local/include/matio.h
$(DEPS_ARCH)/lib64/matio/include/matio.h: $(BREWDIR)/include/matio.h
mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf include && ln -sf $(dir $<) .
ln-matio: lib64/matio/lib/libmatio.a \
lib64/matio/lib/libhdf5.a \
lib64/matio/lib/libsz.a \
lib64/matio/include/matio.h
ln-matio: $(DEPS_ARCH)/lib64/matio/lib/libmatio.a \
$(DEPS_ARCH)/lib64/matio/lib/libhdf5.a \
$(DEPS_ARCH)/lib64/matio/lib/libsz.a \
$(DEPS_ARCH)/lib64/matio/include/matio.h
clean-matio:
rm -rf lib64/matio
rm -rf $(DEPS_ARCH)/lib64/matio
# GSL
lib64/gsl/lib/libgsl.a: /usr/local/lib/libgsl.a
$(DEPS_ARCH)/lib64/gsl/lib/libgsl.a: $(BREWDIR)/lib/libgsl.a
mkdir -p $(dir $@) && ln -sf $< $@
lib64/gsl/lib/libgslcblas.a: /usr/local/lib/libgslcblas.a
$(DEPS_ARCH)/lib64/gsl/lib/libgslcblas.a: $(BREWDIR)/lib/libgslcblas.a
mkdir -p $(dir $@) && ln -sf $< $@
lib64/gsl/include/gsl/gsl_blas.h: /usr/local/include/gsl/gsl_blas.h
$(DEPS_ARCH)/lib64/gsl/include/gsl/gsl_blas.h: $(BREWDIR)/include/gsl/gsl_blas.h
mkdir -p $(dir $@) && cd $(dir $@).. && rm -rf gsl && ln -sf $(dir $<) .
ln-gsl: lib64/gsl/lib/libgsl.a \
lib64/gsl/lib/libgslcblas.a \
lib64/gsl/include/gsl/gsl_blas.h
ln-gsl: $(DEPS_ARCH)/lib64/gsl/lib/libgsl.a \
$(DEPS_ARCH)/lib64/gsl/lib/libgslcblas.a \
$(DEPS_ARCH)/lib64/gsl/include/gsl/gsl_blas.h
clean-gsl:
rm -rf lib64/gsl
rm -rf $(DEPS_ARCH)/lib64/gsl
#
# Slicot
# slicot
#
tarballs/slicot-$(SLICOT_VERSION).tar.gz:
mkdir -p tarballs
wget $(WGET_OPTIONS) -O $@ https://deb.debian.org/debian/pool/main/s/slicot/slicot_$(SLICOT_VERSION).orig.tar.gz
sources64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz
rm -rf sources64/slicot-*-with-32bit-integer-and-underscore
$(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz
rm -rf $(DEPS_ARCH)/sources64/slicot-*-with-32bit-integer-and-underscore
mkdir -p $@
tar xf $< --directory $@ --strip-components=1
touch $@
sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz
rm -rf sources64/slicot-*-with-64bit-integer-and-underscore
$(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore: tarballs/slicot-$(SLICOT_VERSION).tar.gz
rm -rf $(DEPS_ARCH)/sources64/slicot-*-with-64bit-integer-and-underscore
mkdir -p $@
tar xf $< --directory $@ --strip-components=1
touch $@
lib64/Slicot/with-underscore/lib/libslicot_pic.a: sources64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore
make -C $< FORTRAN=gfortran LOADER=gfortran SLICOTLIB=../libslicot_pic.a OPTS="-O2 -g" lib
$(DEPS_ARCH)/lib64/slicot/with-underscore/lib/libslicot_pic.a: $(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION)-with-32bit-integer-and-underscore
make -C $< FORTRAN=$(BREWDIR)/bin/gfortran LOADER=$(BREWDIR)/bin/gfortran SLICOTLIB=../libslicot_pic.a OPTS="-O2 -g" lib -j$(NTHREADS)
strip -S $</libslicot_pic.a
mkdir -p $(dir $@)
cp $</libslicot_pic.a $@
lib64/Slicot/with-underscore/lib/libslicot64_pic.a: sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore
make -C $< FORTRAN=gfortran LOADER=gfortran SLICOTLIB=../libslicot64_pic.a OPTS="-O2 -g -fdefault-integer-8" lib
$(DEPS_ARCH)/lib64/slicot/with-underscore/lib/libslicot64_pic.a: $(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore
make -C $< FORTRAN=$(BREWDIR)/bin/gfortran LOADER=$(BREWDIR)/bin/gfortran SLICOTLIB=../libslicot64_pic.a OPTS="-O2 -g -fdefault-integer-8" lib -j$(NTHREADS)
strip -S $</libslicot64_pic.a
mkdir -p $(dir $@)
cp $</libslicot64_pic.a $@
build-slicot: lib64/Slicot/with-underscore/lib/libslicot_pic.a \
lib64/Slicot/with-underscore/lib/libslicot64_pic.a
build-slicot: $(DEPS_ARCH)/lib64/slicot/with-underscore/lib/libslicot_pic.a \
$(DEPS_ARCH)/lib64/slicot/with-underscore/lib/libslicot64_pic.a
clean-slicot-tar:
rm -f tarballs/slicot-$(SLICOT_VERSION).tar.gz
clean-slicot-src:
rm -rf sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore
rm -rf $(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION)-with-64bit-integer-and-underscore
clean-libslicot:
rm -rf lib64/Slicot
rm -rf $(DEPS_ARCH)/lib64/Slicot
clean-slicot-all: clean-slicot-src clean-slicot-tar clean-libslicot
......@@ -132,31 +140,40 @@ clean-slicot-all: clean-slicot-src clean-slicot-tar clean-libslicot
#
# X13AS
#
tarballs/x13assrc_V$(X13AS_VERSION).tar.gz:
tarballs/x13as_asciisrc-v$(X13AS_VERSION).tar.gz:
mkdir -p tarballs
wget $(WGET_OPTIONS) -O $@ https://www.census.gov/ts/x13as/unix/x13assrc_V$(X13AS_VERSION).tar.gz
wget $(WGET_OPTIONS) -O $@ https://www2.census.gov/software/x-13arima-seats/x13as/unix-linux/program-archives/x13as_asciisrc-v$(X13AS_VERSION).tar.gz
sources64/x13as-$(X13AS_VERSION): tarballs/x13assrc_V$(X13AS_VERSION).tar.gz
rm -rf sources64/x13as-*
$(DEPS_ARCH)/sources64/x13as-$(X13AS_VERSION): tarballs/x13as_asciisrc-v$(X13AS_VERSION).tar.gz
rm -rf $(DEPS_ARCH)/sources64/x13as-*
mkdir -p $@
tar xf $< --directory $@
lib64/x13as/x13as: sources64/x13as-$(X13AS_VERSION)
$(DEPS_ARCH)/lib64/x13as/x13as: $(DEPS_ARCH)/sources64/x13as-$(X13AS_VERSION)
# Statically link x13as (see #1865).
# Using -static is not possible, it does not work under Darwin.
# Implement an ugly workaround in the absence of -static-libquadmath flag.
# In particular, gcc must be used as the linker, because gfortran does not
# honour static linking of libquadmath.
# Once the -static-libquadmath flag is added (GCC 13? ; see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46539), go back to using
# gfortran as the linker with -static-libgfortran and
# -static-libquadmath flags, and drop the GCC_VERSION variable.
cd $< && sed -i '' 's/-static//g' makefile.gf
make -C $< -f makefile.gf FC=gfortran LINKER=gfortran FFLAGS="-O2 -std=legacy" PROGRAM=x13as
make -C $< -f makefile.gf FC=$(BREWDIR)/bin/gfortran LINKER=$(BREWDIR)/bin/gcc-$(GCC_VERSION) FFLAGS="-O2 -std=legacy" LDFLAGS=-static-libgcc LIBS="$(BREWDIR)/lib/gcc/current/libgfortran.a $(BREWDIR)/lib/gcc/current/libquadmath.a" PROGRAM=x13as -j$(NTHREADS)
strip $</x13as
mkdir -p $(dir $@)
cp $</x13as $@
build-x13as: lib64/x13as/x13as
build-x13as: $(DEPS_ARCH)/lib64/x13as/x13as
clean-x13as-tar:
rm -f tarballs/x13assrc_V$(X13AS_VERSION).tar.gz
rm -f tarballs/x13as_asciisrc-v$(X13AS_VERSION).tar.gz
clean-x13as-src:
rm -rf sources64/x13as-$(X13AS_VERSION)
rm -rf $(DEPS_ARCH)/sources64/x13as-$(X13AS_VERSION)
clean-x13as-bin:
rm -rf lib64/x13as
rm -rf $(DEPS_ARCH)/lib64/x13as
clean-x13as-all: clean-x13as-tar clean-x13as-src clean-x13as-bin
SLICOT_VERSION = 5.0+20101122
X13AS_VERSION = 1.1_B39
X13AS_VERSION = 1-1-b60
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<title>Dynare VERSION_READ</title>
<title>Dynare VERSION_NO_SPACE</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" />
<welcome file="welcome.html" mime-type="text/html" />
<conclusion file="conclusion.html" mime-type="text/html" />
<license file="gpl-3.0-standalone.html" mime-type="text/html" />
<pkg-ref id="org.dynare" />
<options customize="allow" require-scripts="false" hostArchitectures="x86_64" />
<domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="false"/> <!-- on enable_currentUserHome="true" does not require admin rights! enable_localSystem="true" or enable_anywhere="true" requires admin rights by default, even though this can be changed in the installer though under Change Installation. -->
<pkg-ref id="default" />
<options customize="allow" require-scripts="false" hostArchitectures="x86_64,arm64" />
<choices-outline>
<line choice="org.dynare" />
<line choice="org.dynare.gcc" />
<line choice="default" />
</choices-outline>
<choice id="org.dynare" title="Dynare" description="Dynare Required Files" start_enabled="false" enabled="false">
<pkg-ref id="org.dynare" />
<choice id="default" title="Dynare" description="Dynare Required Files" start_enabled="false" enabled="false" customLocation="/Applications/Dynare/LOCATION">
<pkg-ref id="org.dynare.VERSION_NO_SPACE" />
</choice>
<choice id="org.dynare.gcc" title="GCC for `use_dll`" description="This is necessary for the use of Dynare with the `use_dll` option. NB: This takes a few minutes and requires an active internet connection.">
<pkg-ref id="org.dynare.gcc" />
</choice>
<pkg-ref id="org.dynare" version="VERSION_NO_SPACE">dynare-VERSION_NO_SPACE.pkg</pkg-ref>
<pkg-ref id="org.dynare.gcc" version="VERSION_NO_SPACE">dynare-VERSION_NO_SPACE-gcc.pkg</pkg-ref>
<pkg-ref id="org.dynare.VERSION_NO_SPACE" version="VERSION_NO_SPACE">dynare-VERSION_NO_SPACE.pkg</pkg-ref>
</installer-gui-script>
\ No newline at end of file
#!/usr/bin/env bash
# Copyright © 2019-2021 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 <https://www.gnu.org/licenses/>.
set -ex
set -o errexit
readonly LOG_FILE="$2"/install.log
sudo touch "$LOG_FILE"
exec 1>"$LOG_FILE"
exec 2>&1
# Remove dummy payload
rm -f "$2"/dummy
# Test for Internet connection
if ! curl -s -m 4 https://github.com >/dev/null; then
osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'
echo "No internet connection to github.com"
exit 1
fi
# Install Command Line Tools
# Checking that “xcode-select -print-path” returns a valid path is not enough, because
# the contents of that directory might have been removed (this is the official way of
# uninstalling CLT, see https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_CAN_I_UNINSTALL_THE_COMMAND_LINE_TOOLS_)
# Hence we also check that the directory contains the git binary.
if ! xcpath=$(/usr/bin/xcode-select -print-path) || [[ ! -x "$xcpath"/usr/bin/git ]]; then
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
SUC=$(softwareupdate -l |
grep "\*.*Command Line" |
grep -m1 "" |
awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
# On macOS 10.15 softwareupdate output is preceded by "Label: "
[[ $SUC == Label:* ]] && SUC=${SUC#"Label: "}
softwareupdate -i "$SUC" --verbose
rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
softwareupdate -l
fi
# If CLT installation didn't work, exit
if ! xcpath=$(/usr/bin/xcode-select -print-path) || [[ ! -x "$xcpath"/usr/bin/git ]]; then
osascript -e 'display alert "Dynare Installation Error" message "Not able to find Command Line Tools.\n\nCommand Line Tools is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'
echo "Command Line Tools not installed"
exit 1
fi
# Ensure git is in the path
if ! which git >/dev/null; then
osascript -e 'display alert "Dynare Installation Error" message "Not able to find Git even though the Command Line Tools have already been installed. This is likely a problem with your PATH environment variable.\n\nGit is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'
echo $PATH
echo "Git not found in PATH"
exit 1
fi
# Install Homebrew
BREWDIR="$2"/.brew
[ -d "$BREWDIR" ] || mkdir -p "$BREWDIR"
BREW_URL="https://github.com/Homebrew/brew"
BREW_BRANCH="master"
curl -\# -L "$BREW_URL"/tarball/"$BREW_BRANCH" | tar xz -m --strip 1 -C "$BREWDIR"
# Change ownership of Dynare directory
chown -R "$USER":staff "$2"
sudo -u "$USER" "$BREWDIR"/bin/brew tap homebrew/core
HOMEBREW_CACHE="$HOME"/Library/Caches/Homebrew-Dynare
HOMEBREW_NO_AUTO_UPDATE=1
[[ -z "${HOMEBREW_NO_ANALYTICS}" ]] && HOMEBREW_NO_ANALYTICS=1
# Move modified formulas to Homebrew Formula directory
mv "$2"/*.rb "$BREWDIR"/Library/Taps/homebrew/homebrew-core/Formula
# Install GCC & deps
sudo -u "$USER" "$BREWDIR"/bin/brew install gcc -v --force-bottle
exit 0