aboutsummaryrefslogtreecommitdiff
path: root/math/dynare
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2011-09-27 06:35:23 +0000
committerWen Heping <wen@FreeBSD.org>2011-09-27 06:35:23 +0000
commitb26682e3bd97bf310658ec43d2c54391a3141857 (patch)
treeb1d9c6f5ef1841c5cecdaa79f8bc3fe5e3ff2afd /math/dynare
parent2b359118214252719c6009766dada91cdcf819ab (diff)
downloadports-b26682e3bd97bf310658ec43d2c54391a3141857.tar.gz
ports-b26682e3bd97bf310658ec43d2c54391a3141857.zip
Notes
Diffstat (limited to 'math/dynare')
-rw-r--r--math/dynare/Makefile48
-rw-r--r--math/dynare/distinfo2
-rw-r--r--math/dynare/files/patch-journal.cweb53
-rw-r--r--math/dynare/files/patch-parser-exception.h10
-rw-r--r--math/dynare/pkg-descr5
-rw-r--r--math/dynare/pkg-plist4
6 files changed, 122 insertions, 0 deletions
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