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))
352
return((ptrbits == 64) ? "-mabi=64" : "-mabi=n32");
353
if (!CompIsGcc(comp))
356
* Add correct 64/32 bit flags for Sun workshop compilers
358
if (MachIsUS(arch) && CompIsSunWorkshop(comp))
361
sp = (arch == SunUSI || arch == SunUSII) ?
362
"-xarch=v9" : "-xarch=v9b";
364
sp = (arch == SunUSI || arch == SunUSII) ?
365
"-xarch=v8plusa" : "-xarch=v8plusb";
367
else if (CompIsIBMXL(comp)) /* IBM xl compilers */
368
sp = (ptrbits == 64) ? "-q64" : "-q32";
371
GetGccVers(comp, &k, &j, &k, &k);
372
if ( !(j >= 3 && (OS != OSOSX || j > 3 || !CompIsAppleGcc(comp))) )
374
else if (OS == OSAIX)
375
sp = (ptrbits == 64) ? "-maix64" : "-maix32";
376
else if ((MachIsX86(arch) || MachIsPPC(arch) || MachIsUS(arch)) ||
377
arch == IbmPwr7 || arch == IbmPwr6)
381
else if (ptrbits == 32)
387
main(int nargs, char **args)
391
int h, i, j, k, verb, asmb, nof77, mhz;
394
int delay=0; /* change this to come from "special" ints in GetFlags */
396
int Use3DNow=0; /* this needs to come from getflags */
398
int USEDEFL1, USEARCHDEF;
399
char *targ, *sp, *pmake, *flapack;
400
char *comps[3*NCOMP], *comp, *flags, *srcdir, *blddir, *f2cdefs, *cdefs;
401
char *outfile, *smaflags, *dmaflags, *f77lib, *gccflags, *goodgcc;
402
char targarg[256], ln[1024];
404
char *adnames[NARDEF] = {"sKERNDEF", "dKERNDEF", "sMMDEF", "dMMDEF"};
406
GetFlags(nargs, args, &verb, &OS, (enum ASMDIA*) &asmb, &vecexts, &mach,
407
&mhz, &ptrbits, &ncpu, comps, &gccflags, &outfile, &srcdir,
408
&blddir, &USEDEFL1, &USEARCHDEF, &nof77, &f2cdefs, &cdefs, &pmake,
409
&flapack, &smaflags, &dmaflags, &f77lib, &l2size, &targ);
410
if (ncpu > 1) THREADS = 1;
414
fpout = fopen(outfile, "w");
416
assert(srcdir && blddir);
418
* Update l2size, and set f2cdefs/cdefs if they are null
420
if (!l2size) l2size = 4*1024*1024;
422
if (!f2cdefs) f2cdefs = "";
424
* Append any appended flags, and then we have just compilers and flags
426
for (i=2*NCOMP; i < 3*NCOMP; i++)
430
comps[i-NCOMP] = NewAppendedString(comps[i-NCOMP], comps[i]);
436
* If any C compiler is unspecified, use it to specify the others
437
* Use DKC preferentially if it is specified
439
if (comps[DKC_] && comps[NCOMP+DKC_])
444
for (i=0; i < F77_; i++)
446
if (comps[i] && comps[NCOMP+i])
454
fprintf(stderr, "Need a valid C compiler and flags\n");
458
for (i=0; i < F77_; i++)
463
comps[NCOMP+i] = comps[NCOMP+k];
466
* If F77 compiler unspecified or nof77 asserted, set it to ICC for linking
468
if (!comps[F77_] || nof77)
470
comps[F77_] = comps[ICC_];
471
comps[NCOMP+F77_] = comps[NCOMP+ICC_];
474
* Find dominant ISA extension
477
for (i=1; i < NISA && !ISAX; i++)
478
if (vecexts & (1<<i))
481
fprintf(fpout, "# ----------------------------\n");
482
fprintf(fpout, "# Make.inc for ATLAS3.8.4\n");
483
fprintf(fpout, "# ----------------------------\n\n");
485
fprintf(fpout, "# ----------------------------------\n");
486
fprintf(fpout, "# Make sure we get the correct shell\n");
487
fprintf(fpout, "# ----------------------------------\n");
488
fprintf(fpout, " SHELL = /bin/sh\n\n");
490
fprintf(fpout, "# -------------------------------------------------\n");
491
fprintf(fpout, "# Name indicating the platform to configure BLAS to\n");
492
fprintf(fpout, "# -------------------------------------------------\n");
493
fprintf(fpout, " ARCH = %s", machnam[mach]);
494
fprintf(fpout, "%d", ptrbits);
496
fprintf(fpout, "%s", ISAXNAM[ISAX]);
497
fprintf(fpout, "\n\n");
499
fprintf(fpout, "# ----------------------------\n");
500
fprintf(fpout, "# Paths to various directories\n");
501
fprintf(fpout, "# ----------------------------\n");
502
fprintf(fpout, " BLDdir = %s\n", blddir);
503
fprintf(fpout, " SRCdir = %s\n", srcdir);
504
fprintf(fpout, " INCAdir = $(BLDdir)/include\n");
505
fprintf(fpout, " INCSdir = $(SRCdir)/include\n");
506
fprintf(fpout, " BINdir = $(BLDdir)/bin\n");
507
fprintf(fpout, " LIBdir = $(BLDdir)/lib\n\n");
508
fprintf(fpout, " SYSdir = $(BLDdir)/tune/sysinfo\n");
509
fprintf(fpout, " GMMdir = $(BLDdir)/src/blas/gemm\n");
510
fprintf(fpout, " GMVdir = $(BLDdir)/src/blas/gemv\n");
511
fprintf(fpout, " GR1dir = $(BLDdir)/src/blas/ger\n");
512
fprintf(fpout, " L1Bdir = $(BLDdir)/src/blas/level1\n");
513
fprintf(fpout, " L2Bdir = $(BLDdir)/src/blas/level2\n");
514
fprintf(fpout, " L3Bdir = $(BLDdir)/src/blas/level3\n");
515
fprintf(fpout, " TSTdir = $(BLDdir)/src/testing\n");
516
fprintf(fpout, " AUXdir = $(BLDdir)/src/auxil\n");
517
fprintf(fpout, " CBLdir = $(BLDdir)/interfaces/blas/C/src\n");
518
fprintf(fpout, " FBLdir = $(BLDdir)/interfaces/blas/F77/src\n");
519
fprintf(fpout, " PTSdir = $(BLDdir)/src/pthreads\n");
520
fprintf(fpout, " MMTdir = $(BLDdir)/tune/blas/gemm\n");
521
fprintf(fpout, " MVTdir = $(BLDdir)/tune/blas/gemv\n");
522
fprintf(fpout, " R1Tdir = $(BLDdir)/tune/blas/ger\n");
523
fprintf(fpout, " L1Tdir = $(BLDdir)/tune/blas/level1\n");
524
fprintf(fpout, " L3Tdir = $(BLDdir)/tune/blas/level3\n");
525
fprintf(fpout, "\n");
528
"# ---------------------------------------------------------------------\n");
530
"# Name and location of scripts for running executables during tuning\n");
532
"# ---------------------------------------------------------------------\n");
533
fprintf(fpout, " ATLRUN = $(BLDdir)/bin/ATLrun.sh\n");
534
fprintf(fpout, " ATLFWAIT = $(BLDdir)/bin/xatlas_waitfile\n\n");
536
fprintf(fpout, "# ---------------------\n");
537
fprintf(fpout, "# Libraries to be built\n");
538
fprintf(fpout, "# ---------------------\n");
539
fprintf(fpout, " ATLASlib = $(LIBdir)/libatlas.a\n");
540
fprintf(fpout, " CBLASlib = $(LIBdir)/libcblas.a\n");
541
fprintf(fpout, " F77BLASlib = $(LIBdir)/libf77blas.a\n");
544
fprintf(fpout, " PTCBLASlib = $(LIBdir)/libptcblas.a\n");
545
fprintf(fpout, " PTF77BLASlib = $(LIBdir)/libptf77blas.a\n");
547
fprintf(fpout, " LAPACKlib = $(LIBdir)/liblapack_atlas.a\n");
548
fprintf(fpout, " TESTlib = $(LIBdir)/libtstatlas.a\n\n");
550
fprintf(fpout, " FULLBLASlib = $(LIBdir)/atlas/libblas.a\n");
551
fprintf(fpout, " FULLLAPACKlib = $(LIBdir)/atlas/liblapack.a\n");
553
fprintf(fpout, "# -------------------------------------------\n");
554
fprintf(fpout, "# Upper bound on largest cache size, in bytes\n");
555
fprintf(fpout, "# -------------------------------------------\n");
556
fprintf(fpout, " L2SIZE = -DL2SIZE=%d\n\n", l2size);
558
fprintf(fpout, "# ---------------------------------------\n");
559
fprintf(fpout, "# Command setting up correct include path\n");
560
fprintf(fpout, "# ---------------------------------------\n");
562
" INCLUDES = -I$(INCAdir) -I$(INCSdir) -I$(INCSdir)/contrib\n\n");
564
fprintf(fpout, "# -------------------------------------------\n");
565
fprintf(fpout, "# Defines for setting up F77/C interoperation\n");
566
fprintf(fpout, "# -------------------------------------------\n");
567
fprintf(fpout, " F2CDEFS = %s\n\n", f2cdefs);
569
fprintf(fpout, "# ------------------------------\n");
570
fprintf(fpout, "# Architecture identifying flags\n");
571
fprintf(fpout, "# ------------------------------\n");
572
fprintf(fpout, " ARCHDEFS =");
574
fprintf(fpout, " -DATL_OS_%s", osnam[OS]);
575
if (mach != MACHOther)
576
fprintf(fpout, " -DATL_ARCH_%s", machnam[mach]);
578
fprintf(fpout, " -DATL_CPUMHZ=%d", mhz);
580
fprintf(fpout, " -DSUN_HR");
582
fprintf(fpout, " -DGCCWIN -DUseClock");
583
for (i=1; i < NISA; i++)
584
if (vecexts & (1<<i))
585
fprintf(fpout, " -DATL_%s", ISAXNAM[i]);
586
if (Use3DNow) fprintf(fpout, " -DATL_3DNowFLOPS");
588
fprintf(fpout, " -DATL_USE64BITS");
589
if (mach == IA64Itan || mach == IA64Itan2 )
590
fprintf(fpout, " -DATL_MAXNREG=128");
591
if (asmb != ASM_None) fprintf(fpout, " -DATL_%s", ASMNAM[asmb]);
592
if (mach == IA64Itan2)
593
fprintf(fpout, " -DATL_IntelIccBugs");
595
* Need up update handling of apple vs. gnu gcc for altivec
598
if (ISAX == ISA_AV && strstr(CC, "gcc") && strstr(MCC, "gcc") &&
600
fprintf(fpout, " -DATL_%s -DATL_AVgcc", ISAXNAM[ISAX]);
602
fprintf(fpout, "\n\n");
605
"# -------------------------------------------------------------------\n");
607
"# NM is the flag required to name a compiled object/executable\n");
609
"# OJ is the flag required to compile to object rather than executable\n");
610
fprintf(fpout, "# These flags are used by all compilers.\n");
612
"# -------------------------------------------------------------------\n");
613
fprintf(fpout, " NM = -o\n");
614
fprintf(fpout, " OJ = -c\n\n");
616
sprintf(ln, "%s/CONFIG/src/CompMake.txt", srcdir);
617
DisplayFile(ln, fpout, 0);
618
fprintf(fpout, " CDEFS = $(L2SIZE) $(INCLUDES) $(F2CDEFS) $(ARCHDEFS)");
619
if (cdefs) fprintf(fpout, " %s", cdefs);
622
fprintf(fpout, " -DATL_NCPU=%d", ncpu);
623
if (OS == OSFreeBSD) fprintf(fpout, " -D_THREAD_SAFE -D_REENTRANT");
624
if (OS == OSAIX) fprintf(fpout, " -DIBM_PT_ERROR");
625
if (OS == OSIRIX) fprintf(fpout, " -D_POSIX_C_SOURCE=199506L");
627
if (delay) fprintf(fpout, " -DATL_FOPENDELAY");
628
fprintf(fpout, "\n\n");
629
for (i=0; i < NCOMP; i++)
631
fprintf(fpout, " %s = %s\n", COMPNAME[i], comps[i]);
633
fprintf(fpout, " %sFLAGS = %s\n", COMPNAME[i], comps[NCOMP+i]);
634
else if (i == ICC_ || i == XCC_)
635
fprintf(fpout, " %sFLAGS = $(CDEFS) %s\n",
636
COMPNAME[i], comps[NCOMP+i]);
637
else /* non-interf comps don't include CDEFS by default (added later) */
638
fprintf(fpout, " %sFLAGS = %s\n",
639
COMPNAME[i], comps[NCOMP+i]);
641
fprintf(fpout, " SMAFLAGS =");
643
fprintf(fpout, " %s", smaflags);
644
fprintf(fpout, "\n DMAFLAGS =");
646
fprintf(fpout, " %s", dmaflags);
647
fprintf(fpout, "\n");
648
fprintf(fpout, " CKC = $(SKC)\n");
649
fprintf(fpout, " ZKC = $(DKC)\n");
650
fprintf(fpout, " sKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
651
fprintf(fpout, " dKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
652
fprintf(fpout, " cKCFLAGS = $(CDEFS) $(SKCFLAGS)\n");
653
fprintf(fpout, " zKCFLAGS = $(CDEFS) $(DKCFLAGS)\n");
655
for (i=0; i < NCOMP; i++)
657
if (i == XCC_) continue; /* do not accept cross-compiler */
658
j = strlen(comps[i]);
659
if (j >= 3 && comps[i][j-3] == 'g' &&
660
comps[i][j-2] == 'c' && comps[i][j-1] == 'c')
663
goodgcc = (j < NCOMP) ? comps[j] : "gcc";
664
fprintf(fpout, " GOODGCC = %s", goodgcc);
666
fprintf(fpout, " %s", gccflags);
667
GetGccVers(goodgcc, &i, &j, &k, &k);
668
if (OS == OSOSX && j > 3) /* need bullshit apple annoyance flag */
669
fprintf(fpout, " -force_cpusubtype_ALL");
670
sp = GetPtrbitsFlag(OS, mach, ptrbits, goodgcc);
672
fprintf(fpout, " %s", sp);
673
fprintf(fpout, "\n");
675
fprintf(fpout, " LDFLAGS =");
679
fprintf(fpout, " -melf_i386");
680
else if (ptrbits == 64)
681
fprintf(fpout, " -melf_x86_64");
683
fprintf(fpout, "_fbsd");
685
fprintf(fpout, "\n F77SYSLIB = %s\n", f77lib ? f77lib : "");
686
fprintf(fpout, " BC = $(ICC)\n");
687
fprintf(fpout, " NCFLAGS = $(ICCFLAGS)\n");
688
fprintf(fpout, "\n CLINKER = $(ICC)\n CLINKFLAGS = $(ICCFLAGS)\n");
689
fprintf(fpout, " FLINKER = $(F77)\n FLINKFLAGS = $(F77FLAGS)\n");
690
fprintf(fpout, " FCLINKFLAGS = $(FLINKFLAGS)");
691
if (strstr(comps[F77_], "ifort") && !OSIsWin(OS))
692
fprintf(fpout, " -nofor_main");
693
fprintf(fpout, "\n ARCHIVER = ar\n");
694
fprintf(fpout, " ARFLAGS = r\n");
696
* JF Mertens says that even x86 OS X still need ranlib for safety
698
if (OS == OSOSX /* && MachIsPPC(mach) */)
699
fprintf(fpout, " RANLIB = ranlib\n\n");
701
fprintf(fpout, " RANLIB = echo\n\n");
703
fprintf(fpout, "# -------------------------------------\n");
704
fprintf(fpout, "# tar, gzip, gunzip, and parallel make\n");
705
fprintf(fpout, "# -------------------------------------\n");
706
fprintf(fpout, " TAR = tar\n");
707
fprintf(fpout, " GZIP = gzip\n");
708
fprintf(fpout, " GUNZIP = gunzip\n");
709
fprintf(fpout, " PMAKE = %s\n\n", pmake ? pmake : "$(MAKE)");
711
* Need to add libs to GetFlags and update GetSysLib to do this right
713
fprintf(fpout, "# ------------------------------------\n");
714
fprintf(fpout, "# Reference and system libraries\n");
715
fprintf(fpout, "# ------------------------------------\n");
716
fprintf(fpout, " BLASlib = \n");
717
fprintf(fpout, " FBLASlib = \n");
718
fprintf(fpout, " FLAPACKlib = ");
719
if (flapack) fprintf(fpout, "%s", flapack);
720
fprintf(fpout, "\n");
721
fprintf(fpout, " SLAPACKlib = \n");
723
fprintf(fpout, " LIBS = -lpthread");
725
fprintf(fpout, " LIBS =");
727
fprintf(fpout, " -lm");
728
fprintf(fpout, "\n\n");
731
"# --------------------------------------------------------------------\n");
733
"# Compiler names for architectural defaults and flags to atlas_build\n");
735
"# --------------------------------------------------------------------\n");
736
for (i=0; i < NCOMP; i++)
738
sp = NewStringCopy(COMPNAME[i]);
739
for (j=0; sp[j]; j++)
740
sp[j] = tolower(sp[j]);
741
fprintf(fpout, " %sD = ", sp);
744
* Regardless of actual names, use standard gnu compiler names for defs
746
if (CompIsGcc(comps[i]))
750
GetGccVers(comps[i], &k, &j, &k, &k);
752
sp = NewStringCopy("g77");
754
sp = NewStringCopy("gfortran");
756
else sp = NewStringCopy("gcc");
760
sp = NameWithoutPath(comps[i]);
761
if (!strncmp(sp, "ATLwin_", 7))
762
sp = NewStringCopy(comps[i]+7);
764
fprintf(fpout, "%s\n", sp);
767
fprintf(fpout, " INSTFLAGS = -1 %d -a %d\n\n", USEDEFL1, USEARCHDEF);
769
fprintf(fpout, "# ---------------------------------------\n");
770
fprintf(fpout, "# Generic targets needed by all makefiles\n");
771
fprintf(fpout, "# ---------------------------------------\n");
772
fprintf(fpout, "do_it: all\n");
775
fprintf(fpout, " waitfile = wfdefault\n");
776
fprintf(fpout, "waitfile:\n\tcd $(BINdir) ; make xatlas_waitfile\n");
777
fprintf(fpout, "\t$(ATLFWAIT) -s %d -f $(waitfile)\n", delay);
779
else fprintf(fpout, "waitfile:\n");
780
if (fpout != stdout && fpout != stderr) fclose(fpout);