Differences between revisions 12 and 14 (spanning 2 versions)
Revision 12 as of 2009-04-01 03:28:03
Size: 4693
Comment:
Revision 14 as of 2009-06-10 03:43:08
Size: 4836
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
Line 4: Line 3:
Line 9: Line 7:
If running {{{ If running

{{{
Line 11: Line 11:
}}} or running {{{ }}}
or running

{{{
Line 13: Line 16:
}}}
gives the following error
}}}
gives the following error
Line 19: Line 23:
then the source code is most likely with Unix line endings. Download the Windows source
code from the Ptolemy web page.
then the source code is most likely with Unix line endings. Download the Windows source code from the Ptolemy web page.
Line 24: Line 26:
Under Windows, if the BCVTB is compiled using the Microsoft compiler, then
the MATLAB libraries also need to be compiled with the Microsoft compiler.
If, however, the gcc compiler has been used when compiling the BCVTB,
then the following compilation error may be obtained when compiling the MATLAB libraries:
Under Windows, if the BCVTB is compiled using the Microsoft compiler, then the MATLAB libraries also need to be compiled with the Microsoft compiler. If, however, the gcc compiler has been used when compiling the BCVTB,  then the following compilation error may be obtained when compiling the MATLAB libraries:
Line 29: Line 29:
Writing library for establishBSDSocket.mexw32 
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_establishclientsocket' 
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_exchangewithsocket' 
Writing library for establishBSDSocket.mexw32
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_establishclientsocket'
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_exchangewithsocket'
Line 34: Line 34:
To fix this problem, open Matlab, run  To fix this problem, open Matlab, run
Line 40: Line 41:
Line 43: Line 43:
Line 65: Line 66:
Line 67: Line 67:
Line 70: Line 69:
Line 76: Line 74:
This problem is caused because the linker flags in Matlab changed in R2009a.
To fix this problem, open the file {{{$HOME/.matlab/R2009a/mexopts.sh}}}, and change the entry of LDFLAGS from
This problem is caused because the linker flags in Matlab changed in R2009a. To fix this problem, open the file {{{bcvtb/lib/simulink/compile.m}}} and remove the entry
Line 79: Line 77:
-twolevel_namespace -undefined error -L/usr/lib
}}}
Then, recompile the file. This will be fixed in releases after version 0.1.1.

== Runtime problems ==
The following steps typically help analyzing problems if a simulation program does not work as expected.

=== Check log files ===
For each simulation, the BCVTB will write a log file that contains the console output of the simulation program. The name of the simulation log file is determined by parameter {{{simulationLogFile}}} of the {{{Simulator}}} actor, with the default name being {{{simulation.log}}}. Check this file for possible error messages.
=== Investigate program output ===
Depending on how simulation programs are called by the {{{Simulation}}} actor in Ptolemy, the console output written by the simulation program may not be visible. To see the console output, change the command line of the Ptolemy actor from

{{{
 bash ./runClient.sh
Line 82: Line 93:
Line 83: Line 95:
-flat_namespace -undefined suppress
}}}
Alternatively, you may copy the file {{{mexopt.sh}}} from a previous matlab version, i.e., copy
{{{$HOME/.matlab/"matlab-version"/mexopt.sh}}} to {{{$HOME/.matlab/R2009a/mexopts.sh}}}.

== Runtime problems ==

The following steps typically help analyzing problems if a simulation program does not work as expected.

