StochSS / GillesPy2

Modeling toolkit for biochemical simulation
http://gillespy2.readthedocs.io/
GNU General Public License v3.0
72 stars 32 forks source link

Oregonator and Lotkavolterra_Oscillator models fail to run with C solvers #572

Closed BryanRumsey closed 3 years ago

BryanRumsey commented 3 years ago

Oregonator Error

Error encountered during execution of Makefile target: 'ode'.
Return code: 2- stdout: make: Entering directory '/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base'
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmpr3_f3l9w/obj/ODESimulation.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESimulation.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmpr3_f3l9w/template
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmpr3_f3l9w/obj/ODESolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp  -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmpr3_f3l9w/template
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode_nls.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_nls.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode_io.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_io.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_iterative.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_iterative.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode_proj.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_proj.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_matrix.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_matrix.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sunmatrix_band.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunmatrix_band.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sunmatrix_dense.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunmatrix_dense.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode_ls.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_ls.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_linearsolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_linearsolver.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_nonlinearsolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nonlinearsolver.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_nvector_senswrapper.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nvector_senswrapper.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sunnonlinsol_newton.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunnonlinsol_newton.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_nvector.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nvector.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/nvector_serial.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/nvector_serial.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/cvode_spils.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_spils.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sundials_math.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_math.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmpr3_f3l9w/obj/sunlinsol_spgmr.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunlinsol_spgmr.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmpr3_f3l9w/obj/model.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmpr3_f3l9w/obj/arg_parser.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/arg_parser.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmpr3_f3l9w/template
g++ -std=c++14 -Wall -O3 -o /tmp/tmpr3_f3l9w/Simulation.out /tmp/tmpr3_f3l9w/template/template.cpp /tmp/tmpr3_f3l9w/obj/model.o /tmp/tmpr3_f3l9w/obj/arg_parser.o -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmpr3_f3l9w/template /tmp/tmpr3_f3l9w/obj/cvode_nls.o /tmp/tmpr3_f3l9w/obj/cvode_io.o /tmp/tmpr3_f3l9w/obj/sundials_iterative.o /tmp/tmpr3_f3l9w/obj/cvode_proj.o /tmp/tmpr3_f3l9w/obj/sundials_matrix.o /tmp/tmpr3_f3l9w/obj/sunmatrix_band.o /tmp/tmpr3_f3l9w/obj/sunmatrix_dense.o /tmp/tmpr3_f3l9w/obj/cvode_ls.o /tmp/tmpr3_f3l9w/obj/sundials_linearsolver.o /tmp/tmpr3_f3l9w/obj/sundials_nonlinearsolver.o /tmp/tmpr3_f3l9w/obj/sundials_nvector_senswrapper.o /tmp/tmpr3_f3l9w/obj/sunnonlinsol_newton.o /tmp/tmpr3_f3l9w/obj/sundials_nvector.o /tmp/tmpr3_f3l9w/obj/nvector_serial.o /tmp/tmpr3_f3l9w/obj/cvode.o /tmp/tmpr3_f3l9w/obj/cvode_spils.o /tmp/tmpr3_f3l9w/obj/sundials_math.o /tmp/tmpr3_f3l9w/obj/sunlinsol_spgmr.o /tmp/tmpr3_f3l9w/obj/ODESimulation.o /tmp/tmpr3_f3l9w/obj/ODESolver.o
make: Leaving directory '/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base'

- stderr: /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp: In function ‘void Gillespy::ODESolver(Gillespy::Simulation<double>*, double)’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp:49:7: warning: variable ‘flag’ set but not used [-Wunused-but-set-variable]
   49 |   int flag;
      |       ^~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp: In instantiation of ‘void Gillespy::Simulation<PType>::output_results_buffer(std::ostream&) [with PType = double; std::ostream = std::basic_ostream<char>]’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:141:18:   required from here
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:128:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  128 |   for (int trajectory = 0; trajectory < number_trajectories; trajectory++) {
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:129:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  129 |    for (int timestep = 0; timestep < number_timesteps; timestep++) {
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:132:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  132 |     for (int species = 0; species < model->number_species; species++) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp: In instantiation of ‘void Gillespy::Simulation<PType>::output_results_buffer(std::ostream&) [with PType = unsigned int; std::ostream = std::basic_ostream<char>]’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:142:18:   required from here
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:128:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  128 |   for (int trajectory = 0; trajectory < number_trajectories; trajectory++) {
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:129:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  129 |    for (int timestep = 0; timestep < number_timesteps; timestep++) {
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:132:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  132 |     for (int species = 0; species < model->number_species; species++) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/tmpr3_f3l9w/template/template.cpp:25:
/tmp/tmpr3_f3l9w/template/template_definitions.h:2:57: error: narrowing conversion of ‘2.0e+0’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {2.0,250.0,500.0,1000.0,0.0}
      |                                                         ^
/tmp/tmpr3_f3l9w/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template_definitions.h:2:57: error: narrowing conversion of ‘2.5e+2’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {2.0,250.0,500.0,1000.0,0.0}
      |                                                         ^
/tmp/tmpr3_f3l9w/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template_definitions.h:2:57: error: narrowing conversion of ‘5.0e+2’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {2.0,250.0,500.0,1000.0,0.0}
      |                                                         ^
/tmp/tmpr3_f3l9w/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template_definitions.h:2:57: error: narrowing conversion of ‘1.0e+3’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {2.0,250.0,500.0,1000.0,0.0}
      |                                                         ^
/tmp/tmpr3_f3l9w/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘V’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:30: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                              ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P0’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:46: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                                              ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P1’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:63: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                                                               ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P2’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:80: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                                                                                ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P3’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:99: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                                                                                                   ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P4’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmpr3_f3l9w/template/template_definitions.h:1:118: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,2.0) CONSTANT(P1,0.1) CONSTANT(P2,104.0) CONSTANT(P3,4e-07) CONSTANT(P4,26.0)
      |                                                                                                                      ^~~~~~~~
/tmp/tmpr3_f3l9w/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
make: *** [/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Makefile:87: ode] Error 1

Lotkavolterra_Oscillator Error

Error encountered during execution of Makefile target: 'ode'.
Return code: 2- stdout: make: Entering directory '/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base'
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmp71yhqxkf/obj/ODESimulation.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESimulation.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmp71yhqxkf/template
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmp71yhqxkf/obj/ODESolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp  -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmp71yhqxkf/template
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode_nls.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_nls.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode_io.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_io.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_iterative.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_iterative.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode_proj.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_proj.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_matrix.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_matrix.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sunmatrix_band.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunmatrix_band.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sunmatrix_dense.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunmatrix_dense.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode_ls.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_ls.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_linearsolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_linearsolver.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_nonlinearsolver.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nonlinearsolver.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_nvector_senswrapper.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nvector_senswrapper.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sunnonlinsol_newton.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunnonlinsol_newton.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_nvector.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_nvector.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/nvector_serial.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/nvector_serial.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/cvode_spils.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/cvode_spils.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sundials_math.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sundials_math.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -c -o /tmp/tmp71yhqxkf/obj/sunlinsol_spgmr.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/src/sunlinsol_spgmr.c -Wall -O3 -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmp71yhqxkf/obj/model.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base
g++ -std=c++14 -Wall -O3 -c -o /tmp/tmp71yhqxkf/obj/arg_parser.o /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/arg_parser.cpp -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmp71yhqxkf/template
g++ -std=c++14 -Wall -O3 -o /tmp/tmp71yhqxkf/Simulation.out /tmp/tmp71yhqxkf/template/template.cpp /tmp/tmp71yhqxkf/obj/model.o /tmp/tmp71yhqxkf/obj/arg_parser.o -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base -I/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Sundials/include -I/tmp/tmp71yhqxkf/template /tmp/tmp71yhqxkf/obj/cvode_nls.o /tmp/tmp71yhqxkf/obj/cvode_io.o /tmp/tmp71yhqxkf/obj/sundials_iterative.o /tmp/tmp71yhqxkf/obj/cvode_proj.o /tmp/tmp71yhqxkf/obj/sundials_matrix.o /tmp/tmp71yhqxkf/obj/sunmatrix_band.o /tmp/tmp71yhqxkf/obj/sunmatrix_dense.o /tmp/tmp71yhqxkf/obj/cvode_ls.o /tmp/tmp71yhqxkf/obj/sundials_linearsolver.o /tmp/tmp71yhqxkf/obj/sundials_nonlinearsolver.o /tmp/tmp71yhqxkf/obj/sundials_nvector_senswrapper.o /tmp/tmp71yhqxkf/obj/sunnonlinsol_newton.o /tmp/tmp71yhqxkf/obj/sundials_nvector.o /tmp/tmp71yhqxkf/obj/nvector_serial.o /tmp/tmp71yhqxkf/obj/cvode.o /tmp/tmp71yhqxkf/obj/cvode_spils.o /tmp/tmp71yhqxkf/obj/sundials_math.o /tmp/tmp71yhqxkf/obj/sunlinsol_spgmr.o /tmp/tmp71yhqxkf/obj/ODESimulation.o /tmp/tmp71yhqxkf/obj/ODESolver.o
make: Leaving directory '/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base'

- stderr: /opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp: In function ‘void Gillespy::ODESolver(Gillespy::Simulation<double>*, double)’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/ode_cpp_solver/ODESolver.cpp:49:7: warning: variable ‘flag’ set but not used [-Wunused-but-set-variable]
   49 |   int flag;
      |       ^~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp: In instantiation of ‘void Gillespy::Simulation<PType>::output_results_buffer(std::ostream&) [with PType = double; std::ostream = std::basic_ostream<char>]’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:141:18:   required from here
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:128:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  128 |   for (int trajectory = 0; trajectory < number_trajectories; trajectory++) {
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:129:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  129 |    for (int timestep = 0; timestep < number_timesteps; timestep++) {
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:132:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  132 |     for (int species = 0; species < model->number_species; species++) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp: In instantiation of ‘void Gillespy::Simulation<PType>::output_results_buffer(std::ostream&) [with PType = unsigned int; std::ostream = std::basic_ostream<char>]’:
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:142:18:   required from here
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:128:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  128 |   for (int trajectory = 0; trajectory < number_trajectories; trajectory++) {
      |                            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:129:36: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  129 |    for (int timestep = 0; timestep < number_timesteps; timestep++) {
      |                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/model.cpp:132:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
  132 |     for (int species = 0; species < model->number_species; species++) {
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/tmp71yhqxkf/template/template.cpp:25:
/tmp/tmp71yhqxkf/template/template_definitions.h:2:43: error: narrowing conversion of ‘9.4999999999999998e-3’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {0.0095,0.008}
      |                                           ^
/tmp/tmp71yhqxkf/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmp71yhqxkf/template/template_definitions.h:2:43: error: narrowing conversion of ‘8.0000000000000002e-3’ from ‘double’ to ‘unsigned int’ [-Wnarrowing]
    2 | #define GPY_INIT_POPULATIONS {0.0095,0.008}
      |                                           ^
/tmp/tmp71yhqxkf/template/template.cpp:30:46: note: in expansion of macro ‘GPY_INIT_POPULATIONS’
   30 |  unsigned int populations[GPY_NUM_SPECIES] = GPY_INIT_POPULATIONS;
      |                                              ^~~~~~~~~~~~~~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘V’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmp71yhqxkf/template/template_definitions.h:1:30: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,0.004) CONSTANT(P1,0.5) CONSTANT(P2,0.0045)
      |                              ^~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P0’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmp71yhqxkf/template/template_definitions.h:1:46: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,0.004) CONSTANT(P1,0.5) CONSTANT(P2,0.0045)
      |                                              ^~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P1’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmp71yhqxkf/template/template_definitions.h:1:65: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,0.004) CONSTANT(P1,0.5) CONSTANT(P2,0.0045)
      |                                                                 ^~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:60:52: warning: unnecessary parentheses in declaration of ‘P2’ [-Wparentheses]
   60 |  #define CONSTANT(name, value) static const double (name) = (value);
      |                                                    ^
/tmp/tmp71yhqxkf/template/template_definitions.h:1:82: note: in expansion of macro ‘CONSTANT’
    1 | #define GPY_PARAMETER_VALUES CONSTANT(V,1.0) CONSTANT(P0,0.004) CONSTANT(P1,0.5) CONSTANT(P2,0.0045)
      |                                                                                  ^~~~~~~~
/tmp/tmp71yhqxkf/template/template.cpp:61:2: note: in expansion of macro ‘GPY_PARAMETER_VALUES’
   61 |  GPY_PARAMETER_VALUES
      |  ^~~~~~~~~~~~~~~~~~~~
make: *** [/opt/conda/lib/python3.8/site-packages/gillespy2/solvers/cpp/c_base/Makefile:87: ode] Error 1
jtcooper10 commented 3 years ago

This is a narrowing issue, the C++ solvers are expecting integers and encounters issues when that's not the case.

We have two potential solutions: either explicitly cast the species initial populations to integers when the template is generated (but have an explicit cast from the C++ side for safety), or modify the inital_populations vector to accept doubles and have the solvers handle the conversions themselves. If there are any scenarios where a real-valued initial population is allowed, then the latter is necessary.