changed reading hint
[gromacs/adressmacs.git] / gmx_conf
blob237ed93aff76086199832933b7d3dc6f25dd23fe
1 #!/bin/csh -f
3 if ( $?cwd ) then
4 setenv CUR $cwd
5 else
6 setenv CUR `pwd`
7 endif
8 setenv CORE gmxcore
9 setenv BNC gmxbench
10 setenv TST gmxtests
12 clear
13 if ( -d src ) then
14 echo 'Source already present'
15 echo 'Will only configure GMXRC'
16 else
17 echo 'Starting GROMACS installation'
18 echo '-----------------------------'
20 echo 'Unpacking archives...'
22 foreach fz ( $CORE $BNC $TST )
23 echo $fz
24 if ( -f $fz.taz ) then
25 cat $fz.taz | uncompress -c | tar xf -
26 else
27 if ( -f $fz.tgz ) then
28 cat $fz.tgz | gzip -d -c | tar xf -
29 else
30 if ( $fz == $CORE ) then
31 echo FATAL, no file $fz.tgz or $fz.taz found
32 exit
33 endif
34 endif
35 endif
36 end
37 endif
39 echo ""
41 # Determine which CPUS are available
42 setenv CPUS ""
43 set ncpu = 0
44 foreach i ( src/makef/Makefile.* )
45 setenv EXT $i:e
46 if ( ( $EXT != SGI ) && ( $EXT != def ) && ( $EXT != std ) && ( $EXT != no ) && ( $EXT != ruggr2 ) && ( $EXT != ins ) && ( $EXT != ind) ) then
47 setenv CPUS "$CPUS"" ""$EXT"
48 @ ncpu += 1
49 endif
50 end
52 echo ' Which CPU/Machine do you have ?'
53 echo '--------------------------------------------------------------------'
54 set i = 0
55 foreach cpu ( $CPUS )
56 set desc=`head -1 src/makef/Makefile.$cpu`
57 if ( "$desc" == "#" ) then
58 set desc="# Unknown"
59 endif
60 printf "%5s - %-26s" $cpu "$desc"
61 if ( $i == 0 ) then
62 set i = 1
63 else
64 printf "\n"
65 set i = 0
66 endif
67 end
68 echo ""
70 setenv MKPREFIX src/makef/Makefile
72 echo 'Please select the cpu that is appropriate'
73 set cpu = $<
74 if ( -f $MKPREFIX.$cpu ) then
75 echo $cpu is OK
76 set cpmf = 0
77 else
78 echo 'Give a short abbreviation for your CPU/Machine, eg. ibm'
79 set cpu = $<
80 set cpmf = 1
81 endif
83 if ( $cpmf == 1 ) then
84 cp $MKPREFIX.no $MKPREFIX.$cpu
85 echo 'I have created a file called ' $MKPREFIX.$cpu
86 echo 'Please follow the instructions in the online readme.hmtl file'
87 endif
89 echo ' '
90 echo 'GROMACS Cool Quote Installation'
91 echo '-------------------------------'
92 echo 'If you do *NOT* want cool quotes type No here'
93 set cq = $<
94 if ( $cq != No ) then
95 setenv COOL setenv
96 else
97 setenv COOL \#setenv
98 echo 'Now you will be treated like a fast food addict'
99 endif
101 setenv RC GMXRC
102 echo Creating $RC file
103 if ( -f $RC ) mv $RC $RC.bak
105 setenv PATHPREFIX `pwd`
106 cat > $RC << EOD
108 # Directories, edit to match your site, we assume
109 # users have a c-shell allways
112 # remove previous GROMACS environment, if present
113 source $PATHPREFIX/NOGMX -quiet
115 # This is were the sources are
116 setenv GMXHOME $PATHPREFIX
119 # If you support multiple machines then it's useful to
120 # have a switch statement here, which, depending on hostname
121 # point to the proper directories, and sets the GMXCPU variable
123 # For easy updating, it is also recommended to put you local
124 # stuff in the GMXRC.local file
125 # Don't forget the GMXCPU variable
127 setenv LOCAL_RC \$GMXHOME/GMXRC.local
128 if ( -f \$LOCAL_RC ) then
129 source \$LOCAL_RC
130 else
131 # Here are some defaults, if you have one machine, edit these
132 setenv GMXCPU $cpu
133 endif
135 # Some directories that live below the root
136 setenv GMXBIN \$GMXHOME/bin/\$GMXCPU
137 setenv GMXLIB \$GMXHOME/top
140 # Default Graphics Font
142 setenv GMXFONT 10x20
145 # Set the path #
146 setenv PATH "\$PATH":"\$GMXBIN"
149 if ( \$?LD_LIBRARY_PATH ) then
150 setenv LD_LIBRARY_PATH "\$LD_LIBRARY_PATH":\$GMXHOME/lib/\$GMXCPU
151 else
152 setenv LD_LIBRARY_PATH \$GMXHOME/lib/\$GMXCPU
153 endif
154 if ( \$?MANPATH ) then
155 setenv MANPATH "\$MANPATH":\$GMXHOME/man
156 else
157 setenv MANPATH /usr/man:\$GMXHOME/man
158 endif
160 # Now finally, if you consider our Cool Quotes to be offensive
161 # you might consider commenting out the following line:
162 $COOL IAMCOOL YES
164 if ( -f \$GMXHOME/complete ) source \$GMXHOME/complete
166 # end of script
169 echo 'Done, it is compile time now.'
170 echo 'Source GMXRC and read instructions in'
171 echo 'http://md.chem.rug.nl/~gmx/readme2.0.html'