LLNL / GridKit

Experimental code for prototyping interfaces betwen numerical libraries and network models.
Other
5 stars 1 forks source link

Fails to build with SUNDIALS 6.1.1 #5

Open ashermancinelli opened 2 years ago

ashermancinelli commented 2 years ago

Dependencies:

Configure output: ```console $ CC=clang CXX=clang++ cmake .. -DGRIDKIT_ENABLE_SUNDIALS_SPARSE=OFF -- The C compiler identification is Clang 15.0.0 -- The CXX compiler identification is Clang 15.0.0 -- Check for working C compiler: /usr/local/bin/clang -- Check for working C compiler: /usr/local/bin/clang - works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/local/bin/clang++ -- Check for working CXX compiler: /usr/local/bin/clang++ - works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found Ipopt library: /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/ipopt-3.14.0-hjxo6vfii42gvwgxltgalatt5azdn7ei/lib64/libipopt.so -- Found Ipopt include: /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/ipopt-3.14.0-hjxo6vfii42gvwgxltgalatt5azdn7ei/include/coin-or -- SUNDIALS configuration found: /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/lib64/cmake/sundials/SUNDIALSConfig.cmake -- Configuring done -- Generating done -- Build files have been written to: /home/asher/workspace/GridKit/build ```
Build output: ```console [ 51%] Building CXX object Solver/SteadyState/CMakeFiles/solvers_steady_obj_shared.dir/Kinsol.cpp.o /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:91:19: error: no matching function for call to 'KINCreate' solver_ = KINCreate(); ^~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/kinsol/kinsol.h:98:23: note: candidate function not viable: requires single argument 'sunctx', but no arguments were provided SUNDIALS_EXPORT void *KINCreate(SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:144:25: error: no matching function for call to 'SUNLinSol_Dense' linearSolver_ = SUNLinSol_Dense(yy_, JacobianMat_); ^~~~~~~~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunlinsol/sunlinsol_dense.h:58:33: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNLinearSolver SUNLinSol_Dense(N_Vector y, SUNMatrix A, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:162:25: error: no matching function for call to 'SUNLinSol_Dense' linearSolver_ = SUNLinSol_Dense(yy_, JacobianMat_); ^~~~~~~~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunlinsol/sunlinsol_dense.h:58:33: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNLinearSolver SUNLinSol_Dense(N_Vector y, SUNMatrix A, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:106:15: error: no matching function for call to 'N_VNew_Serial' yy_ = N_VNew_Serial(model_->size()); ^~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:330:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureSimulation' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/nvector/nvector_serial.h:85:26: note: candidate function not viable: requires 2 arguments, but 1 was provided SUNDIALS_EXPORT N_Vector N_VNew_Serial(sunindextype vec_length, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:141:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:159:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:330:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureLinearSolver' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:106:15: error: no matching function for call to 'N_VNew_Serial' yy_ = N_VNew_Serial(model_->size()); ^~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:331:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureSimulation' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/nvector/nvector_serial.h:85:26: note: candidate function not viable: requires 2 arguments, but 1 was provided SUNDIALS_EXPORT N_Vector N_VNew_Serial(sunindextype vec_length, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:141:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:159:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:331:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureLinearSolver' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:106:15: error: no matching function for call to 'N_VNew_Serial' yy_ = N_VNew_Serial(model_->size()); ^~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:332:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureSimulation' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/nvector/nvector_serial.h:85:26: note: candidate function not viable: requires 2 arguments, but 1 was provided SUNDIALS_EXPORT N_Vector N_VNew_Serial(sunindextype vec_length, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:141:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:159:24: error: no matching function for call to 'SUNDenseMatrix' JacobianMat_ = SUNDenseMatrix(model_->size(), model_->size()); ^~~~~~~~~~~~~~ /home/asher/workspace/GridKit/Solver/SteadyState/Kinsol.cpp:332:20: note: in instantiation of member function 'AnalysisManager::Sundials::Kinsol::configureLinearSolver' requested here template class Kinsol; ^ /spack/opt/spack/linux-opensuse_leap15-westmere/clang-15.0.0/sundials-6.1.1-5bss4fslapws7srrxblx5r35j47jnrlx/include/sunmatrix/sunmatrix_dense.h:79:27: note: candidate function not viable: requires 3 arguments, but 2 were provided SUNDIALS_EXPORT SUNMatrix SUNDenseMatrix(sunindextype M, sunindextype N, SUNContext sunctx); ^ 12 errors generated. make[2]: *** [Solver/SteadyState/CMakeFiles/solvers_steady_obj_shared.dir/build.make:80: Solver/SteadyState/CMakeFiles/solvers_steady_obj_shared.dir/Kinsol.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:982: Solver/SteadyState/CMakeFiles/solvers_steady_obj_shared.dir/all] Error 2 make: *** [Makefile:158: all] Error 2 ```
pelesh commented 2 years ago

Thanks for reporting. It seems there are some significant API changes in Sundials 6. I'll take a look.

pelesh commented 2 years ago

It seems that @balos1 made it easy to switch to v6 using this script. I'll give it a try and see how well it works for GridKit. I will likely drop support for Sundials < 6.0.