PERL 29
Stargen.sh Guest on 22nd August 2020 04:33:27 AM
  1. #!/bin/tcsh
  2.  
  3. #############################################
  4. # SETTING UP CGI ENV VARIABLES
  5. #############################################
  6. setenv LBC_BASE /scisoft/LBC/LBC-1.1
  7. setenv LBC_DB /scisoft/LBC/LBC_DB
  8.  
  9. if (-f /etc/redhat-release) then
  10.     setenv MACH redhat
  11. else if (-f /etc/SuSE-release) then
  12.     setenv MACH suse
  13. else
  14.     setenv MACH `uname -s | tr '[A-Z]' '[a-z]'`
  15. endif
  16. setenv  iraf    /scisoft/iraf/iraf/
  17. setenv  hostid  unix
  18. setenv  host    ${iraf}unix/
  19. setenv  hlib    ${iraf}unix/hlib/
  20. setenv  hbin    ${iraf}unix/bin.$MACH/
  21. setenv  tmp     /tmp/
  22. setenv  TERM    xgterm
  23. switch ($MACH)
  24. case freebsd:
  25.     setenv HSI_CF "-O -DBSD -w -Wunused"
  26.     setenv HSI_XF "-Inolibc -/DBSD -w -/Wunused"
  27.     setenv HSI_FF "-O"
  28.     setenv HSI_LF "-static"
  29.     setenv HSI_F77LIBS ""
  30.     setenv HSI_LFLAGS ""
  31.     setenv HSI_OSLIBS "-lcompat"
  32.     set    mkzflags = "'lflags=-z' -/static"
  33.     breaksw
  34.  
  35. case linux:
  36.     setenv HSI_CF "-O -DLINUX -DPOSIX -DSYSV -w -Wunused"
  37.     setenv HSI_XF "-Inolibc -DLINUX -DPOSIX -DSYSV -w -/Wunused"
  38.     setenv HSI_FF "-O"
  39.     setenv HSI_LF "-Wl,-Bstatic"
  40.     setenv HSI_F77LIBS ""
  41.     setenv HSI_LFLAGS ""
  42.     setenv HSI_OSLIBS ""
  43.     set    mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
  44.     breaksw
  45.  
  46. case redhat:
  47.     setenv HSI_CF "-O -DLINUX -DREDHAT -DPOSIX -DSYSV -w -Wunused"
  48.     setenv HSI_XF "-Inolibc -DLINUX -DREDHAT -DPOSIX -DSYSV -w -/Wunused"
  49.     setenv HSI_FF "-O"
  50.     setenv HSI_LF "-Wl,-Bstatic"
  51.     setenv HSI_F77LIBS ""
  52.     setenv HSI_LFLAGS ""
  53.     setenv HSI_OSLIBS ""
  54.     set    mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
  55.     breaksw
  56.  
  57. case suse:
  58.     setenv HSI_CF "-O -DSUSE -DLINUX -DPOSIX -DSYSV -w -Wunused"
  59.     setenv HSI_XF "-Inolibc -DSUSE -DLINUX -DPOSIX -DSYSV -w -/Wunused"
  60.     setenv HSI_FF "-O"
  61.     setenv HSI_LF "-Wl,-Bstatic -specs=/iraf/iraf//unix/bin.suse/gcc-specs"
  62.     setenv HSI_F77LIBS ""
  63.     setenv HSI_LFLAGS ""
  64.     setenv HSI_OSLIBS ""
  65.     set    mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
  66.     breaksw
  67.  
  68. case sunos:
  69.     setenv HSI_CF "-O -DSOLARIS -DX86 -DPOSIX -DSYSV -w -Wunused"
  70.     setenv HSI_XF "-Inolibc -DSOLARIS -DX86 -DPOSIX -DSYSV -w -/Wunused"
  71.     setenv HSI_FF "-O"
  72.     #setenv HSI_LF "-t -Wl,-Bstatic"
  73.     #setenv HSI_LFLAGS "-t -Wl,-Bstatic"
  74.     #setenv HSI_OSLIBS \
  75.     #   "-lsocket -lnsl -lintl -Wl,-Bdynamic -ldl -Wl,-Bstatic -lelf"
  76.     setenv HSI_LF "-t"
  77.     setenv HSI_F77LIBS ""
  78.     setenv HSI_LFLAGS "-t"
  79.     setenv HSI_OSLIBS "-lsocket -lnsl -lintl -ldl -lelf"
  80.     set    mkzflags = "'lflags=-Nxz -/Wl,-Bstatic'"
  81.     breaksw
  82.  
  83. default:
  84.     echo 'Warning in hlib$irafuser.csh: unknown platform '"$MACH"
  85.     exit 1
  86.     breaksw
  87. endsw
  88.  
  89. # Setup to use GNU gcc/f2c for compilation.
  90. setenv  CC      gcc
  91. setenv  F77     $hlib/f77.sh
  92. setenv  F2C     $hbin/f2c.e
  93. setenv  RANLIB  ranlib
  94.  
  95. # The following determines whether or not the VOS is used for filename mapping.
  96. if (-f ${iraf}lib/libsys.a) then
  97.         setenv  HSI_LIBS\
  98.     "${hlib}libboot.a ${iraf}lib/libsys.a ${iraf}lib/libvops.a ${hlib}libos.a"
  99. else
  100.         setenv  HSI_CF "$HSI_CF -DNOVOS"
  101.         setenv  HSI_LIBS "${hlib}libboot.a ${hlib}libos.a"
  102. endif
  103.  
  104. setenv HSI_LIBS "$HSI_LIBS $HSI_OSLIBS"
  105.  
  106. alias   mkiraf  ${hlib}mkiraf.csh
  107. alias   mkmlist ${hlib}mkmlist.csh
  108. alias   mkz     ${hbin}mkpkg.e "$mkzflags"
  109.  
  110. alias   edsym   ${hbin}edsym.e
  111. alias   generic ${hbin}generic.e
  112. alias   mkpkg   ${hbin}mkpkg.e
  113. alias   rmbin   ${hbin}rmbin.e
  114. alias   rmfiles ${hbin}rmfiles.e
  115. alias   rtar    ${hbin}rtar.e
  116. alias   wtar    ${hbin}wtar.e
  117. alias   xc      ${hbin}xc.e
  118. alias   xyacc   ${hbin}xyacc.e
  119.  
  120. ##################################################
  121. # MAIN PROG STARTS HERE
  122. # ./stargen.sh $Device $taglia $StarMagnitude $fitsfile $WkIdProcess
  123. ##################################################
  124. #mklbc > pippo.txt
  125. #echo "/scisoft/LBC/LBC-1.1/bin/lbcimgen -D ${1} -w ${2} -1 s -l ${3} -v ${4}" > stargen.log
  126. /scisoft/LBC/LBC-1.1/bin/lbcimgen -D ${1} -w ${2} -1 s -l ${3} -v ${4} > stargen.log
  127. echo  "<b> TECHNICAL LOG: </b>\n" >> ../htdocs/fits/stargen_${7}.txt
  128. cat stargen.log >> ../htdocs/fits/stargen_${5}.txt

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.