Successful built of atlas3.9.16 on cygwin1.7

Anonymous
2009-10-25
2013-01-09
  • Anonymous - 2009-10-25

    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  ; 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  ; 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  ; 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  ; 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  ; 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  ; 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  ; then \
        +    cp -f xccobj.exe $(GMVdir)/. ; \
        + else \
        +    cp -f xccobj $(GMVdir)/. ; \
        + fi
         cp -f atlas_smv.h $(INCAdir)/.
         cp -f atlas_smv.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  ; then \
        +    cp -f xccobj.exe $(GMVdir)/. ; \
        + else \
        +    cp -f xccobj $(GMVdir)/. ; \
        + fi
         cp -f atlas_dmv.h $(INCAdir)/.
         cp -f atlas_dmv.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  ; then \
        +    cp -f xccobj.exe $(GMVdir)/. ; \
        + else \
        +    cp -f xccobj $(GMVdir)/. ; \
        + fi
         cp -f atlas_cmv.h $(INCAdir)/.
         cp -f atlas_cmv.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  ; then \
        +    cp -f xccobj.exe $(GMVdir)/. ; \
        + else \
        +    cp -f xccobj $(GMVdir)/. ; \
        + fi
         cp -f atlas_zmv.h $(INCAdir)/.
         cp -f atlas_zmv.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  ; 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 ; then \
        -           cp -f xccobj $(GR1dir)/. ; \
        -        fi
         if  ; 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 ; then \
        -           cp -f xccobj $(GR1dir)/. ; \
        -        fi
         if  ; 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 ; then \
        -           cp -f xccobj $(GR1dir)/. ; \
        -        fi
         if  ; 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 ; then \
        -           cp -f xccobj $(GR1dir)/. ; \
        -        fi
         if  ; 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  ; 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
          */

     
  • marco atzeri

    marco atzeri - 2009-10-25

    ilaenv.f belongs to lapack so it should be a mistake to have it in cblas.

    Could you send me the your patches ? Copy and paste from the forum seems to not work to have a reliable/usable patch.

    I just built the cygwin package for lapack-3.2.1 and I was working for the atlas-3.9.16 package. But I just messed something and your work will speed up mine.

    Marco
    marco_atzeri (at) yahoo (dot) it

     
  • marco atzeri

    marco atzeri - 2009-10-26

    ilaenv seems just a misplaced interface

        $ find . -name "*ilaenv*"
       
        ./ATLAS/interfaces/blas/C/src/clapack_ilaenv.c
        ./ATLAS/interfaces/blas/F77/src/f77wrap/ATL_f77wrap_ilaenv.c
        ./ATLAS/interfaces/blas/F77/src/ilaenv.f
        ./ATLAS/src/lapack/ATL_ilaenv.c

    Moreover it is the only "lapack" in blas interface

    Marco

     
  • R. Clint Whaley

    R. Clint Whaley - 2009-10-27

    First, let me say I appreciate all the windows stuff you guys are sending me.  I have managed to get a copy of Windows 7, and I have ordered some parts  I need to resurrect my Windows box, and then I hope to use all this info to improve ATLAS's Windows install.

    Now, the ilaenv questions is somewhat discussed in the BLDdir/src/lapack/Makefile:

    # We build ATL_ilaenv into ATLAS rather than LAPACK, because it is dependent
    # on the BLAS, and more importantly, the thread count, and objects put in
    # lapack should be independent of both the BLAS and the nthreads.  Therefore,
    # the C/F77 interface for ilaenv can be found in the blas/ subdir rather than
    # the lapack (this way the serial/threaded version is determined by what
    # lib you link in, just as with the BLAS)
    #

    In a few developer releases from now, I expect to begin adding thread-specific lapack routines, which will force me to split lapack into serial and threaded libs anyway, and if that happens ilaenv will probably move back to lapack . . .

    Basically, to get good lapack performance, you need to tune the serial and threaded libs separately, and right now lapack is the same lib regardless of threading.

    Does this help?

    Thanks,
    Clint

     
  • R. Clint Whaley

    R. Clint Whaley - 2009-10-27

    BTW, I see the someone thought ilaenv being in the BLAS is an error.  It is not.  As the above comment pseudo-explains, if you move it you can expect a performance dropoff (either in threading or serial, depending on what you do). 

    Cheers,
    Clint

     
  • marco atzeri

    marco atzeri - 2009-10-28

    Hi Clint,

    thanks for the clarification.

    Unfortunately such change break the Dll export list so it is not acceptable for a package mantainer like me.

    As the current LAPACK has ilaenv

        $ nm /usr/lib/liblapack.dll.a |grep ilaenv |grep T
        00000000 T _ilaenv_

    I need to mantain it also in the ATLAS Lapack dll, otherwise
    I will break any program using it from cyglapack-0.dll

    If you need the ilaenv in blas for performance reason,
    does it make sense to make ilaenv (in lapack) as a wrapper around your "renamed" blas_ilaenv (in blas) ?

    something like

    ilaenv( in lapack) -> blas_ilaenv(in blas) ->  _ATL_ilaenv(in atlas) 

    Marco

     
  • R. Clint Whaley

    R. Clint Whaley - 2009-10-28

    Yes, I think that should work.  Inside your blas\_ilaenv, you need to call ATL\_ilaenv in the serial lib, and ATL\_itlaenv in the parallel blas lib.  Does this make sense?

    Thanks,
    Clint

     
  • marco atzeri

    marco atzeri - 2009-10-29

    I am not very familiar of the ATLAS internal, but
    isn't it already implemented in

        ATLAS/interfaces/blas/F77/src/f77wrap/ATL_f77wrap_ilaenv.c
       

    ?

        #include "f77wrap_lapack.h"
        #include "atlas_lapack.h"
        void F77WRAP_ILAENV(const F77_INTEGER *ispec, const F77_INTEGER *irout,
                            const F77_INTEGER *iopts,
                            const F77_INTEGER *N1, const F77_INTEGER *N2,
                            const F77_INTEGER *N3, const F77_INTEGER *N4,
                            F77_INTEGER *iret)
        {
           #ifdef ATL_USEPTHREADS
              *iret = ATL_itlaenv(*ispec, *irout, *iopts, *N1, *N2, *N3, *N4);
           #else
              *iret = ATL_ilaenv(*ispec, *irout, *iopts, *N1, *N2, *N3, *N4);
           #endif
        }

    I

     
  • Avi

    Avi - 2009-11-10

    Please excuse my ignorance, but if I'm trying to build 3.9.16 using cygwin 1.7 on a Core 2 Duo (Lenovo T9400) which patches do I need to apply, and, more importantly, how do I apply them?

    Thank you.

     
  • Anonymous - 2009-11-11

    In your case, all patches except for single-core.patch are necessary.
    To apply patches, use "patch" command or modify files by hand.

    By the way, Marco kindly prepared a cygwin binary package for Core2 and a cygport source. You can use them. See (http://sourceforge.net/projects/math-atlas/forums/forum/1026734/topic/3433410).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks