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 (MachIsS390(arch))
345
if (MachIsHPPA(arch))
347
if (MachIsALPHA(arch))
349
if (MachIsARMEL(arch))
351
if (MachIsMIPS(arch))
353
// return((ptrbits == 64) ? "-mabi=64" : "-mabi=n32");
356
if (!CompIsGcc(comp))
359
* Add correct 64/32 bit flags for Sun workshop compilers
361
if (MachIsUS(arch) && CompIsSunWorkshop(comp))
364
sp = (arch == SunUSI || arch == SunUSII) ?
365
"-xarch=v9" : "-xarch=v9b";
367
sp = (arch == SunUSI || arch == SunUSII) ?
368
"-xarch=v8plusa" : "-xarch=v8plusb";
370
else if (CompIsIBMXL(comp)) /* IBM xl compilers */
371
sp = (ptrbits == 64) ? "-q64" : "-q32";
374
GetGccVers(comp, &k, &j, &k, &k);
375
if ( !(j >= 3 && (OS != OSOSX || j > 3 || !CompIsAppleGcc(comp))) )
377
else if (OS == OSAIX)
378
sp = (ptrbits == 64) ? "-maix64" : "-maix32";
379
else if ((MachIsX86(arch) || MachIsPPC(arch) || MachIsUS(arch)) ||
380
arch == IbmPwr7 || arch == IbmPwr6)
384
else if (ptrbits == 32)
390
main(int nargs, char **args)
394
int h, i, j, k, verb, asmb, nof77, mhz;
397
int delay=0; /* change this to come from "special" ints in GetFlags */
399
int Use3DNow=0; /* this needs to come from getflags */
401
int USEDEFL1, USEARCHDEF;
402
char *targ, *sp, *pmake, *flapack;
403
char *comps[3*NCOMP], *comp, *flags, *srcdir, *blddir, *f2cdefs, *cdefs;
404
char *outfile, *smaflags, *dmaflags, *f77lib, *gccflags, *goodgcc;
405
char targarg[256], ln[1024];
407
char *adnames[NARDEF] = {"sKERNDEF", "dKERNDEF", "sMMDEF", "dMMDEF"};
409
GetFlags(nargs, args, &verb, &OS, (enum ASMDIA*) &asmb, &vecexts, &mach,
410
&mhz, &ptrbits, &ncpu, comps, &gccflags, &outfile, &srcdir,
411
&blddir, &USEDEFL1, &USEARCHDEF, &nof77, &f2cdefs, &cdefs, &pmake,
412
&flapack, &smaflags, &dmaflags, &f77lib, &l2size, &targ);
413
if (ncpu > 1) THREADS = 1;
417
fpout = fopen(outfile, "w");
419
assert(srcdir && blddir);
421
* Update l2size, and set f2cdefs/cdefs if they are null
423
if (!l2size) l2size = 4*1024*1024;
425
if (!f2cdefs) f2cdefs = "";
427
* Append any appended flags, and then we have just compilers and flags
429
for (i=2*NCOMP; i < 3*NCOMP; i++)
433
comps[i-NCOMP] = NewAppendedString(comps[i-NCOMP], comps[i]);
439
* If any C compiler is unspecified, use it to specify the others
440
* Use DKC preferentially if it is specified
442
if (comps[DKC_] && comps[NCOMP+DKC_])
447
for (i=0; i < F77_; i++)
449
if (comps[i] && comps[NCOMP+i])
457
fprintf(stderr, "Need a valid C compiler and flags\n");
461
for (i=0; i < F77_; i++)
466
comps[NCOMP+i] = comps[NCOMP+k];
469
* If F77 compiler unspecified or nof77 asserted, set it to ICC for linking
471
if (!comps[F77_] || nof77)
473
comps[F77_] = comps[ICC_];
474
comps[NCOMP+F77_] = comps[NCOMP+ICC_];
477
* Find dominant ISA extension
480
for (i=1; i < NISA && !ISAX; i++)
481
if (vecexts & (1<<i))
484
fprintf(fpout, "# ----------------------------\n");
485
fprintf(fpout, "# Make.inc for ATLAS3.8.4\n");
486
fprintf(fpout, "# ----------------------------\n\n");
488
fprintf(fpout, "# ----------------------------------\n");
489
fprintf(fpout, "# Make sure we get the correct shell\n");
490
fprintf(fpout, "# ----------------------------------\n");
491
fprintf(fpout, " SHELL = /bin/sh\n\n");
493
fprintf(fpout, "# -------------------------------------------------\n");
494
fprintf(fpout, "# Name indicating the platform to configure BLAS to\n");
495
fprintf(fpout, "# -------------------------------------------------\n");
496
fprintf(fpout, " ARCH = %s", machnam[mach]);
497
fprintf(fpout, "%d", ptrbits);
499
fprintf(fpout, "%s", ISAXNAM[ISAX]);
500
fprintf(fpout, "\n\n");
502
fprintf(fpout, "# ----------------------------\n");
503
fprintf(fpout, "# Paths to various directories\n");
504
fprintf(fpout, "# ----------------------------\n");
505
fprintf(fpout, " BLDdir = %s\n", blddir);
506
fprintf(fpout, " SRCdir = %s\n", srcdir);
507
fprintf(fpout, " INCAdir = $(BLDdir)/include\n");
508
fprintf(fpout, " INCSdir = $(SRCdir)/include\n");
509
fprintf(fpout, " BINdir = $(BLDdir)/bin\n");
510
fprintf(fpout, " LIBdir = $(BLDdir)/lib\n\n");
511
fprintf(fpout, " SYSdir = $(BLDdir)/tune/sysinfo\n");
512
fprintf(fpout, " GMMdir = $(BLDdir)/src/blas/gemm\n");
513
fprintf(fpout, " GMVdir = $(BLDdir)/src/blas/gemv\n");
514
fprintf(fpout, " GR1dir = $(BLDdir)/src/blas/ger\n");
515
fprintf(fpout, " L1Bdir = $(BLDdir)/src/blas/level1\n");
516
fprintf(fpout, " L2Bdir = $(BLDdir)/src/blas/level2\n");
517
fprintf(fpout, " L3Bdir = $(BLDdir)/src/blas/level3\n");
518
fprintf(fpout, " TSTdir = $(BLDdir)/src/testing\n");
519
fprintf(fpout, " AUXdir = $(BLDdir)/src/auxil\n");
520
fprintf(fpout, " CBLdir = $(BLDdir)/interfaces/blas/C/src\n");
521
fprintf(fpout, " FBLdir = $(BLDdir)/interfaces/blas/F77/src\n");
522
fprintf(fpout, " PTSdir = $(BLDdir)/src/pthreads\n");
523
fprintf(fpout, " MMTdir = $(BLDdir)/tune/blas/gemm\n");
524
fprintf(fpout, " MVTdir = $(BLDdir)/tune/blas/gemv\n");
525
fprintf(fpout, " R1Tdir = $(BLDdir)/tune/blas/ger\n");
526
fprintf(fpout, " L1Tdir = $(BLDdir)/tune/blas/level1\n");
527
fprintf(fpout, " L3Tdir = $(BLDdir)/tune/blas/level3\n");
528
fprintf(fpout, "\n");
531
"# ---------------------------------------------------------------------\n");
533
"# Name and location of scripts for running executables during tuning\n");
535
"# ---------------------------------------------------------------------\n");
536
fprintf(fpout, " ATLRUN = $(BLDdir)/bin/ATLrun.sh\n");
537
fprintf(fpout, " ATLFWAIT = $(BLDdir)/bin/xatlas_waitfile\n\n");
539
fprintf(fpout, "# ---------------------\n");
540
fprintf(fpout, "# Libraries to be built\n");
541
fprintf(fpout, "# ---------------------\n");
542
fprintf(fpout, " ATLASlib = $(LIBdir)/libatlas.a\n");
543
fprintf(fpout, " CBLASlib = $(LIBdir)/libcblas.a\n");
544
fprintf(fpout, " F77BLASlib = $(LIBdir)/libf77blas.a\n");
547
fprintf(fpout, " PTCBLASlib = $(LIBdir)/libptcblas.a\n");
548
fprintf(fpout, " PTF77BLASlib = $(LIBdir)/libptf77blas.a\n");
550
fprintf(fpout, " LAPACKlib = $(LIBdir)/liblapack_atlas.a\n");
551
fprintf(fpout, " TESTlib = $(LIBdir)/libtstatlas.a\n\n");
553
fprintf(fpout, " FULLBLASlib = $(LIBdir)/atlas/libblas.a\n");
554
fprintf(fpout, " FULLLAPACKlib = $(LIBdir)/atlas/liblapack.a\n");
556
fprintf(fpout, "# -------------------------------------------\n");
557
fprintf(fpout, "# Upper bound on largest cache size, in bytes\n");
558
fprintf(fpout, "# -------------------------------------------\n");
559
fprintf(fpout, " L2SIZE = -DL2SIZE=%d\n\n", l2size);
561
fprintf(fpout, "# ---------------------------------------\n");
562
fprintf(fpout, "# Command setting up correct include path\n");
563
fprintf(fpout, "# ---------------------------------------\n");
565
" INCLUDES = -I$(INCAdir) -I$(INCSdir) -I$(INCSdir)/contrib\n\n");
567
fprintf(fpout, "# -------------------------------------------\n");
568
fprintf(fpout, "# Defines for setting up F77/C interoperation\n");
569
fprintf(fpout, "# -------------------------------------------\n");
570
fprintf(fpout, " F2CDEFS = %s\n\n", f2cdefs);
572
fprintf(fpout, "# ------------------------------\n");
573
fprintf(fpout, "# Architecture identifying flags\n");
574
fprintf(fpout, "# ------------------------------\n");
575
fprintf(fpout, " ARCHDEFS =");
577
fprintf(fpout, " -DATL_OS_%s", osnam[OS]);
578
if (mach != MACHOther)
579
fprintf(fpout, " -DATL_ARCH_%s", machnam[mach]);
581
fprintf(fpout, " -DATL_CPUMHZ=%d", mhz);
583
fprintf(fpout, " -DSUN_HR");
585
fprintf(fpout, " -DGCCWIN -DUseClock");
586
for (i=1; i < NISA; i++)
587
if (vecexts & (1<<i))
588
fprintf(fpout, " -DATL_%s", ISAXNAM[i]);
589
if (Use3DNow) fprintf(fpout, " -DATL_3DNowFLOPS");
591
fprintf(fpout, " -DATL_USE64BITS");
592
if (mach == IA64Itan || mach == IA64Itan2 )
593
fprintf(fpout, " -DATL_MAXNREG=128");
594
if (asmb != ASM_None) fprintf(fpout, " -DATL_%s", ASMNAM[asmb]);
595
if (mach == IA64Itan2)
596
fprintf(fpout, " -DATL_IntelIccBugs");
598
* Need up update handling of apple vs. gnu gcc for altivec
601
if (ISAX == ISA_AV && strstr(CC, "gcc") && strstr(MCC, "gcc") &&
603
fprintf(fpout, " -DATL_%s -DATL_AVgcc", ISAXNAM[ISAX]);
605
fprintf(fpout, "\n\n");
608
"# -------------------------------------------------------------------\n");
610
"# NM is the flag required to name a compiled object/executable\n");
612
"# OJ is the flag required to compile to object rather than executable\n");
613
fprintf(fpout, "# These flags are used by all compilers.\n");
615
"# -------------------------------------------------------------------\n");
616
fprintf(fpout, " NM = -o\n");
617
fprintf(fpout, " OJ = -c\n\n");
619
sprintf(ln, "%s/CONFIG/src/CompMake.txt", srcdir);
620
DisplayFile(ln, fpout, 0);
621
fprintf(fpout, " CDEFS = $(L2SIZE) $(INCLUDES) $(F2CDEFS) $(ARCHDEFS)");
622
if (cdefs) fprintf(fpout, " %s", cdefs);
625
fprintf(fpout, " -DATL_NCPU=%d", ncpu);
626
if (OS == OSFreeBSD) fprintf(fpout, " -D_THREAD_SAFE -D_REENTRANT");
627
if (OS == OSAIX) fprintf(fpout, " -DIBM_PT_ERROR");
628
if (OS == OSIRIX) fprintf(fpout, " -D_POSIX_C_SOURCE=199506L");
630
if (delay) fprintf(fpout, " -DATL_FOPENDELAY");
631
fprintf(fpout, "\n\n");
632
for (i=0; i < NCOMP; i++)
634
fprintf(fpout, " %s = %s\n", COMPNAME[i], comps[i]);
636
fprintf(fpout, " %sFLAGS = %s\n", COMPNAME[i], comps[NCOMP+i]);
637
else if (i == ICC_ || i == XCC_)
638
fprintf(fpout, " %sFLAGS = $(CDEFS) %s\n",
639
COMPNAME[i], comps[NCOMP+i]);
640
else /* non-interf comps don't include CDEFS by default (added later) */
641
fprintf(fpout, " %sFLAGS = %s\n",
642
COMPNAME[i], comps[NCOMP+i]);
644
fprintf(fpout, " SMAFLAGS =");
646
fprintf(fpout, " %s", smaflags);
647
fprintf(fpout, "\n DMAFLAGS =");
649
fprintf(fpout, " %s", dmaflags);
650
fprintf(fpout, "\n");
651
fprintf(fpout, " CKC = $(SKC)\n");
652
fprintf(fpout, " ZKC = $(DKC)\n");
653
fprintf(fpout, " sKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
654
fprintf(fpout, " dKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
655
fprintf(fpout, " cKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
656
fprintf(fpout, " zKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
658
for (i=0; i < NCOMP; i++)
660
if (i == XCC_) continue; /* do not accept cross-compiler */
661
j = strlen(comps[i]);
662
if (j >= 3 && comps[i][j-3] == 'g' &&
663
comps[i][j-2] == 'c' && comps[i][j-1] == 'c')
666
goodgcc = (j < NCOMP) ? comps[j] : "gcc";
667
fprintf(fpout, " GOODGCC = %s", goodgcc);
669
fprintf(fpout, " %s", gccflags);
670
GetGccVers(goodgcc, &i, &j, &k, &k);
671
if (OS == OSOSX && j > 3) /* need bullshit apple annoyance flag */
672
fprintf(fpout, " -force_cpusubtype_ALL");
673
sp = GetPtrbitsFlag(OS, mach, ptrbits, goodgcc);
675
fprintf(fpout, " %s", sp);
676
fprintf(fpout, "\n");
678
fprintf(fpout, " LDFLAGS =");
682
fprintf(fpout, " -melf_i386");
683
else if (ptrbits == 64)
684
fprintf(fpout, " -melf_x86_64");
686
fprintf(fpout, "_fbsd");
688
fprintf(fpout, "\n F77SYSLIB = %s\n", f77lib ? f77lib : "");
689
fprintf(fpout, " BC = $(ICC)\n");
690
fprintf(fpout, " NCFLAGS = $(ICCFLAGS)\n");
691
fprintf(fpout, "\n CLINKER = $(ICC)\n CLINKFLAGS = $(ICCFLAGS)\n");
692
fprintf(fpout, " FLINKER = $(F77)\n FLINKFLAGS = $(F77FLAGS)\n");
693
fprintf(fpout, " FCLINKFLAGS = $(FLINKFLAGS)");
694
if (strstr(comps[F77_], "ifort") && !OSIsWin(OS))
695
fprintf(fpout, " -nofor_main");
696
fprintf(fpout, "\n ARCHIVER = ar\n");
697
fprintf(fpout, " ARFLAGS = r\n");
699
* JF Mertens says that even x86 OS X still need ranlib for safety
701
if (OS == OSOSX /* && MachIsPPC(mach) */)
702
fprintf(fpout, " RANLIB = ranlib\n\n");
704
fprintf(fpout, " RANLIB = echo\n\n");
706
fprintf(fpout, "# -------------------------------------\n");
707
fprintf(fpout, "# tar, gzip, gunzip, and parallel make\n");
708
fprintf(fpout, "# -------------------------------------\n");
709
fprintf(fpout, " TAR = tar\n");
710
fprintf(fpout, " GZIP = gzip\n");
711
fprintf(fpout, " GUNZIP = gunzip\n");
712
fprintf(fpout, " PMAKE = %s\n\n", pmake ? pmake : "$(MAKE)");
714
* Need to add libs to GetFlags and update GetSysLib to do this right
716
fprintf(fpout, "# ------------------------------------\n");
717
fprintf(fpout, "# Reference and system libraries\n");
718
fprintf(fpout, "# ------------------------------------\n");
719
fprintf(fpout, " BLASlib = \n");
720
fprintf(fpout, " FBLASlib = \n");
721
fprintf(fpout, " FLAPACKlib = ");
722
if (flapack) fprintf(fpout, "%s", flapack);
723
fprintf(fpout, "\n");
724
fprintf(fpout, " SLAPACKlib = \n");
726
fprintf(fpout, " LIBS = -lpthread");
728
fprintf(fpout, " LIBS =");
730
fprintf(fpout, " -lm");
731
fprintf(fpout, "\n\n");
734
"# --------------------------------------------------------------------\n");
736
"# Compiler names for architectural defaults and flags to atlas_build\n");
738
"# --------------------------------------------------------------------\n");
739
for (i=0; i < NCOMP; i++)
741
sp = NewStringCopy(COMPNAME[i]);
742
for (j=0; sp[j]; j++)
743
sp[j] = tolower(sp[j]);
744
fprintf(fpout, " %sD = ", sp);
747
* Regardless of actual names, use standard gnu compiler names for defs
749
if (CompIsGcc(comps[i]))
753
GetGccVers(comps[i], &k, &j, &k, &k);
755
sp = NewStringCopy("g77");
757
sp = NewStringCopy("gfortran");
759
else sp = NewStringCopy("gcc");
763
sp = NameWithoutPath(comps[i]);
764
if (!strncmp(sp, "ATLwin_", 7))
765
sp = NewStringCopy(comps[i]+7);
767
fprintf(fpout, "%s\n", sp);
770
fprintf(fpout, " INSTFLAGS = -1 %d -a %d\n\n", USEDEFL1, USEARCHDEF);
772
fprintf(fpout, "# ---------------------------------------\n");
773
fprintf(fpout, "# Generic targets needed by all makefiles\n");
774
fprintf(fpout, "# ---------------------------------------\n");
775
fprintf(fpout, "do_it: all\n");
778
fprintf(fpout, " waitfile = wfdefault\n");
779
fprintf(fpout, "waitfile:\n\tcd $(BINdir) ; make xatlas_waitfile\n");
780
fprintf(fpout, "\t$(ATLFWAIT) -s %d -f $(waitfile)\n", delay);
782
else fprintf(fpout, "waitfile:\n");
783
if (fpout != stdout && fpout != stderr) fclose(fpout);