Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Fix FMU hybrj_ function signature
Browse files Browse the repository at this point in the history
3rdParty/CMinpack/hybrj_.c has void return value, FMU export uses int.

EMCC linking and WebAssembly runtime errors out on incorrect function signature.

Belonging to [master]:
  - #2806
  • Loading branch information
david-polak authored and OpenModelica-Hudson committed Jan 19, 2019
1 parent 0ef03fc commit 683050e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions SimulationRuntime/c/simulation/solver/nonlinearSolverHybrd.c
Expand Up @@ -56,7 +56,7 @@ struct dataAndSys {
int sysNumber;
};

static int wrapper_fvec_hybrj(const integer* n, const double* x, double* f, double* fjac, const integer* ldjac, const integer* iflag, void* data);
static void wrapper_fvec_hybrj(const integer* n, const double* x, double* f, double* fjac, const integer* ldjac, const integer* iflag, void* data);

/*! \fn allocate memory for nonlinear system solver hybrd
*
Expand Down Expand Up @@ -305,7 +305,7 @@ static int getAnalyticalJacobian(struct dataAndSys* dataSys, double* jac)
*
*
*/
static int wrapper_fvec_hybrj(const integer* n, const double* x, double* f, double* fjac, const integer* ldjac, const integer* iflag, void* dataAndSysNum)
static void wrapper_fvec_hybrj(const integer* n, const double* x, double* f, double* fjac, const integer* ldjac, const integer* iflag, void* dataAndSysNum)
{
int i,j;
struct dataAndSys *dataSys = (struct dataAndSys*) dataAndSysNum;
Expand Down Expand Up @@ -400,8 +400,6 @@ static int wrapper_fvec_hybrj(const integer* n, const double* x, double* f, doub
throwStreamPrint(NULL, "Well, this is embarrasing. The non-linear solver should never call this case.%d", (int)*iflag);
break;
}

return 0;
}

/*! \fn solve non-linear system with hybrd method
Expand Down
Expand Up @@ -45,7 +45,7 @@ extern "C" {
#endif

extern
int hybrj_( int(*) (const integer*, const double*, double*, double *, const integer*, const integer*, void*), const integer *n, double *x, double *fvec, double *fjac, const integer *ldfjac,
void hybrj_( void(*) (const integer*, const double*, double*, double *, const integer*, const integer*, void*), const integer *n, double *x, double *fvec, double *fjac, const integer *ldfjac,
const double *xtol, const integer *axfev, double *diag, const integer *mode,
const double *factor, const integer *nprint, integer *info, integer *nfev, integer *njev,
double *r, integer *lr, double *qtf, double *wa1, double *wa2,
Expand Down

0 comments on commit 683050e

Please sign in to comment.