next up previous contents index
Next: 8.2 Calling from Fortran Up: 8 Additional Information Previous: 8 Additional Information

8.1 Building the Library

Usually, HYPRE can be built by simply typing configure followed by make in the top-level source directory.

8.1.1 Library configuration

To automatically generate machine specific makefiles, type configure in the top level directory. The configure script is a portable script generated by GNU Autoconf. It runs a series of tests to determine characteristics of the machine on which it is running, and it uses the results of the these tests to produce the machine specific makefiles, called `Makefile', from template files called `Makefile.in' in each directory. Once the makefiles are produced you can run make as you would with any other makefile.

The configure script primarily does the following things:

The configure script makes these decisions based on a hierarchical check. First, it attempts to identify the machine on which it is running as a specific supported machine. Next it will try to identify the architecture as a supported architecture. If both of these fail, generic default decisions are made by the script. However, the script does have some command-line options that can give you control over the choices it will make. You can type configure -help to see the list of all of the command-line options to configure. This is the best resource for information on configure options. Below is some additional helpful information. Be aware that not all command line options have been tested on all machines and architectures, even supported machines and architectures.

-with- options
Each -with- option that is listed in configure -help also was a -without- option (usually the default, but not always). Additionally, all -with- options have a -with-option=pathname. This is not a supported feature for all -with- options however and may have no effect on configuration.

Compilers
If you want to choose a compiler then is it recommended that you choose all (C, C++, Fortran) compilers.

Compiler Flags
To choose optimization or debug, use -enable-opt (default) or -enable-debug. For other compiler flags use the -with-CFLAGS option.

BLAS
By default, configure attempts to find the systems native optimized BLAS library. The path for this library must be in the user's PATH. To specify another BLAS library available, use -with-BLAS=pathname or -with-BLAS=link list. To configure and compile without BLAS use the -without-BLAS option.

Configure automatically generates a file HYPRE_config.h that includes all the header files found to be necessary by configure. This file may be used to see how a compiled version of the library was configured and may also be included by the user in his/her own code.

8.1.2 Linking to the Library

A program linking with HYPRE must be compiled with -I$HYPRE_DIR/include and linked with -L$HYPRE_DIR/lib -lhypre library name... -lhypre library name..., where $HYPRE_DIR is the directory where HYPRE is installed. Additionally, any other libraries to which HYPRE is linked must also be linked to by the users application. For example, the BLAS library or PETSc library are often (but not always) linked in by HYPRE and would also need to be linked in by the users application.

It may be useful to reference the Makefile in the test subdirectory. This makefile is designed to build test applications that link with and call HYPRE. All include and linking flags that are used by HYPRE and needed by these test applications get exported to this file by the configure script.


next up previous contents index
Next: 8.2 Calling from Fortran Up: 8 Additional Information Previous: 8 Additional Information

Thomas Treadway
Fri Jul 27 10:01:25 PDT 2001