Repository navigation
Expand file tree
/
Copy pathmatlab
More file actions
executable file
·1702 lines (1662 loc) · 54.9 KB
/
Copy pathmatlab
File metadata and controls
executable file
·1702 lines (1662 loc) · 54.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
# Copyright 1984-2015 The MathWorks, Inc.
#
# Name:
# matlab script file for invoking MATLAB
#
# Usage:
# matlab [-h|-help] | [-n | -e]
# [-arch | v=variant | v=arch/variant]
# [-c licensefile] [-display Xdisplay | -nodisplay]
# [-nosplash] [-mwvisual visualid] [-debug]
# [-softwareopengl | -nosoftwareopengl]
# [-desktop | -nodesktop | -nojvm]
# [-jdb [port]]
# [-r MATLAB_command] [-logfile logfile]
# [-Ddebugger [options]]
#
# Description:
# This Bourne Shell script sets MATLAB environment variables,
# determines the machine architecture, and starts the appropriate
# executable.
#
# Options:
#
# -h,-help
#
# Help. Show command usage
#
# -n
#
# Print out the values of the environment variables and
# arguments passed to the MATLAB executable as well as
# other diagnostic information. MATLAB is not run.
#
# -e
#
# Print ALL environment variables and their values to
# standard output just prior to exiting. This argument
# must have been parsed before exiting for anything to
# be printed. MATLAB is not run. The last possible exiting
# point is just before the MATLAB image would have been
# executed and a status of 0 is returned. If the exit
# status is not 0 on return then the variables and values
# may not be correct.
#
# -arch
#
# Run MATLAB assuming this architecture rather than the
# actual machine architecture.
#
# v=variant
#
# Execute the version of MATLAB found in the directory
# bin/$ARCH/variant instead of bin/$ARCH.
#
# v=arch/variant
#
# Execute the version of MATLAB found in the directory
# bin/arch/variant instead of bin/$ARCH.
#
#
# -c licensefile
#
# Set location of the license file that MATLAB should use.
# It can have the form port@host or be a colon separated
# list of license files. This option will cause the
# LM_LICENSE_FILE and MLM_LICENSE_FILE environment variables
# to be ignored.
#
# -display Xdisplay
#
# Send X commands to X Window Server display, Xdisplay. This
# supersedes the value of the DISPLAY environment variable.
#
# -nodisplay
#
# Do not display any X commands. The DISPLAY environment
# variable is ignored. The MATLAB desktop will not be started.
# However, unless -nojvm is also provided the Java virtual
# machine will be started.
#
# -nosplash
#
# Do not display the splash screen during startup.
#
# -mwvisual visualid
#
# The default X visual to use for figure windows.
# The visualid is a hex number which can be found using
# xdpyinfo.
#
# -softwareopengl
#
# Force MATLAB to start with software OpenGL
# libraries. Not available on Mac.
#
# -nosoftwareopengl
#
# Disable auto-selection of software OpenGL when a graphics driver
# with known issues is detected. Not available on Mac.
#
# -noopengl
#
# Disable OpenGL completely and use painters instead.
#
# -debug
#
# Provides debugging information especially for X based
# problems. Should be used only in conjunction with a
# Technical Support Representative from The MathWorks, Inc.
#
# -desktop
#
# Allow the MATLAB desktop to be started by a process
# without a controlling terminal. This is usually a required
# command line argument when attempting to start MATLAB
# from a window manager menu or desktop icon.
#
# -nodesktop
#
# Do not start the MATLAB desktop. Use the current window
# for commands. The Java virtual machine will be started.
#
# -nojvm
#
# Shut off all Java support by not starting the Java virtual
# machine. In particular the MATLAB desktop will not be
# started.
#
# -jdb [port]
#
# Enable remote Java debugger on port (default 4444)
#
# -r MATLAB_command
#
# Start MATLAB and execute the MATLAB command.
#
# -logfile log
#
# Make a copy of any output to the command window in file log.
# This includes all crash reports.
#
# -Ddebugger [options]
#
# Start MATLAB with debugger (e.g. dbx, gdb, dde, xdb, cvd).
# A full path can be specified for debugger. The options
# cover ONLY those that go after the executable to be debugged
# in the syntax of the actual debug command and for most
# debuggers this is very limited. To customize your debugging
# session use a startup file. See your debugger documentation
# for details. Options above that would normally be passed to
# the MATLAB executable should be used as parameters of
# a command inside the debugger like 'run' and not used
# when running the matlab script. If any of the options are
# placed before the -Ddebugger argument they will be
# handled as if they were part of the options after the
# -Ddebugger argument and will be treated as illegal
# options by most debuggers. The MATLAB_DEBUG environment
# variable is set to the filename part of the debugger argument.
#
# NOTE: For certain debuggers like gdb, the SHELL environment
# variable is ALWAYS set to /bin/sh.
#
#__________________________________________________________________________
#
# Enable proper operation on Windows when using a UNIX-compatible shell
# Simply redirects to the Windows starter executable.
#
if [ "$OS" = "Windows_NT" ]; then
arglist=
while [ $# -gt 0 ]; do
# Quote arguments to preserve arguments that contain whitespace
# or single quotes, e.g., -r "disp('hello'); quit"
arglist="$arglist \"$1\""
shift
done
eval exec "\"$0.exe\" $arglist"
fi
#
arg0_=$0
#
# Temporary file that hold MATLABPATH code from .matlab7rc.sh file.
#
temp_file=/tmp/matlab.$LOGNAME.$$.a
#
trap "rm -f $temp_file; exit 1" 1 2 3 15
#
# Some Bourne shells use builtin echo that doesn't preserve backslashes
# in certain cases, e.g. echo "'a\nb'"
#
# Need version of non-builtin echo that will preserve the backslash.
#
if [ -x /usr/ucb/echo ]; then # On Solaris, only /usr/ucb/echo does it.
ECHO=/usr/ucb/echo
elif [ -x /bin/echo ]; then # On Linux and Mac, /bin/echo does it.
ECHO=/bin/echo
else
ECHO=echo
fi
#========================= archlist.sh (start) ============================
#
# usage: archlist.sh
#
# abstract: This Bourne Shell script creates the variable ARCH_LIST.
#
# note(s): 1. This file is always imbedded in another script
#
# Copyright 1997-2013 The MathWorks, Inc.
#----------------------------------------------------------------------------
#
ARCH_LIST='glnxa64 maci64'
#=======================================================================
# Functions:
# check_archlist ()
#=======================================================================
check_archlist () { # Sets ARCH. If first argument contains a valid
# arch then ARCH is set to that value else
# an empty string. If there is a second argument
# do not output any warning message. The most
# common forms of the first argument are:
#
# ARCH=arch
# MATLAB_ARCH=arch
# argument=-arch
#
# Always returns a 0 status.
#
# usage: check_archlist arch=[-]value [noprint]
#
if [ $# -gt 0 ]; then
arch_in=`expr "$1" : '.*=\(.*\)'`
if [ "$arch_in" != "" ]; then
ARCH=`echo "$ARCH_LIST EOF $arch_in" | awk '
#-----------------------------------------------------------------------
{ for (i = 1; i <= NF; i = i + 1)
if ($i == "EOF")
narch = i - 1
for (i = 1; i <= narch; i = i + 1)
if ($i == $NF || "-" $i == $NF) {
print $i
exit
}
}'`
#-----------------------------------------------------------------------
if [ "$ARCH" = "" -a $# -eq 1 ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ' '
echo " Warning: $1 does not specify a valid architecture - ignored . . ."
echo ' '
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fi
else
ARCH=""
fi
else
ARCH=""
fi
#
return 0
}
#=======================================================================
#========================= archlist.sh (end) ==============================
#
#=======================================================================
# Functions:
# check_rc_file ()
# build_cmd ()
#=======================================================================
check_rc_file () { # Checks rc_file file for minimal features.
# Currently the only thing it checks for is:
#
# .matlab7rc.sh in the file
#
# If it fails the check print a warning message.
# The rc_file is assumed to exist.
#
# Always returns a zero status.
#
# usage: check_rc_file rc_file
#
grep '\.matlab7rc.sh' "$1" > /dev/null 2>&1
if [ $? -ne 0 ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo "---------------------------------------------------------------------------"
echo "Warning: The .matlab7rc.sh file that was sourced is old . . ."
echo " --> file = $1"
echo " "
echo ' Please use $MATLAB/bin/.matlab7rc.sh to update this file.'
echo " --> MATLAB = $MATLAB"
echo "---------------------------------------------------------------------------"
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fi
return 0
}
#=======================================================================
build_cmd () { # Takes the cmd input string and outputs the same
# string correctly quoted to be evaluated again.
#
# Always returns a 0
#
# usage: build_cmd
#
# Use version of echo here that will preserve
# backslashes within $cmd. - g490189
$ECHO "$cmd" | awk '
#----------------------------------------------------------------------------
BEGIN { squote = sprintf ("%c", 39) # set single quote
dquote = sprintf ("%c", 34) # set double quote
}
NF != 0 { newarg=dquote # initialize output string to
# double quote
lookquote=dquote # look for double quote
oldarg = $0
while ((i = index (oldarg, lookquote))) {
newarg = newarg substr (oldarg, 1, i - 1) lookquote
oldarg = substr (oldarg, i, length (oldarg) - i + 1)
if (lookquote == dquote)
lookquote = squote
else
lookquote = dquote
newarg = newarg lookquote
}
printf " %s", newarg oldarg lookquote }'
#----------------------------------------------------------------------------
return 0
}
#=======================================================================
#
#**************************************************************************
# Determine the path of the MATLAB root directory - always one directory
# up from the path to this command.
#**************************************************************************
#
filename=$arg0_
#
# Now it is either a file or a link to a file.
#
cpath=`pwd`
#
# Use it to find the top of the tree
# Skip this if someone wants to override the default
#
if [ "$SOURCE_MATLAB_ENV_FROM" = "" ]; then
#
# Follow up to 8 links before giving up. Same as BSD 4.3
#
n=1
maxlinks=8
while [ $n -le $maxlinks ]
do
#
# Get directory correctly!
#
newdir=`echo "$filename" | awk '
{ tail = $0
np = index (tail, "/")
while ( np != 0 ) {
tail = substr (tail, np + 1, length (tail) - np)
if (tail == "" ) break
np = index (tail, "/")
}
head = substr ($0, 1, length ($0) - length (tail))
if ( tail == "." || tail == "..")
print $0
else
print head
}'`
if [ ! "$newdir" ]; then
newdir="."
fi
(cd "$newdir") > /dev/null 2>&1
if [ $? -ne 0 ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ''
echo 'Internal error 1: We could not determine the path of the'
echo ' MATLAB root directory.'
echo ''
echo " original command path = $arg0_"
echo " current command path = $filename"
echo ''
echo ' Please contact:'
echo ''
echo ' MathWorks Technical Support'
echo ''
echo ' for further assistance.'
echo ''
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exit 1
fi
cd "$newdir"
#
# Need the function pwd - not the built in one
#
newdir=`/bin/pwd`
#
newbase=`expr //$filename : '.*/\(.*\)' \| $filename`
lscmd=`ls -l $newbase 2>/dev/null`
if [ ! "$lscmd" ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ''
echo 'Internal error 2: Could not determine the path of the'
echo ' MATLAB root directory.'
echo ''
echo " original command path = $filename"
echo " current command path = $filename"
echo ''
echo ' Please contact:'
echo ''
echo ' MathWorks Technical Support'
echo ''
echo ' for further assistance.'
echo ''
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exit 1
fi
#
# Check for link portably
#
if [ `expr "$lscmd" : '.*->.*'` -ne 0 ]; then
filename=`echo "$lscmd" | awk '{ print $NF }'`
else
#
# It's a file
#
dir="$newdir"
command="$newbase"
#
cd "$dir"/..
#
# On Mac OS X, the -P option to pwd causes it to return a resolved path, but
# on 10.5, -P is no longer the default, so we are now passing -P explicitly
#
if [ "$ARCH" = "" ]; then
#if we are on Mac OS X then /bin/pwd will not return a resolved path. This is ok
#because the whole point here is to source $MATLABROOT/bin/util/arch.sh which will
#set $ARCH.
MATLABdefault=`/bin/pwd`
. "$MATLABdefault/bin/util/arch.sh"
fi
if [ "$ARCH" = 'mac' -o "$ARCH" = 'maci' -o "$ARCH" = 'maci64' ]; then
MATLABdefault=`/bin/pwd -P`
#
# The Linux version of pwd returns a resolved path by default, and there is
# no -P option
#
else
MATLABdefault=`/bin/pwd`
fi
break
fi
n=`expr $n + 1`
done
if [ $n -gt $maxlinks ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ''
echo 'Internal error 3: More than $maxlinks links in path to'
echo " this script. That's too many!"
echo ''
echo " original command path = $filename"
echo " current command path = $filename"
echo ''
echo ' Please contact:'
echo ''
echo ' MathWorks Technical Support'
echo ''
echo ' for further assistance.'
echo ''
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exit 1
fi
else
MATLABdefault="$SOURCE_MATLAB_ENV_FROM"
fi
cd "$cpath"
#
#**************************************************************************
#
# Do not use ARCH if it exists in the environment
#
ARCH=""
#
# Parse the arguments
#
stat="OK"
showenv=0
showenv_all=0
VARIANT=""
VARIANTmatlab="MATLAB"
arglist=""
arglist2=
memmgr=""
desktopflag=1
jvmflag=1
awtflag=1
nodisplay=0
usemesa=0
nousemesa=0
noopengl=0
workerflag=0
while [ "$stat" = "OK" -a $# -gt 0 ]; do
case "$1" in
-h|-help)
stat=""
;;
-n)
showenv=1
;;
-e)
showenv_all=1
;;
#-c)
# This now is handled by the * case.
# ;;
-display)
if [ $# -eq 1 ]; then
stat=""
else
arglist="$arglist $1"
shift
isoption=`expr "/$1" : '/\(-.*\)'`
if [ "$isoption" != "" ]; then
stat=""
else
arglist="$arglist $1"
display="$1"
fi
fi
;;
-nodisplay)
arglist="$arglist $1"
nodisplay=1
;;
-noawt)
arglist="$arglist $1"
awtflag=0
;;
-softwareopengl)
usemesa=1;
arglist="$arglist $1"
;;
-softwareopengllinux)
usemesa=1;
arglist="$arglist -softwareopengl"
;;
-nosoftwareopengl)
nousemesa=1;
arglist="$arglist $1"
;;
-noopengl)
noopengl=1;
arglist="$arglist $1"
;;
-memmgr)
if [ $# -eq 1 ]; then
stat=""
else
shift
memmgr=$1
fi
;;
-check_malloc)
memmgr="debug"
;;
-D*)
debugger=`expr "$1" : '-D\(.*\)'`
if [ "$debugger" = "" ]; then
stat=""
else
MATLAB_DEBUG=`expr "//$debugger" : ".*/\(.*\)"`
fi
;;
-jdb)
arglist="$arglist $1"
;;
-nodesktop)
desktopflag=0
;;
-nojvm)
jvmflag=0
;;
-dmlworker)
workerflag=1
arglist="$arglist $1"
;;
-r)
if [ $# -eq 1 ]; then
stat=""
else
arglist="$arglist $1"
shift
cmd="$1"
quoted_cmd=`build_cmd`
# Use version of echo here that will preserve
# backslashes in $quoted_cmd. - g490189
arglist="$arglist `$ECHO $quoted_cmd`"
fi
;;
-timing)
timingWanted=1
if [ "$ARCH" = "" ]; then
. "$MATLABdefault/bin/util/arch.sh"
fi
if [ -f "$MATLABdefault/bin/$ARCH/cpucount" ]; then
MATLAB_CPUCOUNT=`"$MATLABdefault/bin/$ARCH/cpucount"`
fi
;;
-logfile)
if [ $# -eq 1 ]; then
#
# The MATLAB executable will check that there is no logfile
#
arglist="$arglist $1"
else
#
# The MATLAB executable will check if the file can be opened for writing
#
arglist="$arglist $1 $2"
shift
fi
;;
v=*/*)
foundVariant=0
#
# Test options if no debugger.
#
if [ "$debugger" = "" ]; then
#
# Check for variant
#
value=`expr "$1" : 'v=\(.*\)/.*'`
value2=`expr "$1" : 'v=.*/\(.*\)'`
arch=$ARCH
check_archlist argument=$value noprint
if [ "$ARCH" != "" -a -f "$MATLABdefault/bin/$value/$value2/MATLAB" ]; then
VARIANT=$value2
VARIANTmatlab=$VARIANT/MATLAB
foundVariant=1
else
ARCH=$arch
fi
fi
if [ "$foundVariant" = "0" ]; then
arglist="$arglist $1"
fi
;;
v=*)
foundVariant=0
#
# Test options if no debugger.
#
if [ "$debugger" = "" ]; then
value=`expr "$1" : 'v=\(.*\)'`
#
# Check for variant
#
if [ "$ARCH" = "" ]; then
. "$MATLABdefault/bin/util/arch.sh"
fi
if [ -f "$MATLABdefault/bin/$ARCH/$value/MATLAB" ]; then
VARIANT=$value
VARIANTmatlab=$VARIANT/MATLAB
foundVariant=1
fi
fi
if [ "$foundVariant" = "0" ]; then
arglist="$arglist $1"
fi
;;
-*)
found=0
#
# Test options if no debugger.
#
if [ "$debugger" = "" ]; then
#
# Check for -arch
#
arch=$ARCH
check_archlist argument=$1 noprint
if [ "$ARCH" != "" ]; then
found=1
else
ARCH=$arch
fi
fi
if [ "$found" = "0" ]; then
arglist="$arglist $1"
fi
;;
*)
arglist="$arglist $1"
;;
esac
shift
done
#
# Check for errors
#
if [ "$stat" != "OK" -a "$showenv" != "1" ]; then # An error occurred.
#
if [ "$stat" != "" ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ""
echo " ${command}: $stat"
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fi
if [ "$ARCH" = "" ]; then
. "$MATLABdefault/bin/util/arch.sh"
fi
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ""
echo " Usage: ${command} [-h|-help] | [-n | -e]"
echo " [v=variant]"
echo " [-c licensefile] [-display Xdisplay | -nodisplay]"
echo " [--noFigureWindows]"
echo " [-nosplash] [-debug]"
echo " [-softwareopengl | -nosoftwareopengl]"
echo " [-desktop | -nodesktop | -nojvm]"
echo " [-r MATLAB_command] [-logfile log]"
echo " [-singleCompThread]"
echo " [-jdb [port]]"
echo " [-Ddebugger [options]]"
echo " [-nouserjavapath]"
echo ""
echo " -h|-help - Display arguments."
echo " -n - Display final environment variables,"
echo " arguments, and other diagnostic"
echo " information. MATLAB is not run."
echo " -e - Display ALL the environment variables and"
echo " their values to standard output. MATLAB"
echo " is not run. If the exit status is not"
echo " 0 on return then the variables and values"
echo " may not be correct."
echo " v=variant - Start the version of MATLAB found"
echo " in bin/$ARCH/variant instead of bin/$ARCH."
echo " -c licensefile - Set location of the license file that MATLAB"
echo " should use. It can have the form port@host or"
echo " be a colon separated list of license files."
echo " The LM_LICENSE_FILE and MLM_LICENSE_FILE"
echo " environment variables will be ignored."
echo " -display Xdisplay - Send X commands to X server display, Xdisplay."
echo " Linux only."
echo " -nodisplay - Do not display any X commands. The MATLAB"
echo " desktop will not be started. However, unless"
echo " -nojvm is also provided the Java virtual machine"
echo " will be started."
echo " -noFigureWindows - Disables the display of figure windows in MATLAB."
echo " -nosplash - Do not display the splash screen during startup."
echo " -softwareopengl - Force MATLAB to start with software OpenGL"
echo " libraries. Not available on Mac."
echo " -nosoftwareopengl - Disable auto-selection of software OpenGL"
echo " when a graphics driver with known issues is detected."
echo " Not available on Mac."
echo " -debug - Provide debugging information especially for X"
echo " based problems. Linux only."
echo " -desktop - Allow the MATLAB desktop to be started by a"
echo " process without a controlling terminal. This is"
echo " usually a required command line argument when"
echo " attempting to start MATLAB from a window manager"
echo " menu or desktop icon."
echo " -nodesktop - Do not start the MATLAB desktop. Use the current"
echo " terminal for commands. The Java virtual machine"
echo " will be started."
echo " -singleCompThread - Limit MATLAB to a single computational thread. "
echo " By default, MATLAB makes use of the multithreading "
echo " capabilities of the computer on which it is running."
echo " -nojvm - Shut off all Java support by not starting the"
echo " Java virtual machine. In particular the MATLAB"
echo " desktop will not be started."
echo " -jdb [port] - Enable remote Java debugging on port (default 4444)"
echo " -r MATLAB_command - Start MATLAB and execute the MATLAB_command."
echo " -logfile log - Make a copy of any output to the command window"
echo " in file log. This includes all crash reports."
echo " -Ddebugger [options] - Start debugger to debug MATLAB."
echo " -nouserjavapath - Ignore custom javaclasspath.txt and javalibrarypath.txt files."
echo ""
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
if [ "$showenv_all" = "1" ]; then
env
fi
exit 1
fi
#
# Determine what is set in the environment
#
AUTOMOUNT_MAPenv="$AUTOMOUNT_MAP"
DISPLAYenv="$DISPLAY"
TOOLBOXenv="$TOOLBOX"
MATLABPATHenv="$MATLABPATH"
MATLAB_MEM_MGRenv="$MATLAB_MEM_MGR"
SHELLenv="$SHELL"
#
# Set the defaults - MATLABdefault is determined above.
#
AUTOMOUNT_MAPdefault=''
DISPLAYdefault=''
ARCHdefault=''
TOOLBOXdefault='$MATLAB/toolbox'
MATLABPATHdefault=''
#
MATLAB_MEM_MGRdefault=''
#
SHELLdefault='$SHELL'
#
MATLAB_UTIL_DIRdefault=$MATLABdefault/bin/util
#
# Feature state variables
#
#--------------------------------------------------------------------------
#
# Source file .matlab7rc.sh and get values for the following environment
# variables
#
# ARCH (machine architecture)
# AUTOMOUNT_MAP (Path prefix map for automounting)
# DISPLAY (DISPLAY variable for X Window System)
# LDPATH_PREFIX (path(s) that appear at the start of
# LD_LIBRARY_PATH)
# LDPATH_SUFFIX (path(s) that appear at the end of
# LD_LIBRARY_PATH)
# LD_LIBRARY_PATH (load library path - the name
# LD_LIBRARY_PATH is platform dependent)
# MATLAB (MATLAB root directory)
# MATLABPATH (MATLAB search path)
# SHELL (which shell to use for ! and unix
# command in MATLAB)
# TOOLBOX (toolbox path)
#
# The search order for .matlab7rc.sh is:
#
# . (current directory)
# $HOME (users home directory)
# $MATLAB/bin (MATLAB bin directory)
#
if [ -f .matlab7rc.sh ]; then
SOURCED_DIR='.'
SOURCED_DIReval=`pwd`
. "$cpath"/.matlab7rc.sh
elif [ -f "$HOME"/.matlab7rc.sh ]; then
SOURCED_DIR='$HOME'
SOURCED_DIReval=$HOME
. "$HOME"/.matlab7rc.sh
elif [ -f "$MATLABdefault/bin/.matlab7rc.sh" ]; then
#
# NOTE: At this point we will use the MATLAB determined earlier to
# source the file. After that the value in that file if not
# null will be used.
#
SOURCED_DIR='$MATLAB/bin'
SOURCED_DIReval=$MATLABdefault/bin
. "$MATLABdefault/bin/.matlab7rc.sh"
else
SOURCED_DIR=
MATLAB_UTIL_DIR=$MATLAB_UTIL_DIRdefault
#
# arch.sh requires MATLAB - save temporarily
#
MATLABsave="$MATLAB"
MATLAB="$MATLABdefault"
#
. "$MATLAB_UTIL_DIR/arch.sh"
if [ "$ARCH" = "unknown" ]; then
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo ''
echo '^G Sorry! We could not determine the machine architecture for your'
echo ' host. Please contact:'
echo ''
echo ' MathWorks Technical Support'
echo ''
echo ' for further assistance.'
echo ''
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exit 1
fi
MATLAB="$MATLABsave"
#
ARCHdefault=$ARCH
fi
#
#--------------------------------------------------------------------------
#
# Determine the final values for the following variables
#
# ARCH (machine architecture)
# AUTOMOUNT_MAP (Path prefix map for automounting)
# DISPLAY (DISPLAY variable for X Window System)
# MATLAB (MATLAB root directory)
# MATLAB_MEM_MGR (Type of memory manager)
# MATLAB_DEBUG (name of the debugger from -Ddebugger argument)
# MATLABPATH (MATLAB search path)
# SHELL (which shell to use for ! and unix
# command in MATLAB)
# TOOLBOX (toolbox path)
#
rcfile='r '
environ='e '
script='s '
argument='a '
rcfilep='rs'
environp='es'
#
# Sourced a .matlab7rc.sh file
#
if [ "$SOURCED_DIR" != "" ]; then
if [ "$AUTOMOUNT_MAP" != "" ]; then
if [ "$AUTOMOUNT_MAPenv" != "" ]; then
AUTOMOUNT_MAPmode="$environ"
else
AUTOMOUNT_MAPmode="$rcfile"
fi
else
AUTOMOUNT_MAPmode="$script"
AUTOMOUNT_MAP="$AUTOMOUNT_MAPdefault"
fi
#
if [ "$MATLAB" != "" ]; then
MATLABmode="$rcfile"
else
MATLABmode="$script"
MATLAB="$MATLABdefault"
fi
if [ "$AUTOMOUNT_MAP" != "" ]; then
MATLAB=`echo $MATLAB $AUTOMOUNT_MAP | awk '
{if (substr($1,1,length($2)) == $2)
if (NF == 4) # a -> b
print $NF substr($1,length($2) + 1)
else # a ->
print substr($1,length($2) + 1)
else
print $1}'`
fi
#
if [ "$display" != "" ]; then
DISPLAYmode="$argument"
DISPLAY="$display"
elif [ "$DISPLAY" != "" ]; then
if [ "$DISPLAYenv" = "$DISPLAY" ]; then
DISPLAYmode="$environ"
else
DISPLAYmode="$rcfile"
fi
else
DISPLAYmode="$script"
DISPLAY="`eval echo $DISPLAYdefault`"
fi
#
if [ "$ARCH" != "" ]; then
ARCHmode="$rcfile"
else
ARCHmode="$script"
ARCH="$ARCHdefault"
fi
#
if [ "$TOOLBOX" != "" ]; then
if [ "$TOOLBOXenv" = "$TOOLBOX" ]; then
TOOLBOXmode="$environ"
else
TOOLBOXmode="$rcfile"
fi
else
TOOLBOXmode="$script"
TOOLBOX="`eval echo $TOOLBOXdefault`"
fi
#
if [ "$MATLABPATH" != "" ]; then
if [ "$MATLABPATHenv" = "$MATLABPATH" ]; then
MATLABPATHmode="$environp"
else
MATLABPATHmode="$rcfilep"
fi
else
MATLABPATHmode="$script"
MATLABPATH="`eval echo $MATLABPATHdefault`"
fi
#
# For MATLAB_MEM_MGR:
#
# 1. memmgr manager argument
# 2. check_malloc argument
# 3. rcfile (not currently set)
# 4. environment
# 5. default (empty)
#
if [ "$memmgr" != "" ]; then
MATLAB_MEM_MGRmode="$argument"
MATLAB_MEM_MGR=$memmgr
elif [ "$MATLAB_MEM_MGR" != "" ]; then
if [ "$MATLAB_MEM_MGRenv" = "$MATLAB_MEM_MGR" ]; then
MATLAB_MEM_MGRmode="$environ"
else
MATLAB_MEM_MGRmode="$rcfile"
fi