=== Investigate program output ===
Depending on how simulation programs are called by the {{{Simulation}}} actor in Ptolemy, the console output written by the simulation program may not be visible. To see the console output, change the command line of the Ptolemy actor from{{{
 bash ./runClient.sh
}}}
to{{{
Line 101: Line 99:
=== Investigate log files ===
If something goes wrong during the simulation, check the files {{{simulation.log}}}, {{{utilSocket.log}}} and {{{utilClient.log}}}. They contain log messages that may indicate the cause of the problem. If these files do not exist, go to the directory {{{bcvtb/lib}}}, open the file {{{defines.h}}} and add the line
Line 102: Line 102:
=== Investigate log files ===
If something goes wrong during the simulation,
check the files {{{simulation.log}}}, {{{utilSocket.log}}} and {{{utilClient.log}}}.
They contain log messages that may indicate the cause of the problem.
If these files do not exist, go to the directory {{{bcvtb/lib}}},
open the file {{{defines.h}}} and add the line
Line 111: Line 105:
Then, from the directory {{{bcvtb/lib}}} compile the libraries using  Then, from the directory {{{bcvtb/lib}}} compile the libraries using
Line 116: Line 111:
and rerun the simulation. Now the log files should be written to the
directory from which you started the BCVTB.
and rerun the simulation. Now the log files should be written to the directory from which you started the BCVTB.

Help

TableOfContents

1. Compilation problems

1.1. Error when compiling Ptolemy II (Windows only)

If running

make configPt
  • or running

./configure && make fast install
  • gives the following error

/bin/sh: -c: line 1: unexpected EOF while looking for matching `''
/bin/sh: -c: line 4: syntax error: unexpected end of file

then the source code is most likely with Unix line endings. Download the Windows source code from the Ptolemy web page.

1.2. Error when compiling MATLAB (Windows only)

Under Windows, if the BCVTB is compiled using the Microsoft compiler, then the MATLAB libraries also need to be compiled with the Microsoft compiler. If, however, the gcc compiler has been used when compiling the BCVTB, then the following compilation error may be obtained when compiling the MATLAB libraries:

Writing library for establishBSDSocket.mexw32
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_establishclientsocket'
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_exchangewithsocket'
c:\docume~1\mwetter\locals~1\temp\mex_ae679\simulinksocket.obj .text: undefined reference to '_closeipc'

To fix this problem, open Matlab, run

mex -setup

and select the Microsoft Visual C++ compiler from the menu. This need to be done only once as it updates your Matlab settings.

1.3. Error when compiling MATLAB (Mac OS X with Matlab R2009a only)

Under Mac OS X, if the BCVTB is compiled in Matlab R2009a, the following error may occur:

Undefined symbols:
  "_mxGetM", referenced from:
      _mexFunction in establishBSDSocket.o
  "_mxGetN", referenced from:
      _mexFunction in establishBSDSocket.o
  "_mxIsNumeric", referenced from:
      _mexFunction in establishBSDSocket.o
  "_mxGetClassID", referenced from:
      _ssGetDTypeIdFromMxArray in establishBSDSocket.o
  "_mxCalloc", referenced from:
      __RegNumInputPortsCB in establishBSDSocket.o
      __RegNumOutputPortsCB in establishBSDSocket.o
      _mexFunction in establishBSDSocket.o
  "_mxGetPr", referenced from:
      _mexFunction in establishBSDSocket.o
  "_mxIsComplex", referenced from:
      _mexFunction in establishBSDSocket.o
  "_mxCreateDoubleMatrix_700", referenced from:
      _mexFunction in establishBSDSocket.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
    mex: link of ' "establishBSDSocket.mexmaci"' failed.
??? Error using ==> mex at 218
Unable to complete successfully.
Error in ==> /Applications/MATLAB_R2009a.app/toolbox/simulink/simulink/+legacycode/@LCT/compile.p>compile at 261
Error in ==> /Applications/MATLAB_R2009a.app/toolbox/simulink/simulink/legacy_code.p>legacy_code at 91
Error in ==> compile at 58
    legacy_code('compile', def, ...

This problem is caused because the linker flags in Matlab changed in R2009a. To fix this problem, open the file bcvtb/lib/simulink/compile.m and remove the entry

-L/usr/lib

Then, recompile the file. This will be fixed in releases after version 0.1.1.

2. Runtime problems

The following steps typically help analyzing problems if a simulation program does not work as expected.

2.1. Check log files

For each simulation, the BCVTB will write a log file that contains the console output of the simulation program. The name of the simulation log file is determined by parameter simulationLogFile of the Simulator actor, with the default name being simulation.log. Check this file for possible error messages.

2.2. Investigate program output

Depending on how simulation programs are called by the Simulation actor in Ptolemy, the console output written by the simulation program may not be visible. To see the console output, change the command line of the Ptolemy actor from

 bash ./runClient.sh

to

 xterm -e bash ./runClient.sh

This will start a terminal that shows the output of the running simulation program which help analyzing what goes wrong, for example, when the simulation program terminates due to an error before connecting to the BCVTB.

2.3. Investigate log files

If something goes wrong during the simulation, check the files simulation.log, utilSocket.log and utilClient.log. They contain log messages that may indicate the cause of the problem. If these files do not exist, go to the directory bcvtb/lib, open the file defines.h and add the line

#define NDEBUG

Then, from the directory bcvtb/lib compile the libraries using

make clean
make

and rerun the simulation. Now the log files should be written to the directory from which you started the BCVTB.

bcvtb: Help (last edited 2016-04-21 17:07:12 by ThierryNouidui)