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

« back to all changes in this revision

Viewing changes to CONFIG/src/probe_arch.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:
88
88
 * keeps trying them until out of probes or one returns good (non-zero) value
89
89
 */
90
90
{
91
 
   char cmnd[2048], res[2048], osname[128], targ[512];
 
91
   char osname[128];
 
92
   char *cmnd, *res, *frm, *targ;
92
93
   enum OSTYPE OS;
93
94
   enum ASMDIA asmd;
94
 
   int iret=0;
 
95
   int i, iret=0;
95
96
 
96
97
   *sure = 0;
97
98
   asmd = (asmd0 > ASM_None && asmd0 < NASMD) ? asmd0 : gas_x86_32;
98
99
   OS = (OS0 > OSOther && OS0 < NOS) ? OS0 : OSLinux;
99
100
   if (OS == OSOSX)
100
101
      strlowcpy(osname, osnam[OSFreeBSD]);
 
102
   else if (OSIsWin(OS))
 
103
      strcpy(osname, "win");
101
104
   else
102
105
      strlowcpy(osname, osnam[OS]);
103
106
   if (targ0)
 
107
   {
 
108
      i = strlen(targ0) + 24;
 
109
      targ = malloc(sizeof(char)*i);
 
110
      assert(targ);
104
111
      sprintf(targ, "atlrun=atlas_runX targ=%s", targ0);
105
 
   else targ[0] = '\0';
 
112
   }
 
113
   else
 
114
   {
 
115
      targ = malloc(sizeof(char));
 
116
      assert(targ);
 
117
      targ[0] = '\0';
 
118
   }
106
119
 
107
120
/*
108
121
 * If Assembler right or unspecified, try x86 probe
109
122
 */
110
123
   if (asmd == gas_x86_32 || asmd == gas_x86_64)
111
124
   {
112
 
      sprintf(cmnd, "make IRunArchInfo_x86 MYFLAGS=\"-DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'",
113
 
              osnam[OS], ASMNAM[asmd], flag, targ, find);
114
 
      if (!CmndOneLine(NULL, cmnd, res))
 
125
      frm = "make IRunArchInfo_x86 MYFLAGS=\"-DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'";
 
126
      i = strlen(frm) + strlen(osnam[OS]) + strlen(ASMNAM[asmd]) + strlen(flag)
 
127
          + strlen(targ) + strlen(find) + 1;
 
128
      cmnd = malloc(sizeof(char)*i);
 
129
      assert(cmnd);
 
130
      sprintf(cmnd, frm, osnam[OS], ASMNAM[asmd], flag, targ, find);
 
131
      res = atlsys_1L(NULL, cmnd, 0, 0);
 
132
      if (res)
115
133
      {
116
134
         iret = GetFirstInt(res);
117
135
         *sure = GetLastInt(res);
 
136
         free(res);
118
137
      }
 
138
      free(cmnd);
119
139
   }
120
140
/*
121
141
 * If that didn't work, try OS-specific probe
122
142
 */
123
143
   if (!iret)
124
144
   {
125
 
      sprintf(cmnd, "make IRunArchInfo_%s MYFLAGS=\"-DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'",
126
 
              osname, osnam[OS], ASMNAM[asmd], flag, targ, find);
127
 
      if (!CmndOneLine(NULL, cmnd, res))
 
145
      frm = "make IRunArchInfo_%s MYFLAGS=\"-DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'";
 
146
      i = 1 + strlen(frm) + strlen(osname) + 3+strlen(osnam[OS]) +
 
147
          strlen(ASMNAM[asmd]) + strlen(flag) + strlen(targ) + strlen(find);
 
148
      cmnd = malloc(sizeof(char)*i);
 
149
      assert(cmnd);
 
150
      sprintf(cmnd, frm, osname, osnam[OS], ASMNAM[asmd], flag, targ, find);
 
151
      res = atlsys_1L(NULL, cmnd, 0, 0);
 
152
      if (res)
128
153
      {
129
154
         iret = GetFirstInt(res);
130
155
         *sure = GetLastInt(res);
 
156
         free(res);
131
157
      }
 
158
      free(cmnd);
132
159
   }
133
160
   return(iret);
134
161
}
140
167
 * case
141
168
 */
142
169
{
143
 
   char cmnd[2048], res[2048], osname[128], targ[512];
 
170
   char osname[128];
 
171
   char *cmnd, *res, *targ;
 
172
   char *frm="make IRunArchInfo_%s MYFLAGS=\"-m64 -DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'";
144
173
   enum OSTYPE OS;
145
174
   enum ASMDIA asmd;
146
 
   int iret=0;
 
175
   int i, iret=0;
147
176
 
148
177
   *sure = 0;
149
178
   asmd = (asmd0 > ASM_None && asmd0 < NASMD) ? asmd0 : gas_x86_32;
150
179
   OS = (OS0 > OSOther && OS0 < NOS) ? OS0 : OSLinux;
151
 
   if (OS == OSOSX)
152
 
      strlowcpy(osname, osnam[OSFreeBSD]);
153
 
   else
154
 
      strlowcpy(osname, osnam[OS]);
 
180
   i = (OS == OSOSX) ? OSFreeBSD : OS;
 
181
   assert(strlen(osnam[i]) < 128);
 
182
   strlowcpy(osname, osnam[i]);
155
183
   if (targ0)
 
184
   {
 
185
      i = strlen(targ0) + 24;
 
186
      targ = malloc(sizeof(char)*i);
 
187
      assert(targ);
156
188
      sprintf(targ, "atlrun=atlas_runX targ=%s", targ0);
157
 
   else targ[0] = '\0';
 
189
   }
 
190
   else
 
191
   {
 
192
      targ = malloc(sizeof(char));
 
193
      assert(targ);
 
194
      targ[0] = '\0';
 
195
   }
158
196
 
159
197
/*
160
198
 * Try OS-specific probe, compiling with -m64 (assumes gcc workalike)
161
199
 */
162
 
   sprintf(cmnd, "make IRunArchInfo_%s MYFLAGS=\"-m64 -DATL_OS_%s -DATL_%s\" args=\"%s\" %s | fgrep '%s'",
163
 
           osname, osnam[OS], ASMNAM[asmd], flag, targ, find);
164
 
   if (!CmndOneLine(NULL, cmnd, res))
 
200
   i = 1 + strlen(frm) + strlen(osnam) + strlen(osnam[OS]) +
 
201
       strlen(ASMNAM[asmd]) + strlen(flag) + strlen(targ) + strlen(find);
 
202
   cmnd = malloc(i*sizeof(char));
 
203
   assert(cmnd);
 
204
   sprintf(cmnd, frm, osname, osnam[OS], ASMNAM[asmd], flag, targ, find);
 
205
   free(targ);
 
206
   res = atlsys_1L(NULL, cmnd, 0, 0);
 
207
   free(cmnd);
 
208
   if (res)
165
209
   {
166
210
      iret = GetFirstInt(res);
167
211
      *sure = GetLastInt(res);
 
212
      free(res);
168
213
   }
169
214
   return(iret);
170
215
}
171
216
 
172
 
main(int nargs, char **args)
 
217
int main(int nargs, char **args)
173
218
{
174
219
   int flags, CacheLevel, osname[128], sure, bits, i, j;
175
220
   enum OSTYPE OS;
225
270
      printf("NCACHES=0\n");
226
271
   if (flags & PCacheSize)
227
272
      printf("%d Cache size (kb) = 0\n", CacheLevel);
228
 
   exit(0);
 
273
   return(0);
229
274
}