2009-10-25 13:15:56 UTC
I have succeeded in building atlas-3.9.16 on cygwin-1.7 with gcc-4.3.4.
#Patches
Following patches were applied. (Patches themselves are attached at the end)
1. cygwin-assert.patch (workaround for Artifact ID 2873570)
1. cygwin-cp.patch (workaround for Artifact ID 2883088)
1. single-core.patch (workaround for Artifact ID 2881745 and 2883351)
1. cygwin-stack-boundary.patch
Without "cygwin-stack-boundary.patch", xzlanbtst goes into an infinite loop. The patch removes checks for Windows completely. I don't know if it is applicable for compilers other than gcc on cygwin.
#configure
"configure" script was invoked as follows:
ATLAS/configure -b 32 -t 1 -m 1800 -D c -DPentiumCPS=1800 -D c -mtune=pentium4 --with-netlib-lapack-tarfile=lapack-3.2.1.tgz -Si latune 1
"-D c -mtune=pentium4" is necessary because "xmmintrin.h" requires that "\_\_SSE\_\_" is defined. (I think that "-D c -msse" also works.)
#Build
##Static link library
"make", "make check" and "make time" go fine.
##Dynamic link library
I built DLLs as follows:
ar x libcblas.a ilaenv.o
ar r liblapack.a ilaenv.o
gcc -shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
-o cygatlas-0.dll -Wl,--out-implib=libatlas.dll.a \
-Wl,--whole-archive libatlas.a -Wl,--no-whole-archive \
-shared-libgcc
gcc -shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
-o cygblas-0.dll -Wl,--out-implib=libblas.dll.a \
-Wl,--whole-archive libcblas.a libf77blas.a -Wl,--no-whole-archive \
-shared-libgcc -lgfortran libatlas.dll.a
gcc -shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base \
-o cyglapack-0.dll -Wl,--out-implib=liblapack.dll.a \
-Wl,--whole-archive liblapack.a -Wl,--no-whole-archive \
-shared-libgcc -lgfortran libblas.dll.a
These DLLs are for replacement of cygwin's official lapack package.
Thanks Marco for maintaining it.
The first two lines are necessary because octave on cygwin requires ilaenv in cyglapack-0.dll not in cygblas-0.dll.
**cygwin-assert.patch**
--- origsrc/ATLAS/include/atlas_mmparse.h 2009-10-18 04:08:26.000000000 +0900
+++ src/ATLAS/include/atlas_mmparse.h 2009-10-24 11:24:45.764578200 +0900
@@ -515,9 +515,10 @@
fpout = stdout;
else if (!strcmp(file, "stderr"))
fpout = stderr;
- else
+ else {
fpout = fopen(file, "w");
- assert(fpout);
+ assert(fpout);
+ }
PrintMMNodes(fpout, nq);
if (fpout != stdout && fpout != stderr)
fclose(fpout);
--- origsrc/ATLAS/include/atlas_mvparse.h 2009-10-18 04:08:26.000000000 +0900
+++ src/ATLAS/include/atlas_mvparse.h 2009-10-24 11:24:45.794621400 +0900
@@ -414,9 +414,10 @@
fpout = stdout;
else if (!strcmp(file, "stderr"))
fpout = stderr;
- else
+ else {
fpout = fopen(file, "w");
- assert(fpout);
+ assert(fpout);
+ }
PrintMVNodes(fpout, nq);
if (fpout != stdout && fpout != stderr)
fclose(fpout);
--- origsrc/ATLAS/include/atlas_r1parse.h 2009-10-18 04:08:26.000000000 +0900
+++ src/ATLAS/include/atlas_r1parse.h 2009-10-24 11:24:45.814650200 +0900
@@ -346,9 +346,10 @@
fpout = stdout;
else if (!strcmp(file, "stderr"))
fpout = stderr;
- else
+ else {
fpout = fopen(file, "w");
- assert(fpout);
+ assert(fpout);
+ }
PrintR1Nodes(fpout, nq);
if (fpout != stdout && fpout != stderr)
fclose(fpout);
**cygwin-cp.patch**
--- origsrc/ATLAS/makes/Make.mmtune 2009-10-18 04:08:27.000000000 +0900
+++ src/ATLAS/makes/Make.mmtune 2009-10-24 11:24:45.854707800 +0900
@@ -281,8 +281,11 @@
cd $(GMMdir)/KERNEL ; rm -f sMakefile xccobj
cd KERNEL ; mv -f ATL_s*.c $(GMMdir)/KERNEL/.
mv -f KERNEL/sMakefile $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/.
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/. ; \
+ else \
+ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/. ; \
+ fi
$(MAKE) smmlib
touch sinstall
@@ -368,8 +371,11 @@
cd $(GMMdir)/KERNEL ; rm -f dMakefile xccobj
cd KERNEL ; mv -f ATL_d*.c $(GMMdir)/KERNEL/.
mv -f KERNEL/dMakefile $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/.
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/. ; \
+ else \
+ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/. ; \
+ fi
$(MAKE) dmmlib
touch dinstall
@@ -452,8 +458,11 @@
cd $(GMMdir)/KERNEL ; rm -f qMakefile xccobj
cd KERNEL ; mv -f ATL_q*.c $(GMMdir)/KERNEL/.
mv -f KERNEL/qMakefile $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/.
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/. ; \
+ else \
+ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/. ; \
+ fi
$(MAKE) qmmlib
touch qinstall
@@ -536,8 +545,11 @@
cd $(GMMdir)/KERNEL ; rm -f cMakefile xccobj
cd KERNEL ; mv -f ATL_c*.c $(GMMdir)/KERNEL/.
mv -f KERNEL/cMakefile $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/.
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/. ; \
+ else \
+ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/. ; \
+ fi
$(MAKE) cmmlib
touch cinstall
@@ -620,8 +632,11 @@
cd $(GMMdir)/KERNEL ; rm -f zMakefile xccobj
cd KERNEL ; mv -f ATL_z*.c $(GMMdir)/KERNEL/.
mv -f KERNEL/zMakefile $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/.
- -@ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/.
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe $(GMMdir)/KERNEL/. ; \
+ else \
+ cp -f $(BINdir)/xccobj $(GMMdir)/KERNEL/. ; \
+ fi
$(MAKE) zmmlib
touch zinstall
@@ -1397,8 +1412,11 @@
$(BINdir)/xccobj :
cd $(BINdir) ; $(MAKE) xccobj
xccobj : $(BINdir)/xccobj
- -@ cp -f $(BINdir)/xccobj .
- -@ cp -f $(BINdir)/xccobj.exe .
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe . ; \
+ else \
+ cp -f $(BINdir)/xccobj . ; \
+ fi
auxlib :
cd $(AUXdir) ; $(MAKE) lib
--- origsrc/ATLAS/makes/Make.mvtune 2009-10-18 04:08:27.000000000 +0900
+++ src/ATLAS/makes/Make.mvtune 2009-10-24 11:24:45.904779800 +0900
@@ -225,8 +225,11 @@
cp -f $(mySRCdir)/CASES/$(mvTrout) $(GMVdir)/ATL_sgemvT.c
cp -f $(mySRCdir)/CASES/$(mvSrout) $(GMVdir)/ATL_sgemvS.c
cp -f Make_smv $(GMVdir)/.
- -@ cp -f xccobj $(GMVdir)/.
- -@ cp -f xccobj.exe $(GMVdir)/.
+ if [ -s xccobj.exe ] ; then \
+ cp -f xccobj.exe $(GMVdir)/. ; \
+ else \
+ cp -f xccobj $(GMVdir)/. ; \
+ fi
cp -f atlas_smv.h $(INCAdir)/.
cp -f atlas_smv[N,T,S].h $(INCAdir)/.
touch $(INCSdir)/atlas_mv.h
@@ -383,8 +386,11 @@
cp -f $(mySRCdir)/CASES/$(mvTrout) $(GMVdir)/ATL_dgemvT.c
cp -f $(mySRCdir)/CASES/$(mvSrout) $(GMVdir)/ATL_dgemvS.c
cp -f Make_dmv $(GMVdir)/.
- -@ cp -f xccobj $(GMVdir)/.
- -@ cp -f xccobj.exe $(GMVdir)/.
+ if [ -s xccobj.exe ] ; then \
+ cp -f xccobj.exe $(GMVdir)/. ; \
+ else \
+ cp -f xccobj $(GMVdir)/. ; \
+ fi
cp -f atlas_dmv.h $(INCAdir)/.
cp -f atlas_dmv[N,T,S].h $(INCAdir)/.
touch $(INCSdir)/atlas_mv.h
@@ -567,8 +573,11 @@
cp -f $(mySRCdir)/CASES/$(mvTrout) $(GMVdir)/ATL_cgemvT.c
cp -f $(mySRCdir)/CASES/$(mvSrout) $(GMVdir)/ATL_cgemvS.c
cp -f Make_cmv $(GMVdir)/.
- -@ cp -f xccobj $(GMVdir)/.
- -@ cp -f xccobj.exe $(GMVdir)/.
+ if [ -s xccobj.exe ] ; then \
+ cp -f xccobj.exe $(GMVdir)/. ; \
+ else \
+ cp -f xccobj $(GMVdir)/. ; \
+ fi
cp -f atlas_cmv.h $(INCAdir)/.
cp -f atlas_cmv[N,T,S].h $(INCAdir)/.
touch $(INCSdir)/atlas_mv.h
@@ -751,8 +760,11 @@
cp -f $(mySRCdir)/CASES/$(mvTrout) $(GMVdir)/ATL_zgemvT.c
cp -f $(mySRCdir)/CASES/$(mvSrout) $(GMVdir)/ATL_zgemvS.c
cp -f Make_zmv $(GMVdir)/.
- -@ cp -f xccobj $(GMVdir)/.
- -@ cp -f xccobj.exe $(GMVdir)/.
+ if [ -s xccobj.exe ] ; then \
+ cp -f xccobj.exe $(GMVdir)/. ; \
+ else \
+ cp -f xccobj $(GMVdir)/. ; \
+ fi
cp -f atlas_zmv.h $(INCAdir)/.
cp -f atlas_zmv[N,T,S].h $(INCAdir)/.
touch $(INCSdir)/atlas_mv.h
@@ -767,7 +779,10 @@
$(BINdir)/xccobj :
cd $(BINdir) ; $(MAKE) xccobj
xccobj : $(BINdir)/xccobj
- -@ cp -f $(BINdir)/xccobj .
- -@ cp -f $(BINdir)/xccobj.exe .
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe . ; \
+ else \
+ cp -f $(BINdir)/xccobj . ; \
+ fi
$(BINdir)/xsubstr:
cd $(BINdir) ; $(MAKE) xsubstr
--- origsrc/ATLAS/makes/Make.r1tune 2009-10-18 04:08:27.000000000 +0900
+++ src/ATLAS/makes/Make.r1tune 2009-10-24 11:24:45.934823000 +0900
@@ -157,11 +157,10 @@
cp -f sr1outd/Make_sr1 $(GR1dir)/.
cp sr1outd/*.c $(GR1dir)/.
cp -f sr1outd/*.h $(INCAdir)/.
- if [ -s "xccobj" ]; then \
- cp -f xccobj $(GR1dir)/. ; \
- fi
if [ -s "xccobj.exe" ] ; then \
cp -f xccobj.exe $(GR1dir)/. ; \
+ else \
+ cp -f xccobj $(GR1dir)/. ; \
fi
touch $(INCSdir)/atlas_r1.h
rm -f sr1outd/* ; rmdir sr1outd
@@ -267,11 +266,10 @@
cp -f dr1outd/Make_dr1 $(GR1dir)/.
cp dr1outd/*.c $(GR1dir)/.
cp -f dr1outd/*.h $(INCAdir)/.
- if [ -s "xccobj" ]; then \
- cp -f xccobj $(GR1dir)/. ; \
- fi
if [ -s "xccobj.exe" ] ; then \
cp -f xccobj.exe $(GR1dir)/. ; \
+ else \
+ cp -f xccobj $(GR1dir)/. ; \
fi
touch $(INCSdir)/atlas_r1.h
rm -f dr1outd/* ; rmdir dr1outd
@@ -386,11 +384,10 @@
cp -f cr1outd/Make_cr1 $(GR1dir)/.
cp cr1outd/*.c $(GR1dir)/.
cp -f cr1outd/*.h $(INCAdir)/.
- if [ -s "xccobj" ]; then \
- cp -f xccobj $(GR1dir)/. ; \
- fi
if [ -s "xccobj.exe" ] ; then \
cp -f xccobj.exe $(GR1dir)/. ; \
+ else \
+ cp -f xccobj $(GR1dir)/. ; \
fi
touch $(INCSdir)/atlas_r1.h
rm -f cr1outd/* ; rmdir cr1outd
@@ -505,11 +502,10 @@
cp -f zr1outd/Make_zr1 $(GR1dir)/.
cp zr1outd/*.c $(GR1dir)/.
cp -f zr1outd/*.h $(INCAdir)/.
- if [ -s "xccobj" ]; then \
- cp -f xccobj $(GR1dir)/. ; \
- fi
if [ -s "xccobj.exe" ] ; then \
cp -f xccobj.exe $(GR1dir)/. ; \
+ else \
+ cp -f xccobj $(GR1dir)/. ; \
fi
touch $(INCSdir)/atlas_r1.h
rm -f zr1outd/* ; rmdir zr1outd
@@ -528,5 +524,8 @@
$(BINdir)/xccobj :
cd $(BINdir) ; $(MAKE) xccobj
xccobj : $(BINdir)/xccobj
- -@ cp -f $(BINdir)/xccobj .
- -@ cp -f $(BINdir)/xccobj.exe .
+ if [ -s $(BINdir)/xccobj.exe ] ; then \
+ cp -f $(BINdir)/xccobj.exe . ; \
+ else \
+ cp -f $(BINdir)/xccobj . ; \
+ fi
**single-core.patch**
--- origsrc/ATLAS/bin/atlas_install.c 2009-10-18 04:08:26.000000000 +0900
+++ src/ATLAS/bin/atlas_install.c 2009-10-24 11:24:45.734535000 +0900
@@ -1059,7 +1059,11 @@
"\n\nSTAGE 5-1: FINAL STATIC LIBRARY UPDATE\n");
sprintf(ln2, "INSTALL_LOG/LIBUPDATE.LOG");
PrintBanner(ln2, 1, 5, 1, 1);
+#ifdef ATL_NCPU
sprintf(ln, "%s IBuildLibs IBuildPtlibs0 %s %s\n", fmake, redir, ln2);
+#else
+ sprintf(ln, "%s IBuildLibs %s %s\n", fmake, redir, ln2);
+#endif
fprintf(stdout, ln);
ATL_Cassert(system(ln)==0, "STATIC LIBRARY UPDATE", ln2);
PrintBanner(ln2, 0, 5, 1, 1);
--- origsrc/ATLAS/tune/blas/gemm/ummsearch.c 2009-10-18 04:09:09.000000000 +0900
+++ src/ATLAS/tune/blas/gemm/ummsearch.c 2009-10-24 11:24:45.964866200 +0900
@@ -1584,7 +1584,7 @@ void getBestOfSearches
continue;
}
sprintf(ln, "%s", ep->rout);
- mmp->next = ReadMMFile(ln);
+ mmp->next = ReadMMFile(ln); if (!mmp->next) continue;
/*
* If MFLOPs not set, time and the write back out
*/
**cygwin-stack-boundary.patch**
--- origsrc/ATLAS/CONFIG/src/SpewMakeInc.c 2009-10-18 04:08:27.000000000 +0900
+++ src/ATLAS/CONFIG/src/SpewMakeInc.c 2009-10-24 11:24:45.674448600 +0900
@@ -680,8 +680,10 @@
GetGccVers(goodgcc, &i, &j, &k, &k);
if (OS == OSOSX && j > 3) /* need bullshit apple annoyance flag */
fprintf(fpout, " -force_cpusubtype_ALL");
+#if 0
if (OSIsWin(OS)) /* stop gcc breaking ABI */
fprintf(fpout, " -mpreferred-stack-boundary=2");
+#endif
sp = GetPtrbitsFlag(OS, mach, ptrbits, goodgcc);
if (strlen(sp) > 0)
fprintf(fpout, " %s", sp);
--- origsrc/ATLAS/CONFIG/src/probe_comp.c 2009-10-18 04:08:27.000000000 +0900
+++ src/ATLAS/CONFIG/src/probe_comp.c 2009-10-24 11:24:45.704491800 +0900
@@ -745,6 +745,7 @@
* for the tester compiles, but that requires Make.inc changes, so I'm not
* doing it until I see a need).
*/
+#if 0
if (OSIsWin(OS))
{
for (i=0; i < NCOMP; i++)
@@ -756,6 +757,7 @@
}
}
}
+#endif
/*
* Need to add target & bitwidth args for MIPSpro compilers on IRIX
*/