s-amouyal12 / cantera

Automatically exported from code.google.com/p/cantera
0 stars 0 forks source link

Unable to compile on Ubuntu 12.04 [errors at IDADlsSetDenseJacFn] #259

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When compiling Cangtera 2.2.0 on Ubuntu 12.04 with the default sundials package 
[installed via 'sudo apt-get install sundials'], I got several errors 
associated with IDA_Solver.cpp:

src/numerics/IDA_Solver.cpp: In member function 'virtual void 
Cantera::IDA_Solver::setJacobianType(int)':
src/numerics/IDA_Solver.cpp:276:67: error: invalid conversion from 'int 
(*)(sd_size_t, realtype, realtype, N_Vector, N_Vector, N_Vector, DlsMat, void*, 
N_Vector, N_Vector, N_Vector) {aka int (*)(long int, double, double, 
_generic_N_Vector*, _generic_N_Vector*, _generic_N_Vector*, _DlsMat*, void*, 
_generic_N_Vector*, _generic_N_Vector*, _generic_N_Vector*)}' to 
'IDADlsDenseJacFn {aka int (*)(int, double, double, _generic_N_Vector*, 
_generic_N_Vector*, _generic_N_Vector*, _DlsMat*, void*, _generic_N_Vector*, 
_generic_N_Vector*, _generic_N_Vector*)}' [-fpermissive]
             int flag = IDADlsSetDenseJacFn(m_ida_mem, ida_jacobian);
                                                                   ^
In file included from /usr/include/ida/ida_dense.h:24:0,
                 from src/numerics/IDA_Solver.cpp:14:
/usr/include/ida/ida_direct.h:256:21: error:   initializing argument 2 of 'int 
IDADlsSetDenseJacFn(void*, IDADlsDenseJacFn)' [-fpermissive]
 SUNDIALS_EXPORT int IDADlsSetDenseJacFn(void *ida_mem, IDADlsDenseJacFn jac);
                     ^
src/numerics/IDA_Solver.cpp: In member function 'virtual void 
Cantera::IDA_Solver::init(doublereal)':
src/numerics/IDA_Solver.cpp:403:59: error: invalid conversion from 'int 
(*)(sd_size_t, realtype, realtype, N_Vector, N_Vector, N_Vector, DlsMat, void*, 
N_Vector, N_Vector, N_Vector) {aka int (*)(long int, double, double, 
_generic_N_Vector*, _generic_N_Vector*, _generic_N_Vector*, _DlsMat*, void*, 
_generic_N_Vector*, _generic_N_Vector*, _generic_N_Vector*)}' to 
'IDADlsDenseJacFn {aka int (*)(int, double, double, _generic_N_Vector*, 
_generic_N_Vector*, _generic_N_Vector*, _DlsMat*, void*, _generic_N_Vector*, 
_generic_N_Vector*, _generic_N_Vector*)}' [-fpermissive]
         flag = IDADlsSetDenseJacFn(m_ida_mem, ida_jacobian);
                                                           ^
In file included from /usr/include/ida/ida_dense.h:24:0,
                 from src/numerics/IDA_Solver.cpp:14:
/usr/include/ida/ida_direct.h:256:21: error:   initializing argument 2 of 'int 
IDADlsSetDenseJacFn(void*, IDADlsDenseJacFn)' [-fpermissive]
 SUNDIALS_EXPORT int IDADlsSetDenseJacFn(void *ida_mem, IDADlsDenseJacFn jac);
                     ^
scons: *** [build/src/numerics/IDA_Solver.os] Error 1
scons: building terminated because of errors.

These errors were eliminated when I modified lines 21 to 25 of IDA_Solver.cpp 
so that 'sd_size_t' represented 'int'.  I assume that this is an issue 
associated with the way that SUNDIALS_VERSION is configured.

Original issue reported on code.google.com by grrhen...@gmail.com on 14 Jul 2015 at 10:01