Building dynamic/shared libraries

ATLAS natively builds static libraries (i.e. libs that usually end in `.a' under Unix and `.lib' under windows). ATLAS always builds such a library, but it can also optionally be requested to build a dynamic/shared library (typically ending in .so for Unix or .dll windows) as well. In order to do so, you must tell ATLAS up front to compile with the proper flags (the same is true when building netlib's LAPACK, see §[*] for more details). As long as you are using gnu compilers, all you need to add to your configure command is:
   --shared

For any non-gnu compiler, you will additionally have to tell configure what flags are needed to tell the compiler to produce a shared library-compatible object file (you can skip this step if the compiler does so by default.

ATLAS always builds the static libraries, but the -shared command adds an additional step to the install which also builds two shared libraries:

libsatlas.[so,dylib,dll]
: This library contains all serial APIs (serial lapack, serial BLAS), and all ATLAS symbols needed to support them.
libtatlas.[so,dylib,dll]
: This library contains all parallel APIs (parallel LAPACK and parallel BLAS) and all ATLAS symbols needed to support them.

After your build is complete, you can cd to your OBJdir/lib directory, and ask ATLAS to build the .so you want. If you want all libraries, including the FORTRAN77 routines, the target choices are:

shared
: create shared versions of ATLAS's sequential libs
ptshared
: create shared versions of ATLAS's threaded libs
If you want only C routines (eg., you don't have a FORTRAN compiler):
cshared
: create shared versions of ATLAS's sequential libs
cptshared
: create shared versions of ATLAS's threaded libs

Note that this support for building dynamic libraries is new in this release, and not well debugged or supported, and is much less likely to work for non-gnu compilers.

WINDOWS NOTE: If you are on Windows and using the MinGW compilers to work natively in windows (outside cygwin), then please see the errata file for additional instructions on enabling this porting.

IMPORTANT NOTE: Since gcc uses one less integer register when compiling with this flag, this could potentially impact performance of the architectural defaults, but we have not seen it so far. Therefore, do not throw this flag unless you want dynamic libraries. If you want both static and dynamic libs, the safest thing is probably to build ATLAS twice, once static and once dynamic, rather than getting both from a dynamic install.

R. Clint Whaley 2016-07-28