Commit fdf9a8a4 authored by Houtan Bastani's avatar Houtan Bastani

move preprocessor to submodule

parent 04ce0891
......@@ -30,3 +30,6 @@
[submodule "contrib/jsonlab"]
path = contrib/jsonlab
url = https://github.com/fangq/jsonlab.git
[submodule "preprocessor"]
path = preprocessor
url = https://github.com/DynareTeam/dynare-preprocessor.git
......@@ -35,6 +35,17 @@ EXTRA_DIST = \
scripts \
.dir-locals.el
all-local: preprocessor/src/dynare_m
{ \
if [ -z "`file preprocessor/src/dynare_m | grep x86.64`" ]; then \
ARCH="32"; \
else \
ARCH="64"; \
fi; \
mkdir -p $(abs_srcdir)/matlab/preprocessor$$ARCH; \
cp preprocessor/src/dynare_m $(abs_srcdir)/matlab/preprocessor$$ARCH; \
}
dist-hook:
rm -rf `find $(distdir)/matlab $(distdir)/examples -name *~`
rm -rf $(distdir)/matlab/preprocessor* $(distdir)/matlab/dynare_version.m
......@@ -51,13 +62,13 @@ install-exec-local:
find $(DESTDIR)$(pkglibdir) -name LICENSE.md -delete
rm -rf $(DESTDIR)$(pkglibdir)/matlab/preprocessor*
{ \
if [ -z "`file preprocessor/dynare_m | grep x86.64`" ]; then \
if [ -z "`file preprocessor/src/dynare_m | grep x86.64`" ]; then \
ARCH="32"; \
else \
ARCH="64"; \
fi; \
mkdir -p $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH; \
cp preprocessor/dynare_m $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH; \
cp preprocessor/src/dynare_m $(DESTDIR)$(pkglibdir)/matlab/preprocessor$$ARCH; \
}
uninstall-local:
......
dnl Process this file with autoconf to produce a configure script.
dnl Copyright (C) 2009-2017 Dynare Team
dnl Copyright (C) 2009-2018 Dynare Team
dnl
dnl This file is part of Dynare.
dnl
......@@ -19,9 +19,11 @@ dnl along with Dynare. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.62])
AC_INIT([dynare], [4.6-unstable])
AC_CONFIG_SRCDIR([preprocessor/DynareMain.cc])
AC_CONFIG_SRCDIR([preprocessor/src/DynareMain.cc])
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax])
AC_CONFIG_SUBDIRS([preprocessor])
AC_PROG_CC
AC_PROG_CXX
......@@ -61,17 +63,6 @@ AX_PROG_LN_S
AC_PROG_MKDIR_P
AM_PROG_LEX
# Hack to get lex include dir, ticket #575
AC_PATH_PROG([LEXPATH], [$LEX])
AC_SUBST([LEXINC], [`eval "echo $LEXPATH | sed 's|\(.*\)$LEX$|\1../include|'"`])
AC_CHECK_PROG([YACC], [bison], [bison])
if test "x$YACC" = "x"; then
unset YACC # AM_MISSING_PROG needs an unset variable: an empty variable won't do
AM_MISSING_PROG([YACC], [bison])
fi
# We need 1.36 because of unordered_{set,hash} used by Dynare++
AX_BOOST_BASE([1.36], [], [AC_MSG_ERROR([Can't find Boost >= 1.36])])
......@@ -121,9 +112,6 @@ if test "x$PDFLATEX" != "x" -a "x$BIBTEX" != "x"; then
fi
AM_CONDITIONAL([HAVE_BEAMER], [test "x$ax_latex_have_beamer" = "xyes"])
AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "x"])
AC_CHECK_PROG([CTANGLE], [ctangle], [ctangle])
AM_CONDITIONAL([HAVE_CTANGLE], [test "x$CTANGLE" != "x"])
if test "x$CTANGLE" = "x"; then
......@@ -166,8 +154,6 @@ AX_PTHREAD
AC_CONFIG_FILES([Makefile
VERSION
preprocessor/macro/Makefile
preprocessor/Makefile
doc/Makefile
doc/preprocessor/Makefile
doc/macroprocessor/Makefile
......@@ -220,8 +206,6 @@ AM_CONDITIONAL([ENABLE_ORG_EXPORT], [test "x$enable_org_export" != "x"])
# Construct final output message
BUILD_PREPROCESSOR="yes"
if test "x$ax_blas_ok" = "xyes" -a "x$ax_lapack_ok" = "xyes" -a "x$has_matio" = "xyes"; then
if test x"$ax_pthread_ok" = "xyes"; then
BUILD_DYNAREPLUSPLUS="yes"
......@@ -250,12 +234,6 @@ else
BUILD_OTHER_PDF_DOC="no (missing pdflatex)"
fi
if test "x$DOXYGEN" != "x"; then
BUILD_DYNARE_PREPROC_DOC="yes"
else
BUILD_DYNARE_PREPROC_DOC="no (missing doxygen)"
fi
if test "x$enable_org_export" != "x"; then
BUILD_DYNARE_INTERNAL_DOC="yes"
else
......@@ -293,7 +271,6 @@ AC_MSG_NOTICE([
Dynare is now configured for building the following components...
Binaries (with "make"):
Dynare preprocessor: $BUILD_PREPROCESSOR
Dynare++: $BUILD_DYNAREPLUSPLUS
PDF documentation (with "make pdf"):
......@@ -304,7 +281,6 @@ PDF documentation (with "make pdf"):
HTML documentation (with "make html"):
Dynare reference manual: $BUILD_DYNARE_HTML_MANUAL
Dynare preprocessor developer doc: $BUILD_DYNARE_PREPROC_DOC
Dynare internal doc: $BUILD_DYNARE_INTERNAL_DOC
Info documentation (with "make info"): $BUILD_DYNARE_INFO
......
mex_PROGRAMS = bytecode
bytecode_CPPFLAGS = -Wno-maybe-uninitialized $(AM_CPPFLAGS) -I$(top_srcdir)/../../sources -I$(top_srcdir)/../../sources/bytecode -I$(top_srcdir)/../../../preprocessor
bytecode_CPPFLAGS = -Wno-maybe-uninitialized $(AM_CPPFLAGS) -I$(top_srcdir)/../../sources -I$(top_srcdir)/../../sources/bytecode -I$(top_srcdir)/../../../preprocessor/src
TOPDIR = $(top_srcdir)/../../sources/bytecode
......
Subproject commit 662d3f71cecf0d8a32e94564071bf9cfc27eae4d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Copyright (C) 2010-2017 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/>.
*/
#ifndef _CONFIG_FILE_HH
#define _CONFIG_FILE_HH
#include <map>
#include <vector>
#include "WarningConsolidation.hh"
using namespace std;
typedef map<string, double> member_nodes_t;
class Hook
{
public:
Hook(string &global_init_file_arg);
~Hook();
private:
map<string, string> hooks;
public:
inline map<string, string>
get_hooks()
{
return hooks;
};
};
class Path
{
public:
Path(vector<string> &includepath_arg);
~Path();
private:
map<string, vector<string> > paths;
public:
inline map<string, vector<string> >
get_paths()
{
return paths;
};
};
class SlaveNode
{
friend class ConfigFile;
public:
SlaveNode(string &computerName_arg, string port_arg, int minCpuNbr_arg, int maxCpuNbr_arg, string &userName_arg,
string &password_arg, string &remoteDrive_arg, string &remoteDirectory_arg,
string &dynarePath_arg, string &matlabOctavePath_arg, bool singleCompThread_arg, int numberOfThreadsPerJob_arg,
string &operatingSystem_arg);
~SlaveNode();
protected:
const string computerName;
const string port;
int minCpuNbr;
int maxCpuNbr;
const string userName;
const string password;
const string remoteDrive;
const string remoteDirectory;
const string dynarePath;
const string matlabOctavePath;
const bool singleCompThread;
const int numberOfThreadsPerJob;
const string operatingSystem;
};
class Cluster
{
friend class ConfigFile;
public:
Cluster(member_nodes_t member_nodes_arg);
~Cluster();
protected:
member_nodes_t member_nodes;
};
//! The abstract representation of a "config" file
class ConfigFile
{
public:
ConfigFile(bool parallel_arg, bool parallel_test_arg, bool parallel_slave_open_mode_arg, const string &cluster_name);
~ConfigFile();
private:
const bool parallel;
const bool parallel_test;
const bool parallel_slave_open_mode;
const string cluster_name;
string firstClusterName;
//! Hooks
vector<Hook *> hooks;
//! Paths
vector<Path *> paths;
//! Cluster Table
map<string, Cluster *> clusters;
//! Node Map
map<string, SlaveNode *> slave_nodes;
//! Add Hooks
void addHooksConfFileElement(string &global_init_file);
//! Add Paths
void addPathsConfFileElement(vector<string> &includepath);
//! Add a SlaveNode or a Cluster object
void addParallelConfFileElement(bool inNode, bool inCluster, member_nodes_t member_nodes, string &name,
string &computerName, string port, int minCpuNbr, int maxCpuNbr, string &userName,
string &password, string &remoteDrive, string &remoteDirectory,
string &dynarePath, string &matlabOctavePath, bool singleCompThread, int numberOfThreadsPerJob,
string &operatingSystem);
public:
//! Parse config file
void getConfigFileInfo(const string &parallel_config_file);
//! Check Pass
void checkPass(WarningConsolidation &warnings) const;
//! Check Pass
void transformPass();
//! Get Path Info
vector<string> getIncludePaths() const;
//! Write any hooks
void writeHooks(ostream &output) const;
//! Create options_.parallel structure, write options
void writeCluster(ostream &output) const;
//! Close slave nodes if needed
void writeEndParallel(ostream &output) const;
};
#endif // ! CONFIG_FILE_HH
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
noinst_LIBRARIES = libmacro.a
BUILT_SOURCES = MacroBison.hh stack.hh position.hh location.hh MacroBison.cc MacroFlex.cc
# We don't put BUILT_SOURCES in libmacro_a_SOURCES, otherwise MacroBison.o and MacroFlex.o will be linked two times (Automake translates MacroFlex.ll and MacroBison.yy into their respective .o); so BUILT_SOURCES is in EXTRA_DIST
libmacro_a_SOURCES = \
MacroFlex.ll \
MacroBison.yy \
MacroDriver.cc \
MacroDriver.hh \
MacroValue.cc \
MacroValue.hh
EXTRA_DIST = $(BUILT_SOURCES)
# The -I.. is for <FlexLexer.h>
libmacro_a_CPPFLAGS = $(BOOST_CPPFLAGS) -I..
MacroFlex.cc: MacroFlex.ll
$(LEX) -o MacroFlex.cc MacroFlex.ll
MacroBison.cc MacroBison.hh location.hh stack.hh position.hh: MacroBison.yy
$(YACC) -o MacroBison.cc MacroBison.yy
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment