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
  • 6.x
  • master
  • julia
  • python-codegen
  • llvm-15
  • 5.x
  • 4.6
  • uop
  • rework_pac
  • aux_vars_fix
  • julia-6.2.0
  • julia-6.3.0
  • julia-6.4.0
  • julia-7.0.0
14 results

Target

Select target project
No results found
Select Git revision
  • planner_nostrict
  • debug_compilation
  • test
  • master
  • filter_initial_state
  • M
  • 4.6
  • enterprise
  • uop
  • rework_pac
  • aux_vars_fix
  • created_preprocessor_repo
12 results
Show changes
103 files
+ 36014
32720
Compare changes
  • Side-by-side
  • Inline

Files

.clang-format

0 → 100644
+22 −0
Original line number Original line Diff line number Diff line
# This file should be kept in sync with the one in dynare.git (which also
# contains more explanations).
Language: Cpp
Standard: c++20
ColumnLimit: 100
BasedOnStyle: GNU
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
Cpp11BracedListStyle: true
DeriveLineEnding: false
IndentPPDirectives: AfterHash
InsertNewlineAtEOF: true
PackConstructorInitializers: NextLine
PPIndentWidth: 1
PointerAlignment: Left
# RemoveParentheses: ReturnStatement
# RemoveSemicolon: true
SpaceAfterTemplateKeyword: false
SpaceBeforeParens: ControlStatements
SpaceBeforeCpp11BracedList: true

.clang-tidy

0 → 100644
+8 −0
Original line number Original line Diff line number Diff line
# TODO: add the following check families:
# - bugprone-*
# - cppcoreguidelines-

# NB: as of clang-tidy 16, we get several false positives inside boost, notably this one:
#  https://github.com/llvm/llvm-project/issues/40486

Checks: 'performance-*,modernize-*,-modernize-use-trailing-return-type,-clang-diagnostic-unqualified-std-cast-call'
+0 −66
Original line number Original line Diff line number Diff line
# For checking that no file has been unduly ignored, run:
# $ git ls-files -i --exclude-per-directory=.gitignore
# Any file that is displayed should be removed from the ignore list
# (possibly by an exclusion rule beginning with an exclamation mark)

# Generic ignore rules
*~
*~
*.o
*.a
*.fig
\#*\#
*.txt

# Build system rules
build-aux/*
.deps
Makefile
Makefile.in
configure
config.log
config.status
aclocal.m4
autom4te.cache
TAGS

# Preprocessor
/src/dynare_m
/src/dynare_m.exe
/src/DynareBison.cc
/src/DynareBison.hh
/src/FlexLexer.h
/src/DynareFlex.cc
/src/location.hh
/src/position.hh
/src/stack.hh
/src/macro/Parser.cc
/src/macro/Parser.hh
/src/macro/Tokenizer.cc
/src/macro/location.hh
/src/macro/position.hh
/src/macro/stack.hh
/src/doc/

# macOS stuff
.DS_Store

# Doc rules
*.pdf
*.aux
*.log
*.nav
*.out
*.snm
*.toc
*.vrb
!/doc/macroprocessor/new-design.pdf
!/doc/macroprocessor/old-design.pdf

# test files
checksum
*.mod
*.tex
*.json
+*

# Bison verbose output file
*.output
+53 −105
Original line number Original line Diff line number Diff line
variables:
variables:
  TERM: linux
  TERM: linux
  MINGW32_BOOST_VERSION: 1.71.0-1
  MINGW64_BOOST_VERSION: 1.88.0-2
  MINGW64_BOOST_VERSION: 1.71.0-1
  WGET_OPTIONS: '--no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error'
  WGET_OPTIONS: '--no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error'
  # To ensure that "false && true" fails, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/25394#note_412609647
  FF_ENABLE_BASH_EXIT_CODE_CHECK: 'true'


before_script:
build_linux_x86_64:
  - 'export REMOTE_PATH=https://www.dynare.org/preprocessor/$CI_COMMIT_SHORT_SHA'

stages:
  - build
  - prepare

build_linux_32:
  stage: build
  stage: build
  script:
  script:
    - autoreconf -si
    - meson setup --buildtype=release -Db_lto=true build
    - './configure LDFLAGS="-m32 -static -static-libgcc -static-libstdc++" CXXFLAGS=-m32'
    - meson compile -C build -v
    - make -j$(nproc)
    - strip src/dynare_m
    - mkdir -p bin
    - mv src/dynare_m bin
    - mkdir -p $CI_COMMIT_SHORT_SHA/linux/32
    - tar cfz $CI_COMMIT_SHORT_SHA/linux/32/preprocessor.tar.gz bin
    - cd $CI_COMMIT_SHORT_SHA/linux/32 && sha256sum preprocessor.tar.gz > sha256sum
  artifacts:
  artifacts:
    paths:
    paths:
      - $CI_COMMIT_SHORT_SHA/linux/32/*
      - build/src/dynare-preprocessor
    expire_in: 1 hour


build_linux_64:
build_linux_arm64:
  stage: build
  stage: build
  script:
  script:
    - autoreconf -si
    - meson setup --buildtype=release -Db_lto=true --cross-file scripts/linux-arm64-cross.ini build
    - './configure LDFLAGS="-static -static-libgcc -static-libstdc++"'
    - meson compile -C build -v
    - make -j$(nproc)
    - strip src/dynare_m
    - mkdir -p bin
    - mv src/dynare_m bin
    - mkdir -p $CI_COMMIT_SHORT_SHA/linux/64
    - tar cfz $CI_COMMIT_SHORT_SHA/linux/64/preprocessor.tar.gz bin
    - cd $CI_COMMIT_SHORT_SHA/linux/64 && sha256sum preprocessor.tar.gz > sha256sum
  artifacts:
  artifacts:
    paths:
    paths:
      - $CI_COMMIT_SHORT_SHA/linux/64/*
      - build/src/dynare-preprocessor
    expire_in: 1 hour


build_windows_32:
build_windows_x86_64:
  stage: build
  stage: build
  script:
  script:
    - mkdir -p ~/tarballs
    - mkdir -p tarballs
    - '[[ -f ~/tarballs/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.xz ]] || wget $WGET_OPTIONS -P ~/tarballs http://repo.msys2.org/mingw/i686/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.xz'
    - '[[ -f tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst'
    - mkdir -p deps
    - mkdir -p deps
    - tar xf ~/tarballs/mingw-w64-i686-boost-$MINGW32_BOOST_VERSION-any.pkg.tar.xz --directory deps
    - tar xf tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst --directory deps
    - autoreconf -si
    - echo -e "[properties]\nboost_root = '$(pwd)/deps/mingw64/'" > boost.ini
    - './configure --host=i686-w64-mingw32 --with-boost=$(pwd)/deps/mingw32/include LDFLAGS="-static -static-libgcc -static-libstdc++"'
    - meson setup --buildtype=release -Db_lto=true --cross-file scripts/windows-cross.ini --cross-file boost.ini build
    - make -j$(nproc)
    - meson compile -C build -v
    - i686-w64-mingw32-strip src/dynare_m.exe
  cache:
    - mkdir -p bin
    # This cache is shared between all branches, to save space
    - mv src/dynare_m.exe bin
    key: $CI_JOB_NAME
    - mkdir -p $CI_COMMIT_SHORT_SHA/windows/32
    paths:
    - tar cfz $CI_COMMIT_SHORT_SHA/windows/32/preprocessor.tar.gz bin
      - tarballs/
    - cd $CI_COMMIT_SHORT_SHA/windows/32 && sha256sum preprocessor.tar.gz > sha256sum
  artifacts:
  artifacts:
    paths:
    paths:
      - $CI_COMMIT_SHORT_SHA/windows/32/*
      - build/src/dynare-preprocessor.exe
    expire_in: 1 hour


build_windows_64:
build_macos_x86_64:
  stage: build
  stage: build
  tags:
    - macOS
  script:
  script:
    - mkdir -p ~/tarballs
    - arch -x86_64 meson setup --buildtype=release -Db_lto=true --native-file scripts/homebrew-native-x86_64.ini build
    - '[[ -f ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.xz ]] || wget $WGET_OPTIONS -P ~/tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.xz'
    - arch -x86_64 meson compile -C build -v
    - mkdir -p deps
    - tar xf ~/tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.xz --directory deps
    - autoreconf -si
    - './configure --host=x86_64-w64-mingw32 --with-boost=$(pwd)/deps/mingw64/include LDFLAGS="-static -static-libgcc -static-libstdc++"'
    - make -j$(nproc)
    - x86_64-w64-mingw32-strip src/dynare_m.exe
    - mkdir -p bin
    - mv src/dynare_m.exe bin
    - mkdir -p $CI_COMMIT_SHORT_SHA/windows/64
    - tar cfz $CI_COMMIT_SHORT_SHA/windows/64/preprocessor.tar.gz bin
    - cd $CI_COMMIT_SHORT_SHA/windows/64 && sha256sum preprocessor.tar.gz > sha256sum
  artifacts:
  artifacts:
    paths:
    paths:
      - $CI_COMMIT_SHORT_SHA/windows/64/*
      - build/src/dynare-preprocessor
    expire_in: 1 hour


build_macOS:
build_macos_arm64:
  stage: build
  stage: build
  tags:
  tags:
    - macOS
    - macOS
  script:
  script:
    - autoreconf -si
    - export PATH="/opt/homebrew/bin:$PATH"
    - './configure CXX=g++-9 CXXFLAGS=-static-libgcc'
    - arch -arm64 meson setup --buildtype=release -Db_lto=true --native-file scripts/homebrew-native-arm64.ini build
    - make -j$(nproc)
    - arch -arm64 meson compile -C build -v
    - strip src/dynare_m
    - mkdir -p bin
    - mv src/dynare_m bin
    - mkdir -p $CI_COMMIT_SHORT_SHA/macOS/64
    - tar cfz $CI_COMMIT_SHORT_SHA/macOS/64/preprocessor.tar.gz bin
    - cd $CI_COMMIT_SHORT_SHA/macOS/64 && sha256sum preprocessor.tar.gz > sha256sum
  artifacts:
  artifacts:
    paths:
    paths:
      - $CI_COMMIT_SHORT_SHA/macOS/64/*
      - build/src/dynare-preprocessor
    expire_in: 1 hour


aggregate_builds:
test_clang_format:
  stage: prepare
  stage: test
  dependencies:
    - build_linux_32
    - build_linux_64
    - build_windows_32
    - build_windows_64
    - build_macOS
  script:
  script:
    - linux32sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/linux/32/sha256sum)
    - meson setup build-clang-format
    - linux64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/linux/64/sha256sum)
    - ninja -C build-clang-format clang-format-check
    - windows32sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/windows/32/sha256sum)
  needs: []
    - windows64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/windows/64/sha256sum)

    - macOS64sha=$(cut -f 1 -d ' ' < $CI_COMMIT_SHORT_SHA/macOS/64/sha256sum)
test_clang_tidy:
    - cd $CI_COMMIT_SHORT_SHA
  stage: test
    - echo 'PREPROCESSOR_VERSION = "'$CI_COMMIT_SHORT_SHA'"' > julia.conf
  script:
    - echo 'REMOTE_PATH = "https://www.dynare.org/preprocessor/'$CI_COMMIT_SHORT_SHA'"' >> julia.conf
    # Hack needed for meson < 1.6.0 which only looks for unversioned clang-tidy
    - echo -e "\n" >> julia.conf
    - mkdir -p ~/.local/bin && ln -s /usr/bin/clang-tidy-19 ~/.local/bin/clang-tidy
    - echo "download_info = Dict(" >> julia.conf
    - export PATH="$HOME/.local/bin:$PATH"
    - echo "    Linux(:i686, :glibc) => ("\"\$REMOTE_PATH/linux/32/preprocessor.tar.gz\"", "\"$linux32sha\"")," >> julia.conf
    - meson setup build-clang-tidy
    - echo "    Linux(:x86_64, :glibc) => ("\"\$REMOTE_PATH/linux/64/preprocessor.tar.gz\"", "\"$linux64sha\"")," >> julia.conf
    # Generate Flex and Bison files
    - echo "    Windows(:i686) => ("\"\$REMOTE_PATH/windows/32/preprocessor.tar.gz\"", "\"$windows32sha\"")," >> julia.conf
    - meson compile -C build-clang-tidy
    - echo "    Windows(:x86_64) => ("\"\$REMOTE_PATH/windows/64/preprocessor.tar.gz\"", "\"$windows64sha\"")," >> julia.conf
    - ninja -C build-clang-tidy clang-tidy
    - echo "    MacOS() => ("\"\$REMOTE_PATH/macOS/64/preprocessor.tar.gz\"", "\"$macOS64sha\"")," >> julia.conf
  needs: []
    - echo " )" >> julia.conf
  when: manual
  artifacts:
    paths:
      - $CI_COMMIT_SHORT_SHA/*/*/*
      - $CI_COMMIT_SHORT_SHA/julia.conf
    expire_in: 1 week
+4 −4
Original line number Original line Diff line number Diff line
                    GNU GENERAL PUBLIC LICENSE
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007
                       Version 3, 29 June 2007


 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
 of this license document, but changing it is not allowed.


@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
    GNU General Public License for more details.
    GNU General Public License for more details.


    You should have received a copy of the GNU General Public License
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    along with this program.  If not, see <https://www.gnu.org/licenses/>.


Also add information on how to contact you by electronic and paper mail.
Also add information on how to contact you by electronic and paper mail.


@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
  You should also get your employer (if you work as a programmer) or school,
  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.


  The GNU General Public License does not permit incorporating your program
  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.

Makefile.am

deleted100644 → 0
+0 −11
Original line number Original line Diff line number Diff line
SUBDIRS = src doc

ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = \
	license.txt \
	COPYING

dist-hook:
	rm -rf `find $(distdir) -name '.git*'`
+2 −5
Original line number Original line Diff line number Diff line
@@ -9,12 +9,9 @@


The Dynare Preprocessor defines the Dynare model language. It takes in a `.mod`
The Dynare Preprocessor defines the Dynare model language. It takes in a `.mod`
file, computes the derivatives of the model represented therein, and produces
file, computes the derivatives of the model represented therein, and produces
MATLAB/Octave, C, Julia, or JSON output.
MATLAB/Octave, Julia, or JSON output.

There is more to come here. For the moment, see the [Dynare
repository](https://git.dynare.org/Dynare/dynare)


# License
# License


Most of the source files are covered by the GNU General Public Licence version
Most of the source files are covered by the GNU General Public Licence version
3 or later. There are some exceptions. See [license.txt](license.txt) for specifics.
3 or later. There are some exceptions, see the respective file headers.

configure.ac

deleted100644 → 0
+0 −132
Original line number Original line Diff line number Diff line
dnl Process this file with autoconf to produce a configure script.

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

AC_PREREQ([2.62])
AC_INIT([dynare-preprocessor], [4.6-unstable])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([src/DynareMain.cc])
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability foreign no-dist-gzip dist-xz tar-pax])

AC_PROG_CC
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX_17

AC_CANONICAL_HOST
case ${host_os} in
  *mingw32*)
    # On Windows, we don't want dynamic linking
    AM_LDFLAGS="-static"
    AC_SUBST([AM_LDFLAGS])
    ;;
  *cygwin*)
    AC_MSG_WARN([You are compiling for the Cygwin target. This means that the preprocessor will])
    AC_MSG_WARN([not run from MATLAB unless you add the Cygwin DLL to the path.])
    AC_MSG_WARN([This is probably not what you want. Consider using a MinGW cross-compiler.])
    ;;
esac

# Use C++ for testing headers
AC_LANG([C++])

AM_CXXFLAGS="-Wall -Wno-parentheses -Wold-style-cast"
AC_SUBST([AM_CXXFLAGS])

# If default 'ar' is not available, try to find one with a host prefix (see ticket #145)
AC_CHECK_PROGS([AR], [ar ${host_alias}-ar])

AC_PROG_RANLIB
AM_PROG_AR

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 -z "$YACC"; 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])])

CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
AC_CHECK_HEADERS([boost/graph/adjacency_list.hpp], [], [AC_MSG_ERROR([Can't find Boost Graph Library])])
AC_CHECK_HEADERS([boost/algorithm/string/trim.hpp], [], [AC_MSG_ERROR([Can't find Boost String Library])])
AC_CHECK_HEADERS([boost/algorithm/string/split.hpp], [], [AC_MSG_ERROR([Can't find Boost String Library])])
CPPFLAGS="$CPPFLAGS_SAVED"

# Don't use deprecated hash structures
AC_DEFINE([BOOST_NO_HASH], [], [Don't use deprecated STL hash structures])

# Check if internal documentation can be built
AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])

# Check if user documentation can be built
AC_ARG_ENABLE([doc], AS_HELP_STRING([--disable-doc], [disable compilation of documentation]), [], [enable_doc=yes])
AM_CONDITIONAL([ENABLE_DOC], [test "$enable_doc" = yes])

if test "$enable_doc" = yes; then
  AC_CHECK_PROG([PDFLATEX], [pdflatex], [pdflatex], [no])
  test "$PDFLATEX" = no && AC_MSG_ERROR([pdflatex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
  AC_CHECK_PROG([BIBTEX], [bibtex], [bibtex], [no])
  test "$BIBTEX" = no && AC_MSG_ERROR([bibtex cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])
  AX_LATEX_CLASS([beamer], [ax_latex_have_beamer], [], [AC_MSG_ERROR([beamer cannot be found. If you want to skip the compilation of the documentation, pass the --disable-doc flag.])])
fi


AC_CONFIG_FILES([Makefile
                 src/Makefile
                 src/macro/Makefile
                 doc/Makefile
                 doc/preprocessor/Makefile
                 doc/macroprocessor/Makefile
])

if test -n "$DOXYGEN"; then
  BUILD_INTERNAL_DOC="yes"
else
  BUILD_INTERNAL_DOC="no (missing doxygen)"
fi

if test "$enable_doc" = yes; then
  BUILD_DOC="yes"
else
  BUILD_DOC="no"
fi

AC_MSG_NOTICE([

The Dynare Preprocessor is now configured to build...

Binaries (with "make")
 Dynare preprocessor:                         yes

PDF documentation (with "make pdf"):
 Preprocessor & Macroprocessor presentations: $BUILD_DOC

HTML documentation (with "make html"):
 Dynare preprocessor internal doc:            $BUILD_INTERNAL_DOC

])

AC_OUTPUT

doc/Makefile.am

deleted100644 → 0
+0 −3
Original line number Original line Diff line number Diff line
SUBDIRS = preprocessor macroprocessor

EXTRA_DIST = logos

doc/macroprocessor/Makefile.am

deleted100644 → 0
+0 −14
Original line number Original line Diff line number Diff line
if ENABLE_DOC
pdf-local: macroprocessor.pdf
endif

SRC = macroprocessor.tex new-design.pdf

EXTRA_DIST = $(SRC)

macroprocessor.pdf: $(SRC)
	$(PDFLATEX) macroprocessor
	$(PDFLATEX) macroprocessor

clean-local:
	rm -f macroprocessor.pdf *.toc *.aux *.log *.nav *.snm *.vrb *.out *~

doc/meson.build

0 → 100644
+42 −0
Original line number Original line Diff line number Diff line
latexmk_exe = find_program('latexmk', required : false, disabler : true)

# We have to set TEXINPUTS because the current directory is not the source
# directory when latexmk is invoked (and using the -cd option in combination
# with -outdir/-auxdir does not work in all cases because @OUTDIR@ and
# @PRIVATE_DIR@ can be relative paths)

# Without the -g flag, latexmk remembers a previous build failure and will refuse
# to recompile even if the error has been fixed in the TeX source

latexmk_command = [ latexmk_exe, '-pdf', '-g', '-outdir=@OUTDIR@', '-auxdir=@PRIVATE_DIR@', '@INPUT@']

# The \graphicspath{} command does not compute directories relative to TEXINPUTS,
# so add these manually
logos_dir = meson.current_source_dir() / 'logos'

macroprocessor_pdf = custom_target('macroprocessor.pdf',
                                   output : 'macroprocessor.pdf',
                                   input : 'macroprocessor/macroprocessor.tex',
                                   command : latexmk_command,
                                   env : { 'TEXINPUTS': meson.current_source_dir()
                                                        + '/macroprocessor:' + logos_dir + ':' },
                                   depend_files : [ 'macroprocessor/new-design.pdf',
                                                    'logos/dlogo.png' ],
                                   build_by_default : false,
                                   install : true,
                                   install_dir : 'share/doc/dynare')

preprocessor_pdf = custom_target('preprocessor.pdf',
                                 output : 'preprocessor.pdf',
                                 input : 'preprocessor/preprocessor.tex',
                                 command : latexmk_command,
                                 env : { 'TEXINPUTS': meson.current_source_dir() + '/preprocessor:'
                                                      + logos_dir + ':' },
                                 depend_files : [ 'preprocessor/expr.png',
                                                  'preprocessor/expr-sharing.png',
                                                  'preprocessor/json-preprocessor.png',
                                                  'preprocessor/matrices.png',
                                                  'preprocessor/overview.png', 'logos/dlogo.png' ],
                                 build_by_default : false,
                                 install : true,
                                 install_dir : 'share/doc/dynare')

doc/preprocessor/Makefile.am

deleted100644 → 0
+0 −14
Original line number Original line Diff line number Diff line
if ENABLE_DOC
pdf-local: preprocessor.pdf
endif

SRC = preprocessor.tex expr.png expr-sharing.png matrices.png overview.png json-preprocessor.png

EXTRA_DIST = $(SRC)

preprocessor.pdf: $(SRC)
	$(PDFLATEX) preprocessor
	$(PDFLATEX) preprocessor

clean-local:
	rm -f *.pdf *.toc *.aux *.log *.nav *.snm *.vrb *.out *~

license.txt

deleted100644 → 0
+0 −119
Original line number Original line Diff line number Diff line
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dynare-preprocessor
Upstream-Contact: Dynare Team, whose members in 2019 are:
                  Stéphane Adjemian <stephane.adjemian@univ-lemans.fr>
                  Houtan Bastani <houtan@dynare.org>
                  Michel Juillard <michel.juillard@mjui.fr>
                  Frédéric Karamé <frederic.karame@univ-lemans.fr>
                  Junior Maih <junior.maih@gmail.com>
                  Ferhat Mihoubi <fmihoubi@univ-evry.fr>
                  Johannes Pfeifer <jpfeifer@gmx.de>
                  Marco Ratto <marco.ratto@ec.europa.eu>
                  Sébastien Villemot <sebastien@dynare.org>
Source: https://www.dynare.org

Files: *
Copyright: 1996-2019 Dynare Team
License: GPL-3+

Files: m4/ax_boost_base.m4
       m4/ax_boost_system.m4
       m4/ax_boost_filesystem.m4
Copyright: 2008-2009 Thomas Porschberg <thomas@randspringer.de>
           2009 Peter Adolphs
           2008-2009 Michael Tindal
           2008 Daniel Casimiro <dan.casimiro@gmail.com>
           2009 Roman Rybalko <libtorrent@romanr.info>
License: FSFAP

Files: m4/ax_cxx_compile_stdcxx.m4
       m4/ax_cxx_compile_stdcxx_17.m4
Copyright: 2008 Benjamin Kosnik <bkoz@redhat.com>
           2012 Zack Weinberg <zackw@panix.com>
           2013 Roy Stogner <roystgnr@ices.utexas.edu>
           2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
           2015 Paul Norman <penorman@mac.com>
           2015 Moritz Klammler <moritz@klammler.eu>
           2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
           2019 Enji Cooper <yaneurabeya@gmail.com>
License: FSFAP

Files: m4/ax_latex_class.m4 m4/ax_tex_test.m4
Copyright: 2008 Boretti Mathieu <boretti@eig.unige.ch>
           2009 Dynare Team
License: LGPL-2.1+

License: GPL-3+
 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/>.

License: GPL-3+ with Autoconf exception
 This program 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.
 .
 This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
 .
 As a special exception, the respective Autoconf Macro's copyright owner
 gives unlimited permission to copy, distribute and modify the configure
 scripts that are the output of Autoconf when processing the Macro. You
 need not follow the terms of the GNU General Public License when using
 or distributing such scripts, even though portions of the text of the
 Macro appear in them. The GNU General Public License (GPL) does govern
 all other use of the material that constitutes the Autoconf Macro.
 .
 This special exception to the GPL applies to versions of the Autoconf
 Macro released by the Autoconf Archive. When you make and distribute a
 modified version of the Autoconf Macro, you may extend this special
 exception to the GPL to apply to your modified version as well.

License: LGPL-2.1+
 This library is free software; you can redistribute it and/or modify it
 under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation; either version 2.1 of the License, or (at
 your option) any later version.
 .
 This library 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 Lesser
 General Public License for more details.
 .
 You should have received a copy of the GNU Lesser General Public License
 along with this library. If not, see <http://www.gnu.org/licenses/>.

License: LGPL-3+
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 .
 This program 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 Lesser General Public License for more details.
 .
 You should have received a copy of the GNU Lesser General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

License: FSFAP
 Copying and distribution of this file, with or without modification, are
 permitted in any medium without royalty provided the copyright notice
 and this notice are preserved. This file is offered as-is, without any
 warranty.

m4/ax_boost_base.m4

deleted100644 → 0
+0 −301
Original line number Original line Diff line number Diff line
# ===========================================================================
#      https://www.gnu.org/software/autoconf-archive/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
#   Test for the Boost C++ libraries of a particular version (or newer)
#
#   If no path to the installed boost library is given the macro searchs
#   under /usr, /usr/local, /opt and /opt/local and evaluates the
#   $BOOST_ROOT environment variable. Further documentation is available at
#   <http://randspringer.de/boost/index.html>.
#
#   This macro calls:
#
#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
#   And sets:
#
#     HAVE_BOOST
#
# LICENSE
#
#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#   Copyright (c) 2009 Peter Adolphs
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 43

# example boost program (need to pass version)
m4_define([_AX_BOOST_BASE_PROGRAM],
          [AC_LANG_PROGRAM([[
#include <boost/version.hpp>
]],[[
(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))]));
]])])

AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
  [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
    [use Boost library from a standard location (ARG=yes),
     from the specified location (ARG=<path>),
     or disable it (ARG=no)
     @<:@ARG=yes@:>@ ])],
    [
     AS_CASE([$withval],
       [no],[want_boost="no";_AX_BOOST_BASE_boost_path=""],
       [yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""],
       [want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"])
    ],
    [want_boost="yes"])


AC_ARG_WITH([boost-libdir],
  [AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
    [Force given directory for boost libraries.
     Note that this will override library path detection,
     so use this parameter only if default library detection fails
     and you know exactly where your boost libraries are located.])],
  [
   AS_IF([test -d "$withval"],
         [_AX_BOOST_BASE_boost_lib_path="$withval"],
    [AC_MSG_ERROR([--with-boost-libdir expected directory name])])
  ],
  [_AX_BOOST_BASE_boost_lib_path=""])

BOOST_LDFLAGS=""
BOOST_CPPFLAGS=""
AS_IF([test "x$want_boost" = "xyes"],
      [_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])])
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
])


# convert a version string in $2 to numeric and affect to polymorphic var $1
AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[
  AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"])
  _AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'`
  _AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'`
  AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"],
        [AC_MSG_ERROR([You should at least specify libboost major version])])
  _AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'`
  AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"],
        [_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"])
  _AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
  AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"],
        [_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"])
  _AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+  $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor`
  AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET)
])

dnl Run the detection of boost should be run only if $want_boost
AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[
    _AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1])
    succeeded=no


    AC_REQUIRE([AC_CANONICAL_HOST])
    dnl On 64-bit systems check for system libraries in both lib64 and lib.
    dnl The former is specified by FHS, but e.g. Debian does not adhere to
    dnl this (as it rises problems for generic multi-arch support).
    dnl The last entry in the list is chosen by default when no libraries
    dnl are found, e.g. when only header-only libraries are installed!
    AS_CASE([${host_cpu}],
      [x86_64],[libsubdirs="lib64 libx32 lib lib64"],
      [ppc64|s390x|sparc64|aarch64|ppc64le],[libsubdirs="lib64 lib lib64"],
      [libsubdirs="lib"]
    )

    dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
    dnl them priority over the other paths since, if libs are found there, they
    dnl are almost assuredly the ones desired.
    AS_CASE([${host_cpu}],
      [i?86],[multiarch_libsubdir="lib/i386-${host_os}"],
      [multiarch_libsubdir="lib/${host_cpu}-${host_os}"]
    )

    dnl first we check the system location for boost libraries
    dnl this location ist chosen if boost libraries are installed with the --layout=system option
    dnl or if you install boost with RPM
    AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[
        AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"])
         AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[
           AC_MSG_RESULT([yes])
           BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include"
           for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do
                AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"])
                AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[
                        AC_MSG_RESULT([yes])
                        BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp";
                        break;
                ],
      [AC_MSG_RESULT([no])])
           done],[
      AC_MSG_RESULT([no])])
    ],[
        if test X"$cross_compiling" = Xyes; then
            search_libsubdirs=$multiarch_libsubdir
        else
            search_libsubdirs="$multiarch_libsubdir $libsubdirs"
        fi
        for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
            if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then
                for libsubdir in $search_libsubdirs ; do
                    if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                done
                BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path_tmp/$libsubdir"
                BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include"
                break;
            fi
        done
    ])

    dnl overwrite ld flags if we have required special directory with
    dnl --with-boost-libdir parameter
    AS_IF([test "x$_AX_BOOST_BASE_boost_lib_path" != "x"],
          [BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_lib_path"])

    AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION)])
    CPPFLAGS_SAVED="$CPPFLAGS"
    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
    export CPPFLAGS

    LDFLAGS_SAVED="$LDFLAGS"
    LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
    export LDFLAGS

    AC_REQUIRE([AC_PROG_CXX])
    AC_LANG_PUSH(C++)
        AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
        AC_MSG_RESULT(yes)
    succeeded=yes
    found_system=yes
        ],[
        ])
    AC_LANG_POP([C++])



    dnl if we found no boost with system layout we search for boost libraries
    dnl built and installed without the --layout=system option or for a staged(not installed) version
    if test "x$succeeded" != "xyes" ; then
        CPPFLAGS="$CPPFLAGS_SAVED"
        LDFLAGS="$LDFLAGS_SAVED"
        BOOST_CPPFLAGS=
        if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
            BOOST_LDFLAGS=
        fi
        _version=0
        if test -n "$_AX_BOOST_BASE_boost_path" ; then
            if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then
                for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
                    _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
                    V_CHECK=`expr $_version_tmp \> $_version`
                    if test "x$V_CHECK" = "x1" ; then
                        _version=$_version_tmp
                    fi
                    VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
                    BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE"
                done
                dnl if nothing found search for layout used in Windows distributions
                if test -z "$BOOST_CPPFLAGS"; then
                    if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then
                        BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path"
                    fi
                fi
                dnl if we found something and BOOST_LDFLAGS was unset before
                dnl (because "$_AX_BOOST_BASE_boost_lib_path" = ""), set it here.
                if test -n "$BOOST_CPPFLAGS" && test -z "$BOOST_LDFLAGS"; then
                    for libsubdir in $libsubdirs ; do
                        if ls "$_AX_BOOST_BASE_boost_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                    done
                    BOOST_LDFLAGS="-L$_AX_BOOST_BASE_boost_path/$libsubdir"
                fi
            fi
        else
            if test "x$cross_compiling" != "xyes" ; then
                for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local ; do
                    if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then
                        for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do
                            _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
                            V_CHECK=`expr $_version_tmp \> $_version`
                            if test "x$V_CHECK" = "x1" ; then
                                _version=$_version_tmp
                                best_path=$_AX_BOOST_BASE_boost_path
                            fi
                        done
                    fi
                done

                VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
                BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
                if test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
                    for libsubdir in $libsubdirs ; do
                        if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                    done
                    BOOST_LDFLAGS="-L$best_path/$libsubdir"
                fi
            fi

            if test -n "$BOOST_ROOT" ; then
                for libsubdir in $libsubdirs ; do
                    if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
                done
                if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
                    version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
                    stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
                        stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
                    V_CHECK=`expr $stage_version_shorten \>\= $_version`
                    if test "x$V_CHECK" = "x1" && test -z "$_AX_BOOST_BASE_boost_lib_path" ; then
                        AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
                        BOOST_CPPFLAGS="-I$BOOST_ROOT"
                        BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
                    fi
                fi
            fi
        fi

        CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
        export CPPFLAGS
        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
        export LDFLAGS

        AC_LANG_PUSH(C++)
            AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[
            AC_MSG_RESULT(yes)
        succeeded=yes
        found_system=yes
            ],[
            ])
        AC_LANG_POP([C++])
    fi

    if test "x$succeeded" != "xyes" ; then
        if test "x$_version" = "x0" ; then
            AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
        else
            AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
        fi
        # execute ACTION-IF-NOT-FOUND (if present):
        ifelse([$3], , :, [$3])
    else
        AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
        # execute ACTION-IF-FOUND (if present):
        ifelse([$2], , :, [$2])
    fi

    CPPFLAGS="$CPPFLAGS_SAVED"
    LDFLAGS="$LDFLAGS_SAVED"

])

m4/ax_cxx_compile_stdcxx.m4

deleted100644 → 0
+0 −951
Original line number Original line Diff line number Diff line
# ===========================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
#   Check for baseline language coverage in the compiler for the specified
#   version of the C++ standard.  If necessary, add switches to CXX and
#   CXXCPP to enable support.  VERSION may be '11' (for the C++11 standard)
#   or '14' (for the C++14 standard).
#
#   The second argument, if specified, indicates whether you insist on an
#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
#   -std=c++11).  If neither is specified, you get whatever works, with
#   preference for an extended mode.
#
#   The third argument, if specified 'mandatory' or if left unspecified,
#   indicates that baseline support for the specified C++ standard is
#   required and that the macro should error out if no mode with that
#   support is found.  If specified 'optional', then configuration proceeds
#   regardless, after defining HAVE_CXX${VERSION} if and only if a
#   supporting mode is found.
#
# LICENSE
#
#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
#   Copyright (c) 2015 Paul Norman <penorman@mac.com>
#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#   Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
#   Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 11

dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl  (serial version number 13).

AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
  m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
        [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
        [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
        [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
  m4_if([$2], [], [],
        [$2], [ext], [],
        [$2], [noext], [],
        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
  m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
        [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
        [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
        [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
  AC_LANG_PUSH([C++])dnl
  ac_success=no

  m4_if([$2], [noext], [], [dnl
  if test x$ac_success = xno; then
    for alternative in ${ax_cxx_compile_alternatives}; do
      switch="-std=gnu++${alternative}"
      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
                     $cachevar,
        [ac_save_CXX="$CXX"
         CXX="$CXX $switch"
         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
          [eval $cachevar=yes],
          [eval $cachevar=no])
         CXX="$ac_save_CXX"])
      if eval test x\$$cachevar = xyes; then
        CXX="$CXX $switch"
        if test -n "$CXXCPP" ; then
          CXXCPP="$CXXCPP $switch"
        fi
        ac_success=yes
        break
      fi
    done
  fi])

  m4_if([$2], [ext], [], [dnl
  if test x$ac_success = xno; then
    dnl HP's aCC needs +std=c++11 according to:
    dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
    dnl Cray's crayCC needs "-h std=c++11"
    for alternative in ${ax_cxx_compile_alternatives}; do
      for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
        cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
        AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
                       $cachevar,
          [ac_save_CXX="$CXX"
           CXX="$CXX $switch"
           AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
            [eval $cachevar=yes],
            [eval $cachevar=no])
           CXX="$ac_save_CXX"])
        if eval test x\$$cachevar = xyes; then
          CXX="$CXX $switch"
          if test -n "$CXXCPP" ; then
            CXXCPP="$CXXCPP $switch"
          fi
          ac_success=yes
          break
        fi
      done
      if test x$ac_success = xyes; then
        break
      fi
    done
  fi])
  AC_LANG_POP([C++])
  if test x$ax_cxx_compile_cxx$1_required = xtrue; then
    if test x$ac_success = xno; then
      AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
    fi
  fi
  if test x$ac_success = xno; then
    HAVE_CXX$1=0
    AC_MSG_NOTICE([No compiler with C++$1 support was found])
  else
    HAVE_CXX$1=1
    AC_DEFINE(HAVE_CXX$1,1,
              [define if the compiler supports basic C++$1 syntax])
  fi
  AC_SUBST(HAVE_CXX$1)
])


dnl  Test body for checking C++11 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)


dnl  Test body for checking C++14 support

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
  _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
)

dnl  Tests for new features in C++11

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[

// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201103L

#error "This is not a C++11 compiler"

#else

namespace cxx11
{

  namespace test_static_assert
  {

    template <typename T>
    struct check
    {
      static_assert(sizeof(int) <= sizeof(T), "not big enough");
    };

  }

  namespace test_final_override
  {

    struct Base
    {
      virtual ~Base() {}
      virtual void f() {}
    };

    struct Derived : public Base
    {
      virtual ~Derived() override {}
      virtual void f() override {}
    };

  }

  namespace test_double_right_angle_brackets
  {

    template < typename T >
    struct check {};

    typedef check<void> single_type;
    typedef check<check<void>> double_type;
    typedef check<check<check<void>>> triple_type;
    typedef check<check<check<check<void>>>> quadruple_type;

  }

  namespace test_decltype
  {

    int
    f()
    {
      int a = 1;
      decltype(a) b = 2;
      return a + b;
    }

  }

  namespace test_type_deduction
  {

    template < typename T1, typename T2 >
    struct is_same
    {
      static const bool value = false;
    };

    template < typename T >
    struct is_same<T, T>
    {
      static const bool value = true;
    };

    template < typename T1, typename T2 >
    auto
    add(T1 a1, T2 a2) -> decltype(a1 + a2)
    {
      return a1 + a2;
    }

    int
    test(const int c, volatile int v)
    {
      static_assert(is_same<int, decltype(0)>::value == true, "");
      static_assert(is_same<int, decltype(c)>::value == false, "");
      static_assert(is_same<int, decltype(v)>::value == false, "");
      auto ac = c;
      auto av = v;
      auto sumi = ac + av + 'x';
      auto sumf = ac + av + 1.0;
      static_assert(is_same<int, decltype(ac)>::value == true, "");
      static_assert(is_same<int, decltype(av)>::value == true, "");
      static_assert(is_same<int, decltype(sumi)>::value == true, "");
      static_assert(is_same<int, decltype(sumf)>::value == false, "");
      static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
      return (sumf > 0.0) ? sumi : add(c, v);
    }

  }

  namespace test_noexcept
  {

    int f() { return 0; }
    int g() noexcept { return 0; }

    static_assert(noexcept(f()) == false, "");
    static_assert(noexcept(g()) == true, "");

  }

  namespace test_constexpr
  {

    template < typename CharT >
    unsigned long constexpr
    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
    {
      return *s ? strlen_c_r(s + 1, acc + 1) : acc;
    }

    template < typename CharT >
    unsigned long constexpr
    strlen_c(const CharT *const s) noexcept
    {
      return strlen_c_r(s, 0UL);
    }

    static_assert(strlen_c("") == 0UL, "");
    static_assert(strlen_c("1") == 1UL, "");
    static_assert(strlen_c("example") == 7UL, "");
    static_assert(strlen_c("another\0example") == 7UL, "");

  }

  namespace test_rvalue_references
  {

    template < int N >
    struct answer
    {
      static constexpr int value = N;
    };

    answer<1> f(int&)       { return answer<1>(); }
    answer<2> f(const int&) { return answer<2>(); }
    answer<3> f(int&&)      { return answer<3>(); }

    void
    test()
    {
      int i = 0;
      const int c = 0;
      static_assert(decltype(f(i))::value == 1, "");
      static_assert(decltype(f(c))::value == 2, "");
      static_assert(decltype(f(0))::value == 3, "");
    }

  }

  namespace test_uniform_initialization
  {

    struct test
    {
      static const int zero {};
      static const int one {1};
    };

    static_assert(test::zero == 0, "");
    static_assert(test::one == 1, "");

  }

  namespace test_lambdas
  {

    void
    test1()
    {
      auto lambda1 = [](){};
      auto lambda2 = lambda1;
      lambda1();
      lambda2();
    }

    int
    test2()
    {
      auto a = [](int i, int j){ return i + j; }(1, 2);
      auto b = []() -> int { return '0'; }();
      auto c = [=](){ return a + b; }();
      auto d = [&](){ return c; }();
      auto e = [a, &b](int x) mutable {
        const auto identity = [](int y){ return y; };
        for (auto i = 0; i < a; ++i)
          a += b--;
        return x + identity(a + b);
      }(0);
      return a + b + c + d + e;
    }

    int
    test3()
    {
      const auto nullary = [](){ return 0; };
      const auto unary = [](int x){ return x; };
      using nullary_t = decltype(nullary);
      using unary_t = decltype(unary);
      const auto higher1st = [](nullary_t f){ return f(); };
      const auto higher2nd = [unary](nullary_t f1){
        return [unary, f1](unary_t f2){ return f2(unary(f1())); };
      };
      return higher1st(nullary) + higher2nd(nullary)(unary);
    }

  }

  namespace test_variadic_templates
  {

    template <int...>
    struct sum;

    template <int N0, int... N1toN>
    struct sum<N0, N1toN...>
    {
      static constexpr auto value = N0 + sum<N1toN...>::value;
    };

    template <>
    struct sum<>
    {
      static constexpr auto value = 0;
    };

    static_assert(sum<>::value == 0, "");
    static_assert(sum<1>::value == 1, "");
    static_assert(sum<23>::value == 23, "");
    static_assert(sum<1, 2>::value == 3, "");
    static_assert(sum<5, 5, 11>::value == 21, "");
    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");

  }

  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
  // because of this.
  namespace test_template_alias_sfinae
  {

    struct foo {};

    template<typename T>
    using member = typename T::member_type;

    template<typename T>
    void func(...) {}

    template<typename T>
    void func(member<T>*) {}

    void test();

    void test() { func<foo>(0); }

  }

}  // namespace cxx11

#endif  // __cplusplus >= 201103L

]])


dnl  Tests for new features in C++14

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[

// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201402L

#error "This is not a C++14 compiler"

#else

namespace cxx14
{

  namespace test_polymorphic_lambdas
  {

    int
    test()
    {
      const auto lambda = [](auto&&... args){
        const auto istiny = [](auto x){
          return (sizeof(x) == 1UL) ? 1 : 0;
        };
        const int aretiny[] = { istiny(args)... };
        return aretiny[0];
      };
      return lambda(1, 1L, 1.0f, '1');
    }

  }

  namespace test_binary_literals
  {

    constexpr auto ivii = 0b0000000000101010;
    static_assert(ivii == 42, "wrong value");

  }

  namespace test_generalized_constexpr
  {

    template < typename CharT >
    constexpr unsigned long
    strlen_c(const CharT *const s) noexcept
    {
      auto length = 0UL;
      for (auto p = s; *p; ++p)
        ++length;
      return length;
    }

    static_assert(strlen_c("") == 0UL, "");
    static_assert(strlen_c("x") == 1UL, "");
    static_assert(strlen_c("test") == 4UL, "");
    static_assert(strlen_c("another\0test") == 7UL, "");

  }

  namespace test_lambda_init_capture
  {

    int
    test()
    {
      auto x = 0;
      const auto lambda1 = [a = x](int b){ return a + b; };
      const auto lambda2 = [a = lambda1(x)](){ return a; };
      return lambda2();
    }

  }

  namespace test_digit_separators
  {

    constexpr auto ten_million = 100'000'000;
    static_assert(ten_million == 100000000, "");

  }

  namespace test_return_type_deduction
  {

    auto f(int& x) { return x; }
    decltype(auto) g(int& x) { return x; }

    template < typename T1, typename T2 >
    struct is_same
    {
      static constexpr auto value = false;
    };

    template < typename T >
    struct is_same<T, T>
    {
      static constexpr auto value = true;
    };

    int
    test()
    {
      auto x = 0;
      static_assert(is_same<int, decltype(f(x))>::value, "");
      static_assert(is_same<int&, decltype(g(x))>::value, "");
      return x;
    }

  }

}  // namespace cxx14

#endif  // __cplusplus >= 201402L

]])


dnl  Tests for new features in C++17

m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[

// If the compiler admits that it is not ready for C++17, why torture it?
// Hopefully, this will speed up the test.

#ifndef __cplusplus

#error "This is not a C++ compiler"

#elif __cplusplus < 201703L

#error "This is not a C++17 compiler"

#else

#include <initializer_list>
#include <utility>
#include <type_traits>

namespace cxx17
{

  namespace test_constexpr_lambdas
  {

    constexpr int foo = [](){return 42;}();

  }

  namespace test::nested_namespace::definitions
  {

  }

  namespace test_fold_expression
  {

    template<typename... Args>
    int multiply(Args... args)
    {
      return (args * ... * 1);
    }

    template<typename... Args>
    bool all(Args... args)
    {
      return (args && ...);
    }

  }

  namespace test_extended_static_assert
  {

    static_assert (true);

  }

  namespace test_auto_brace_init_list
  {

    auto foo = {5};
    auto bar {5};

    static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
    static_assert(std::is_same<int, decltype(bar)>::value);
  }

  namespace test_typename_in_template_template_parameter
  {

    template<template<typename> typename X> struct D;

  }

  namespace test_fallthrough_nodiscard_maybe_unused_attributes
  {

    int f1()
    {
      return 42;
    }

    [[nodiscard]] int f2()
    {
      [[maybe_unused]] auto unused = f1();

      switch (f1())
      {
      case 17:
        f1();
        [[fallthrough]];
      case 42:
        f1();
      }
      return f1();
    }

  }

  namespace test_extended_aggregate_initialization
  {

    struct base1
    {
      int b1, b2 = 42;
    };

    struct base2
    {
      base2() {
        b3 = 42;
      }
      int b3;
    };

    struct derived : base1, base2
    {
        int d;
    };

    derived d1 {{1, 2}, {}, 4};  // full initialization
    derived d2 {{}, {}, 4};      // value-initialized bases

  }

  namespace test_general_range_based_for_loop
  {

    struct iter
    {
      int i;

      int& operator* ()
      {
        return i;
      }

      const int& operator* () const
      {
        return i;
      }

      iter& operator++()
      {
        ++i;
        return *this;
      }
    };

    struct sentinel
    {
      int i;
    };

    bool operator== (const iter& i, const sentinel& s)
    {
      return i.i == s.i;
    }

    bool operator!= (const iter& i, const sentinel& s)
    {
      return !(i == s);
    }

    struct range
    {
      iter begin() const
      {
        return {0};
      }

      sentinel end() const
      {
        return {5};
      }
    };

    void f()
    {
      range r {};

      for (auto i : r)
      {
        [[maybe_unused]] auto v = i;
      }
    }

  }

  namespace test_lambda_capture_asterisk_this_by_value
  {

    struct t
    {
      int i;
      int foo()
      {
        return [*this]()
        {
          return i;
        }();
      }
    };

  }

  namespace test_enum_class_construction
  {

    enum class byte : unsigned char
    {};

    byte foo {42};

  }

  namespace test_constexpr_if
  {

    template <bool cond>
    int f ()
    {
      if constexpr(cond)
      {
        return 13;
      }
      else
      {
        return 42;
      }
    }

  }

  namespace test_selection_statement_with_initializer
  {

    int f()
    {
      return 13;
    }

    int f2()
    {
      if (auto i = f(); i > 0)
      {
        return 3;
      }

      switch (auto i = f(); i + 4)
      {
      case 17:
        return 2;

      default:
        return 1;
      }
    }

  }

  namespace test_template_argument_deduction_for_class_templates
  {

    template <typename T1, typename T2>
    struct pair
    {
      pair (T1 p1, T2 p2)
        : m1 {p1},
          m2 {p2}
      {}

      T1 m1;
      T2 m2;
    };

    void f()
    {
      [[maybe_unused]] auto p = pair{13, 42u};
    }

  }

  namespace test_non_type_auto_template_parameters
  {

    template <auto n>
    struct B
    {};

    B<5> b1;
    B<'a'> b2;

  }

  namespace test_structured_bindings
  {

    int arr[2] = { 1, 2 };
    std::pair<int, int> pr = { 1, 2 };

    auto f1() -> int(&)[2]
    {
      return arr;
    }

    auto f2() -> std::pair<int, int>&
    {
      return pr;
    }

    struct S
    {
      int x1 : 2;
      volatile double y1;
    };

    S f3()
    {
      return {};
    }

    auto [ x1, y1 ] = f1();
    auto& [ xr1, yr1 ] = f1();
    auto [ x2, y2 ] = f2();
    auto& [ xr2, yr2 ] = f2();
    const auto [ x3, y3 ] = f3();

  }

  namespace test_exception_spec_type_system
  {

    struct Good {};
    struct Bad {};

    void g1() noexcept;
    void g2();

    template<typename T>
    Bad
    f(T*, T*);

    template<typename T1, typename T2>
    Good
    f(T1*, T2*);

    static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);

  }

  namespace test_inline_variables
  {

    template<class T> void f(T)
    {}

    template<class T> inline T g(T)
    {
      return T{};
    }

    template<> inline void f<>(int)
    {}

    template<> int g<>(int)
    {
      return 5;
    }

  }

}  // namespace cxx17

#endif  // __cplusplus < 201703L

]])

m4/ax_cxx_compile_stdcxx_17.m4

deleted100644 → 0
+0 −35
Original line number Original line Diff line number Diff line
# =============================================================================
#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html
# =============================================================================
#
# SYNOPSIS
#
#   AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
#   Check for baseline language coverage in the compiler for the C++17
#   standard; if necessary, add switches to CXX and CXXCPP to enable
#   support.
#
#   This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
#   macro with the version set to C++17.  The two optional arguments are
#   forwarded literally as the second and third argument respectively.
#   Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
#   more information.  If you want to use this macro, you also need to
#   download the ax_cxx_compile_stdcxx.m4 file.
#
# LICENSE
#
#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
#   Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 2

AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])

m4/ax_latex_class.m4

deleted100644 → 0
+0 −68
Original line number Original line Diff line number Diff line
# ===========================================================================
#         http://www.nongnu.org/autoconf-archive/ax_latex_class.html
# ===========================================================================
#
# OBSOLETE MACRO
#
#   Deprecated because of licensing issues. The Lesser GPL imposes licensing
#   restrictions on the generated configure script unless it is augmented
#   with an Autoconf Exception clause.
#
# SYNOPSIS
#
#   AX_LATEX_CLASS(CLASSNAME,VARIABLETOSET[,ACTION-IF-FOUND[,ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
#   This macros test is class CLASSNAME exists and work and set
#   VARIABLETOSET to yes or no If ACTION-IF-FOUND (and ACTION-IF-NOT-FOUND)
#   are set, do the correct action
#
# LICENSE
#
#   Copyright © 2008 Boretti Mathieu <boretti@eig.unige.ch>
#   Copyright © 2009 Dynare Team
#
#   This library is free software; you can redistribute it and/or modify it
#   under the terms of the GNU Lesser General Public License as published by
#   the Free Software Foundation; either version 2.1 of the License, or (at
#   your option) any later version.
#
#   This library 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 Lesser
#   General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public License
#   along with this library. If not, see <http://www.gnu.org/licenses/>.

AC_DEFUN([AX_LATEX_CLASS],[
AC_CACHE_CHECK([for usability of class $1],[ac_cv_latex_class_]translit($1,[-],[_]),[
AX_LATEX_TEST([\documentclass{$1}
\begin{document}
\end{document}],[ac_cv_latex_class_]translit($1,[-],[_]))
])
$2=$[ac_cv_latex_class_]translit($1,[-],[_]) ; export $2;
AC_SUBST($2)
ifelse($#,2,[],$#,3,[
    if test "[$]$2" = "yes" ;
    then
        $3
    fi
],$#,4,[
    ifelse($3,[],[
        if test "[$]$2" = "no" ;
        then
            $4
        fi
    ],[
        if test "[$]$2" = "yes" ;
        then
            $3
        else
            $4
        fi
    ])
])

])

m4/ax_latex_test.m4

deleted100644 → 0
+0 −56
Original line number Original line Diff line number Diff line
# ===========================================================================
#          http://www.nongnu.org/autoconf-archive/ax_latex_test.html
# ===========================================================================
#
# OBSOLETE MACRO
#
#   Deprecated because of licensing issues. The Lesser GPL imposes licensing
#   restrictions on the generated configure script unless it is augmented
#   with an Autoconf Exception clause.
#
# SYNOPSIS
#
#   AX_LATEX_TEST(FILEDATA,VARIABLETOSET,[NOCLEAN])
#
# DESCRIPTION
#
#   This macros execute the latex application with FILEDATA as input and set
#   VARIABLETOSET the yes or no depending of the result if NOCLEAN is set,
#   the folder used for the test is not delete after testing.
#
#   The macro assumes that the variable PDFLATEX is set.
#
# LICENSE
#
#   Copyright © 2008 Boretti Mathieu <boretti@eig.unige.ch>
#   Copyright © 2009 Dynare Team
#
#   This library is free software; you can redistribute it and/or modify it
#   under the terms of the GNU Lesser General Public License as published by
#   the Free Software Foundation; either version 2.1 of the License, or (at
#   your option) any later version.
#
#   This library 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 Lesser
#   General Public License for more details.
#
#   You should have received a copy of the GNU Lesser General Public License
#   along with this library. If not, see <http://www.gnu.org/licenses/>.

AC_DEFUN([AX_LATEX_TEST],[
rm -rf conftest.dir/.acltx
AS_MKDIR_P([conftest.dir/.acltx])
cd conftest.dir/.acltx
m4_ifval([$2],[$2="no"; export $2;])
cat > conftest.tex << ACLEOF
$1
ACLEOF
cat conftest.tex | $PDFLATEX 2>&1 1>output m4_ifval([$2],[&& $2=yes])
cd ..
cd ..
sed 's/^/| /' conftest.dir/.acltx/conftest.tex >&5
echo "$as_me:$LINENO: executing cat conftest.tex | $PDFLATEX" >&5
sed 's/^/| /' conftest.dir/.acltx/output >&5
m4_ifval([$3],,[rm -rf conftest.dir/.acltx])
])

meson.build

0 → 100644
+19 −0
Original line number Original line Diff line number Diff line
# Meson file for building the preprocessor in a standalone fashion.
# It is not used when building Dynare as a whole.

project('dynare-preprocessor', 'cpp',
        version : '7-unstable',
        # NB: update C++ standard in .clang-format whenever the following is modified
        default_options : [ 'cpp_std=gnu++20', 'warning_level=2' ],
        meson_version : '>=0.64.0')

add_global_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', language : 'cpp')

if get_option('warning_level').to_int() >= 2
  add_global_arguments('-Wold-style-cast', language : 'cpp')
endif

cpp_compiler = meson.get_compiler('cpp')

subdir('src')
subdir('doc')
+10 −0
Original line number Original line Diff line number Diff line
# Meson native file for compiling under Homebrew / arm64

[binaries]
cpp = '/opt/homebrew/bin/g++-15'
flex = '/opt/homebrew/opt/flex/bin/flex'
bison = '/opt/homebrew/opt/bison/bin/bison'

[built-in options]
# XCode 15 (on Ventura and Sonoma) has a linker issue, see https://github.com/mesonbuild/meson/issues/12282, workaround is to use ld_classic
cpp_link_args = [ '-Wl,-ld_classic' ]
 No newline at end of file
+10 −0
Original line number Original line Diff line number Diff line
# Meson native file for compiling under Homebrew / x86-64

[binaries]
cpp = '/usr/local/bin/g++-15'
flex = '/usr/local/opt/flex/bin/flex'
bison = '/usr/local/opt/bison/bin/bison'

[built-in options]
# XCode 15 (on Ventura and Sonoma) has a linker issue, see https://github.com/mesonbuild/meson/issues/12282, workaround is to use ld_classic
cpp_link_args = [ '-Wl,-ld_classic' ]
 No newline at end of file
+11 −0
Original line number Original line Diff line number Diff line
# Meson cross file for targeting Linux arm64

[binaries]
cpp = 'aarch64-linux-gnu-g++'
strip = 'aarch64-linux-gnu-strip'

[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

scripts/wasm.ini

0 → 100644
+44 −0
Original line number Original line Diff line number Diff line
# Meson cross file for creating a WebAssembly version of the preprocessor.
#
# Requires emscripten to be installed.
# Was successfully tested with emscripten 3.1.69 installed through emsdk
# tool, as described on: https://emscripten.org/docs/getting_started/downloads.html
# Don’t forget to source script snippet in current shell before running meson.
#
# Compilation creates a .wasm and .js wrapper under <builddir>/src/
#
# Can be run locally with node.js using:
#  node dynare-preprocessor.js file.mod
# NB: a version of node.js is shipped with emscripten (under the node/
# subdirectory), but another version should also work.

[binaries]
cpp = 'em++'

[host_machine]
system = 'emscripten'
# Could be changed to wasm64 if 4GB memory constraint is hit
# Some background: https://v8.dev/blog/4gb-wasm-memory
cpu_family = 'wasm32'
cpu = 'wasm32'
endian = 'little'

[built-in options]
# Never do a debug build, because otherwise the lack of optimisations can
# overflow the memory capacities.
buildtype = 'release'
# The -fexceptions flag (for both compilation and linking) is needed for an
# unknown reason (C++ compilers are supposed to always add exception support).
# The -Wno-unqualified-std-cast-call flag removes many warnings about “move”
# not being qualified with “std::” namespace.
# The -fexperimental-library flag is needed to get std::jthread support (it was
# supposed to no longer be necessary for LLVM 20, but for some reason we still
# need it).
cpp_args = [ '-fexceptions', '-Wno-unqualified-std-cast-call', '-fexperimental-library' ]
# NODERAWFS=1 is needed for accessing the local filesystem
cpp_link_args = [ '-s', 'NODERAWFS=1', '-fexceptions' ]

[properties]
# It’s necessary to use a different copy of Boost than the one under
# /usr/include, because otherwise GCC headers confuse Clang
boost_root = '/tmp/boost_1_86_0'
+22 −0
Original line number Original line Diff line number Diff line
# Meson cross file for targeting Windows from Linux
# NB: The boost_root property must be set, possibly through a second cross file

[binaries]
cpp = 'x86_64-w64-mingw32-g++-posix'
strip = 'x86_64-w64-mingw32-strip'

[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

[built-in options]
prefer_static = true 

# See the comments in the main Dynare Meson cross-file
cpp_args = [ '-fstack-protector', '-march=nocona', '-msahf', '-mtune=generic' ]
cpp_link_args = [ '-fstack-protector' ]

#[properties]
#boost_root = '/home/sebastien/dynare/unstable/preprocessor/deps/mingw64/'

src/Bytecode.cc

0 → 100644
+106 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright © 2022-2024 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/>.
 */

