You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use sundials via inline-c. I am starting to define the types some of which are quite complex :( Even the simplest seems to throw up problems. For example what should I do here?
#if defined(SUNDIALS_INT64_T)
#if __STDC_VERSION__ >= 199901L
typedef int64_t sunindextype;
#else
typedef long int sunindextype;
#endif
#elif defined(SUNDIALS_INT32_T)
#if __STDC_VERSION__ >= 199901L
typedef int32_t sunindextype;
#else
typedef int sunindextype;
#endif
#endif
At the moment I have this
-- This is a lie!!!
type SunIndexType = CLong
sunTypesTable :: Map.Map CT.TypeSpecifier TH.TypeQ
sunTypesTable = Map.fromList
[
(CT.TypeName "sunindextype", [t| SunIndexType |] )
]
sunctx = mempty {ctxTypesTable = sunTypesTable}
Activity
idontgetoutmuch commentedon Mar 11, 2018
Ah but maybe I don't need to do this anyway.
stites commentedon Nov 13, 2018
@idontgetoutmuch how did you resolve this?
idontgetoutmuch commentedon Nov 14, 2018
I don't think I did resolve that particular issue but it's all working - see here: https://github.com/haskell-numerics/hmatrix-sundials/blob/master/src/Numeric/Sundials/Arkode.hsc
ekmett commentedon Jun 3, 2019
My best work around for this sort of issue is to use
hsc2hsandinline-cin the same Haskell module.With
hsc2hsyou can useand then the rest of your code is correct.
idontgetoutmuch commentedon Jul 7, 2019
👍