Skip to content
Snippets Groups Projects
Verified Commit b0a7826c authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Dynare++ / sylvester equation solver: first batch of modernizations

parent 2666a4ce
No related branches found
No related tags found
No related merge requests found
Pipeline #581 passed
Showing
with 96 additions and 182 deletions
Loading
  • Developer

    @sebastien I get this error compiling on mac. not sure if it is my problem or perhaps related to your last commit? I made all sorts of make distclean without success.

    Making all in dynare++
    Making all in sylv
    Making all in cc
    g++ -DPACKAGE_NAME=\"dynare\" -DPACKAGE_TARNAME=\"dynare\" -DPACKAGE_VERSION=\"4.6-unstable\" -DPACKAGE_STRING=\"dynare\ 4.6-unstable\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dynare\" -DVERSION=\"4.6-unstable\" -DHAVE_BOOST=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BOOST_GRAPH_ADJACENCY_LIST_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_TRIM_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_SPLIT_HPP=1 -DHAVE_BOOST_LEXICAL_CAST_HPP=1 -DBOOST_NO_HASH=/\*\*/ -DHAVE_LIBZ=1 -DHAVE_LIBHDF5=1 -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_MATLAB=1 -I.  -I../../../mex/sources  -Wall -Wno-parentheses -g -O2 -MT libsylv_a-BlockDiagonal.o -MD -MP -MF .deps/libsylv_a-BlockDiagonal.Tpo -c -o libsylv_a-BlockDiagonal.o `test -f 'BlockDiagonal.cc' || echo './'`BlockDiagonal.cc
    In file included from BlockDiagonal.cc:5:
    In file included from ./BlockDiagonal.hh:10:
    In file included from ./QuasiTriangular.hh:8:
    ./Vector.hh:20:7: error: function definition does not declare parameters
      int len{0};
          ^
    ./Vector.hh:21:7: error: function definition does not declare parameters
      int s{1};
          ^
    ./Vector.hh:22:11: error: function definition does not declare parameters
      double *data{nullptr};
              ^
    ./Vector.hh:23:8: error: function definition does not declare parameters
      bool destroy{false};
           ^
    ./Vector.hh:25:14: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
      Vector() = default;
                 ^
    ./Vector.hh:26:19: error: member initializer 'len' does not name a non-static data member or base class
      Vector(int l) : len(l),  data(new double[l]), destroy(true)
                      ^~~~~~
    ./Vector.hh:26:28: error: member initializer 'data' does not name a non-static data member or base class
      Vector(int l) : len(l),  data(new double[l]), destroy(true)
                               ^~~~~~~~~~~~~~~~~~~
    ./Vector.hh:26:49: error: member initializer 'destroy' does not name a non-static data member or base class
      Vector(int l) : len(l),  data(new double[l]), destroy(true)
                                                    ^~~~~~~~~~~~~
    ./Vector.hh:29:23: error: member initializer 'len' does not name a non-static data member or base class
      Vector(Vector &v) : len(v.length()), s(v.skip()), data(v.base()) 
                          ^~~~~~~~~~~~~~~
    ./Vector.hh:29:40: error: member initializer 's' does not name a non-static data member or base class
      Vector(Vector &v) : len(v.length()), s(v.skip()), data(v.base()) 
                                           ^~~~~~~~~~~
    ./Vector.hh:29:53: error: member initializer 'data' does not name a non-static data member or base class
      Vector(Vector &v) : len(v.length()), s(v.skip()), data(v.base()) 
                                                        ^~~~~~~~~~~~~~
    ./Vector.hh:35:7: error: member initializer 'len' does not name a non-static data member or base class
        : len(l),  data(new double[len]), destroy(true)
          ^~~~~~
    ./Vector.hh:35:32: error: use of undeclared identifier 'len'
        : len(l),  data(new double[len]), destroy(true)
                                   ^
    ./Vector.hh:35:39: error: member initializer 'destroy' does not name a non-static data member or base class
        : len(l),  data(new double[len]), destroy(true)
                                          ^~~~~~~~~~~~~
    ./Vector.hh:40:7: error: member initializer 'len' does not name a non-static data member or base class
        : len(l),  data(d) 
          ^~~~~~
    ./Vector.hh:40:16: error: member initializer 'data' does not name a non-static data member or base class
        : len(l),  data(d) 
                   ^~~~~~~
    ./Vector.hh:44:7: error: member initializer 'len' does not name a non-static data member or base class
        : len(l), s(skip), data(d) 
          ^~~~~~
    ./Vector.hh:44:15: error: member initializer 's' does not name a non-static data member or base class
        : len(l), s(skip), data(d) 
                  ^~~~~~~
    ./Vector.hh:44:24: error: member initializer 'data' does not name a non-static data member or base class
        : len(l), s(skip), data(d) 
                           ^~~~~~~
    ./Vector.hh:56:12: error: use of undeclared identifier 'data'
        return data[s*i];
               ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    1 warning and 20 errors generated.
    make[3]: *** [libsylv_a-BlockDiagonal.o] Error 1
    make[2]: *** [all-recursive] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all-recursive] Error 1
    
  • Author Owner

    It looks like your compiler is not in C++14 mode by default. But then you should have trouble compiling the preprocessor, which also requires C++14. Is it also the case?

    What is your compiler version? (as returned by g++ --version)

  • Author Owner

    I just pushed commit 74d22931 that may fix your issue. Please let me know if this is the case.

  • Developer

    @sebastien just in case on g++ version:

    g++ --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 10.0.0 (clang-1000.10.44.2) Target: x86_64-apple-darwin18.2.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

  • Contributor

    @rattoma does the compilation work for you if you add -std=gnu++14? i.e.

    cd dynare++/sylv/cc
    g++ -std=gnu++14 -DPACKAGE_NAME=\"dynare\" -DPACKAGE_TARNAME=\"dynare\" -DPACKAGE_VERSION=\"4.6-unstable\" -DPACKAGE_STRING=\"dynare\ 4.6-unstable\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"dynare\" -DVERSION=\"4.6-unstable\" -DHAVE_BOOST=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BOOST_GRAPH_ADJACENCY_LIST_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_TRIM_HPP=1 -DHAVE_BOOST_ALGORITHM_STRING_SPLIT_HPP=1 -DHAVE_BOOST_LEXICAL_CAST_HPP=1 -DBOOST_NO_HASH=/\*\*/ -DHAVE_LIBZ=1 -DHAVE_LIBHDF5=1 -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_MATLAB=1 -I.  -I../../../mex/sources  -Wall -Wno-parentheses -g -O2 -MT libsylv_a-BlockDiagonal.o -MD -MP -MF .deps/libsylv_a-BlockDiagonal.Tpo -c -o libsylv_a-BlockDiagonal.o `test -f 'BlockDiagonal.cc' || echo './'`BlockDiagonal.cc
    
  • Author Owner

    As said above, I pushed a fix.

  • Developer

    @sebastien many thanks. it works perfectly now.

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment