3
void PrintUsage(char *name, int iarg, char *arg)
5
fprintf(stderr, "\nERROR around arg %d (%s).\n", iarg,
6
arg ? arg : "unknown");
7
fprintf(stderr, "USAGE: %s [flags] where flags are:\n", name);
8
fprintf(stderr, " -v <verb> : verbosity level\n");
9
fprintf(stderr, " -O <enum OSTYPE #> : set OS type\n");
10
fprintf(stderr, " -s <enum ASMDIA #> : set assembly dialect\n");
11
fprintf(stderr, " -A <enum MACHTYPE #> : set machine/architecture\n");
13
" -V # # = ((1<<vecISA1) | (1<<vecISA2) | ... | (1<<vecISAN))\n");
14
fprintf(stderr, " -b <32/64> : set pointer bitwidth\n");
15
fprintf(stderr, " -o <outfile>\n");
16
fprintf(stderr, " -C [xc,ic,if,sk,dk,sm,dm,al,ac] <compiler>\n");
17
fprintf(stderr, " -F [xc,ic,if,sk,dk,sm,dm,al,ac,gc] '<comp flags>'\n");
18
fprintf(stderr, /* HERE */
19
" -Fa [xc,ic,if,sk,dk,sm,dm,al,ac,gc] '<comp flags to append>'\n");
20
fprintf(stderr, " al: append flags to all compilers\n");
21
fprintf(stderr, " ac: append flags to all C compilers\n");
22
fprintf(stderr, " gc: append flags to gcc compiler used in user-contributed index files.\n");
23
fprintf(stderr, " acg: append to all C compilers & the index gcc\n");
24
fprintf(stderr, " alg: append to all compilers & the index gcc\n");
26
" -T <targ> : ssh target for cross-compilation (probably broken)\n");
27
fprintf(stderr, " -D [c,f] -D<mac>=<rep> : cpp #define to add to [CDEFS,F2CDEFS]\n");
29
" eg. -D c -DL2SIZE=8388604 -D f -DADD__ -D f -DStringSunStyle\n");
30
fprintf(stderr, " -d [s,b] : set source/build directory\n");
31
fprintf(stderr, " -f <#> : size (in KB) to flush before timing\n");
33
" -t <#> : set # of threads (-1: autodect; 0: no threading)\n");
34
fprintf(stderr, " -m <mhz> : set clock rate\n");
35
fprintf(stderr, " -S[i/s] <handle> <val> : special int/string arg\n");
37
" -Si bozol1 <0/1> : supress/enable bozo L1 defaults\n");
39
" -Si archdef <1/0> : enable/supress arch default use\n");
41
" -Si nof77 <0/1> : Have/don't have fortran compiler\n");
43
" -Ss kern <path to comp> : use comp for all kernel compilers\n");
45
" -Ss pmake <parallel make invocation (eg '$(MAKE) -j 4')>\n");
47
" -Ss f77lib <path to f77 lib needed by C compiler>\n");
49
" -Ss flapack <path to netlib lapack>: used to build full lapack lib\n");
50
fprintf(stderr, " -Ss [s,d]maflags 'flags'\n");
52
"NOTE: enum #s can be found by : make xprint_enums ; ./xprint_enums\n");
56
void GetFlags(int nargs, /* nargs as passed into main */
57
char **args, /* args as passed into main */
58
int *verb, /* verbosity setting */
59
enum OSTYPE *OS, /* OS to assume */
60
enum ASMDIA *asmb, /* assembly dialect to assume */
61
int *vec, /* Vector ISA extension bitfield */
62
enum MACHTYPE *mach, /* machine/arch to assume */
63
int *mhz, /* Clock rate in Mhz */
64
int *ptrbits /* # of bits in ptr: 32/64 */,
65
int *nthreads, /* # of threads */
67
char **gccflags, /* append flags for user-contrib gcc */
69
char **srcdir, /* path to top of source directory */
70
char **bindir, /* path to top of binary directory */
71
int *bozol1, /* Use untuned L1 */
72
int *UseArchDef, /* Use arch defaults */
74
char **f2cdefs, /* F77-to-C interface defines */
75
char **ecdefs, /* extra cpp defines to add to CDEFS */
76
char **pmake, /* parallel make command */
77
char **flapack, /* netlib F77 LAPACK */
78
char **smaflags, /* single prec muladd flags */
79
char **dmaflags, /* double prec muladd flags */
80
char **f77lib, /* netlib F77 LAPACK */
81
int *flush, /* size in KB to flush */
82
char **targ /* mach to ssh to*/
85
int i, k, k0, kn, DoInt;
88
char *cdefs=NULL, *fdefs=NULL;
92
*srcdir = *bindir = NULL;
97
*smaflags = *dmaflags = NULL;
101
for (k=0; k < NCOMP*3; k++)
117
for (i=1; i < nargs; i++)
119
if (args[i][0] != '-')
120
PrintUsage(args[0], i, args[i]);
125
PrintUsage(args[0], i, "out of arguments");
126
*flush = atoi(args[i]);
130
PrintUsage(args[0], i, "out of arguments");
131
*nthreads = atoi(args[i]);
135
PrintUsage(args[0], i, "out of arguments");
136
*ptrbits = atoi(args[i]);
140
PrintUsage(args[0], i, "out of arguments");
141
*mhz = atoi(args[i]);
145
PrintUsage(args[0], i, "out of arguments");
146
*mach = atoi(args[i]);
150
PrintUsage(args[0], i, "out of arguments");
151
*vec = atoi(args[i]);
155
PrintUsage(args[0], i, "out of arguments");
156
*asmb = atoi(args[i]);
160
PrintUsage(args[0], i, "out of arguments");
165
PrintUsage(args[0], i, "out of arguments");
166
*verb = atoi(args[i]);
170
PrintUsage(args[0], i, "out of arguments");
174
if (args[i][2] != 'i' && args[i][2] != 's')
175
PrintUsage(args[0], i, "-S needs i or s suffix!");
176
DoInt = args[i][2] == 'i';
178
PrintUsage(args[0], i, "out of arguments");
181
PrintUsage(args[0], i, "out of arguments");
186
if (!strcmp(sp0, "archdef"))
188
else if (!strcmp(sp0, "bozol1"))
190
else if (!strcmp(sp0, "nof77"))
192
else if (!strcmp(sp0, "kern"))
194
else if (!strcmp(sp0, "pmake"))
196
else if (!strcmp(sp0, "flapack"))
198
else if (!strcmp(sp0, "f77lib"))
200
else if (!strcmp(sp0, "smaflags"))
202
else if (!strcmp(sp0, "dmaflags"))
205
PrintUsage(args[0], i-1, sp0);
209
PrintUsage(args[0], i, "out of arguments");
214
PrintUsage(args[0], i, "out of arguments");
216
PrintUsage(args[0], i, "out of arguments");
217
if (args[i-1][0] == 'f')
218
fdefs = NewAppendedString(fdefs, args[i]);
220
cdefs = NewAppendedString(cdefs, args[i]);
224
PrintUsage(args[0], i, "out of arguments");
226
PrintUsage(args[0], i, "out of arguments");
236
PrintUsage(args[0], i, "out of arguments");
239
if (*sp == 'i' && sp[1] == 'c') k = ICC_;
240
else if (*sp == 'i' && sp[1] == 'f') k = F77_;
241
else if (*sp == 's' && sp[1] == 'k') k = SKC_;
242
else if (*sp == 'd' && sp[1] == 'k') k = DKC_;
243
else if (*sp == 's' && sp[1] == 'm') k = SMC_;
244
else if (*sp == 'd' && sp[1] == 'm') k = DMC_;
245
else if (*sp == 'x' && sp[1] == 'c') k = XCC_;
246
if (*sp == 'a' && (sp[1] == 'l' || sp[1] == 'c'))
247
{ /* only appended flags can be applied to all compilers */
248
if (args[i-1][1] == 'F')
250
if (args[i-1][2] == 'a')
267
PrintUsage(args[0], i, "out of arguments");
268
for (k=k0; k < kn; k++)
269
if (sp[1] == 'l' || k-2*NCOMP != F77_)
271
if (sp[2] == 'g' && args[i-2][1] == 'F')
274
else if (*sp == 'g' && sp[1] == 'c')
277
PrintUsage(args[0], i, "out of arguments");
282
if (k < 0) PrintUsage(args[0], i, args[i]);
283
if (args[i-1][1] == 'F')
286
if (args[i-1][2] == 'a')
290
PrintUsage(args[0], i, "out of arguments");
295
PrintUsage(args[0], i, args[i]);
299
* allocate these strings ourselves so we can free them later if necessary
301
for (i=0; i < 3*NCOMP; i++)
305
if (!strcmp(comps[i], "default"))
309
sp = malloc(sizeof(char)*(strlen(comps[i])+1));
310
strcpy(sp, comps[i]);
316
* If the special flag -Ss gcc3 is thrown, force gcc3's use for all kernel
317
* compilers (standard gcc assumed to be gcc4)
321
for (i=0; i < NCOMP; i++)
323
if (!comps[i] && (i == SMC_ || i == DMC_ || i == SKC_ || i == DKC_))
324
comps[i] = NewStringCopy(gcc3);
329
if (*ptrbits != 32 && *ptrbits != 64)
332
char *GetPtrbitsFlag(enum OSTYPE OS, enum MACHTYPE arch, int ptrbits,
335
* RETURNS: string forcing setting of ptrbits for gcc
341
if (MachIsIA64(arch))
343
if (MachIsMIPS(arch))
344
return((ptrbits == 64) ? "-mabi=64" : "-mabi=n32");
345
if (!CompIsGcc(comp))
348
* Add correct 64/32 bit flags for Sun workshop compilers
350
if (MachIsUS(arch) && CompIsSunWorkshop(comp))
353
sp = (arch == SunUSI || arch == SunUSII) ?
354
"-xarch=v9" : "-xarch=v9b";
356
sp = (arch == SunUSI || arch == SunUSII) ?
357
"-xarch=v8plusa" : "-xarch=v8plusb";
359
else if (CompIsIBMXL(comp)) /* IBM xl compilers */
360
sp = (ptrbits == 64) ? "-q64" : "-q32";
363
GetGccVers(comp, &k, &j, &k, &k);
364
if ( !(j >= 3 && (OS != OSOSX || j > 3 || !CompIsAppleGcc(comp))) )
366
else if (OS == OSAIX)
367
sp = (ptrbits == 64) ? "-maix64" : "-maix32";
368
else if ((MachIsX86(arch) || MachIsPPC(arch) || MachIsUS(arch)) ||
369
arch == IbmPwr7 || arch == IbmPwr6)
373
else if (ptrbits == 32)
379
main(int nargs, char **args)
383
int h, i, j, k, verb, asmb, nof77, mhz;
386
int delay=0; /* change this to come from "special" ints in GetFlags */
388
int Use3DNow=0; /* this needs to come from getflags */
390
int USEDEFL1, USEARCHDEF;
391
char *targ, *sp, *pmake, *flapack;
392
char *comps[3*NCOMP], *comp, *flags, *srcdir, *blddir, *f2cdefs, *cdefs;
393
char *outfile, *smaflags, *dmaflags, *f77lib, *gccflags, *goodgcc;
394
char targarg[256], ln[1024];
396
char *adnames[NARDEF] = {"sKERNDEF", "dKERNDEF", "sMMDEF", "dMMDEF"};
398
GetFlags(nargs, args, &verb, &OS, (enum ASMDIA*) &asmb, &vecexts, &mach,
399
&mhz, &ptrbits, &ncpu, comps, &gccflags, &outfile, &srcdir,
400
&blddir, &USEDEFL1, &USEARCHDEF, &nof77, &f2cdefs, &cdefs, &pmake,
401
&flapack, &smaflags, &dmaflags, &f77lib, &l2size, &targ);
402
if (ncpu > 1) THREADS = 1;
406
fpout = fopen(outfile, "w");
408
assert(srcdir && blddir);
410
* Update l2size, and set f2cdefs/cdefs if they are null
412
if (!l2size) l2size = 4*1024*1024;
414
if (!f2cdefs) f2cdefs = "";
416
* Append any appended flags, and then we have just compilers and flags
418
for (i=2*NCOMP; i < 3*NCOMP; i++)
422
comps[i-NCOMP] = NewAppendedString(comps[i-NCOMP], comps[i]);
428
* If any C compiler is unspecified, use it to specify the others
429
* Use DKC preferentially if it is specified
431
if (comps[DKC_] && comps[NCOMP+DKC_])
436
for (i=0; i < F77_; i++)
438
if (comps[i] && comps[NCOMP+i])
446
fprintf(stderr, "Need a valid C compiler and flags\n");
450
for (i=0; i < F77_; i++)
455
comps[NCOMP+i] = comps[NCOMP+k];
458
* If F77 compiler unspecified or nof77 asserted, set it to ICC for linking
460
if (!comps[F77_] || nof77)
462
comps[F77_] = comps[ICC_];
463
comps[NCOMP+F77_] = comps[NCOMP+ICC_];
466
* Find dominant ISA extension
469
for (i=1; i < NISA && !ISAX; i++)
470
if (vecexts & (1<<i))
473
fprintf(fpout, "# ----------------------------\n");
474
fprintf(fpout, "# Make.inc for ATLAS3.8.4\n");
475
fprintf(fpout, "# ----------------------------\n\n");
477
fprintf(fpout, "# ----------------------------------\n");
478
fprintf(fpout, "# Make sure we get the correct shell\n");
479
fprintf(fpout, "# ----------------------------------\n");
480
fprintf(fpout, " SHELL = /bin/sh\n\n");
482
fprintf(fpout, "# -------------------------------------------------\n");
483
fprintf(fpout, "# Name indicating the platform to configure BLAS to\n");
484
fprintf(fpout, "# -------------------------------------------------\n");
485
fprintf(fpout, " ARCH = %s", machnam[mach]);
486
fprintf(fpout, "%d", ptrbits);
488
fprintf(fpout, "%s", ISAXNAM[ISAX]);
489
fprintf(fpout, "\n\n");
491
fprintf(fpout, "# ----------------------------\n");
492
fprintf(fpout, "# Paths to various directories\n");
493
fprintf(fpout, "# ----------------------------\n");
494
fprintf(fpout, " BLDdir = %s\n", blddir);
495
fprintf(fpout, " SRCdir = %s\n", srcdir);
496
fprintf(fpout, " INCAdir = $(BLDdir)/include\n");
497
fprintf(fpout, " INCSdir = $(SRCdir)/include\n");
498
fprintf(fpout, " BINdir = $(BLDdir)/bin\n");
499
fprintf(fpout, " LIBdir = $(BLDdir)/lib\n\n");
500
fprintf(fpout, " SYSdir = $(BLDdir)/tune/sysinfo\n");
501
fprintf(fpout, " GMMdir = $(BLDdir)/src/blas/gemm\n");
502
fprintf(fpout, " GMVdir = $(BLDdir)/src/blas/gemv\n");
503
fprintf(fpout, " GR1dir = $(BLDdir)/src/blas/ger\n");
504
fprintf(fpout, " L1Bdir = $(BLDdir)/src/blas/level1\n");
505
fprintf(fpout, " L2Bdir = $(BLDdir)/src/blas/level2\n");
506
fprintf(fpout, " L3Bdir = $(BLDdir)/src/blas/level3\n");
507
fprintf(fpout, " TSTdir = $(BLDdir)/src/testing\n");
508
fprintf(fpout, " AUXdir = $(BLDdir)/src/auxil\n");
509
fprintf(fpout, " CBLdir = $(BLDdir)/interfaces/blas/C/src\n");
510
fprintf(fpout, " FBLdir = $(BLDdir)/interfaces/blas/F77/src\n");
511
fprintf(fpout, " PTSdir = $(BLDdir)/src/pthreads\n");
512
fprintf(fpout, " MMTdir = $(BLDdir)/tune/blas/gemm\n");
513
fprintf(fpout, " MVTdir = $(BLDdir)/tune/blas/gemv\n");
514
fprintf(fpout, " R1Tdir = $(BLDdir)/tune/blas/ger\n");
515
fprintf(fpout, " L1Tdir = $(BLDdir)/tune/blas/level1\n");
516
fprintf(fpout, " L3Tdir = $(BLDdir)/tune/blas/level3\n");
517
fprintf(fpout, "\n");
520
"# ---------------------------------------------------------------------\n");
522
"# Name and location of scripts for running executables during tuning\n");
524
"# ---------------------------------------------------------------------\n");
525
fprintf(fpout, " ATLRUN = $(BLDdir)/bin/ATLrun.sh\n");
526
fprintf(fpout, " ATLFWAIT = $(BLDdir)/bin/xatlas_waitfile\n\n");
528
fprintf(fpout, "# ---------------------\n");
529
fprintf(fpout, "# Libraries to be built\n");
530
fprintf(fpout, "# ---------------------\n");
531
fprintf(fpout, " ATLASlib = $(LIBdir)/libatlas.a\n");
532
fprintf(fpout, " CBLASlib = $(LIBdir)/libcblas.a\n");
533
fprintf(fpout, " F77BLASlib = $(LIBdir)/libf77blas.a\n");
536
fprintf(fpout, " PTCBLASlib = $(LIBdir)/libptcblas.a\n");
537
fprintf(fpout, " PTF77BLASlib = $(LIBdir)/libptf77blas.a\n");
539
fprintf(fpout, " LAPACKlib = $(LIBdir)/liblapack_atlas.a\n");
540
fprintf(fpout, " TESTlib = $(LIBdir)/libtstatlas.a\n\n");
542
fprintf(fpout, "# -------------------------------------------\n");
543
fprintf(fpout, "# Upper bound on largest cache size, in bytes\n");
544
fprintf(fpout, "# -------------------------------------------\n");
545
fprintf(fpout, " L2SIZE = -DL2SIZE=%d\n\n", l2size);
547
fprintf(fpout, "# ---------------------------------------\n");
548
fprintf(fpout, "# Command setting up correct include path\n");
549
fprintf(fpout, "# ---------------------------------------\n");
551
" INCLUDES = -I$(INCAdir) -I$(INCSdir) -I$(INCSdir)/contrib\n\n");
553
fprintf(fpout, "# -------------------------------------------\n");
554
fprintf(fpout, "# Defines for setting up F77/C interoperation\n");
555
fprintf(fpout, "# -------------------------------------------\n");
556
fprintf(fpout, " F2CDEFS = %s\n\n", f2cdefs);
558
fprintf(fpout, "# ------------------------------\n");
559
fprintf(fpout, "# Architecture identifying flags\n");
560
fprintf(fpout, "# ------------------------------\n");
561
fprintf(fpout, " ARCHDEFS =");
563
fprintf(fpout, " -DATL_OS_%s", osnam[OS]);
564
if (mach != MACHOther)
565
fprintf(fpout, " -DATL_ARCH_%s", machnam[mach]);
567
fprintf(fpout, " -DATL_CPUMHZ=%d", mhz);
569
fprintf(fpout, " -DSUN_HR");
571
fprintf(fpout, " -DGCCWIN -DUseClock");
572
for (i=1; i < NISA; i++)
573
if (vecexts & (1<<i))
574
fprintf(fpout, " -DATL_%s", ISAXNAM[i]);
575
if (Use3DNow) fprintf(fpout, " -DATL_3DNowFLOPS");
577
fprintf(fpout, " -DATL_USE64BITS");
578
if (mach == IA64Itan || mach == IA64Itan2 )
579
fprintf(fpout, " -DATL_MAXNREG=128");
580
if (asmb != ASM_None) fprintf(fpout, " -DATL_%s", ASMNAM[asmb]);
581
if (mach == IA64Itan2)
582
fprintf(fpout, " -DATL_IntelIccBugs");
584
* Need up update handling of apple vs. gnu gcc for altivec
587
if (ISAX == ISA_AV && strstr(CC, "gcc") && strstr(MCC, "gcc") &&
589
fprintf(fpout, " -DATL_%s -DATL_AVgcc", ISAXNAM[ISAX]);
591
fprintf(fpout, "\n\n");
594
"# -------------------------------------------------------------------\n");
596
"# NM is the flag required to name a compiled object/executable\n");
598
"# OJ is the flag required to compile to object rather than executable\n");
599
fprintf(fpout, "# These flags are used by all compilers.\n");
601
"# -------------------------------------------------------------------\n");
602
fprintf(fpout, " NM = -o\n");
603
fprintf(fpout, " OJ = -c\n\n");
605
sprintf(ln, "%s/CONFIG/src/CompMake.txt", srcdir);
606
DisplayFile(ln, fpout, 0);
607
fprintf(fpout, " CDEFS = $(L2SIZE) $(INCLUDES) $(F2CDEFS) $(ARCHDEFS)");
608
if (cdefs) fprintf(fpout, " %s", cdefs);
611
fprintf(fpout, " -DATL_NCPU=%d", ncpu);
612
if (OS == OSFreeBSD) fprintf(fpout, " -D_THREAD_SAFE -D_REENTRANT");
613
if (OS == OSAIX) fprintf(fpout, " -DIBM_PT_ERROR");
614
if (OS == OSIRIX) fprintf(fpout, " -D_POSIX_C_SOURCE=199506L");
616
if (delay) fprintf(fpout, " -DATL_FOPENDELAY");
617
fprintf(fpout, "\n\n");
618
for (i=0; i < NCOMP; i++)
620
fprintf(fpout, " %s = %s\n", COMPNAME[i], comps[i]);
622
fprintf(fpout, " %sFLAGS = %s\n", COMPNAME[i], comps[NCOMP+i]);
623
else if (i == ICC_ || i == XCC_)
624
fprintf(fpout, " %sFLAGS = $(CDEFS) %s\n",
625
COMPNAME[i], comps[NCOMP+i]);
626
else /* non-interf comps don't include CDEFS by default (added later) */
627
fprintf(fpout, " %sFLAGS = %s\n",
628
COMPNAME[i], comps[NCOMP+i]);
630
fprintf(fpout, " SMAFLAGS =");
632
fprintf(fpout, " %s", smaflags);
633
fprintf(fpout, "\n DMAFLAGS =");
635
fprintf(fpout, " %s", dmaflags);
636
fprintf(fpout, "\n");
637
fprintf(fpout, " CKC = $(SKC)\n");
638
fprintf(fpout, " ZKC = $(DKC)\n");
639
fprintf(fpout, " sKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
640
fprintf(fpout, " dKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
641
fprintf(fpout, " cKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
642
fprintf(fpout, " zKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
644
for (i=0; i < NCOMP; i++)
646
if (i == XCC_) continue; /* do not accept cross-compiler */
647
j = strlen(comps[i]);
648
if (j >= 3 && comps[i][j-3] == 'g' &&
649
comps[i][j-2] == 'c' && comps[i][j-1] == 'c')
652
goodgcc = (j < NCOMP) ? comps[j] : "gcc";
653
fprintf(fpout, " GOODGCC = %s", goodgcc);
655
fprintf(fpout, " %s", gccflags);
656
GetGccVers(goodgcc, &i, &j, &k, &k);
657
if (OS == OSOSX && j > 3) /* need bullshit apple annoyance flag */
658
fprintf(fpout, " -force_cpusubtype_ALL");
659
sp = GetPtrbitsFlag(OS, mach, ptrbits, goodgcc);
661
fprintf(fpout, " %s", sp);
662
fprintf(fpout, "\n");
664
fprintf(fpout, " LDFLAGS =");
668
fprintf(fpout, " -melf_i386");
669
else if (ptrbits == 64)
670
fprintf(fpout, " -melf_x86_64");
672
fprintf(fpout, "_fbsd");
674
fprintf(fpout, "\n F77SYSLIB = %s\n", f77lib ? f77lib : "");
675
fprintf(fpout, " BC = $(ICC)\n");
676
fprintf(fpout, " NCFLAGS = $(ICCFLAGS)\n");
677
fprintf(fpout, "\n CLINKER = $(ICC)\n CLINKFLAGS = $(ICCFLAGS)\n");
678
fprintf(fpout, " FLINKER = $(F77)\n FLINKFLAGS = $(F77FLAGS)\n");
679
fprintf(fpout, " FCLINKFLAGS = $(FLINKFLAGS)");
680
if (strstr(comps[F77_], "ifort") && !OSIsWin(OS))
681
fprintf(fpout, " -nofor_main");
682
fprintf(fpout, "\n ARCHIVER = ar\n");
683
fprintf(fpout, " ARFLAGS = r\n");
685
* JF Mertens says that even x86 OS X still need ranlib for safety
687
if (OS == OSOSX /* && MachIsPPC(mach) */)
688
fprintf(fpout, " RANLIB = ranlib\n\n");
690
fprintf(fpout, " RANLIB = echo\n\n");
692
fprintf(fpout, "# -------------------------------------\n");
693
fprintf(fpout, "# tar, gzip, gunzip, and parallel make\n");
694
fprintf(fpout, "# -------------------------------------\n");
695
fprintf(fpout, " TAR = tar\n");
696
fprintf(fpout, " GZIP = gzip\n");
697
fprintf(fpout, " GUNZIP = gunzip\n");
698
fprintf(fpout, " PMAKE = %s\n\n", pmake ? pmake : "$(MAKE)");
700
* Need to add libs to GetFlags and update GetSysLib to do this right
702
fprintf(fpout, "# ------------------------------------\n");
703
fprintf(fpout, "# Reference and system libraries\n");
704
fprintf(fpout, "# ------------------------------------\n");
705
fprintf(fpout, " BLASlib = \n");
706
fprintf(fpout, " FBLASlib = \n");
707
fprintf(fpout, " FLAPACKlib = ");
708
if (flapack) fprintf(fpout, "%s", flapack);
709
fprintf(fpout, "\n");
710
fprintf(fpout, " SLAPACKlib = \n");
712
fprintf(fpout, " LIBS = -lpthread");
714
fprintf(fpout, " LIBS =");
716
fprintf(fpout, " -lm");
717
fprintf(fpout, "\n\n");
720
"# --------------------------------------------------------------------\n");
722
"# Compiler names for architectural defaults and flags to atlas_build\n");
724
"# --------------------------------------------------------------------\n");
725
for (i=0; i < NCOMP; i++)
727
sp = NewStringCopy(COMPNAME[i]);
728
for (j=0; sp[j]; j++)
729
sp[j] = tolower(sp[j]);
730
fprintf(fpout, " %sD = ", sp);
733
* Regardless of actual names, use standard gnu compiler names for defs
735
if (CompIsGcc(comps[i]))
739
GetGccVers(comps[i], &k, &j, &k, &k);
741
sp = NewStringCopy("g77");
743
sp = NewStringCopy("gfortran");
745
else sp = NewStringCopy("gcc");
749
sp = NameWithoutPath(comps[i]);
750
if (!strncmp(sp, "ATLwin_", 7))
751
sp = NewStringCopy(comps[i]+7);
753
fprintf(fpout, "%s\n", sp);
756
fprintf(fpout, " INSTFLAGS = -1 %d -a %d\n\n", USEDEFL1, USEARCHDEF);
758
fprintf(fpout, "# ---------------------------------------\n");
759
fprintf(fpout, "# Generic targets needed by all makefiles\n");
760
fprintf(fpout, "# ---------------------------------------\n");
761
fprintf(fpout, "do_it: all\n");
764
fprintf(fpout, " waitfile = wfdefault\n");
765
fprintf(fpout, "waitfile:\n\tcd $(BINdir) ; make xatlas_waitfile\n");
766
fprintf(fpout, "\t$(ATLFWAIT) -s %d -f $(waitfile)\n", delay);
768
else fprintf(fpout, "waitfile:\n");
769
if (fpout != stdout && fpout != stderr) fclose(fpout);