~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to CONFIG/src/backend/archinfo_freebsd.c

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Sylvestre Ledru, Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.4) (25 sid)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-8xeeiziu1iml040c
Tags: 3.10.1-1
[ Sylvestre Ledru ]
* New upstream release (Closes: #609287)

[ Sébastien Villemot ]
* Provide architectural defaults (i.e. precomputed timings) for all
  release archs (except armel and mips for the time being, due to slow
  porterboxes). This will make the package build much faster and should
  eliminate transient build failures due to excessive variance in the
  timings.
* Move symlinks for lib{cblas,f77blas,atlas,lapack_atlas} out of the
  libblas.so.3 alternative and make them always present, so that
  software relying on these libs do not break when another alternative
  is selected for BLAS
* ATLAS now has improved ARM support with native asm constructs. This required
  the following tunes:
  + armel-is-v4t.diff: new patch, prevents FTBFS on armel; otherwise,
    ATLAS uses asm constructs too recent for the platform (armel is only v4t)
  + debian/rules: on armhf, define the ATL_ARM_HARDFP flag; otherwise the asm
    constructs use the soft-float ABI for passing floating points
  + on armhf, ensure that -mfloat-abi=softfp and -mcpu=vfpv3 flags are never
    used; this is implemented via a patch (armhf.diff) and by the use of fixed
    archdefs
* The generic package is now built without multi-threading, because otherwise
  the package fails to build on some single-processor machines (this required
  the introduction of a patch: fix-non-threaded-build.diff). As a side effect,
  the build of the custom package gracefully handles non-threaded
  builds. (Closes: #602524)
* Add libblas.a as slave in the libblas.so alternative (Closes: #701921)
* Add symlinks for lib{f77blas,atlas}.a in /usr/lib (Closes: #666203)
* Modify shlibs file of libatlas3-base, such that packages using
  libblas/liblapack depend on any BLAS/LAPACK alternative, while packages
  depending on ATLAS-specific libraries (e.g. libatlas.so) depend specifically
  on libatlas3-base.
* corei1.diff: remove patch, applied upstream
* Use my @debian.org email address
* Remove obsolete DM-Upload-Allowed flag
* Switch VCS to git
* Remove Conflicts/Replaces against pre-squeeze packages
* libatlas-base-dev now provides libblas.so, as libblas-dev
* No longer use -Wa,--noexecstack in CFLAGS, it makes the package FTBFS
* Do not use POWER3 arch for powerpcspe port (Closes: #701068)
* Bump to debhelper compat level 9
* README.Debian: mention that devscripts is needed to compile the custom
  package (Closes: #697431)
* Bump Standards-Version to 3.9.4. As a consequence, add Built-Using
  fields because the package embeds stuff from liblapack-pic

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
   enum ARCHFAM fam;
57
57
   enum MACHTYPE mach=MACHOther;
58
58
   int ierr, i;
59
 
   char res[1024];
 
59
   char *res;
60
60
 
61
61
   fam = ProbeArchFam(NULL);
62
62
   switch(fam)
63
63
   {
64
64
   case AFPPC: /* don't know */
65
 
      if (!CmndOneLine(NULL, "sysctl hw.model", res))
 
65
      res = atlsys_1L(NULL, "sysctl hw.model", 0, 0);
 
66
      if (res)
66
67
      {
67
68
         if (strstr(res, "PowerMac"))
68
69
         {
95
96
            else if (strstr(res, "c3,1"))
96
97
               mach = PPCG5;
97
98
         }
 
99
         free(res);
98
100
      }
99
101
      break;
100
102
   case AFSPARC: /* don't know */
101
103
      break;
102
104
   case AFALPHA:
103
105
      #if 0
104
 
      if (!CmndOneLine(NULL, "sysctl hw.model", res))
 
106
      res = atlsys_1L(NULL, "sysctl hw.model", 0, 0);
 
107
      if (res)
105
108
      {
106
109
         if (strstr(res, "433au")) mach = Dec21164;
107
110
         else if (strstr(res, "XP1000")) mach = Dec21264;
 
111
         free(res);
108
112
      }
109
113
      #endif
110
114
      break;
111
115
   case AFIA64: /* don't know */
112
116
      break;
113
117
   case AFX86:
114
 
      if (!CmndOneLine(NULL, "sysctl hw.model", res))
 
118
      res = atlsys_1L(NULL, "sysctl hw.model", 0, 0);
 
119
      if (res)
115
120
      {
116
121
         if (strstr(res, "Pentium Pro")) mach = IntPPRO;
117
122
         else if (strstr(res, "Pentium III")) mach = IntPIII;
123
128
         else if (strstr(res, "Pentium/P55C")) mach = IntP5MMX; /* sent by */
124
129
         else if (strstr(res, "Pentium")) mach=IntP5;       /* Nakata Maho */
125
130
         else if (strstr(res, "iMac4,1")) mach=IntCoreDuo;
 
131
         free(res);
126
132
      }
127
133
      break;
128
134
   default:;
129
135
   }
130
136
   return(mach);
131
137
}
132
 
 
133
138
int ProbeNCPU()
134
139
{
135
140
   int ncpu = 0;
136
 
   char *reslns, res[1024];
 
141
   char *res;
137
142
 
138
 
   if (!CmndOneLine(NULL, "sysctl hw.ncpu", res)) ncpu = GetLastInt(res);
 
143
   res = atlsys_1L(NULL, "sysctl hw.ncpu", 0, 0);
 
144
   if (res)
 
145
   {
 
146
      ncpu = GetLastInt(res);
 
147
      free(res);
 
148
   }
139
149
   return(ncpu);
140
150
}
141
151
 
142
152
int ProbePointerBits(int *sure)
143
153
{
144
 
   int iret = 32;
 
154
   int i;
145
155
   char *uname;
146
 
   char cmnd[1024], res[1024];
 
156
   char *cmnd, *res;
147
157
 
148
158
   *sure = 0;
149
159
/*
150
 
 * Note this is a weak probe, archinfo_x86 much better . . .
151
 
 */
152
 
   uname = FindUname(NULL);
153
 
   sprintf(cmnd, "%s -a", uname);
154
 
/*
155
160
 * This probe should be running on backend; if its ptr length is 8, we've
156
161
 * definitely got a 64 bit machine
157
162
 * NOTE: getting 4 could be a result of compiler flags on a 64-bit arch,
159
164
 */
160
165
   if (sizeof(void*) == 8)
161
166
   {
162
 
      iret = 64;
163
167
      *sure = 1;
 
168
      return(64);
164
169
   }
165
170
 
166
 
   else if (!CmndOneLine(NULL, cmnd, res))
 
171
/*
 
172
 * Note this is a weak probe, archinfo_x86 much better . . .
 
173
 */
 
174
   uname = FindUname(NULL);
 
175
   i = strlen(uname) + 4;
 
176
   cmnd = malloc(sizeof(char)*i);
 
177
   assert(cmnd);
 
178
   sprintf(cmnd, "%s -a", uname);
 
179
 
 
180
   res = atlsys_1L(NULL, cmnd, 0, 0);
 
181
   free(cmnd);
 
182
   if (res)
167
183
   {
168
184
/*
169
185
 *    If uname is a known 64-bit platform, we're sure we've got OS support
171
187
 */
172
188
      if (strstr(res, "x86_64") || strstr(res, "ppc64") || strstr(res, "ia64"))
173
189
      {
174
 
         iret = 64;
175
190
         *sure = 1;
 
191
         free(res);
 
192
         return(64);
176
193
      }
 
194
      free(res);
177
195
   }
178
 
   return(iret);
 
196
   return(32);
179
197
}
180
198
 
181
199
int ProbeMhz()
182
200
{
183
201
   int mhz=0;
184
 
   char res[1024];
185
 
   if (!CmndOneLine(NULL, "sysctl hw.cpufrequency", res) )
 
202
   char *res;
 
203
   res = atlsys_1L(NULL, "sysctl hw.cpufrequency", 0, 0);
 
204
   if (res)
 
205
   {
186
206
      mhz = GetFirstDouble(res) / 1000000;
 
207
      free(res);
 
208
   }
187
209
   return(mhz);
188
210
}
189
211
 
194
216
{
195
217
   int iret=0;
196
218
   int imax=0, imin=0, icur=0;
197
 
   char res[1024];
 
219
   char *res;
198
220
 
199
 
   if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_max", res) )
 
221
   res = atlsys_1L(NULL, "sysctl hw.cpufrequency_max", 0, 0);
 
222
   if (res)
 
223
   {
200
224
      imax = GetFirstInt(res);
201
 
   if (!CmndOneLine(NULL, "sysctl hw.cpufrequency_min", res) )
 
225
      free(res);
 
226
   }
 
227
   res = atlsys_1L(NULL, "sysctl hw.cpufrequency_min", 0, 0);
 
228
   if (res)
 
229
   {
202
230
      imin = GetFirstInt(res);
 
231
      free(res);
 
232
   }
203
233
   if (imax)
204
234
   {
205
235
      if (imax != imin)