visit-install 22.9 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4 5 6 7 8 9 10
#!/bin/csh -f
#-----------------------------------------------------------------------
#
# VISIT_INSTALL - Install a compressed tar file distribution of visit
#                 in an existing directory.
#
# Author: Eric Brugger
# Date:   October 26, 1996
#
# Usage
hrchilds's avatar
hrchilds committed
11
#    visit-install [-c anl | llnl_open | llnl_closed | nersc | ornl | princeton | tacc] [-g group] [-gw] [-l] [-dmg]
hrchilds's avatar
hrchilds committed
12
#                  [-beta | -private] version platform directory
hrchilds's avatar
hrchilds committed
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#
#    The default is to install this version as the current version.
#    The -beta flag makes this version the current beta version instead.
#    The -private flag simply adds this version to the tree without making
#        it the current stable or current beta.
#
# Notes:
#    The options must be first.
#
# Modifications:
#    Jeremy Meredith, Mon Mar 19 12:06:55 PST 2001
#    Made it create symlinks for the current or beta release.
#    Made it support a -beta and -private flag.
#
#    Eric Brugger, Thu Mar 29 14:21:39 PST 2001
#    Replace incorrect "else if" constructs with "elif".
#
#    Eric Brugger, Fri Mar 30 08:45:12 PST 2001
#    I undid my previous replacement of "else if" with "elif".  I
#    replaced tests for links (-l) with tests for existance (-e), since
#    tests for links behaved strangely on AIX systems.
#
#    Eric Brugger, Fri Mar 30 10:55:49 PST 2001
hrchilds's avatar
hrchilds committed
36
#    Reorder some lines cleaing up old versions and backing up the
hrchilds's avatar
hrchilds committed
37 38 39 40 41 42 43 44 45 46 47 48
#    current version so that it would work properly.
#
#    Eric Brugger, Wed Jul 18 15:51:32 PDT 2001
#    I added the -a flag.
#
#    Eric Brugger, Wed Feb 20 10:52:52 PST 2002
#    I added support for install sample data files.
#
#    Eric Brugger, Wed Aug 21 14:04:25 PDT 2002
#    I modified the script so that existing distributions would be
#    consistent as much as possible while being updated.
#
hrchilds's avatar
hrchilds committed
49 50 51
#    Eric Brugger, Mon Jul 21 17:53:22 PDT 2003
#    I added the ability to install a configuration file.
#
hrchilds's avatar
hrchilds committed
52 53 54 55
#    Eric Brugger, Thu Jul 31 12:09:02 PDT 2003
#    I removed some error tests that were redundant and caused a
#    maintenance issue.
#
hrchilds's avatar
hrchilds committed
56 57 58
#    Brad Whitlock, Wed Oct 8 16:29:25 PST 2003
#    Added support for clickable scripts in MacOS X.
#
hrchilds's avatar
hrchilds committed
59 60 61 62 63
#    Brad Whitlock, Tue Oct 21 14:07:33 PST 2003
#    I made the command script files that we generate on MacOS X have
#    execute file permissions so they can run when double-clicked in
#    the Finder.
#
hrchilds's avatar
hrchilds committed
64 65 66
#    Eric Brugger, Tue Dec 23 11:05:37 PST 2003
#    I added an option to enable usage logging.
#
hrchilds's avatar
hrchilds committed
67 68 69 70
#    Eric Brugger, Wed May 12 11:05:58 PDT 2004
#    I changed the default for append to be true, and replaced the -a
#    option with -r to make it false.
#
hrchilds's avatar
hrchilds committed
71 72 73 74 75 76 77
#    Eric Brugger, Thu Sep 23 13:41:22 PDT 2004
#    I corrected a bug where the usage logging flag in the visit script
#    doesn't get set when logging is enabled.  The sed command that made
#    the substitution assumed a certain number of spaces in the line,
#    which changed on a recent update.  The current sed command is more
#    forgiving of extra whitespace.
#
hrchilds's avatar
hrchilds committed
78 79 80 81
#    Eric Brugger, Thu Sep 30 10:09:21 PDT 2004
#    I made a chgrp command for installing on the mac conditional on the
#    user specifying a group on the command line.
#
hrchilds's avatar
hrchilds committed
82 83 84 85 86 87 88 89 90
#    Jeremy Meredith, Thu Dec  9 17:41:35 PST 2004
#    Made the switch to version-specific visit scripts.
#    Now the main "visit" script is a symlink to frontendlauncher,
#    legacylauncher is the old "visit" script, and frontendlauncher
#    is the new main script.  Thus we should just erase the old visit
#    script and treat legacylauncher and frontendlauncher as two
#    modern equivalents of the old visit script.  Added the ability to
#    launch tools without passing them as an argument to the visit script.
#
hrchilds's avatar
hrchilds committed
91 92 93
#    Jeremy Meredith, Mon Apr 18 09:27:00 PDT 2005
#    Renamed convert to visitconvert.
#
hrchilds's avatar
hrchilds committed
94 95 96
#    Jeremy Meredith, Wed Apr 20 15:36:36 PDT 2005
#    I ensured that "internallauncher" had the right permissions.
#
hrchilds's avatar
hrchilds committed
97 98 99
#    Jeremy Meredith, Wed Aug 31 16:48:05 PDT 2005
#    I added xml2plugin.
#
hrchilds's avatar
hrchilds committed
100 101 102
#    Brad Whitlock, Tue Mar 7 13:47:00 PST 2006
#    I added the ability to choose a bank other than bdivp.
#
hrchilds's avatar
hrchilds committed
103 104 105 106
#    Eric Brugger, Fri Mar 10 09:55:15 PST 2006
#    I added the ability to install a nersc or ornl config site file.
#    I made a chgrp command conditional on the user having set a group.
# 
hrchilds's avatar
hrchilds committed
107 108 109
#    Brad Whitlock, Thu May 25 15:22:32 PST 2006
#    Added logic to create .installinfo file.
#
hrchilds's avatar
hrchilds committed
110 111 112
#    Eric Brugger, Wed Jun  7 16:38:48 PDT 2006
#    Remove some debug statements.
#
hrchilds's avatar
hrchilds committed
113 114 115
#    Hank Childs, Mon Oct 16 09:12:38 PDT 2006
#    Add support for cli_usagelog.
#
hrchilds's avatar
hrchilds committed
116 117 118 119
#    Brad Whitlock, Wed Sep 20 11:44:49 PDT 2006
#    I made it use mpeg2encode. I also made it install visit_composite
#    and visit_transition.
#
hrchilds's avatar
hrchilds committed
120 121
#    Brad Whitlock, Fri Feb 2 12:14:08 PDT 2007
#    Added support for spaces in the install directory name.
hrchilds's avatar
hrchilds committed
122
#
hrchilds's avatar
hrchilds committed
123 124
#    Thomas R. Treadway, Tue Feb 13 16:20:12 PST 2007
#    Added an dmg option to create a Mac disk image.
hrchilds's avatar
hrchilds committed
125
#
hrchilds's avatar
hrchilds committed
126 127 128 129
#    Eric Brugger, Wed Feb 21 15:36:59 PST 2007
#    Added code to delete the link bin/convert in case it is there
#    from a previous installation.
#
hrchilds's avatar
hrchilds committed
130 131 132 133
#    Thomas R. Treadway, Wed Apr  4 10:22:37 PDT 2007
#    Treat the platformDir like all of the others, allowing darwin-ppc,
#    darwin-i386, or darwin (universal) directory.
#
hrchilds's avatar
hrchilds committed
134 135 136
#    Hank Childs, Mon May 14 17:28:28 PDT 2007
#    Add information to usage statement regarding directory format.
#
137 138
#    Mark C. Miller, Tue Jun 19 17:29:08 PDT 2007
#    Added visit_plugin and mkgrdbl
139 140 141 142
#
#    Hank Childs, Wed Nov 14 16:54:09 PST 2007
#    Make sure we have write permission for the target directory.
#
143 144 145
#    Hank Childs, Mon Nov 19 09:20:04 PST 2007
#    Check for corrupted downloads.
#
146 147 148 149
#    Hank Childs, Mon Nov 26 16:17:06 PST 2007
#    Add some more checks to issue better error messages for various
#    common ways to do this wrong.
#
150 151 152
#    Sean Ahern, Tue Dec  4 11:42:27 EST 2007
#    Added documentation for "-c ornl" and "-c nersc" options.
#
brugger's avatar
 
