#!/bin/csh # # File binval.com # # Find and echo the proper NMRPipe binary type for this system: # 1. Echo is suppressed if variable "noEcho" is set. # 2. Results are returned in variables "binType" (recommended # binary type for this system) and "trueType" (actual type). # SunOS ragnar 5.5.1 Generic i86pc i386 i86pc # SunOS spite 4.1.3 3 sun4m # SunOS spun 5.5 Generic sun4m sparc SUNW,SPARCstation-10 # IRIX infix 4.0.5H 03051335 IP22 # IRIX inspire 5.2 02282016 IP22 mips # IRIX charybdis 5.3 11091811 IP19 mips # IRIX64 ingot 6.2 06101031 IP28 # Linux nmrpc5 2.0.29 #2 Fri Jul 11 09:33:02 EDT 1997 i686 # AIX ibex 2 3 000106761000 # HP-UX picard B.10.20 A 9000/755 2006965250 two-user license # OSF1 aloof.niddk.nih.gov V1.3 111 alpha # sn9092 hpc2 9.2.0.04 roo.0 CRAY J90 # Interix pentameter 3.5 SP-8.0.1969.1 x86 Intel_x86_Family15_Model4_Stepping9 set binType = unknown set trueType = unknown set sysInfo = (`uname -a | fgrep -iv ridiculous` q1 q2 q3 q4 q5) switch( $sysInfo[3] ) case 4\*: set osVer = 4 breaksw case 5\*: set osVer = 5 breaksw case 6\*: set osVer = 6 breaksw case \*pseries64: set osVer = bgl breaksw default: set osVer = 5 breaksw endsw switch( $sysInfo[1] ) case SunOS: if ($osVer == 4) then set binType = sun else set binType = sol endif if ($binType == sol && $sysInfo[5] == i86pc) then set binType = pc endif set trueType = $binType breaksw case Interix: set binType = winxp set trueType = winxp breaksw case Darwin: set binType = mac set trueType = mac breaksw case IRIX: set binType = sgi set trueType = $binType if ($osVer == 5) then set binType = sgi5x set trueType = $binType endif if ($osVer == 6) then set binType = sgi6x set trueType = $binType endif set m1Flag = 0 if ($binType == sgi5x || $binType == sgi6x) then set testCmd = (`hinv | fgrep -i "CPU: MIPS R2" | wc`) if ($testCmd[1]) then set m1Flag = 1 endif set testCmd = (`hinv | fgrep -i "CPU: MIPS R3" | wc`) if ($testCmd[1]) then set m1Flag = 1 endif if ($m1Flag == 1 && $binType == sgi5x) then set binType = sgi5x.m1 set trueType = $binType endif if ($m1Flag == 1 && $binType == sgi6x) then set binType = sgi5x.m1 set trueType = sgi6x.m1 endif endif breaksw case IRIX64: set binType = sgi6x set trueType = sgi6x.m4 breaksw case Linux set binType = linux9 set trueType = linux9 set rInfo = (`which rpm`) if ($#rInfo == 1) then if (-x $rInfo[1]) then set gInfo = (`rpm -q glibc |& sed -e 's/[^0123456789]/ /g'` 0 0 0) if ($gInfo[3] <= 5) then set binType = linux set trueType = linux endif endif endif if ($osVer == bgl) then set binType = blue set trueType = blue endif breaksw case FreeBSD set binType = linux set trueType = FreeBSD breaksw case AIX: set binType = ibm set trueType = $binType breaksw case OSF1: set binType = alpha set trueType = $binType breaksw case HP-UX: set binType = hp set trueType = $binType breaksw case ConvexOS: set binType = convex set trueType = $binType breaksw default: if ($sysInfo[5] == CRAY) then set binType = cray set trueType = cray endif breaksw endsw if ($?noEcho) then exit 0 endif echo "The recommended binary type is: $binType" echo "The actual binary type is: $trueType"