LLNL / sundials

Official development repository for SUNDIALS - a SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. Pull requests are welcome for bug fixes and minor changes.
https://computing.llnl.gov/projects/sundials
BSD 3-Clause "New" or "Revised" License
523 stars 131 forks source link

Getting Error when trying to Build Paradis with KINSOL #496

Closed vikramroybarc closed 6 months ago

vikramroybarc commented 6 months ago

Hi Team,

I am trying to build paradis dislocation dynamics code with KINSOL of sundials 6.6.0. I have modified following lines in the makefile of paradis

ifeq ($(KINSOL_MODE),ON)
   INCS           += -I/home/vikramr/sundials/sundials-6.6.0/INSTDIR/include/
   LIB_PARALLEL   += /home/vikramr/sundials/sundials-6.6.0/INSTDIR/lib/libsundials_kinsol.a
   LIB_SERIAL     += /home/vikramr/sundials/sundials-6.6.0/INSTDIR/lib/libsundials_kinsol.a
   DEFS           += -DUSE_KINSOL
endif

But I am getting this error regarding function N_VNewEmpty()

./src/ParadisSUNDIALS.cc: In function ‘_generic_N_Vector* NewEmptyParaDiSVector()’:
../src/ParadisSUNDIALS.cc:127:36: error: too few arguments to function ‘_generic_N_Vector* N_VNewEmpty(SUNContext)’
  127 |     v = (ParaDiS_Vector)N_VNewEmpty();
      |                         ~~~~~~~~~~~^~
In file included from ../include/Home.h:54,
                 from ../src/ParadisSUNDIALS.cc:60:
/home/vikramr/sundials/sundials-6.6.0/INSTDIR/include/sundials/sundials_nvector.h:208:26: note: declared here
  208 | SUNDIALS_EXPORT N_Vector N_VNewEmpty(SUNContext sunctx);
      |                          ^~~~~~~~~~~
../src/ParadisSUNDIALS.cc: In function ‘_generic_N_Vector* P_VCloneEmpty(ParaDiS_Vector)’:
../src/ParadisSUNDIALS.cc:435:36: error: too few arguments to function ‘_generic_N_Vector* N_VNewEmpty(SUNContext)’
  435 |     v = (ParaDiS_Vector)N_VNewEmpty();
      |                         ~~~~~~~~~~~^~
In file included from ../include/Home.h:54,
                 from ../src/ParadisSUNDIALS.cc:60:

If anyone has an Idea regarding this, kindly help. Thankyou for considering this query

drreynolds commented 6 months ago

It looks like the Paradis interface to SUNDIALS has not been updated since before the SUNDIALS v6.0.0 release in December 2021 (which was when the SUNContext object became required). You'll need to create a SUNContext object via a call to SUNContext_Create, and then pass that in to the constructor for all other SUNDIALS objects that Paradis uses.

vikramroybarc commented 6 months ago

Thankyou drreynolds for your reply.

I tried with version 5.5.0 and it worked.

Thankyou very much for your support