Basic Idea: First Install ATLAS to handle linear algebra routines and then CLAPACK to download appropriate routines. As I understand it, ATLAS provides the basic interface for the CLAPACK routines to run.
Step 1: To run a programme which invokes CLAPACK routines, you, first, need to install ATLAS. Go to the ATLAS website to obtain additional info. Alternatively, you may download the ATLAS software by clicking here. I chose the atlas3.6.0.tar.gz (2.4MB) which is a platform independent and stable distribution. I suppose that this is what one could get if a cygwin installation is intended. You can unpack the .gz file using any archiver to produce a directory with the name of ATLAS. The contents of that directory are:
dir bin
dir CONFIG
dir doc
dir include
dir interfaces
dir lib
dir makes
dir src
dir tune
file config.c
file INSTALL.txt
file Make.top
file Makefile
file README
Step 2: Now you can download CLAPACK. You may go to the CLAPACK web site for further info. I downloaded the clapack2.tgz (6.1MB) archive. You can unpack it with any archiver to produce a directory with the name of CLAPACK. The contents of that directory are:
dir BLAS
dir F2CLIBS
dir INSTALL
dir SRC
dir TESTING
dir TIMING
file clapack.h
file make.inc
file Makefile
file README.install
file README.maintain
in the readme.install file you will see that the contents of the CLAPACK folder also include a directory called Translate. The distribution I got (clapack2.tgz (6.1MB)) does not include that folder.
Step 3: Make sure that the ATLAS and CLAPACK directories are in your Cygwin home directory. Mine is at: C:\cygwin\home\kele (under windows explorer).
Step 4: Open a Cygwin bash shell and then type startx to invoke the XWin X Server (instructions as to how you can do that click here. I simply typed at a bash shell prompt: cp /etc/X11/xinit/xinitrc ~/.xinitrc and startx worked fine after that)). Then do:
cd ~
cd ATLAS
make config
cd lib
cd WinNT_UNKNOWNSSE2 (or the name you chose during the make config process for that folder)
cp *.a /usr/local/lib/
cd ~
I pressed enter almost at every question that prompted up during the make config process. If there is no /usr/local/lib/ directory you can create it by doing:
mkdir /usr/local/ (if there is no /usr/local/ directory)
mkdir /usr/local/lib/
Now, you should have returned to your home directory.
Step 5: Now you can install CLAPACK. Do:
cd ~
cd CLAPACK
cp INSTALL/make.inc.LINUX ./make.inc
Step 6: Edit the make.inc file as follows:
PLAT = _CYGWIN
BLASLIB = ../../libcblaswr.a -L/usr/local/lib -lcblas -latlas
Save the make.inc and exit your editor.
Step 7: Now you are ready to invoke the make.inc file and start the installation. In ~/CLAPACK directory do:
make f2clib
make cblaswrap
cd SRC
make
cd TESTING/MATGEN
make
cd ..
make
cd ..
I got several error 139s during that process. I overcame them by repeating the make command that got interrupted due to that error. It shouldn't take more than 5-6 hours for the whole process (installation of ATLAS plus CLAPACK) to complete. These instructions are quite different from the ones one can find in the readme.install file. I tried following the instructions in that file and whereas everything proceeded smoothly up to step 5, from step 6 upwards error 139s were generated and the installation was painfully slow (it took some 8-9 hours for the steps 6-8 to complete). The instructions presented here have been tried (on my computer) and were found at How to use CLAPACK and ATLAS on Cygwin. The only difference with what the readme.install presents is that the TIMING process is omitted (steps 7 and 8). The error 139s where not avoided.
Step 8: Now copy the rest of the library files to /usr/local/lib/. Do:
cd ~
cd CLAPACK/BLAS/WRAP
cp *.a /usr/local/lib
cd F2CLIBS
cp *.a /usr/local/lib
cd ~
cp *.a /usr/local/lib
Now you should have in your /usr/local/lib directory the following library files (*.a):
libatlas.a
libcblas.a
libf77blas.a
liblapack.a
libtstatlas.a
libcblaswr.a
libF77.a
libI77.a
lapack_CYGWIN.a
tmglib_CYGWIN.a
Step 9: You should be ready to compile any programme which uses a clapack routine. A test programme provided can be found here. You may select and paste from the netlib web site as instructed above. Otherwise, you can download the code by clicking testclapack.c. Sometimes, selecting Save As... from a web browser saves the web page but adds some html tags in the file. Before trying to compile the code make sure that no additional lines have been put by your web browser. Save the file in your Cygwin home directory.
Step 10: In the directory where you have saved the test programme make sure that you also have lapack_CYGWIN.a and tmglib_CYGWIN.a.
Step 11: You are ready to compile the test programme by doing:
gcc testclapack.c (or however your test programme is called) lapack_CYGWIN.a -lcblaswr -lcblas -latlas -lg2c
It should compile without errors. Now run the executable by doing:
./a.exe (or if you have given a name to the output .exe file use the appropriate name)
The output gives:
INFO = 0
s[ 0 ] = 34.000000
s[ 1 ] = 17.888544
s[ 2 ] = 4.472136
s[ 3 ] = 0.000000
That's it I suppose :)