#include <algorithm>
#include <cstdlib>
#include <ios>
#include <iostream>

#include "Bytecode.hh"

namespace Bytecode
{

Writer::Writer(const filesystem::path& filename)
{
  open(filename, ios::out | ios::binary);
  if (!is_open())
    {
      cerr << R"(Error : Can't open file ")" << filename.string() << R"(" for writing)" << endl;
      exit(EXIT_FAILURE);
    }
}

template<>
Writer&
operator<<(Writer& code_file, const FCALL& instr)
{
  code_file.instructions_positions.push_back(code_file.tellp());

  auto write_member = [&code_file](const auto& member) {
    code_file.write(reinterpret_cast<const char*>(&member), sizeof member);
  };

  write_member(instr.tag);
  write_member(instr.nb_output_arguments);
  write_member(instr.nb_input_arguments);
  write_member(instr.indx);
  write_member(instr.add_input_arguments);
  write_member(instr.row);
  write_member(instr.col);
  write_member(instr.call_type);

  int size = static_cast<int>(instr.func_name.size());
  write_member(size);
  code_file.write(instr.func_name.c_str(), size + 1);

  size = static_cast<int>(instr.arg_func_name.size());
  write_member(size);
  code_file.write(instr.arg_func_name.c_str(), size + 1);

  return code_file;
}

template<>
Writer&
operator<<(Writer& code_file, const FBEGINBLOCK& instr)
{
  code_file.instructions_positions.push_back(code_file.tellp());

  auto write_member = [&code_file](const auto& member) {
    code_file.write(reinterpret_cast<const char*>(&member), sizeof member);
  };

  write_member(instr.tag);
  write_member(instr.size);
  write_member(instr.type);
  for (int i = 0; i < instr.size; i++)
    {
      write_member(instr.variables[i]);
      write_member(instr.equations[i]);
    }
  if (instr.type == BlockSimulationType::solveTwoBoundariesSimple
      || instr.type == BlockSimulationType::solveTwoBoundariesComplete
      || instr.type == BlockSimulationType::solveBackwardComplete
      || instr.type == BlockSimulationType::solveForwardComplete)
    {
      write_member(instr.is_linear);
      write_member(instr.u_count_int);
    }
  write_member(instr.nb_col_jacob);
  write_member(instr.det_exo_size);
  write_member(instr.exo_size);

  ranges::for_each_n(instr.det_exogenous.begin(), instr.det_exo_size, write_member);
  ranges::for_each_n(instr.exogenous.begin(), instr.exo_size, write_member);

  return code_file;
}

}

src/Bytecode.hh

0 → 100644
+814 −0

File added.

Preview size limit exceeded, changes collapsed.

src/CodeInterpreter.hh

deleted100644 → 0
+0 −2041

File deleted.

Preview size limit exceeded, changes collapsed.

src/CommonEnums.hh

0 → 100644
+165 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright © 2007-2024 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/>.
 */

#ifndef COMMON_ENUMS_HH
#define COMMON_ENUMS_HH

//! Enumeration of possible symbol types
/*! Warning: do not to change existing values for 0 to 4: the values matter for homotopy_setup
 * command */
enum class SymbolType
{
  endogenous = 0,              // Endogenous (non-heterogeneous)
  exogenous = 1,               // Exogenous (non-heterogeneous)
  exogenousDet = 2,            // Exogenous deterministic (non-heterogeneous)
  parameter = 4,               // Parameter (non-heterogeneous)
  heterogeneousEndogenous = 5, // Endogenous that is heterogeneous across some dimension
  heterogeneousExogenous = 6,  // Exogenous that is heterogeneous across some dimension
  heterogeneousParameter = 7,  // Parameter that is heterogeneous across some dimension
  modelLocalVariable = 10,     // Local variable whose scope is model (pound expression)
  modFileLocalVariable = 11,   // Local variable whose scope is mod file (model excluded)
  externalFunction = 12,       // External (user-defined) function
  trend = 13,                  // Trend variable
  statementDeclaredVariable
  = 14, //!< Local variable assigned within a Statement (see subsample statement for example)
  logTrend = 15, //!< Log-trend variable
  unusedEndogenous
  = 16, //!< Type to mark unused endogenous variables when `nostrict` option is passed

  // Value 17 is unused for the time being (but could be reused)

  epilogue = 18,        //!< Variables created in epilogue block
  excludedVariable = 19 //!< Variable excluded via model_remove/var_remove/include_eqs/exclude_eqs
};

constexpr bool
isHeterogeneous(SymbolType type)
{
  return type == SymbolType::heterogeneousEndogenous || type == SymbolType::heterogeneousExogenous
         || type == SymbolType::heterogeneousParameter;
}

enum class UnaryOpcode
{
  uminus,
  exp,
  log,
  log10,
  cos,
  sin,
  tan,
  acos,
  asin,
  atan,
  cosh,
  sinh,
  tanh,
  acosh,
  asinh,
  atanh,
  sqrt,
  cbrt,
  abs,
  sign,
  steadyState,
  steadyStateParamDeriv,    // for the derivative of the STEADY_STATE operator w.r.t. to a parameter
  steadyStateParam2ndDeriv, // for the 2nd derivative of the STEADY_STATE operator w.r.t. to a
                            // parameter
  expectation,
  erf,
  erfc,
  diff,
  adl,
  sum
};

enum class BinaryOpcode
{
  plus,
  minus,
  times,
  divide,
  power,
  powerDeriv, // for the derivative of the power function (see trac ticket #78)
  equal,
  max,
  min,
  less,
  greater,
  lessEqual,
  greaterEqual,
  equalEqual,
  different
};

