LAPACK

From PHASTA Wiki
Revision as of 15:02, 15 April 2021 by Jopo9795 (talk | contribs)
Jump to: navigation, search

Download and Build LAPACK

First download LAPACK tarball from http://netlib.org/lapack/ and extract the files with tar -xf <name_of_tarball> , which produced folder 'lapack-3.9.1' for this example. Note that for the current method, the location of the unpacked folder does not need to be within the PHASTA source directory.

Create a copy of the provided make include file with cp lapack-3.9.1/make.inc.example lapack-3.9.1/make.inc and modify make.inc with any platform specific changes that are needed (for viz002 no changes were needed).

At the same level as the lapack-3.9.1 folder, create and change to a build directory, <build_lapack_dir> and execute the following from within the build directory, followed by make -j .

#!/bin/bash
cmake \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_BUILD_TYPE=Release \
../lapack-3.9.1 

The directory <build_lapack_dir>/lib/ should now contain libblas.a and liblapack.a library files. These are the files that will be linked to when compiling PHASTA.

Modify CMakeLists.txt File

Add the following flags to the build script that you would normally execute when compiling PHASTA

-DPHASTA_USE_LAPACK=ON \
-DLAPACKBLAS_DIR=</path/to/build_lapack_dir>/lib/ \