brugger committed
153 154 155 156 157 158
#    Eric Brugger, Wed Dec 12 17:49:34 PST 2007
#    I removed the -r option. I modified the behavior of the private
#    install to leave the name of the newly installed version as
#    $version+, to avoid the possibility that it would be recognized
#    as a patch.
#
brugger's avatar
 
brugger committed
159 160 161 162 163
#    Eric Brugger, Fri Jan 11 10:15:40 PST 2008
#    I corrected a test checking for write permission in the install
#    directory inadvertently also required that the install directory
#    already exist.
#
164 165
#    Dave Bremer, Wed Mar  5 14:02:40 CST 2008
#    Added anl (Argonne National Lab) site option.
166 167 168 169
#
#    Hank Childs, Tue Jan 20 14:58:07 PST 2009
#    Added princeton site option.
#
hrchilds's avatar
hrchilds committed
170 171 172
#    Hank Childs, Sun Apr 26 09:26:43 CDT 2009
#    Added TACC option.  Renamed open and closed to llnl_open and llnl_closed.
#
hrchilds's avatar
hrchilds committed
173 174 175 176 177 178
#-----------------------------------------------------------------------

set Compress = COMPRESS

set beta = false
set private = false
hrchilds's avatar
hrchilds committed
179
set config = prompt
hrchilds's avatar
hrchilds committed
180
set configSpecified = false
hrchilds's avatar
hrchilds committed
181
set bank = prompt
hrchilds's avatar
hrchilds committed
182
set logging = false
hrchilds's avatar
hrchilds committed
183 184 185
set group_ownership = none
set dir_permission = 755
set file_permission = 644
hrchilds's avatar
hrchilds committed
186
set dmg = false
hrchilds's avatar
hrchilds committed
187

hrchilds's avatar
hrchilds committed
188 189 190 191 192
# Figure out the platform so if we're on a platform for which we need to
# perform extra steps, we know it.
set uname = `which uname`
set os = `$uname -s | tr "[A-Z]" "[a-z]" | tr -d "[0-9]"`

hrchilds's avatar
hrchilds committed
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
set option_found = true
while ($option_found == true)
   switch ($1)
      case -gw:
         set dir_permission = 775
         set file_permission = 664
         shift
         breaksw
      case -g:
         set group_ownership = $2
         shift
         shift
         breaksw
      case -beta:
         set beta = true
         shift
         breaksw
      case -private:
         set private = true
         shift
         breaksw
hrchilds's avatar
hrchilds committed
214 215
      case -c:
         set config = $2
hrchilds's avatar
hrchilds committed
216
         set configSpecified = true
hrchilds's avatar
hrchilds committed
217 218 219
         shift
         shift
         breaksw
hrchilds's avatar
hrchilds committed
220 221 222 223 224
      case -b:
         set bank = $2
         shift
         shift
         breaksw
hrchilds's avatar
hrchilds committed
225 226 227 228
      case -l:
         set logging = true
         shift
         breaksw
hrchilds's avatar
hrchilds committed
229 230 231 232
      case -dmg:
         set dmg = true
         shift
         breaksw
hrchilds's avatar
hrchilds committed
233 234 235 236 237 238 239
      default:
         set option_found = false
         breaksw
   endsw
end