// Small number value used when evaluating powerDeriv opcodes.
// Put here instead of inside BinaryOpNode class, because needed by bytecode MEX.
constexpr double power_deriv_near_zero {1e-12};

enum class TrinaryOpcode
{
  normcdf,
  normpdf
};

enum class PriorDistributions
{
  noShape = 0,
  beta = 1,
  gamma = 2,
  normal = 3,
  invGamma = 4,
  invGamma1 = 4,
  uniform = 5,
  invGamma2 = 6,
  dirichlet = 7,
  weibull = 8
};

enum class EquationType
{
  evaluate, //!< Simple evaluation, normalized variable on left-hand side (written as such by the
            //!< user)
  evaluateRenormalized, //!< Simple evaluation, normalized variable on left-hand side (normalization
                        //!< computed by the preprocessor)
  solve                 //!< No simple evaluation of the equation, it has to be solved
};

enum class BlockSimulationType
{
  evaluateForward = 1,       //!< Simple evaluation, normalized variable on left-hand side, forward
  evaluateBackward,          //!< Simple evaluation, normalized variable on left-hand side, backward
  solveForwardSimple,        //!< Block of one equation, newton solver needed, forward
  solveBackwardSimple,       //!< Block of one equation, newton solver needed, backward
  solveTwoBoundariesSimple,  //!< Block of one equation, Newton solver needed, forward and backward
  solveForwardComplete,      //!< Block of several equations, Newton solver needed, forward
  solveBackwardComplete,     //!< Block of several equations, Newton solver needed, backward
  solveTwoBoundariesComplete //!< Block of several equations, Newton solver needed, forward and
                             //!< backwar
};

enum class PacTargetKind
{
  unspecified, // Must be the first one, because it’s the default initializer
  ll,
  dl,
  dd
};

#endif
+2648 −2050

File changed.

Preview size limit exceeded, changes collapsed.

+663 −526

File changed.

Preview size limit exceeded, changes collapsed.

src/ConfigFile.hh

deleted100644 → 0
+0 −142
Original line number Original line Diff line number Diff line
/*
 * Copyright © 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;

using member_nodes_t = map<string, double>;

class Hook
{
public:
  explicit Hook(string global_init_file_arg);
private:
  map<string, string> hooks;
public:
  inline map<string, string>
  get_hooks() const
  {
    return hooks;
  };
};

class Path
{
public:
  explicit Path(vector<string> includepath_arg);
private:
  map<string, vector<string>> paths;
public:
  inline map<string, vector<string>>
  get_paths() const
  {
    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);

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:
  explicit Cluster(member_nodes_t member_nodes_arg);

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, string cluster_name);

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, const member_nodes_t &member_nodes, const string &name,
                                  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, bool singleCompThread, int numberOfThreadsPerJob,
                                  const 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<filesystem::path> 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

src/Configuration.hh

0 → 100644
+126 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright © 2010-2023 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/>.
 */

#ifndef CONFIGURATION_HH
#define CONFIGURATION_HH

#include <filesystem>
#include <map>
#include <vector>

#include "WarningConsolidation.hh"

using namespace std;

/* The abstract representation of the configuration.
   Merges information from the command-line and from the configuration file. */
class Configuration
{
public:
  Configuration(bool parallel_arg, bool parallel_test_arg, bool parallel_follower_open_mode_arg,
                bool parallel_use_psexec_arg, string cluster_name);

private:
  using member_nodes_t = map<string, double>;

  class Path
  {
  public:
    explicit Path(vector<string> includepath_arg);
    [[nodiscard]] map<string, vector<string>>
    get_paths() const
    {
      return paths;
    }

  private:
    map<string, vector<string>> paths;
  };

  struct FollowerNode
  {
    FollowerNode(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 programPath_arg, string programConfig_arg,
                 string matlabOctavePath_arg, bool singleCompThread_arg,
                 int numberOfThreadsPerJob_arg, string operatingSystem_arg);
    const string computerName, port;
    int minCpuNbr, maxCpuNbr;
    const string userName, password;
    const string remoteDrive, remoteDirectory;
    const string programPath, programConfig, matlabOctavePath;
    const bool singleCompThread;
    const int numberOfThreadsPerJob;
    const string operatingSystem;
  };

  struct Cluster
  {
    explicit Cluster(member_nodes_t member_nodes_arg);
    member_nodes_t member_nodes;
  };

  const bool parallel, parallel_test, parallel_follower_open_mode, parallel_use_psexec;
  const string cluster_name;
  string firstClusterName;
  //! Hooks
  string global_init_file;
  //! Paths
  vector<Path> paths;
  //! Cluster Table
  map<string, Cluster> clusters;
  //! Node Map
  map<string, FollowerNode> follower_nodes;
  //! Add Paths
  void addPathsConfFileElement(vector<string> includepath);
  //! Add a FollowerNode or a Cluster object
  void addParallelConfFileElement(bool inNode, bool inCluster, const member_nodes_t& member_nodes,
                                  const string& name, const string& computerName,
                                  const string& port, int minCpuNbr, int maxCpuNbr,
                                  const string& userName, const string& password,
                                  const string& remoteDrive, const string& remoteDirectory,
                                  const string& programPath, const string& programConfig,
                                  const string& matlabOctavePath, bool singleCompThread,
                                  int numberOfThreadsPerJob, const string& operatingSystem);
  /* Given a filename (e.g. dynare.ini), looks for it in the configuration directory:
     – if under Linux or macOS, look into the “dynare” subdirectory of the XDG
       configuration directories (following the default values and the precedence order specified in
       the XDG specification)
     – if under Windows, look into %APPDATA%\dynare\
     The returned path will be empty if the file is not found. */
  [[nodiscard]] static filesystem::path findConfigFile(const string& filename);

public:
  //! Parse config file
  void getConfigFileInfo(const filesystem::path& conffile_option, WarningConsolidation& warnings);
  //! Check Pass
  void checkPass(WarningConsolidation& warnings) const;
  //! Check Pass
  void transformPass();
  //! Get Path Info
  [[nodiscard]] vector<filesystem::path> getIncludePaths() const;
  //! Write any hooks
  void writeHooks(ostream& output) const;
  //! Create options_.parallel structure, write options
  void writeCluster(ostream& output) const;
  //! Close follower nodes if needed
  void writeEndParallel(ostream& output) const;
};

#endif
+391 −293

File changed.

Preview size limit exceeded, changes collapsed.

+200 −134

File changed.

Preview size limit exceeded, changes collapsed.

+2824 −5794

File changed.

Preview size limit exceeded, changes collapsed.

+713 −506

File changed.

Preview size limit exceeded, changes collapsed.

+1904 −1163

File changed.

Preview size limit exceeded, changes collapsed.

+297 −161

File changed.

Preview size limit exceeded, changes collapsed.

+203 −103

File changed.

Preview size limit exceeded, changes collapsed.

src/DynareMain2.cc

deleted100644 → 0
+0 −77

File deleted.

Preview size limit exceeded, changes collapsed.

src/EquationTags.cc

0 → 100644
+149 −0

File added.

Preview size limit exceeded, changes collapsed.

src/EquationTags.hh

0 → 100644
+125 −0

File added.

Preview size limit exceeded, changes collapsed.

+3896 −3874

File changed.

Preview size limit exceeded, changes collapsed.

+1860 −1345

File changed.

Preview size limit exceeded, changes collapsed.

Original line number Original line Diff line number Diff line
/*
/*
 * Copyright © 2014-2019 Dynare Team
 * Copyright © 2014-2023 Dynare Team
 *
 *
 * This file is part of Dynare.
 * This file is part of Dynare.
 *
 *
@@ -14,24 +14,25 @@
 * GNU General Public License for more details.
 * GNU General Public License for more details.
 *
 *
 * You should have received a copy of the GNU General Public License
 * You should have received a copy of the GNU General Public License
 * along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 * along with Dynare.  If not, see <https://www.gnu.org/licenses/>.
 */
 */


#ifndef _EXTENDED_PREPROCESSOR_TYPES_HH
#ifndef EXTENDED_PREPROCESSOR_TYPES_HH
#define _EXTENDED_PREPROCESSOR_TYPES_HH
#define EXTENDED_PREPROCESSOR_TYPES_HH


enum class FileOutputType
// Values for the “output” option
enum class OutputType
{
{
    none,                             // outputs files for Matlab/Octave processing
  standard, // Default value, infer the derivation order from .mod file only
    dynamic,                          // outputs <fname>_dynamic.* and related files
  first,    // Output only 1st dynamic derivatives with no other computations
    first,                            // outputs <fname>_first_derivatives.* and related files
  second,   // Output at least 2nd dynamic derivatives
    second,                           // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.* and related files
  third,    // Output at least 3rd dynamic derivatives
    third,                            // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.*, <fname>_third_derivatives.*  and related files
};
};


// Values for the “language” option
enum class LanguageOutputType
enum class LanguageOutputType
{
{
    matlab,                           // outputs files for Matlab/Octave processing
  matlab, // outputs files for MATLAB/Octave processing
  julia,  // outputs files for Julia
  julia,  // outputs files for Julia
};
};


@@ -41,6 +42,7 @@ enum class JsonFileOutputType
  standardout, // output JSON files to stdout
  standardout, // output JSON files to stdout
};
};


// Values for the “json” option
enum class JsonOutputPointType
enum class JsonOutputPointType
{
{
  nojson,        // don't output JSON
  nojson,        // don't output JSON
@@ -49,4 +51,5 @@ enum class JsonOutputPointType
  transformpass, // output JSON after the transform pass
  transformpass, // output JSON after the transform pass
  computingpass  // output JSON after the computing pass
  computingpass  // output JSON after the computing pass
};
};

#endif
#endif

src/Makefile.am

deleted100644 → 0
+0 −97

File deleted.

Preview size limit exceeded, changes collapsed.

src/MinimumFeedbackSet.cc

deleted100644 → 0
+0 −459

File deleted.

Preview size limit exceeded, changes collapsed.

src/MinimumFeedbackSet.hh

deleted100644 → 0
+0 −87

File deleted.

Preview size limit exceeded, changes collapsed.

+854 −718

File changed.

Preview size limit exceeded, changes collapsed.

+84 −59

File changed.

Preview size limit exceeded, changes collapsed.

+1382 −1707

File changed.

Preview size limit exceeded, changes collapsed.

+3033 −271

File changed.

Preview size limit exceeded, changes collapsed.

+1871 −1271

File changed.

Preview size limit exceeded, changes collapsed.

+422 −356

File changed.

Preview size limit exceeded, changes collapsed.

+837 −285

File changed.

Preview size limit exceeded, changes collapsed.

+221 −66

File changed.

Preview size limit exceeded, changes collapsed.

src/SigmaeInitialization.cc

deleted100644 → 0
+0 −100

File deleted.

Preview size limit exceeded, changes collapsed.

+262 −239

File changed.

Preview size limit exceeded, changes collapsed.

+226 −90

File changed.

Preview size limit exceeded, changes collapsed.

+523 −2779

File changed.

Preview size limit exceeded, changes collapsed.

+286 −276

File changed.

Preview size limit exceeded, changes collapsed.

+1391 −268

File changed.

Preview size limit exceeded, changes collapsed.

+248 −74

File changed.

Preview size limit exceeded, changes collapsed.

+110 −29

File changed.

Preview size limit exceeded, changes collapsed.

+27 −26

File changed.

Preview size limit exceeded, changes collapsed.

+580 −428

File changed.

Preview size limit exceeded, changes collapsed.

+328 −203

File changed.

Preview size limit exceeded, changes collapsed.

File changed.

Preview size limit exceeded, changes collapsed.

File changed.

Preview size limit exceeded, changes collapsed.

src/macro/Makefile.am

deleted100644 → 0
+0 −34

File deleted.

Preview size limit exceeded, changes collapsed.

+145 −132

File changed.

Preview size limit exceeded, changes collapsed.

src/meson.build

0 → 100644
+77 −0

File added.

Preview size limit exceeded, changes collapsed.