Gentoo Archives: gentoo-commits

From: "Donnie Berkholz (dberkholz)" <dberkholz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-chemistry/cns/files: cns_solve_env_sh 1.2.1-allow-gcc-openmp.patch
Date: Sun, 03 Aug 2008 07:54:04
Message-Id: E1KPYPh-00083Y-T5@stork.gentoo.org
1 dberkholz 08/08/03 07:54:01
2
3 Added: cns_solve_env_sh 1.2.1-allow-gcc-openmp.patch
4 Log:
5 Bump. Keyword ~amd64; add OpenMP support for parallel refinement; (#209805) Fix a number of environment variables and cns_ functions to work properly.
6 (Portage version: 2.2_rc5/cvs/Linux 2.6.26 x86_64)
7
8 Revision Changes Path
9 1.1 sci-chemistry/cns/files/cns_solve_env_sh
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/files/cns_solve_env_sh?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/files/cns_solve_env_sh?rev=1.1&content-type=text/plain
13
14 Index: cns_solve_env_sh
15 ===================================================================
16 #!/bin/sh
17 #
18 # This file sets up the appropriate environmental variables and paths
19 # for CNSsolve. In the case of the same machines with different versions
20 # of the OS, backward compatibility is assumed - ie. a later version will
21 # be setup for a previous version of the OS if nothing else is available.
22 #
23 # written by: Paul Adams
24 #
25 # copyright Yale University
26 #
27 # ==========================================================================
28 #
29 # >>>>>> Important: define the location of the CNSsolve directory <<<<<<
30 #
31 # CHANGE THE NEXT LINE TO POINT TO THE LOCATION OF THE CNSsolve DIRECTORY
32
33 CNS_SOLVE=_CNSsolve_location_
34
35 #
36 # ==========================================================================
37 #
38 # full expansion of the CNS_SOLVE variable prior to use.
39 #
40 export CNS_SOLVE; CNS_SOLVE=$CNS_SOLVE
41 #
42 # ==========================================================================
43 #
44 # set the number of threads for SGI multiprocessors
45 # if this causes a problem on other systems it can be commented out
46 #
47 export MP_SET_NUMTHREADS; MP_SET_NUMTHREADS=1
48 #
49 # ==========================================================================
50 #
51 # get the machine architecture
52 #
53 if [ -d $CNS_SOLVE ]; then
54 if [ ! "$CNS_ARCH" ]; then
55 export CNS_ARCH; CNS_ARCH=`$CNS_SOLVE/bin/getarch`
56 fi
57 else
58 export CNS_ARCH; CNS_ARCH='unknown'
59 fi
60 #
61 # ==========================================================================
62 #
63 # general environmental variables
64 #
65 export CNS_LIB; CNS_LIB=$CNS_SOLVE/libraries
66 export CNS_MODULE; CNS_MODULE=$CNS_SOLVE/modules
67 export CNS_TOPPAR; CNS_TOPPAR=$CNS_LIB/toppar
68 export CNS_CONFDB; CNS_CONFDB=$CNS_LIB/confdb
69 export CNS_XTALLIB; CNS_XTALLIB=$CNS_LIB/xtal
70 export CNS_NMRLIB; CNS_NMRLIB=$CNS_LIB/nmr
71 export CNS_XRAYLIB; CNS_XRAYLIB=$CNS_LIB/xray
72 export CNS_XTALMODULE; CNS_XTALMODULE=$CNS_MODULE/xtal
73 export CNS_NMRMODULE; CNS_NMRMODULE=$CNS_MODULE/nmr
74 export CNS_HELPLIB; CNS_HELPLIB=$CNS_SOLVE/helplib
75 #
76 # general user aliases
77 #
78 cns_web () { $CNS_SOLVE/bin/cns_web; }
79 cns_header () { $CNS_SOLVE/bin/cns_header; }
80 cns_info () { cat $CNS_SOLVE/bin/cns_info; }
81 cns_transfer () { $CNS_SOLVE/bin/cns_transfer; }
82 if [ -x $CNS_SOLVE/bin/cns_edit_local ]; then
83 cns_edit () { $CNS_SOLVE/bin/cns_edit_local; }
84 else
85 cns_edit () { $CNS_SOLVE/bin/cns_edit; }
86 fi
87 run_tutorial () { "csh -f tutorial.csh"; }
88 #
89 # g77 compilation and use
90 #
91 g77on () { CNS_G77=ON; . $CNS_SOLVE/.cns_solve_env_sh; }
92 g77off () { unset CNS_G77; . $CNS_SOLVE/.cns_solve_env_sh; }
93 #
94 # developer aliases
95 #
96 run_tests () { $CNS_SOLVE/bin/run_tests; }
97 run_diffs () { $CNS_SOLVE/bin/run_diffs; }
98 maketar () { $CNS_SOLVE/bin/maketar; }
99 create_patch () { $CNS_SOLVE/bin/create_patch; }
100 #
101 #
102 # ==========================================================================
103 #
104 # to do expansions - unset noglob just in case user has it otherwise
105 #
106 set +f
107 #
108 # try to set up appropriate path
109 #
110 # first strip off any trailing information (eg. _g77)
111 #
112 CNS_ARCH=`echo ${CNS_ARCH} | sed -e 's/_g77//g'`
113 #
114 cns_vendor=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $1}'`
115 cns_cpu=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $2}'`
116 cns_os=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $3}'`
117 cns_major=`echo $CNS_ARCH | awk 'BEGIN{FS="-"}{print $4}'`
118 cns_minor=`echo $cns_major | sed -e 's/\./ /g'`
119 #
120 # if we are looking for a specific type of setup then limit search
121 #
122 cns_dirs=""
123 if [ ! "$CNS_G77" ]; then
124 if /bin/ls -d $CNS_SOLVE/$cns_vendor-* >/dev/null 2>&1 ; then
125 cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-* 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
126 fi
127 else
128 CNS_ARCH="${CNS_ARCH}_g77"
129 if /bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 >/dev/null 2>&1 ; then
130 cns_dirs="`/bin/ls -d $CNS_SOLVE/$cns_vendor-*_g77 2>&1 | awk 'BEGIN{FS="/"}{print $NF}' | sort -t\- -n -r -k 3 -k 4`"
131 fi
132 fi
133 #
134 # first look for an exact match (with os version)
135 #
136 #
137 cns_found=0
138 if [ -n "$cns_dirs" ]; then
139 for cns_dir in $cns_dirs ; do
140 cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}'`
141 if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
142 if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major} -o \
143 $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-${cns_major}_g77 ]; then
144 cns_archenv=$cns_dir
145 cns_found=1
146 fi
147 fi
148 done
149 #
150 #
151 # now look for an exact match (without os version)
152 #
153 if [ $cns_found -eq 0 ]; then
154 for cns_dir in $cns_dirs ; do
155 if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
156 if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os} -o \
157 $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}_g77 ]; then
158 cns_archenv=$cns_dir
159 cns_found=1
160 fi
161 fi
162 done
163 fi
164 #
165 # now look for a backwards compatible match (with os version major/minor)
166 #
167 if [ $cns_found -eq 0 ]; then
168 for cns_dir in $cns_dirs ; do
169 if [ $cns_found -eq 0 ]; then
170 cns_tmp_major=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $4}' | sed 's/_g77//g'`
171 if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
172 if [ $cns_dir = ${cns_vendor}-${cns_cpu}-${cns_os}-* ]; then
173 osv_test=`echo $cns_major $cns_tmp_major | awk '{if ($1 > $2) print 1}'`
174 if [ $osv_test -eq 1 ]; then
175 cns_archenv=$cns_dir
176 cns_found=1
177 fi
178 fi
179 fi
180 fi
181 done
182 fi
183 #
184 # now look for a wildcard match on cpu
185 #
186 if [ $cns_found -eq 0 ]; then
187 cpu_cpu=`echo $cns_cpu | sed 's/[0-9]*\.*[0-9]*$//'`
188 cpu_ver=`echo $cns_cpu | sed 's/[A-Za-z]*//'`
189 for cns_dir in $cns_dirs ; do
190 if [ $cns_found -eq 0 ]; then
191 cns_tmp_cpu=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[0-9]*\.*[0-9]*$//'`
192 cns_tmp_ver=`echo $cns_dir | awk 'BEGIN{FS="-"}{print $2}' | sed 's/[A-Za-z]*//'`
193 if [ -f $CNS_SOLVE/$cns_dir/bin/cns_solve ]; then
194 if [ $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major} -o \
195 $cns_dir = ${cns_vendor}-${cpu_cpu}*-${cns_os}-${cns_major}_g77 ]; then
196 cpu_test=`echo $cpu_ver $cns_tmp_ver | awk '{if ($1 > $2) print 1}'`
197 if [ $cpu_test -eq 1 ]; then
198 cns_archenv=$cns_dir
199 cns_found=1
200 fi
201 fi
202 fi
203 fi
204 done
205 fi
206 fi
207 #
208 # if found set environment
209 #
210 if [ $cns_found -eq 1 ]; then
211 #
212 # set installation and source directory
213 #
214 export CNS_INST; CNS_INST=$CNS_SOLVE/$cns_archenv
215 export CNS_SOURCE; CNS_SOURCE=$CNS_INST/source
216 #
217 # path for CNSsolve utility programs
218 #
219 if [ -d $CNS_SOLVE/$cns_archenv/utils ]; then
220 export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/utils`
221 fi
222 #
223 # path for CNSsolve executable if installed
224 #
225 if [ -d $CNS_SOLVE/$cns_archenv/bin ]; then
226 export PATH; PATH=`$CNS_SOLVE/bin/modify_path -sh $CNS_SOLVE/$cns_archenv/bin`
227 fi
228 fi
229 #
230 unset cns_vendor cns_cpu cns_os cns_major cns_minor cns_tmp_major cns_tmp_minor
231 unset cns_dir cns_dirs cns_found cns_archenv cns_diff cns_count cns_same
232 unset cpu_cpu cpu_ver cns_tmp_cpu cns_tmp_ver cpu_test osv_test
233 #
234
235
236
237 1.1 sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch
238
239 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch?rev=1.1&view=markup
240 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/files/1.2.1-allow-gcc-openmp.patch?rev=1.1&content-type=text/plain
241
242 Index: 1.2.1-allow-gcc-openmp.patch
243 ===================================================================
244 --- source/xfft.f.orig 2008-08-03 00:36:52.000000000 -0700
245 +++ source/xfft.f 2008-08-03 00:37:06.000000000 -0700
246 @@ -514,7 +514,7 @@
247 LOGICAL QHERM
248 DOUBLE PRECISION XRCELL(9), MAPR
249 C local
250 -!$ integer omp_get_max_threads, kmp_get_stacksize
251 +!$ integer omp_get_max_threads
252 LOGICAL DONE
253 DOUBLE PRECISION ZERO
254 PARAMETER (ZERO=0.0D0)
255 @@ -537,7 +537,7 @@
256 NBPP=1
257 ! The following command is only relevant for the ifort compiler (if -openmp option is used).
258 ! If your compiler is not ifort, and gives an error, just comment the next line out:
259 -!$ if (kmp_get_stacksize().lt.2**23) call kmp_set_stacksize(2**23)
260 +! if (kmp_get_stacksize().lt.2**23) call kmp_set_stacksize(2**23)
261 ! Explanation: the default KMP_STACKSIZE of ifort is 2**21 bytes (2Mb) for 32bit,
262 ! and 2**22 bytes (4Mb) for 64bit.
263 ! This may be low for big structures, which leads to segmentation faults!