Atlas

 

 

 

Index

 

 

Building and Linking Atlas with Cygwin

 

Compiling Atlas for Unix like use in Cygwin is pretty trivial, since Atlas' build process produces the usual Unix type libraries.  What makes Cygwin interesting is, since it's a Windows aware platform, it's possible to build and use Atlas under Windows with Windows dev tools.  If, like me, you spend your days writing OO numerics apps that sit behind .NET user interfaces, this is pretty useful.  There are two main issues in translating the static .a libraries produced by the Atlas build to shared libraries which work with Windows:

  1. Repackaging the libraries as a DLL and removing dependencies on cygwin.dll.  The best known way of doing this is to call gcc -mno-cygwin -shared with a few extra flags.  Given a list of functions which should be exported by the DLL in a .def file, gcc then generates a DLL and an import library which works with gcc.  This is trivial to once the correct gcc flags are found, but most of these flags are cygwin extensions to gcc and aren't well documented.
  2. Building an import library (.lib) which works with other tools, since not all tools can work with gcc import libraries.  This is most easily done by getting the tools in question to generate a .lib based on the list of DLL exports.

Additionally, getting Atlas's build process to run under Cygwin used to be (e.g. in early 2003) a considerable hassle.  As of 3.6.0, Atlas builds out of the box on Cygwin with any version of gcc, so this is not much of an issue.

 

This script—linkAtlasGCC.bash—automates the generation of the DLL exports .def and calls gcc to link the DLL.  It also calls Visual Studio's lib.exe tool to generate an import library which is compatible Visual Studio.  Depending on what parts of Atlas you need, you'll want to comment or uncomment various parts of the Cexports and FortranExports lists and you may need to edit the paths to lib.exe depending on wether or not you have Visual Studio installed and which version is installed if you do have it.

Note that Cygwin doesn't install all the necessary tools to build Atlas by default, so you'll need to manually ask the Cygwin installer for gcc, g77, and make.  Kevin Sheppard maintains fairly thorough instructions on how to build Atlas with Cygwin, so if you need a step by installation guide, visit http://www.kevinsheppard.com/research/MatlabAtlas/MatlabAtlas.htm

 

 

 

Some Historical Notes

 

The bash script distributed here is based on Kevin Sheppard's old cygwin atlas linkage script which used the now obsolete cygwin utility dllwrap.  I needed to incorporate Atlas into my electromagnetic number crunchers, so in early 2003 I took the old script, updated it to use gcc, and added on various hooks I to get the parts of Atlas I needed.  In turn, Kevin's taken the gcc based linkage script, kept it up to date for building Atlas DLLs for use with Matlab, and also distributes a number of prebuilt Matlab compatible libraries.

 

 

 

back to top
 

legal information

copyright 2004 by Todd West
last modified 2004.02.03