diff options
-rw-r--r-- | math/Makefile | 1 | ||||
-rw-r--r-- | math/dynare/Makefile | 48 | ||||
-rw-r--r-- | math/dynare/distinfo | 2 | ||||
-rw-r--r-- | math/dynare/files/patch-journal.cweb | 53 | ||||
-rw-r--r-- | math/dynare/files/patch-parser-exception.h | 10 | ||||
-rw-r--r-- | math/dynare/pkg-descr | 5 | ||||
-rw-r--r-- | math/dynare/pkg-plist | 4 |
7 files changed, 123 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile index 8337abee645b..9b84f927f390 100644 --- a/math/Makefile +++ b/math/Makefile @@ -66,6 +66,7 @@ SUBDIR += dislin SUBDIR += djbfft SUBDIR += drgeo + SUBDIR += dynare SUBDIR += e SUBDIR += edenmath SUBDIR += eigen diff --git a/math/dynare/Makefile b/math/dynare/Makefile new file mode 100644 index 000000000000..a6a1fa5e795a --- /dev/null +++ b/math/dynare/Makefile @@ -0,0 +1,48 @@ +# New ports collection makefile for: dynare +# Date created: Aug 17 2011 +# Whom: Fernando Apesteguia <fernando.apesteguia@gmail.com> +# +# $FreeBSD$ + +PORTNAME= dynare +PORTVERSION= 4.2.1 +CATEGORIES= math +MASTER_SITES= http://www.dynare.org/download/dynare-4.2/source/dynare-2.4.1/at_download/file/ + +MAINTAINER= fernando.apesteguia@gmail.com +COMMENT= Software platform for handling a wide class of economic models + +BUILD_DEPENDS= ${LOCALBASE}/include/boost/unordered_set.hpp:${PORTSDIR}/devel/boost-libs + +WRKSRC= ${WRKDIR}/${DISTNAME} +GNU_CONFIGURE= yes +USE_GMAKE= yes +USE_FORTRAN= yes + +OPTIONS+= OCTAVE "Enable compilation of MEX files for Octave" on +OPTIONS+= MATLAB "Enable compilation of MEX files for MATLAB" off + +.if defined(WITHOUT_MATLAB) +CONFIGURE_ARGS+= --disable-matlab +.endif + +.if defined(WITHOUT_OCTAVE) +CONFIGURE_ARGS+= --disable-octave +.else +BUILD_DEPENDS+= octave:${PORTSDIR}/math/octave +.endif + +do-fetch: + fetch -o ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX} http://www.dynare.org/download/dynare-4.2/source/${DISTNAME}${EXTRACT_SUFX}/at_download/file + +post-configure: + @${ECHO_MSG} "" + @${ECHO_MSG} "" + @${ECHO_MSG} "*******************************************************************************" + @${ECHO_MSG} "Follow instructions at http://www.freebsd.org/doc/handbook/linuxemu-matlab.html" + @${ECHO_MSG} "on how to install MATLAB on FreeBSD" + @${ECHO_MSG} "*******************************************************************************" + @${ECHO_MSG} "" + @${ECHO_MSG} "" + +.include <bsd.port.mk> diff --git a/math/dynare/distinfo b/math/dynare/distinfo new file mode 100644 index 000000000000..8a909a9d3f88 --- /dev/null +++ b/math/dynare/distinfo @@ -0,0 +1,2 @@ +SHA256 (dynare-4.2.1.tar.gz) = 65b30a6524843a5751387cf962a10ba104042bef7932c472254f3bbf03aa044d +SIZE (dynare-4.2.1.tar.gz) = 13634307 diff --git a/math/dynare/files/patch-journal.cweb b/math/dynare/files/patch-journal.cweb new file mode 100644 index 000000000000..33d7731cf2c1 --- /dev/null +++ b/math/dynare/files/patch-journal.cweb @@ -0,0 +1,53 @@ +--- dynare++/kord/journal.cweb.orig 2011-08-21 20:56:09.000000000 +0200 ++++ dynare++/kord/journal.cweb 2011-08-21 23:02:31.000000000 +0200 +@@ -5,6 +5,8 @@ + @c + #include "journal.h" + #include "kord_exception.h" ++#include <sys/types.h> ++#include <sys/sysctl.h> + + #if !defined(__MINGW32__) + # include <sys/resource.h> +@@ -72,7 +74,16 @@ + @<|SystemResources::availableMemory| code@>= + long int SystemResources::availableMemory() + { +- return pageSize()*sysconf(_SC_AVPHYS_PAGES); ++ long value; ++ size_t len; ++ char *path = "vm.stats.vm.v_free_count"; ++ ++ if (sysctlbyname(path, &value, &len, NULL, 0) == -1) { ++ return (-1); ++ } ++ ++ ++ return pageSize() * value; + } + + @ Here we read the current values of resource usage. For MinGW, we +@@ -84,6 +95,10 @@ + long int& idrss, long int& majflt) + { + struct timeval now; ++ long value; ++ size_t len; ++ char *path = "vm.stats.vm.v_free_count"; ++ + gettimeofday(&now, NULL); + elapsed = now.tv_sec-start.tv_sec + (now.tv_usec-start.tv_usec)*1.0e-6; + +@@ -107,7 +122,11 @@ + load_avg = -1.0; + #endif + +- pg_avail = sysconf(_SC_AVPHYS_PAGES); ++ if (sysctlbyname(path, &value, &len, NULL, 0) == -1) { ++ pg_avail = -1; ++ } ++ ++ pg_avail = value; + } + + @ diff --git a/math/dynare/files/patch-parser-exception.h b/math/dynare/files/patch-parser-exception.h new file mode 100644 index 000000000000..b7d5936c3422 --- /dev/null +++ b/math/dynare/files/patch-parser-exception.h @@ -0,0 +1,10 @@ +--- dynare++/parser/cc/parser_exception.h.orig 2011-08-21 19:10:51.000000000 +0200 ++++ dynare++/parser/cc/parser_exception.h 2011-08-21 19:31:06.000000000 +0200 +@@ -6,6 +6,7 @@ + #define OG_FORMULA_PARSER_H + + #include <string> ++#include <stdio.h> + + namespace ogp { + using std::string; diff --git a/math/dynare/pkg-descr b/math/dynare/pkg-descr new file mode 100644 index 000000000000..acd6e91dccce --- /dev/null +++ b/math/dynare/pkg-descr @@ -0,0 +1,5 @@ +Dynare is a software platform for handling a wide class of +economic models, in particular dynamic stochastic general +equilibrium (DSGE) and overlapping generations (OLG) models. + +WWW: http://www.dynare.org diff --git a/math/dynare/pkg-plist b/math/dynare/pkg-plist new file mode 100644 index 000000000000..747230b9a9f5 --- /dev/null +++ b/math/dynare/pkg-plist @@ -0,0 +1,4 @@ +bin/dynare++ +info/dynare.info +lib/matlab/dynare_m +@dirrm lib/matlab |