Skip to content

Commit 8ce7212

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
fix MSVC build of simulation runtime C
- jacobian is not used, comment it out for now - the MSVC 2010 does not support declarations of variables using sizes from local stack variables
1 parent 0ebf1ec commit 8ce7212

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

SimulationRuntime/c/simulation/solver/sym_solver_ssc.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,18 @@ int first_step(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo)
255255
SIMULATION_DATA *sDataOld = (SIMULATION_DATA*)data->localData[1];
256256
DATA_SYM_SOLVER_SSC* userdata = (DATA_SYM_SOLVER_SSC*)solverInfo->solverData;
257257
const int n = data->modelData->nStates;
258-
double jacobian[n*n];
259258
modelica_real* stateDer = sData->realVars + data->modelData->nStates;
260259
modelica_real* stateDerOld = sDataOld->realVars + data->modelData->nStates;
261260
double sc, d, d0 = 0.0, d1 = 0.0, d2 = 0.0, h0, h1, delta_ti, infNorm, sum = 0;
262261
double Atol = data->simulationInfo->tolerance, Rtol = data->simulationInfo->tolerance;
263262
int i,j,retVal;
263+
/* it seems that jacobian is not used yet!
264+
#if defined(_MSC_VER) // handle crap compilers
265+
double *jacobian = (double*)malloc(n*n*sizeof(double));
266+
#else
267+
double jacobian[n*n];
268+
#endif
269+
*/
264270

265271
/* initialize radau values */
266272
for (i=0; i<data->modelData->nStates; i++)
@@ -372,9 +378,15 @@ int first_step(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo)
372378
{
373379
userdata->radauStepSize = 0.5*solverInfo->currentStepSize;
374380
}
381+
/*
382+
#if defined(_MSC_VER) // handle crap compilers
383+
free(jacobian)
384+
#endif
385+
*/
375386
return 0;
376387
}
377388

389+
378390
/*! \fn generateTwoApproximationsOfDifferentOrder
379391
*
380392
* Function generates two approximations of

0 commit comments

Comments
 (0)