﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5523	Complex number issue when compiling PhotoVoltaics example	Christian Kral <dr.christian.kral@…>	Lennart Ochel	"When trying to simulate the model {{{PhotoVoltaics.Examples.SimpleModuleMP3}}} an error occurs during compilation. 

{{{
make -j8 -f PhotoVoltaics.Examples.SimpleModuleMP3.makefile
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3.o PhotoVoltaics.Examples.SimpleModuleMP3.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_functions.o PhotoVoltaics.Examples.SimpleModuleMP3_functions.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_records.o PhotoVoltaics.Examples.SimpleModuleMP3_records.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_01exo.o PhotoVoltaics.Examples.SimpleModuleMP3_01exo.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_02nls.o PhotoVoltaics.Examples.SimpleModuleMP3_02nls.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_03lsy.o PhotoVoltaics.Examples.SimpleModuleMP3_03lsy.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_04set.o PhotoVoltaics.Examples.SimpleModuleMP3_04set.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_05evt.o PhotoVoltaics.Examples.SimpleModuleMP3_05evt.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_06inz.o PhotoVoltaics.Examples.SimpleModuleMP3_06inz.c
PhotoVoltaics.Examples.SimpleModuleMP3_functions.c:213:11: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
  if((_y0 == 0.0))
      ~~~~^~~~~~
PhotoVoltaics.Examples.SimpleModuleMP3_functions.c:213:11: note: remove extraneous parentheses around the comparison to silence this warning
  if((_y0 == 0.0))
     ~    ^     ~
PhotoVoltaics.Examples.SimpleModuleMP3_functions.c:213:11: note: use '=' to turn this equality comparison into an assignment
  if((_y0 == 0.0))
          ^~
          =
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_07dly.o PhotoVoltaics.Examples.SimpleModuleMP3_07dly.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_08bnd.o PhotoVoltaics.Examples.SimpleModuleMP3_08bnd.c
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_09alg.o PhotoVoltaics.Examples.SimpleModuleMP3_09alg.c
PhotoVoltaics.Examples.SimpleModuleMP3.c:170:69: error: assigning to 'modelica_real' (aka 'double') from incompatible type 'Modelica_SIunits_ComplexVoltage_array' (aka 'struct base_array_s')
  data->localData[0]->realVars[91] /* converter.powerAC variable */ = tmp0;
                                                                    ^ ~~~~
1 warning generated.
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_10asr.o PhotoVoltaics.Examples.SimpleModuleMP3_10asr.c
1 error generated.
clang  -Os -fPIC -mfpmath=sse -fno-dollars-in-identifiers     -I""/usr/include/omc/c"" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=PhotoVoltaics_Examples_SimpleModuleMP3 -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=0 -DOMC_NUM_NONLINEAR_SYSTEMS=3 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o PhotoVoltaics.Examples.SimpleModuleMP3_11mix.o PhotoVoltaics.Examples.SimpleModuleMP3_11mix.c
<builtin>: recipe for target 'PhotoVoltaics.Examples.SimpleModuleMP3.o' failed
make: *** [PhotoVoltaics.Examples.SimpleModuleMP3.o] Error 1
make: *** Waiting for unfinished jobs....
Compilation process failed. Exited with code 2.
}}}

This issue applies to

{{{
Connected to OpenModelica 1.14.0~dev-26516-g93a3ce5
Connected to OMSimulator unknown-linux
}}} 

applying the new instantiation phase.

**Note:** PhotoVoltaics is a systems library in OpenModelica, so it can directly be opened in OpenModelica without downloading it from https://github.com/christiankral/PhotoVoltaics"	defect	closed	blocker	1.17.0	Code Generation	v1.14.0-dev-nightly	fixed		Karim Adbdelhak Andreas Heuermann
