#!/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 # Linux riven22 5.19.0-41-generic #42~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 18 17:40:00 UTC 2 x86_64 x86_64 x86_64 GNU/Linux # Linux riven65 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux # Linux uru 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux # 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 # Darwin ...umd.edu 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64 set binType = unknown set trueType = unknown set ubVersion = 0 set sysInfo = (`uname -a | grep -F -iv ridiculous` q1 q2 q3 q4 q5) set x64Info = (`uname -a | grep -F x86_64 | wc`) set arm64Info = (`uname -a | grep -F arm64 | wc`) switch( $sysInfo[3] ) case 2\*: set osVer = 2 breaksw case 3\*: set osVer = 3 breaksw 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 if ($arm64Info[1] == 1) then set binType = mac_arm64 else if ($x64Info[1] == 1) then set binType = mac11_64 endif 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 | grep -F -i "CPU: MIPS R2" | wc`) if ($testCmd[1]) then set m1Flag = 1 endif set testCmd = (`hinv | grep -F -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 = linux if (-e /etc/os-release) then set uInfo = (`grep -F -i ubuntu /etc/os-release | grep NAME`) if ($#uInfo != 0) then set vInfo = (`grep -F VERSION_ID /etc/os-release | tr '=".' ' '` 0 0) set ubVersion = $vInfo[2] endif endif if ($x64Info[1] == 1) then # set relInfo = (`lsb_release -r`) if ($osVer == 2 || $ubVersion < 20) then set binType = linux212_64 else if ($osVer >= 6 || $ubVersion >= 22) then set binType = linux235_64 else set binType = linux231_64 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" if ($ubVersion == 0) then echo "The actual binary type is: $trueType" else echo "The actual binary type is: $trueType" Ubuntu $ubVersion endif