Lapack in Ubunutu

Blas and Lapack may be installed on an Ubuntu system using the instructions at:

Generalized Eigenvalue Problem

* * *

C++ programs that use Lapack can be compiled in Terminal or Bash shell mode via:

g++ file_in -o file_out -lgfortran -llapack -lm


file_in is the source code

file_out is the output executable file

In addition, linker option -lblas may be needed by the source code.

Verify that the output file exists:

ls -lt

Then run the program:


* * *

The source code can also be built in the Code::Blocks IDE.

The following lines must be added to the linker options:

-lblas     (if needed by source code)


1. Suggest running Ubuntu with Gnome shell rather than Unity in order to avoid Code::Blocks missing menu bar problem.

2. Failure to include the linker options will result in errors such as:

ilaenv.f   undefined reference to ‘_gfortran_compare_string’

* * *
Tom Irvine

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s