L" s2 B |! W9 b1 b) S$ @ORIGINAL_COMMAND_LINE=. R" s: a& ]% Q5 A6 {5 Q) O
LOOP_CTRL_FILE=".ns_ba_env"$ s6 |. _# k% [9 O9 I$ _( z
ALTER_HK_FILE=".alter_hkf"4 U2 a1 O0 L" a* |) u3 ]# G
ALTER_COUNT_FILE=".alter_count"( G2 L8 c' Q, P2 B1 a; }
MONTE_IMG_FILE=".monte_img_f"6 w, ^) m" m. x/ f- o
MONTE_COUNT_FILE=".monte_count" q% U+ o$ I2 G5 ]
MONTE_CFG_FILE=".monte_cfg" 2 e8 V' E% p. h f% w+ e" DEPIC_SCRIPT_MESSAGES_FILE=".epicscriptmessages" , f% e" s7 U, H; j 0 `7 w+ N* r1 I) i- Yopen_epicscriptmessages $@2 Y( ^2 P6 m# u& W2 z
8 ^' H" B7 P7 j2 }1 R3 r7 W
scan_for_hva_args $@ 1 A1 B6 f3 [# ^) Q- [ 6 y! d Y4 k1 W* v& |scan_for_har_args() % h5 O( q* }. T# |8 L1 u{5 G1 H6 U, ?. j" _8 }' t, }. b
while [ $# -gt 0 ]; do+ j8 Z8 Z8 P. A4 e% t' s! K, Y' H
case "$1" in $ j5 o" p! C5 Z! q$ j, N -har)2 X6 S$ V: v4 O! t' S' A
have_har_flag=1 . v0 E( W1 c1 ^ [ $# -gt 0 ] && shift - K) `( B3 I7 \3 J/ C* Q0 C) T+ F if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then ! |3 W9 \3 B9 _9 _( \/ n& y, J( I har_hilo_file=$1 8 ~" [3 D% g5 V/ G6 Q4 q# U shift R, y1 E6 f& e5 p7 x7 d fi 9 K4 L# e- m9 n2 v4 C' G if [ $# -gt 0 -a `expr "$1" : '-.*'` -eq 0 ]; then7 o$ m1 m$ w2 Q) w% I
echo "Too many arguments to -har flag. Only one hilo file allowed."3 e. M+ L/ a! A! L( S' B6 F1 S/ ]
exit 1- l1 G# G/ e6 w8 M$ b: F& I
fi' n9 h: Z3 w$ K+ l* D8 @. @
break W3 N9 m3 c5 C, g( P! L
;;, s, M$ g0 s* d, R% B8 G
-har_setup)! }$ J7 k% M" I+ e
have_har_setup_flag=1# N, C0 ]/ e( c3 t0 Z+ v4 |3 I6 J
break " b' l6 [+ ~! {; T ;; 7 w# y! M4 L( H6 h7 c *) 4 X" W+ q$ A, h5 o. L+ u+ b9 F shift 9 l! }0 a. _8 i: T# i; F6 E8 C ;;0 @0 i+ d- E: Y* r& M) ?7 b% b
esac % @- A; Z% v+ w" g# O/ J2 Q" s done ( z# t, g6 ]$ k. m6 K+ u# x; i. a} 5 r' ?* |& |, o ! K5 Q9 X4 B; G8 H8 fscan_for_har_args $@ 2 n; v3 |3 X: t; e N8 U, T$ R# ]. {% Z, Q: _! U8 m: `! J
for argv in $@; h d; o& R0 p2 M9 J' I
do( Q. Y7 p* h4 C# d+ A
ORIGINAL_COMMAND_LINE="$ORIGINAL_COMMAND_LINE $argv": \ A' n8 O" J9 c
if [ $argv = "-gadb" ]; then ( Q3 J# z8 v( l0 v& y databaseOn="y", C3 J; g2 ^' l3 M% V- P
workDir_next=1 " _% [, u1 u! ? elif [ $workDir_next -eq 1 ]; then h% U8 P: @7 K8 j$ L+ p7 q workDir=$argv! F3 W7 S, f7 G/ i4 Z
workDir_next=0 9 B, X5 n/ O! ?; ]) n8 x+ v- ]) [ elif [ $argv = "-ga" ]; then : j( @# x- j: P4 s0 E gui="y" 9 u- X2 ]. e0 _! {% d0 E elif [ $argv = "-f" ]; then4 t' a) J9 B$ N. g8 K
f_next=1 1 v5 f. d: l+ N$ I/ A8 a elif [ $f_next -eq 1 ]; then ! P- h4 V+ w' a9 _3 e f_option=$argv 3 w" F( D* t; p5 ]- W+ l% N/ d f_next=0 ) t* H5 r; K) E" C) ?4 }3 v elif [ $argv = "-o" ]; then . B. d# c* F2 H. Q# y4 P' L o_next=1, t% _* L- b6 M, B+ |2 N
elif [ $o_next -eq 1 ]; then % |1 \. m# e9 I- _- E o_option=$argv " s% \* S+ N: s, l, U6 e- r2 ^ o_next=0) M0 w7 Y2 L5 ^1 H1 ^6 O, @
fi% b5 @) k' ^' T( M+ w" J$ b5 m1 u
done7 h( s+ B) t4 y5 w& g2 b
echo "Command line options: $ORIGINAL_COMMAND_LINE" > $EPIC_SCRIPT_MESSAGES_FILE ( k; k) k$ f$ l3 I# o8 k% A
7 i1 I( E- g1 h( v! Mif [ $databaseOn = "y" -o $gui = "y" ]; then 8 g8 r( r' N( X4 ~: u if [ $cmdname = "pathmill" ]; then- {& s; X% B! a1 A* t' S+ W
if [ "$EPIC_ARCH" = "SUN4_SUNOS_5" -o "$EPIC_ARCH" = "SUN4_SUNOS_5_64" ]; then! K' Y/ E. m5 f7 s) m1 ~0 w ]7 E
ostore="y"! Z" v5 R' h& F* t }
postgres="n"2 `7 V; Z/ Z% |6 p( n
else* }8 h f! V3 e/ n# |
echo "athmill GUI is supported on Solaris platforms only" 1>&2 # Q9 j0 L/ j+ t' c3 A4 G; C exit ; A! F n: N# a9 i! @ fi. O0 W+ z' g8 g& e |- a Z ^& ?
else, g+ b+ U) f3 T5 t* k$ y9 I- _, m
postgres="y"4 a+ L& _3 R8 Q1 g
ostore="n"3 i9 g$ {4 Y. w8 S
fi4 F3 } K9 q. J( X+ |. l6 ]
fi P, q, p4 d( x% m
+ w+ S$ W: t" r( E [
if [ $gui = "y" ]; then* p& p! _. l+ p/ @- u) n- M
if [ $cmdname = "powrmill" ]; then! G5 [5 E6 B# E. R. }. {
pwga $@/ X# O5 V8 X. D( Z! z
exit ! q) d3 Z/ i3 h0 ~7 Z6 l fi * j2 F4 b! G- S; A& o6 R 0 @- z) n* D5 J6 U0 { if [ $cmdname = "pathmill" ]; then ' B! Z0 e& C6 ]& m* g if [ $ostore = "y" ]; then G0 C7 U8 [) T1 V2 P% q
./pathfinder $@ 3 d, T# x$ u! O$ v& U/ @6 q exit% X T# L' f0 s0 E
elif [ $postgres = "y" ]; then " A) k$ b' i- J/ z8 Y' o pmga $@ ( o% ^: R* C) X exit & K! A, _* `3 R2 M fi( m! F* w5 X6 ^% v2 P! v- J, @
fi2 S- ?' \$ V/ J, w: g
fi/ w) b3 `: c5 `0 |
2 H6 F; U, ?7 J2 }, u+ Lif [ $databaseOn = "y" ]; then 9 I k2 A9 O+ M5 }1 r if [ $ostore = "y" ]; then + j# [6 D$ `: s7 B: B1 c! Q3 [ if [ -z "$workDir" ]; then $ j% F; x9 W b, r echo "Error: Missing argument for -gadb option"+ E1 n6 L3 k% G4 S8 V1 \& y- S
Exit 1! V' [" m) J8 {5 T2 q
fi - `, M+ D& M4 Y! N7 e& ^ fi. d; M6 D, ^& n3 i$ `! G
if [ $postgres = "y" ]; then % g6 w3 K1 j1 F2 l if [ -z "$workDir" ]; then, Q- K8 r; j8 p6 n' s; n* j \
echo "Error: Missing argument for -gadb option" 3 F# H* i" \2 l Exit 1 : d& t8 U6 M5 l6 {. @6 ] fi ' a' B# u+ h; T( Q$ T fi ! L$ v* r- L, E- |fi 1 R7 C6 g. l5 E3 ~* ^) C4 s% i5 S( Y5 y. C m
if [ $postgres = "y" ]; then8 y8 k$ |) Q9 r- b- b* a; \
& m$ V$ d. M+ D8 x/ V9 c& w
if [ -r $EPIC_BIN/scripts/gui-init ]; then; d1 |9 p" u C8 k( x/ v9 V6 I1 A
. $EPIC_BIN/scripts/gui-init 8 K$ K: E! w* N3 | elif [ -r $SES_ROOT/bin/scripts/gui-init ]; then6 L2 L/ [; _. L, i9 u
. $SES_ROOT/bin/scripts/gui-init) Z5 h; r2 c; Q- ]7 X+ E
else2 D" \: b6 `/ G, w& U: ]. I2 `0 |
echo " ** Installation in \"$EPIC_HOME\" has been corrupted!" 1>&2, D @: |7 |. g- ?" t
echo " file bin/scripts/gui-init is missing." 1>&2! L/ f+ w0 @7 P: y
fi2 W! B/ D' c3 i3 M8 }7 `# K% {& i
/ w, m5 E q n, o% X, z" Y( m
workfile -tool $cmdname $@9 ^- ^2 {5 t( x# q
fi 8 l+ G' n7 q7 i5 \1 b/ `6 O6 c( P! S6 w
if [ ! -z "$o_option" ]; then $ T- X3 i* b- I, L) j d; p errFile=${o_option}.err 6 M# I) Y4 l% y w% w* ]elif [ ! -z "$f_option" ]; then 4 D; {* b# y2 H' s: ]9 e if [ -d $f_option ]; then1 r1 |; i0 u5 a7 X( Q% j. e
errFile=${f_option}/powrmill.err ) t* \/ q; f0 @5 y* p- o: ^ else errFile=${f_option}.err 2 z# m$ M/ {* g) @' Y) |/ g fi 2 `% p, A9 M. q& h7 H; dfi , R- L) S! a3 t! t, j3 x z3 G& K" a" `" `& e
1 T5 E) ]' g- I9 _& lif [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then ! d+ V; w8 H6 a" B rundir=.epicrun' Y) n1 j' P4 L8 F3 G
else: V% D: R( D% {; a3 C; C2 T
rundir=.epicrun$$ ! n$ P1 L. ^6 \& b; Z0 H% l) Tfi8 D. o0 `: _% J9 n- n
- i9 E. [) [/ s( j3 p5 Jlibpath="$rundir${EPIC_DLIM}$EPIC_DIR" g+ R: V1 A% i/ ^0 c6 W* l
3 f+ }0 B) V, ?) T. ?# Zcwd=`pwd -P`" ], R& O6 O9 s# W# Q- W5 _. z
if [ $cmdname = "acehdl_w" ]; then, z7 e* R3 P% E' F- n
cmd=`basename $0 .sun`8 I7 q3 `, O. ~, F9 c& T3 g
cmd=`basename $cmd _w`/ L& X' }5 o2 b, J4 }7 ?! w
else0 r2 d I: y9 q8 j9 v
cmd=`basename $0 .sun`, Z* [" Q( `1 r2 H8 [. ?
fi3 ?1 `& g) i' f
+ d9 |7 L& v' j8 K5 U/ @& P9 [
command="$EPIC_EXEC/$cmd$EPIC_EXEX" ~8 ]: k% Z6 H s1 q+ e e& I[ ! -x "$command" ] && echo "$cmd: not installed!" 1>&2 && exit 18 D. t3 G+ P) t
: u# L) o" G9 w! Z" B; u
# buildmod extracts -u/-fm options and calls genepiclib % r8 \5 V" R: }& B _- F! J# It also set the remaining options to variable CMDLINE3 x* [0 }4 L) L
# look up in .epicrc for -fm & -FM parameters* A2 M' I$ F# b8 d+ T* s. B2 o
9 q4 Y; S6 C$ i( n# ]& b& D
fmlist1="`get_epicrc ./.epicrc user_adfm_obj_modules`"# W; A* S9 E% Z# t( H
[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules`" ( i5 B9 v/ U% t; c6 E7 f) V) {; D[ "$fmlist1" = "" ] && fmlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules`" % T9 u& _8 O- m+ [( q! [3 K 7 L( X$ q( v; G- {- g" KFMlist1="`get_epicrc ./.epicrc user_adfm_obj_modules_force`" ; a8 i! a6 b# u0 \" N" [4 ][ "$FMlist1" = "" ] && FMlist1="`get_epicrc $HOME/.epicrc user_adfm_obj_modules_force`" 6 {6 H: J: C0 d/ i. q' v* p! v# x[ "$FMlist1" = "" ] && FMlist1="`get_epicrc $EPIC_DIR/.epicrc user_adfm_obj_modules_force`") ~& {. p3 N; n4 G$ m6 |
9 n2 c) n9 p" t# ^* \if [ $# -gt 0 -o "$FMlist1" != "" -o "$fmlist1" != "" ]; then/ f5 K: D2 I; Z( w# Y e. {0 O
# note that the buildmod script will set the CMDLINE variable ' x% o$ c4 N" | . $EPIC_BIN/scripts/buildmod " J( I, T2 }$ _" A- l6 ?7 P' Y" n/ f0 Z+ @5 p. [1 t
#echo "This is the value of cmdline=$CMDLINE" d ^# [ o& I# Q, I1 j" C# J
#exit 0 8 f% ]8 f) R ]) s5 m' p' l 8 U: T. G5 E6 a # if a new timemill/powrmill/pathmill built, run the new one , ]3 g/ y' P0 l7 d# N [ -x "$rundir/$cmd$EPIC_EXEX" ] && command="$rundir/$cmd$EPIC_EXEX" 4 t, I! j! ]2 a; e% zfi9 F, {, k) m$ `7 j! _0 p$ x& D2 Q
3 h( U6 Q3 W. B) bif [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" ]; then% g/ r: [" d6 P
if [ $have_har_flag -eq 1 ]; then 4 ^& A! y: g$ v1 T is_special_har_run=1 2 s. ~7 ~8 Z w, ?, W4 t& I$ e) ] if [ "$o_option" = "" ]; then# ^ w) Y: o% K! T
case $cmd in. T: S( a( e Z6 Y* ~! p2 b
timemill) 8 t* M) |5 u. X# v har_ofile_prefix=timemill " \$ i. \! Z f ;; 6 T, k# c s' v3 B powrmill) 0 i5 W" i* Y2 k- O* p har_ofile_prefix=powrmill . H, ?4 c, T3 @0 R7 D ;;, u/ ^) L2 e3 E% u5 @0 g( W
nanosim): f h6 M) [- ^, g j
har_ofile_prefix=nanosim. s% F" v; J* Z( [3 T
;; : ~3 F% T' r9 S7 V$ {0 v) m esac( O) T. T. D4 K% S1 I( W* P0 @) f9 P
else- J1 z5 Z! K" C- \
har_ofile_prefix=$o_option 3 V5 ^8 H3 R u4 o3 _3 p fi, U5 U% R- ?2 O7 T' p ^% r+ u
fi: D' S) ?& d; @! R1 F9 H
fi" U Z6 k9 y4 W# q
5 ~ ?9 `8 f# S r9 G {# Call Double precision version of the product if -D 6 x& i3 k6 j8 w, S8 r# or simulation time > 1,000,000 ns.0 k3 b" K" w5 w6 G4 X
if [ "$cmd" = "timemill" -o "$cmd" = "powrmill" -o "$cmd" = "nanosim" -o "$cmd" = "railmill" -o "$cmd" = "pwarc" ]; then : r4 v- D* b, f, m; z2 d; m) {, A7 m$ [- E4 @/ o' u* N
# Now the binary always has the ACE feature; P# @: G D! a9 G
USE_ACE=YES # z$ n& o7 L" _ ! y5 u2 N7 m) c& d HAVE_DP=NO 5 G# P4 W' ^; d9 U! x2 f- U EXTRA_CAPACITY=NO ! E( o$ e3 }6 u2 R% D DB_REAL=${FORCE_DB_REAL:-"0"}; _1 E4 q! }- q( B
1 }" y# w- o& i) L" } # Enhance for ACE ease of use 4 m5 {: s" W$ R% U. `$ B" O # If no command line option or only a -T option, do:2 @ Q; Q( e* ] ^0 L* c
# 1. set -A option + @8 N, n8 H+ B/ w3 K' i" {7 z% }, u # 2. assume input file to be hspice/ G3 W, K9 @: ~
# 3. set -o to input file prefix ( w' k3 ]1 C% ~9 h # 4. set -z to input file prefix ) |) k8 Z* }/ _, h7 U # 5. set -c to default config file ; v, E4 G/ N. f" d netlist="" # O( J4 [4 `/ F minusT=NO " v, [3 O! d+ n0 {" U/ M% ` useStdCmdOpt=0 " j' R% K" q* c# f6 D% t: c9 P prefix=""1 u' r. |5 p7 q0 x% e7 E
circuitType=""3 b- w4 D9 X* w C
for opt in $CMDLINE$ H7 e. }( g) v' Y$ c- b' r/ w
do ! M2 J2 u% c+ z6 V/ U case "$opt" in : I4 e; _# l! k9 y6 ^: T- U: ?. l -T) % a- u7 [3 B+ B" G. e4 C% s' q minusT=YES; F: Z7 n$ N, L. V+ [# j+ ]
;; D. r5 Q% j( H. B -*), y* a9 f: a' a
# using standard powrmill command line $ K! O+ ~. b9 P8 e$ @- b useStdCmdOpt=13 V4 n- U" b) @3 A# h/ i' i0 \. B( o
break 4 Q" {, c+ R" B3 |; f0 a- F0 A ;;" l0 A$ W3 U7 u2 p) G; B! d$ F) g
*)/ K! J! Z9 j5 P+ ~: q
if [ "$minusT" = "YES" ]; then8 j( `+ \$ z# F/ F `" Z
circuitType=$opt : \) f, j' J% X, f' F& x$ u minusT=NO # reset flag ) Y5 w! u& u6 D, @3 t else * E! h- V( X% f4 _# q6 }; ^
if [ "$netlist" = "" ]; then, Q+ S+ P2 O3 @1 E' ?
prefix=`basename $opt` , n: N/ N4 k! G1 V9 n" c prefix=`expr $prefix : '\([^.]*\)\..*' \| $prefix` 9 s+ G$ G+ v! s; Q1 ^0 w fi. B* q7 ^0 w( A9 k% k
netlist="$netlist $opt" 2 S$ M0 f) V, k8 r% J fi + G; U0 l( i$ @7 m( W: \. F ;; ; }# f, f" A( V# q, d esac5 K; ~( |+ m" j) ^$ e9 v
done6 ]5 a q& n% p. n! E
9 t8 S/ [/ k( Z: U ( ^; c7 {, I- Z7 [ if [ $useStdCmdOpt -eq 1 ]; then$ A* \5 N: Z! U, G% G4 N% J
# use standard powrmill/timemill command option / e0 V" e$ H/ I+ g# t9 K' l) o1 |! G for opt in $CMDLINE; d4 @8 X1 y. l* B; Q# W
do ; W7 j' A" @8 L" \/ V5 w! O5 h7 m) w case "$opt" in 5 j6 p4 i% u' ^% X& M
-A) ( z: k* S) Y' ^8 [ DB_REAL=1 ! Q: t2 r u2 ? ;;: `$ G' ~( }" H+ {4 M' v9 f) d7 M5 I
esac; e, |6 ]$ e* h+ P- d- x
done c/ |5 c# d7 {- `9 Y if [ "$netlist" != "" ]; then7 ~1 c0 M* N" E4 c$ U
CMDLINE="-nspice $CMDLINE"! w7 ]) N* N: D; y9 y2 m9 Y
fi: `' C5 e* v* D' d! x% _% c
else, O/ J+ y5 P* }% U y
if [ "$netlist" != "" ]; then; c ^4 r q$ }7 f6 ^7 O# N. }
EPIC_DEFAULT_CFG_DIR=${EPIC_DEFAULT_CFG_DIR:-"$EPIC_AUXX/etc/$cmd"}& s. w, Q, M( L% B0 m( S
# construct new command option & P' n. t! F" A- u0 {& u if [ -f $cmd.ini -a "$circuitType" = "" ]; then# Y$ z7 ?3 s9 F" X
CMDLINE="-nspice $cmd.ini $netlist" & L" K9 P2 }4 T5 l else( v9 j' A# ?$ x$ ~& J4 L r
if [ "$circuitType" = "" ]; then 4 ~) `9 R0 x8 u8 n+ T1 ~ circuitType="msana"4 N" N8 o- P1 r) s
fi" ^: g1 A( b& A: Y H4 T
CMDLINE="-nspice $netlist -c $EPIC_DEFAULT_CFG_DIR/$circuitType.cfg"4 C. I0 _1 y' f+ z
fi# z! Y3 P6 Z4 u ?; d; _/ f
CMDLINE="$CMDLINE -A -o $prefix"/ s( F; @' ] O+ q: R$ H) Z
DB_REAL=1# C0 r$ c4 ^# d! a
echo $cmd $CMDLINE: }6 e" C* Z# C' z- `$ q! X
fi 1 E' m* Q. Q5 J& F$ X f' j6 n fi& y i0 }0 v/ x. v
fi # cmd is timemill or powrmill or nanosim or railmill or pwarc! w0 R7 }* t: l
" C0 c! V4 C8 C5 d1 W[ "$HAVE_DP" = "YES" ] && [ -x "${command}_a" ] && command=$command"_a" - F+ ~& d0 U9 S% Y8 |" i; a[ "$USE_ACE" = "YES" -a "$DB_REAL" = "1" -a -x "${command}_a" ] && command=$command"_a"( B3 h/ U' `) K, u7 @2 \4 W
[ "$USE_ACE" = "YES" -a "$vlog_design" != "" -a -x "${command}_v" ] && command=$command"_v". W. q. N; x' V' A6 d
0 r) w9 {2 P8 _) D( y
if [ "$__engine_wrapper_called__" != "Indeed" ]; then6 l: b5 m5 ~7 M
__engine_wrapper_called__=Indeed! v1 H# _: C" C
if [ "$cmd" != "amps" ]; then 6 {( {. j6 _* }2 }& a, B1 C: N export __engine_wrapper_called__- M8 S8 [, H3 F* Q
fi - `5 k$ O9 J5 W/ k" T - o7 f+ Z4 l J( V+ @ trap "cleanup" 00 x* k, w- k1 A1 n+ O+ V2 @2 S: X
trap "" 2 ' t3 a7 b( ^' z% n# L6 d # b+ v8 X7 U) \5 g( Z$ F5 U1 W% V [ -d "$rundir" ] && rm -fr $rundir6 C- a' d) H5 O: g4 L* k
[ -d "$rundir" ] || mkdir $rundir $ P) Y& d# K9 a G/ r; T2 X+ P- j+ Z% m& r
case "$EPIC_ARCH" in ' I' T8 g- a) _- V3 m' x7 l2 t *SUN*64) 3 |( z4 U; R2 o7 N, C& ] LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH" , k" f& ?) Y8 S export LD_LIBRARY_PATH 3 F t7 }$ d2 {* O suffix=.so 8 R3 l0 N" t' P3 B( _3 Q( G7 A ld_err_code=127. v; R' p; y& k- z6 P( z
;;2 s1 a# E% N1 X" O! e9 D# a0 m& j
*SUN*4) 7 x: m$ @3 S8 Y$ p
LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH"6 P3 [2 W" t$ ~. F6 m* _
export LD_LIBRARY_PATH - a* z. \" M& Q5 y suffix=.so.1.0 , z( m" p+ h; l3 {0 m# f ld_err_code=127- o0 }/ F3 i7 j/ t* o* o' t( i
;; & x A2 E: g y. T+ G *SUN*5) 9 z2 Z+ F, ~8 s: w$ G$ C% n8 k) ? LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH" + o3 B, t0 L$ k+ b5 `' V$ Y. ` export LD_LIBRARY_PATH9 z& F# h3 F+ M. g) c
suffix=.so' C" r$ k' i2 ]4 F7 J. D
ld_err_code=127 - X! V! G. w" r" K8 u ;; 0 [3 G; K- C. d! Y' S x86sol*) & j; y; t3 a9 \7 Y0 P' L
LD_LIBRARY_PATH="$libpathLD_LIBRARY_PATH" & O0 R' Y ^& c" G4 B export LD_LIBRARY_PATH ' {$ M# x% i4 x( \$ O suffix=.so! o0 ~' H% z& P
ld_err_code=127, k# j; b8 k" j3 e$ l! D& v- j
;; 5 D/ c$ ~& f7 i) P( M! J6 J *AIX* | aix64) 7 W- V% ~! \/ V' k # When genepiclib creates shared objects, it creates a import file and - Q! `/ O7 c4 V2 T
# uses timemill as program. So at exec time,program timemill is needed ; B6 ~) G& ^& n: ]* Z ~4 r
# in LIBPATH+ G$ V/ W5 {3 m8 {9 d7 i
$ln_default $command $rundir/foomill/ W* n% M0 S5 l' J; F
LIBPATH="$libpathLIBPATH:/lib:/usr/lib" $ z- i. h/ n# i) U3 C; m, M export LIBPATH 3 f, T- s; M( m3 d/ J7 W suffix=.o4 E3 {8 }8 Z7 p2 ^ s: R) n1 y! A
ld_err_code=8 - j( x& q% i8 H- w+ M if [ "$EPIC_ARCH" = "RS6000_AIX_4" -o "$EPIC_ARCH" = "RS6000_AIX_5" -o "$EPIC_ARCH" = "aix64" ]; then 5 E% C2 Y5 _8 I8 [7 l6 s9 L9 ? tdir=`echo "/tmp/d"$$` ! G( Y/ J: e5 f O& D% \ [ -d "$tdir" ] || mkdir $tdir Y! p- M* A3 N& g( l' {# a if [ -f $EPIC_DIR/libCustom.o ]; then* m s: d- e' z: y! f; I r
cp $EPIC_DIR/libCustom.o $tdir/ * J" ~; n/ X0 Y) B$ z $ln_default $tdir/libCustom.o $rundir/ 2 x. l: {% f l! [6 t* { fi . p: T' ^7 r4 K; J7 t& E$ w if [ -f $EPIC_DIR/libModel.o ]; then 9 b7 k$ _5 u0 L( w2 s. d* ?+ W8 T cp $EPIC_DIR/libModel.o $tdir/ 0 a) ^# {5 K" ^1 O C $ln_default $tdir/libModel.o $rundir/, |0 I$ f: R% ]$ g% a/ m: t! z
fi/ t( H5 C* p t b+ ?4 B4 [
if [ -f $EPIC_DIR/libFuncModel.o ]; then/ u* j* d+ Y' _+ p7 D
cp $EPIC_DIR/libFuncModel.o $tdir/# ]* R5 |( \% }0 m7 s
$ln_default $tdir/libFuncModel.o $rundir/+ `( @- \: M; A, k! j
fi G( g8 H- |! _# l1 Q. N+ j1 p# B6 \ if [ -f $EPIC_DIR/libFuncModel.34.o ]; then$ p# b- Q. n- P" `8 {
cp $EPIC_DIR/libFuncModel.34.o $tdir/ ) w' k d4 u0 n& \9 u6 J! K; ?. y $ln_default $tdir/libFuncModel.34.o $rundir/ . L6 {% W& ]) F! S3 j fi7 Z- e5 M" n/ q( m
fi, M, L: u0 ~0 [4 S: ^ |+ L) p+ _/ Q! G
#Set the IBM flag to enable more shared segids # p6 i4 k% x& |/ g EXTSHM="ON"$ [# X2 q# u \5 K" p3 n; o; A4 Z
export EXTSHM8 ~( D. l" P7 C- G4 q1 b
;; 2 O: P9 z: J' b3 K4 [: F8 R *LINUX*) 6 I! G7 \. L. Q- V: t suffix=.so " W& p4 y! E+ H ld_err_code=1 2 U" [! @( i+ b5 P8 v ;;7 p- P& a" @. V8 q" k
*amd64*)5 G8 u7 q" @; D# `; ^) S
suffix=.so( N/ ~, h( K$ I9 u, Q2 F
ld_err_code=1 - M0 x _3 w8 h; d6 J5 {7 N ;; + F+ Q- B0 H. \$ p *suse64*) ' E1 @1 A- F) u' \! t suffix=.so3 q7 W: J$ ^. `, ?" ]/ c
ld_err_code=1- t, m5 s1 t E/ Q/ h! a- m
;; ! r3 g1 T; c9 O% K' H- C$ C *suse32*) ( {( p4 O& V) t' H5 `' c' Y
suffix=.so9 ~% A2 w" w1 ~. S' O
ld_err_code=1% a& l( f/ H) S I; d+ M
;;: e4 c2 F# e# v3 `6 X) o
esac # y; ^# g1 A) J; e% ]1 ^! R! d- C$ f4 F
[ "$has_custom" = "YES" ] && ulib="$ulib $cwd/libCustom$suffix" 8 n2 t# Q, T+ e( ~! e6 D# R2 Y, m- Z [ "$cmdname" != "timemill" ] && [ "$cmdname" != "powrmill" ] \& j; B6 \6 l7 ?. J
&& [ "$cmdname" != "nanosim" ] \, H1 V7 t- n) `, S" y, _5 {
&& [ "$has_model" = "YES" ] && ulib="$ulib $cwd/libModel$suffix"' Y T+ O! Z! M9 J9 m: X2 c1 z+ I
[ "$_VA_" = "YES" ] && ulib="$ulib $cwd/libva$suffix" t6 G( O6 [1 y, V3 j! c3 q! ^; v6 i/ `: ?
#Look for command line option for libFuncModel.so! Q: Q" R; {3 W
# user_library_next=0 : R/ m/ O5 R: v has_fmlib="" ( [3 o2 ?, n8 K8 {; D% C* U% c for opt in $CMDLINE $ l4 }1 M {3 O0 ~& {1 E% _- \ do* f- s% A* r. d- }7 ?: j: B
case "$opt" in 3 I/ l/ Z n1 q8 m
-fm) - @% r4 D v2 c* r7 s CMDLINE="$CMDLINE $cwd/libModel$suffix" 3 y2 R2 p' u0 M9 M ;;6 p$ v0 T" H1 E* |$ w& J
-fm_user_lib) . T% W, E, U3 V/ l. F5 _# A: D has_fmlib="YES" + ^8 r2 V+ `, u. u1 Q# user_library_next=1 - w+ Y! @$ Q, U" a" L5 A$ u: V ;; 1 q, X2 T# b) f( b4 I7 q+ G. F -xc) 4 B4 g; @( ]- ^
if [ "$EXTRA_CAPACITY" = "NO" ]; then7 i2 Q6 C) R4 z' O0 Q
EXTRA_CAPACITY=YES! y: i* S3 n% s8 w% ]" {
fi + q, m4 N0 `+ T6 n' y9 `, T ;; 5 C$ b& D" |4 u& o" j, N1 O# ~# *), q' `) i1 V, G
# if [ $user_library_next -eq 1 ]; then5 H9 _3 u% y# a6 b5 Z; ?4 y4 f
# if [ -f "$opt" ]; then& c, o+ P9 o# e
# libfmodel=$opt + O @- q# ]9 B$ U" y0 T# else " p/ {# V: Q" D$ r0 w# echo "-fm_user_lib: Specified file not found" t S+ ~7 E' t7 b" t
# echo "-fm_user_lib: Specified file not found" >> .epicscriptmessages( s! w5 q0 ~# |6 u7 R+ d8 r
# fi' ^' |) l$ T! O+ N. n
# user_library_next=0' ]4 P+ u4 |: s z# e6 v
# fi. @1 ]& \! } \
# ;; 2 F2 O+ [3 j7 [! F% p6 b/ s esac - n8 Y6 ^, ~9 b, J1 ^8 T done 8 @: O$ ?# S8 `8 \% j: k; N # a1 o, `" |" ~; `8 y8 g4 m7 c if [ $cmdname = "timemill" -o $cmdname = "powrmill" -o $cmdname = "nanosim" ]; then3 o6 [& i/ }5 }0 r* l" I: J& i8 g1 b
flib="" 6 B, L+ }% A+ L if [ "$has_fmlib" = "" ]; then * J1 {+ b3 ]* M+ } flib="$flib `get_epicrc ./.epicrc user_libraries`" % f* s" u' _8 q, c+ ? flib="$flib `get_epicrc $HOME/.epicrc user_libraries`"# o/ E `, Z) ^- B
flib="$flib `get_epicrc $EPIC_DIR/.epicrc user_libraries`": u% `! {0 i5 D
fi# t4 W0 g$ ~' s! J0 `1 H
fi 0 j: x3 D( [: Q! r* m9 y ( M$ C5 ?0 T) A+ W8 n for i in $ulib7 S' ^# k( F5 T0 B! P; E, m7 \
do) H4 s6 f/ P1 g, R2 }
[ ! -f "$i" ] && continue" J4 u4 P& U' i, |6 ]4 X+ u
dir=`dirname $i`; cd $dir; dir=`pwd`; cd $cwd0 O9 e8 ^8 V z F, Y4 T
i="$dir/`basename $i`" ! ~! {, K; C5 Y7 M9 I% }0 M. Y' ?# ` case "$i" in) o# @# T4 c( i+ t2 f
*libCustom$suffix*) [ "$libcustom" = "" ] && libcustom=$i;; ]. h1 s3 C: i$ K" u+ H$ S5 J
*libFuncModel$suffix*) [ "$libfmodel" = "" ] && libfmodel=$i;; ( l; E, V& l0 X) g3 P *libModel$suffix*) [ "$libmodel" = "" ] && libmodel=$i;; . E* f N( u8 v0 R *libva$suffix) [ "$libva" = "" ] && libva=$i;; + n% T& w( I' i1 a7 R esac ]9 B' {# Y! _6 }. \4 @; R [ "$libcustom" != "" -a "$libfmodel" != "" -a "$libmodel" != "" ] \ $ V( l$ Y, [# T) d2 H; Z && break f& ^/ b. k2 \
done # C0 `. G5 V h0 u( ]$ Z' {& L! B) P7 o7 O6 z
# symbolic link shared libraries to .epicrun$$* E" Z9 V( L: Y; c/ v7 Y
cd $EPIC_DIR; epicdir=`pwd`; cd $cwd 4 F4 A" W3 i' U" G if [ $cmdname != "timemill" -a $cmdname != "powrmill" -a $cmdname != "nanosim" ]; then# V/ g' F+ H9 F0 T
if [ "$libfmodel" != "" ]; then 9 o2 ], R( k( x3 l" {& S [ "$libfmodel" != "$epicdir/libFuncModel$suffix" ] && \ % Z/ v! [$ F: b2 S echo "Using $libfmodel ..." && \ - `; I! r! B$ `& M( T) F echo "Using $libfmodel ..." >> $EPIC_SCRIPT_MESSAGES_FILE . x0 [! G- O, y2 h3 o1 q9 A# [: @ if [ -f $rundir/libFuncModel$suffix ]; then+ K% |4 d. @. \, Q6 J+ g4 n
rm $rundir/libFuncModel$suffix $ S/ [( i5 ~4 Q7 t$ ~, u9 @, R fi( b9 N8 k+ a# b
$ln_default $libfmodel $rundir - `% q$ Z1 t( X2 b# \, W: o
fi 7 D0 H" k# B7 F% L1 t8 P if [ "$libmodel" != "" ]; then8 z; t, P4 i# J% C
[ "$libmodel" != "$epicdir/libModel$suffix" ] && \ ' t; Y. u- o' X9 M4 A% O echo "Using $libmodel ..." && \ ! U0 y* P' Q+ V echo "Using $libmodel ..." >> $EPIC_SCRIPT_MESSAGES_FILE7 `# h2 U+ C' |% F/ {: R. y6 ]9 E
if [ -f $rundir/libModel$suffix ]; then. E& E8 S3 o1 ?; p% w3 G
rm $rundir/libModel$suffix / m7 W5 h# E1 n! K fi; R2 p2 Y% y: d1 u& Z8 z0 @
$ln_default $libmodel $rundir # e$ I; V- U- Y) l
fi; X& n" W; C* @2 c! R1 R
fi- P8 U+ n4 D D- O$ z! d+ N1 O
if [ "$libcustom" != "" ]; then 5 s7 k! Z4 x% b! {5 s2 K$ d [ "$libcustom" != "$epicdir/libCustom$suffix" ] && \ h4 f) S9 p5 ~3 M echo "Using $libcustom ..."; C0 T m& C& S1 Y$ y! [
if [ -f $rundir/libCustom$suffix ]; then2 g, N% Q. d# f" \. \
rm $rundir/libCustom$suffix! w5 k; N$ C: t
fi 2 h4 D6 R7 _( W* w: }3 [ $ln_default $libcustom $rundir # r& x3 `; `2 z fi * x. Q8 ?0 P+ H2 P! W4 k$ I4 S+ k6 c& R6 d
if [ "$flib" != "" -a "$flib" != " " ]; then* R- u3 z. i7 k. H
CMDLINE="$CMDLINE -fm_user_lib $flib" " s9 ?" u5 i' m; v+ T& Q; I5 a9 s fi; i% C( Q: l0 F H, g- D& A
+ L: S2 _' v7 |' s8 H if [ "$libva" != "" ]; then 9 v) i) \7 G1 {: K: k w& @% L: Q/ F if [ -f $rundir/libva$suffix ]; then j# v. l6 E% v1 t, h. _6 N2 V rm $rundir/libva$suffix ) s* C' _' k& f7 J fi 2 |4 |8 j7 ?( K/ R8 U# u1 y $ln_default $libva $rundir ' Y4 V% l1 ]$ Q
fi4 g8 c6 o: A* E
1 z: r0 I Z% q# s% i, e