if ($#argv != 3) then
hrchilds's avatar
hrchilds committed
240
   echo "Usage: visit-install [-c anl | llnl_open | llnl_closed | nersc | ornl | princeton | tacc] [-g group] [-b bank] [-gw] [-l] [-dmg]"
brugger's avatar
 
brugger committed
241
   echo "                     [-beta | -private] version platform directory"
hrchilds's avatar
hrchilds committed
242 243 244 245
   echo ""
   echo "                     This will install all of its files and subdirectories"
   echo "                     directly in the specified directory."
   echo "                     (So use /usr/local/visit, not /usr/local)"
hrchilds's avatar
hrchilds committed
246 247 248 249 250 251 252 253
   exit (1)
endif

if ($beta == true && $private == true) then
   echo "Only -beta or -private may be specified, not both."
   exit (1)
endif

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

set version = "$1";
set base = `echo visit$version | tr "." "_"`
set platform = "$2"
set dir = "$3"

set fname1 = $base.$platform.tar.Z
if (! -e $fname1) then
   set Compress = GZIP
   set fname1 = $base.$platform.tar.gz
   if (! -e $fname1) then
      set tarname = $base.$platform.tar
      if (-e $tarname) then
          # Note: as far as I can tell, it would be fine to just
          # accept the unzipped distribution.  But I decided that 
          # would be a bigger change than I wanted to make.
          # ** The purpose of the above comment is to communicate to
          #    a developer that *was* inclined to modify this script to
          #    accept unzipped distributions that I don't have any 
          #    special knowledge that this is a bad idea ... I'm just
          #    not brave enough right now to deal with any potential 
          #    fallout. **
          echo "It appears that you unzipped the distribution file yourself."
          echo "That is not what this script expects."
          echo "Please download the zipped distribution again."
      else
          ls -1 $base.*.tar.* >& /dev/null
          if ($status == 0) then
              echo "You specified your distribution as $platform."
              echo "I could not locate that distribution."
              set num_dist = `ls -1 $base*.tar.* | wc -l`
              if ($num_dist == "1") then
                 echo "But I could find this distribution that you downloaded:"
              else
                 echo "But I could find these distributions that you downloaded:"
              endif
290
              ls -1 $base*.tar.* | sed 's/'$base'\./    /g' | sed 's/.tar.gz//g' | sed 's/.tar.Z//g'
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
              if ($num_dist == 1) then
                  echo "Either try specifying visit-install again with this "
                  echo "distribution, or, if you think you specified the distribution"
                  echo "name correctly, try downloading the file for $platform ($fname1)"
              else
                  echo "Either try specifying visit-install again with one of these "
                  echo "distributions, or, if you think you specified the distribution"
                  echo "name correctly, try downloading the file for $platform ($fname1)"
              endif
              echo ""
          else
              echo "Could not find file containing the distribution."
              echo "(I was looking for file: $fname1)"
          endif
      endif
      echo "Bailing out..."
      exit (2)
   endif
endif
set fname2 = $base.$platform.tar

#
# If the directory name is not an absolute path then make it one.
#
if (`echo "$dir" | grep "^/"` == "") then
   set dir = `pwd`/"$dir"
endif

brugger's avatar
 
brugger committed
319 320 321 322 323 324 325 326 327 328 329
if (-e $dir) then
   touch $dir/test.$$
   if (! -e $dir/test.$$) then
      echo ""
      echo "You do not have write permission to $dir"
      echo "Bailing out"
      echo ""
      exit (2)
   else
      rm $dir/test.$$
   endif
330
else
brugger's avatar
 
brugger committed
331 332 333 334 335 336 337 338 339 340
   touch $dir.test.$$
   if (! -e $dir.test.$$) then
      echo ""
      echo "You do not have write permission to create $dir"
      echo "Bailing out"
      echo ""
      exit (2)
   else
      rm $dir.test.$$
   endif
341 342
endif

hrchilds's avatar
hrchilds committed
343 344 345 346 347 348
while ($config == prompt)
   echo "Choose a system configuration file.  A system configuration"
   echo "file contains profiles that make it easy to access VisIt on"
   echo "remote computers."
   echo ""
   echo "   1) No system configuration"
hrchilds's avatar
hrchilds committed
349 350 351 352 353
   echo "   2) ANL network"
   echo "   3) LLNL open network"
   echo "   4) LLNL closed network"
   echo "   5) NERSC network"
   echo "   6) ORNL network"
354
   echo "   7) Princeton network"
hrchilds's avatar
hrchilds committed
355
   echo "   8) TACC network"
hrchilds's avatar
hrchilds committed
356
   echo ""
357
   echo "(1,2,3,4,5,6,7):"
hrchilds's avatar
hrchilds committed
358 359 360 361 362 363 364

   set config = $<
   switch ($config)
      case 1:
         set config = none
         breaksw
      case 2:
hrchilds's avatar
hrchilds committed
365
         set config = anl
hrchilds's avatar
hrchilds committed
366 367
         breaksw
      case 3:
hrchilds's avatar
hrchilds committed
368
         set config = llnl_open
hrchilds's avatar
hrchilds committed
369
         breaksw
hrchilds's avatar
hrchilds committed
370
      case 4:
hrchilds's avatar
hrchilds committed
371
         set config = llnl_closed
hrchilds's avatar
hrchilds committed
372 373
         breaksw
      case 5:
hrchilds's avatar
hrchilds committed
374
         set config = nersc
hrchilds's avatar
hrchilds committed
375
         breaksw
376
      case 6:
hrchilds's avatar
hrchilds committed
377
         set config = ornl
378
         breaksw
379 380 381
      case 7:
         set config = princeton
         breaksw
hrchilds's avatar
hrchilds committed
382 383 384
      case 8:
         set config = tacc
         breaksw
hrchilds's avatar
hrchilds committed
385 386 387 388 389 390
      default:
         set config = prompt
         breaksw
   endsw
end

hrchilds's avatar
hrchilds committed
391 392
if ($config != none && $config != llnl_open && $config != llnl_closed && $config != nersc && $config != ornl && $config != anl && $config != princeton && $config != tacc) then
   echo "Illegal configuration option, choices are none, open, closed, ornl, nersc, anl, princeton, and tacc."
hrchilds's avatar
hrchilds committed
393 394
   exit (1)
endif
hrchilds's avatar
hrchilds committed
395

hrchilds's avatar
hrchilds committed
396 397 398 399 400 401 402 403 404
# If the config was specified as "none" and we're on Darwin then assume
# for now that the -b option was not passed. If this is the case then let's
# not prompt for a bank and just assume bdivp. This should let "Check for updates"
# work on the Mac with the broken 1.5.2.
# REMOVE IN VISIT 1.6.
if ($configSpecified == true && "$config" == "none" && "$2" == "darwin") then
    set bank = "bdivp"
endif

hrchilds's avatar
hrchilds committed
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
if ($bank == prompt) then
    # Determine whether the user needs a bank in order to install.
    set yn = ""
    while ("$yn" == "")
        echo "Do you need to use a bank when submitting parallel jobs to a"
        echo "batch system? (y/n):"
        set yn = `echo $< | tr "[A-Z]" "[a-z]"`
        if ("$yn" != "y" && "$yn" != "n") then
            set yn = ""
        endif
    end

    # If a bank is required then prompt for it.
    if ("$yn" == "y") then
        while ($bank == prompt)
           echo ""
           echo "Type the name of a bank for VisIt to use when launching its"
           echo "parallel compute engine in a batch system:"

           set bank = $<
           if ("$bank" == "") then
               echo "YOU MUST ENTER A BANK NAME!"
               set bank = prompt
           else
               echo "You chose bank: $bank"
           endif
        end
    else
        # No bank was required. Use the default of bdivp.
        set bank = "bdivp"
    endif
endif

brugger's avatar
 
brugger committed
438 439 440 441 442 443 444 445 446 447 448
#
# If both $dir/$version and $dir/$version+ exist it is an error.
#
if (-e "$dir"/$version) then
   if (-e "$dir"/$version+) then
      echo "Both the directories $version and $version+ exist. Remove"
      echo "one or both."
      exit (3)
   endif
endif

hrchilds's avatar
hrchilds committed
449 450 451 452 453 454 455 456 457 458 459 460
#
# Set up the distribution directory
#
rm -rf distribution
mkdir distribution
cp $fname1 distribution
cd distribution
if ($Compress == "COMPRESS") then
   uncompress $fname1
else
   gunzip $fname1
endif
461 462 463 464 465 466 467 468
if (! -e $fname2) then
   echo ""
   echo "Unable to unzip $fname1.  The file appears to be corrupted."
   echo "This is often the case when a download has not yet completed."
   echo "Bailing out..."
   echo ""
   exit (2)
endif
hrchilds's avatar
hrchilds committed
469 470 471 472 473 474
tar xvbf 20 $fname2
cd ..

#
# If the installation directory doesn't exist, create it.
#
hrchilds's avatar
hrchilds committed
475 476 477
if (! -e "$dir")                mkdir "$dir"
if (! -e "$dir"/bin)            mkdir "$dir"/bin
if (! -e "$dir"/data)           mkdir "$dir"/data
hrchilds's avatar
hrchilds committed
478 479

#
hrchilds's avatar
hrchilds committed
480
# Copy in the new files.  We are careful to leave the current
hrchilds's avatar
hrchilds committed
481 482 483
# installation in a consistent state with the exception of the
# data directory.
#
hrchilds's avatar
hrchilds committed
484
if ($logging == false) then
hrchilds's avatar
hrchilds committed
485
   cp distribution/visit/bin/legacylauncher "$dir"/bin/legacylauncher+
hrchilds's avatar
hrchilds committed
486
else
hrchilds's avatar
hrchilds committed
487
   sed -e "s/logging[ \t]*= 0/logging        = 1/" distribution/visit/bin/legacylauncher > "$dir"/bin/legacylauncher+
hrchilds's avatar
hrchilds committed
488
endif
hrchilds's avatar
hrchilds committed
489 490
cp distribution/visit/bin/frontendlauncher "$dir"/bin/frontendlauncher+
cp distribution/visit/bin/xml2plugin       "$dir"/bin/xml2plugin+
491 492
cp distribution/visit/bin/visit_plugin     "$dir"/bin/visit_plugin+
cp distribution/visit/bin/mkgrdbl          "$dir"/bin/mkgrdbl+
hrchilds's avatar
hrchilds committed
493

brugger's avatar
 
brugger committed
494
if (-e "$dir"/$version) then
hrchilds's avatar
hrchilds committed
495 496
   mv "$dir"/$version "$dir"/$version+
   ln -s $version+ "$dir"/$version
hrchilds's avatar
hrchilds committed
497
endif
brugger's avatar
 
brugger committed
498 499
if (! -e "$dir"/$version+)                 mkdir "$dir"/$version+

hrchilds's avatar
hrchilds committed
500
cd distribution/visit/$version
hrchilds's avatar
hrchilds committed
501 502

# Determine the platform
hrchilds's avatar
hrchilds committed
503 504 505 506 507 508 509 510 511 512
set findcli = `find . -name cli`
set platformBin = `echo "$findcli" | sed -e "s/cli//"`
set savepwd = `pwd`
cd $platformBin/..
set platformPath = `pwd`
cd $savepwd
set platformDir = ""
foreach f (`echo $platformPath | tr "/" " "`)
   set platformDir = $f
end
hrchilds's avatar
hrchilds committed
513
# Copy the files
hrchilds's avatar
hrchilds committed
514
find . -print | cpio -pmud "$dir"/$version+
hrchilds's avatar
hrchilds committed
515
cd ../../..
hrchilds's avatar
hrchilds committed
516
cp distribution/visit/data/* "$dir"/data
hrchilds's avatar
hrchilds committed
517

hrchilds's avatar
hrchilds committed
518 519 520 521
#
# Store some of the installation options so they can be used by VisIt when
# it updates itself later in the "Check for new versions" code.
#
hrchilds's avatar
hrchilds committed
522
echo "1;$config;$bank;$platform" > "$dir"/$version+/$platformDir/.installinfo
hrchilds's avatar
hrchilds committed
523 524


hrchilds's avatar
hrchilds committed
525
#
hrchilds's avatar
hrchilds committed
526
# Use the appropriate configuration file, setting the bank to the right value.
hrchilds's avatar
hrchilds committed
527
#
hrchilds's avatar
hrchilds committed
528
rm -f "$dir"/$version+/.visit/config
hrchilds's avatar
hrchilds committed
529 530 531 532 533 534
if ($config == anl) then
   ln -s visit-config-anl "$dir"/$version+/.visit/config_template
else if ($config == llnl_closed) then
   ln -s visit-config-llnl_closed "$dir"/$version+/.visit/config_template
else if ($config == llnl_open) then
   ln -s visit-config-llnl_open  "$dir"/$version+/.visit/config_template
hrchilds's avatar
hrchilds committed
535
else if ($config == nersc) then
hrchilds's avatar
hrchilds committed
536
   ln -s visit-config-nersc "$dir"/$version+/.visit/config_template
hrchilds's avatar
hrchilds committed
537
else if ($config == ornl) then
hrchilds's avatar
hrchilds committed
538
   ln -s visit-config-ornl "$dir"/$version+/.visit/config_template
539 540
else if ($config == princeton) then
   ln -s visit-config-princeton "$dir"/$version+/.visit/config_template
hrchilds's avatar
hrchilds committed
541 542
else if ($config == tacc) then
   ln -s visit-config-tacc "$dir"/$version+/.visit/config_template
hrchilds's avatar
hrchilds committed
543
endif
hrchilds's avatar
hrchilds committed
544 545
if (-e "$dir"/$version+/.visit/config_template) then
    sed -e "s/bdivp/$bank/" "$dir"/$version+/.visit/config_template > "$dir"/$version+/.visit/config
hrchilds's avatar
hrchilds committed
546
    if ($group_ownership != none) then
hrchilds's avatar
hrchilds committed
547
        chgrp $group_ownership "$dir"/$version+/.visit/config
hrchilds's avatar
hrchilds committed
548
    endif
hrchilds's avatar
hrchilds committed
549
    chmod 664 "$dir"/$version+/.visit/config
hrchilds's avatar
hrchilds committed
550
endif
hrchilds's avatar
hrchilds committed
551

hrchilds's avatar
hrchilds committed
552 553 554 555 556 557 558 559 560 561 562 563 564
#
# If we're on MacOS X, then we want to create some small scripts that
# can be clicked on from the Finder and have VisIt work.
#
if("$os" == "darwin") then
    # Create a clickable script to run the cli, silex, and xmledit.
    set csh = `which csh`
    set scriptNames = ("VisIt" "cli" "Silex" "XmlEdit")
    set appNames = ("visit" "cli" "silex" "xmledit")
    @ i = 1
    while($i < 5)
        set app = $appNames[$i]
        set appscript = $scriptNames[$i]
hrchilds's avatar
hrchilds committed
565 566
        if(-e "$dir"/bin/$appscript.command) then
            rm -f "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
567
        endif
hrchilds's avatar
hrchilds committed
568
        echo "#\!$csh -f"           >  "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
569
        if($i > 1) then
hrchilds's avatar
hrchilds committed
570
            echo "`pwd`/visit -$app" >> "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
571
        else
hrchilds's avatar
hrchilds committed
572
            echo "`pwd`/visit"       >> "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
573
        endif
hrchilds's avatar
hrchilds committed
574
        echo "exit 0"               >> "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
575
        if ($group_ownership != none) then
hrchilds's avatar
hrchilds committed
576
            chgrp $group_ownership "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
577
        endif
hrchilds's avatar
hrchilds committed
578
        chmod $dir_permission  "$dir"/bin/$appscript.command
hrchilds's avatar
hrchilds committed
579 580 581 582
        @ i++
    end
endif

hrchilds's avatar
hrchilds committed
583 584 585
#
# Set the permissions properly
#
hrchilds's avatar
hrchilds committed
586 587 588 589 590
chmod $dir_permission "$dir"
chmod $dir_permission "$dir"/bin
chmod $dir_permission "$dir"/bin/legacylauncher+
chmod $dir_permission "$dir"/bin/frontendlauncher+
chmod $dir_permission "$dir"/bin/xml2plugin+
591 592
chmod $dir_permission "$dir"/bin/visit_plugin+
chmod $dir_permission "$dir"/bin/mkgrdbl+
hrchilds's avatar
hrchilds committed
593 594 595
chmod $dir_permission "$dir"/data
chmod $file_permission "$dir"/data/*
chmod $dir_permission "$dir"/$version+
hrchilds's avatar
hrchilds committed
596

brugger's avatar
 
brugger committed
597 598 599 600 601 602 603 604
#
# Note that there is a short period of time when the second command
# below has set the file permission for some files that should be
# executable to be non-executable, until the next two commands can
# set the executable permission back again.  This will leave the install
# broken for a short period of time (depending on how long the recursive
# chmod takes to execute).
#
hrchilds's avatar
hrchilds committed
605 606
find "$dir"/$version+ -type d -exec chmod $dir_permission {} \;
find "$dir"/$version+ -type f -exec chmod $file_permission {} \;
hrchilds's avatar
hrchilds committed
607

hrchilds's avatar
hrchilds committed
608 609
chmod $dir_permission "$dir"/$version+/*/bin/*
chmod $dir_permission "$dir"/$version+/bin/*
hrchilds's avatar
hrchilds committed
610 611 612 613 614

#
# Set the group ownership properly
#
if ($group_ownership != none) then
hrchilds's avatar
hrchilds committed
615 616 617 618
    chgrp $group_ownership "$dir"/bin
    chgrp $group_ownership "$dir"/bin/legacylauncher+
    chgrp $group_ownership "$dir"/bin/frontendlauncher+
    chgrp $group_ownership "$dir"/bin/xml2plugin+
619 620
    chgrp $group_ownership "$dir"/bin/visit_plugin+
    chgrp $group_ownership "$dir"/bin/mkgrdbl+
hrchilds's avatar
hrchilds committed
621 622 623 624
    chgrp $group_ownership "$dir"/data
    chgrp $group_ownership "$dir"/data/*
    find "$dir"/$version+ -type d -exec chgrp $group_ownership {} \;
    find "$dir"/$version+ -type f -exec chgrp $group_ownership {} \;
hrchilds's avatar
hrchilds committed
625 626
endif

hrchilds's avatar
hrchilds committed
627
if ($logging == true) then
hrchilds's avatar
hrchilds committed
628 629 630 631 632 633
    sed -e "s/logging[ \t]*= 0/logging        = 1/" distribution/visit/$version/bin/internallauncher > "$dir"/$version+/bin/internallauncher
    chmod $dir_permission "$dir"/$version+/bin/internallauncher
    touch "$dir"/$version+/usagelog
    touch "$dir"/$version+/cli_usagelog
    chmod 666 "$dir"/$version+/usagelog
    chmod 666 "$dir"/$version+/cli_usagelog
hrchilds's avatar
hrchilds committed
634
    if ($group_ownership != none) then
hrchilds's avatar
hrchilds committed
635 636
        chgrp $group_ownership "$dir"/$version+/usagelog
        chgrp $group_ownership "$dir"/$version+/cli_usagelog
hrchilds's avatar
hrchilds committed
637 638 639
    endif
endif

hrchilds's avatar
hrchilds committed
640 641 642 643 644 645
#
# Clean up the temporary directories.
#
rm -rf distribution

#
hrchilds's avatar
hrchilds committed
646 647
# Make the symbolic links for the programs
#
hrchilds's avatar
hrchilds committed
648
set programs = "curv3dprep makemili mpeg2encode silex surfcomp text2polys time_annotation visit visitconvert xml2atts xml2avt xml2info xml2java xml2makefile xml2projectfile xml2python xml2window xmledit xmltest visit_composite visit_transition"
hrchilds's avatar
hrchilds committed
649

hrchilds's avatar
hrchilds committed
650
cd "$dir"/bin
hrchilds's avatar
hrchilds committed
651 652 653 654 655
foreach prog ($programs)
    rm -f $prog
    ln -s frontendlauncher $prog
end

hrchilds's avatar
hrchilds committed
656 657 658 659 660 661
#
# Remove the symbolic link for "convert" in case it is there from a previous
# installation.
#
rm -f convert

hrchilds's avatar
hrchilds committed
662 663
#
# Make the symbolic links for the version
hrchilds's avatar
hrchilds committed
664
#
hrchilds's avatar
hrchilds committed
665
cd "$dir"
hrchilds's avatar
hrchilds committed
666 667 668

#
# If $version exists at this point it is a link and must be removed
brugger's avatar
 
brugger committed
669
# with the rm command and replaced with the "plus" version.
hrchilds's avatar
hrchilds committed
670
#
brugger's avatar
 
brugger committed
671 672 673 674
if (-e $version) then
   rm -f $version
   mv $version+ $version
endif
hrchilds's avatar
hrchilds committed
675 676 677 678
if (-e bin/legacylauncher)       rm -f bin/legacylauncher
mv bin/legacylauncher+ bin/legacylauncher
if (-e bin/frontendlauncher)     rm -f bin/frontendlauncher
mv bin/frontendlauncher+ bin/frontendlauncher
hrchilds's avatar
hrchilds committed
679 680
if (-e bin/xml2plugin)           rm -f bin/xml2plugin
mv bin/xml2plugin+ bin/xml2plugin
681 682 683 684
if (-e bin/visit_plugin)         rm -f bin/visit_plugin
mv bin/visit_plugin+ bin/visit_plugin
if (-e bin/mkgrdbl)              rm -f bin/mkgrdbl
mv bin/mkgrdbl+ bin/mkgrdbl
hrchilds's avatar
hrchilds committed
685
if ($beta == true) then
brugger's avatar
 
brugger committed
686
   if (-e $version+)             mv $version+ $version
hrchilds's avatar
hrchilds committed
687
   if (-e beta)                  rm -f beta
hrchilds's avatar
hrchilds committed
688 689
   ln -s $version beta
else if ($private == false) then
brugger's avatar
 
brugger committed
690
   if (-e $version+)             mv $version+ $version
hrchilds's avatar
hrchilds committed
691
   if (-e current)               rm -f current
hrchilds's avatar
hrchilds committed
692 693
   ln -s $version current
endif
hrchilds's avatar
hrchilds committed
694 695 696 697 698 699

#
# Create dmg if requested
if ($dmg == true) then
   /usr/bin/hdiutil create -fs HFS+ -srcfolder $dir -volname VisIt-$version VisIt-$version.dmg
endif
whitlocb's avatar
whitlocb committed
700 701 702 703

# Write out a message that we can look for in the visit update process. This is
# a workaround for a Qt bug.
echo "visit-install done"