Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.32 KB | None | 0 0
  1. /*
  2. * File: ert_main.c
  3. *
  4. * Code generated for Simulink model 'Peltier_model'.
  5. *
  6. * Model version : 1.14
  7. * Simulink Coder version : 8.5 (R2013b) 08-Aug-2013
  8. * C/C++ source code generated on : Thu Apr 3 18:01:46 2014
  9. *
  10. * Target selection: ert.tlc
  11. * Embedded hardware selection: 32-bit Generic
  12. * Emulation hardware selection:
  13. * Differs from embedded hardware (MATLAB Host)
  14. * Code generation objective: Debugging
  15. * Validation result: Passed (0), Warning (1), Error (0)
  16. */
  17.  
  18. #include <stdio.h> /* This ert_main.c example uses printf/fflush */
  19. #include "Peltier_model.h" /* Model's header file */
  20. #include "rtwtypes.h"
  21.  
  22. /*
  23. * Associating rt_OneStep with a real-time clock or interrupt service routine
  24. * is what makes the generated code "real-time". The function rt_OneStep is
  25. * always associated with the base rate of the model. Subrates are managed
  26. * by the base rate from inside the generated code. Enabling/disabling
  27. * interrupts and floating point context switches are target specific. This
  28. * example code indicates where these should take place relative to executing
  29. * the generated code step function. Overrun behavior should be tailored to
  30. * your application needs. This example simply sets an error status in the
  31. * real-time model and returns from rt_OneStep.
  32. */
  33. void rt_OneStep(void)
  34. {
  35. static boolean_T OverrunFlag = 0;
  36.  
  37. /* Disable interrupts here */
  38.  
  39. /* Check for overrun */
  40. if (OverrunFlag) {
  41. rtmSetErrorStatus(Peltier_model_M, "Overrun");
  42. return;
  43. }
  44.  
  45. OverrunFlag = TRUE;
  46.  
  47. /* Save FPU context here (if necessary) */
  48. /* Re-enable timer or interrupt here */
  49. /* Set model inputs here */
  50.  
  51. /* Step the model */
  52. Peltier_model_step();
  53.  
  54. /* Get model outputs here */
  55.  
  56. /* Indicate task complete */
  57. OverrunFlag = FALSE;
  58.  
  59. /* Disable interrupts here */
  60. /* Restore FPU context here (if necessary) */
  61. /* Enable interrupts here */
  62. }
  63.  
  64. /*
  65. * The example "main" function illustrates what is required by your
  66. * application code to initialize, execute, and terminate the generated code.
  67. * Attaching rt_OneStep to a real-time clock is target specific. This example
  68. * illustates how you do this relative to initializing the model.
  69. */
  70. int_T main(int_T argc, const char *argv[])
  71. {
  72. /* Unused arguments */
  73. (void)(argc);
  74. (void)(argv);
  75.  
  76. /* Initialize model */
  77. Peltier_model_initialize();
  78.  
  79. /* Attach rt_OneStep to a timer or interrupt service routine with
  80. * period 0.01 seconds (the model's base sample time) here. The
  81. * call syntax for rt_OneStep is
  82. *
  83. * rt_OneStep();
  84. */
  85. printf("Warning: The simulation will run forever. "
  86. "Generated ERT main won't simulate model step behavior. "
  87. "To change this behavior select the 'MAT-file logging' option.n");
  88. fflush((NULL));
  89. while (rtmGetErrorStatus(Peltier_model_M) == (NULL)) {
  90. /* Perform other application tasks here */
  91. }
  92.  
  93. /* Disable rt_OneStep() here */
  94.  
  95. /* Terminate model */
  96. Peltier_model_terminate();
  97. return 0;
  98. }
  99.  
  100. /*
  101. * File trailer for generated code.
  102. *
  103. * [EOF]
  104. */
  105.  
  106. **************************************************************************
  107. Warning: Neither -compatibleArrayDims nor -largeArrayDims is selected.
  108. Using -compatibleArrayDims. In the future, MATLAB will require
  109. the use of -largeArrayDims and remove the -compatibleArrayDims
  110. option. For more information, see:
  111. http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
  112. **************************************************************************
  113.  
  114. -> mexopts.sh sourced from directory (DIR = $PREF_DIR)
  115. FILE = /Users/JoachimSA/.matlab/R2013b/mexopts.sh
  116. ----------------------------------------------------------------
  117. -> MATLAB = /Applications/MATLAB_R2013b.app
  118. -> CC = xcrun -sdk macosx10.9 clang
  119. -> CC flags:
  120. CFLAGS = -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions
  121. CDEBUGFLAGS = -g
  122. COPTIMFLAGS = -O2 -DNDEBUG
  123. CLIBS = -L/Applications/MATLAB_R2013b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
  124. arguments = -DMX_COMPAT_32
  125. -> CXX = xcrun -sdk macosx10.9 clang++
  126. -> CXX flags:
  127. CXXFLAGS = -fno-common -fexceptions -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9
  128. CXXDEBUGFLAGS = -g
  129. CXXOPTIMFLAGS = -O2 -DNDEBUG
  130. CXXLIBS = -L/Applications/MATLAB_R2013b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
  131. arguments = -DMX_COMPAT_32
  132. -> FC = gfortran
  133. -> FC flags:
  134. FFLAGS = -fexceptions -m64 -fbackslash
  135. FDEBUGFLAGS = -g
  136. FOPTIMFLAGS = -O
  137. FLIBS = -L/Applications/MATLAB_R2013b.app/bin/maci64 -lmx -lmex -lmat -L -lgfortran -L -lgfortranbegin
  138. arguments = -DMX_COMPAT_32
  139. -> LD = xcrun -sdk macosx10.9 clang
  140. -> Link flags:
  141. LDFLAGS = -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2013b.app/extern/lib/maci64/mexFunction.map
  142. LDDEBUGFLAGS = -g
  143. LDOPTIMFLAGS = -O
  144. LDEXTENSION = .mexmaci64
  145. arguments =
  146. -> LDCXX =
  147. -> Link flags:
  148. LDCXXFLAGS =
  149. LDCXXDEBUGFLAGS =
  150. LDCXXOPTIMFLAGS =
  151. LDCXXEXTENSION =
  152. arguments =
  153. ----------------------------------------------------------------
  154.  
  155. -> xcrun -sdk macosx10.9 clang -c -I/Applications/MATLAB_R2013b.app/rtw/c/src -I/Users/JoachimSA/Documents/WICHTIG/Diplomarbeit/Matlab_FIles/Peltier_Codegen/Peltier_model_ert_rtw -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "CC_IMEA.c"
  156.  
  157. -> xcrun -sdk macosx10.9 clang -c -I/Applications/MATLAB_R2013b.app/rtw/c/src -I/Users/JoachimSA/Documents/WICHTIG/Diplomarbeit/Matlab_FIles/Peltier_Codegen/Peltier_model_ert_rtw -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "CC_Opt_Objectives.c"
  158.  
  159. -> xcrun -sdk macosx10.9 clang -c -I/Applications/MATLAB_R2013b.app/rtw/c/src -I/Users/JoachimSA/Documents/WICHTIG/Diplomarbeit/Matlab_FIles/Peltier_Codegen/Peltier_model_ert_rtw -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "CC_System_Utils.c"
  160.  
  161. -> xcrun -sdk macosx10.9 clang -c -I/Applications/MATLAB_R2013b.app/rtw/c/src -I/Users/JoachimSA/Documents/WICHTIG/Diplomarbeit/Matlab_FIles/Peltier_Codegen/Peltier_model_ert_rtw -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "CC_Opt_SystemCabin.c"
  162.  
  163. -> xcrun -sdk macosx10.9 clang -c -I/Applications/MATLAB_R2013b.app/rtw/c/src -I/Users/JoachimSA/Documents/WICHTIG/Diplomarbeit/Matlab_FIles/Peltier_Codegen/Peltier_model_ert_rtw -I/Applications/MATLAB_R2013b.app/extern/include -I/Applications/MATLAB_R2013b.app/simulink/include -DMATLAB_MEX_FILE -fno-common -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -fexceptions -DMX_COMPAT_32 -O2 -DNDEBUG "CC_Optimiser.c"
  164.  
  165. -> xcrun -sdk macosx10.9 clang -O -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2013b.app/extern/lib/maci64/mexFunction.map -o "CC_Optimiser.mexmaci64" CC_IMEA.o CC_Opt_Objectives.o CC_System_Utils.o CC_Opt_SystemCabin.o CC_Optimiser.o -L/Applications/MATLAB_R2013b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
  166.  
  167. Undefined symbols for architecture x86_64:
  168. "_Peltier_model_initialize", referenced from:
  169. _CC_Opt_SystemCabin in CC_Opt_SystemCabin.o
  170. ld: symbol(s) not found for architecture x86_64
  171. clang: error: linker command failed with exit code 1 (use -v to see invocation)
  172.  
  173. mex: link of ' "CC_Optimiser.mexmaci64"' failed.
  174.  
  175. Unable to complete successfully.
  176.  
  177. Error in build_mex_files (line 6)
  178. mex -v ...
  179.  
  180. Error in run (line 63)
  181. evalin('caller', [script ';']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement