0

I'm making a script on c++ that requires the resolution of linear systems. I've looked around and found that the LAPACK++ gives me functions to achieve that end. However I've been having a lot of trouble just getting them installed.

I have the following files:

lapack.lib
blas.lib
libf2c.lib
clapack.h
f2c.h

Those files were given to me to use with microsoft visual studio 2010 some time ago. From what I've read I need at least the lapack.lib and blas.lib libraries, however I have no idea where to put them, or what to install.

I've searched on the web, but all the information I've gathered only got me more confused. If someone could point me in the right direction I'd highly appreciate.

Thanks.

PS1: Take into consideration that I'm very new with Linux. PS2: Do I have to install LAPACK++ or will LAPACK do? Because there seems to be more information about the later than the first.

Daniel Jaló
  • 147
  • 1
  • 3
  • 11

2 Answers2

1

First, you may install liblapack-dev and libblas-dev (dev means the libraries and the include files).

Check that it is not installed yet. It is likely if you have files such as /usr/lib/liblapack.a and /usr/lib/libblas.a

To install liblapack-dev and libblas-dev, you may use the package manager called synaptic. According to http://ubuntuforums.org/showthread.php?t=1505249,

"Go to: System -> Synaptic -> Administration -> Package Manager -> search on lapack (and/or blas), and mark for installation:

libblas3gf libblas-doc libblas-dev

liblapack3gf liblapack-doc liblapack-dev

-> Apply "

(it is the usual way to install software on Debian or Ubuntu if you are root.)

The package manager will ask for your administrator's password "root".

Then, you may install lapack++. According to http://lapackpp.sourceforge.net/ , open a Terminal and write (press enter at end of line) :

./configure --prefix=/your/install/path
make
make install

if you face something like permission denied after typing make install, it may be because you do not have the right to modify a folder. You may use sudo make install to do it as administrator, but you really need to trust the origin of the software to do so...security...Best advice may be to change /your/install/path for something like /home/mylogin/softs/lapackpp and then add -L /home/mylogin/softs/lapackpp/lib -I /home/mylogin/softs/lapackpp/include to build and link the code. -I means add to include search path and -L means add to library search path...you still need to trust the software, but it's less risky for the operating system that sudo.

To build your code, go to the right folder and type something like

 gcc main.c -o main -L /home/mylogin/softs/lapackpp/lib -I /home/mylogin/softs/lapackpp/include -llapackpp -llapack -lblas -lm

If you are not "root", download blas/lapack and build it ! It is exactly the same procedure as lapackpp. But, as you install lapackpp, you may need to add options to -configure...to signal where these libraries are.

Tell us what happened !

Bye,

Francis

francis
  • 9,525
  • 2
  • 25
  • 41
  • Hi @francis. Thank you very much for your help. I've installed all the packages you mentioned using the package manager. Afterwards I ran the command `./configure --prefix=/mypath/lapackpp`. Something happened in the terminal, however when I ran the command `make` I received the warning `make: *** No targets specified and no makefile found. Stop.`. The folder /mypath/lapackpp is also empty. I tried to run the `./configure --prefix=/mypath/lapackpp` command again, but I received a warning saying `bash: ./configure: No such file or directory`. Did I do something wrong? – Daniel Jaló Mar 06 '14 at 22:30
  • End of my configure command looks like `config.status: executing libtool commands`. Is yours the same ? Are you using lapackpp-2.5.4 ? I forgot to mention that you should go to folder `/path/to/lapackpp` (where the configure script is) first using the command `cd /path/to/lapack` then type `ls` to list files and check that `./configure`is here, then `./configure` ... Good luck ! – francis Mar 07 '14 at 16:14
0

The .lib files are operating system specific. They are useless on Linux. You need a Linux build.

I assume we are talking about lapack++ hosted on sourceforge, yes?

In that case:

  • Whoever gave you the binaries (.lib files) is obliged to give you the sources if you ask them.
  • You can get the latest sources on the above site.
Jan Hudec
  • 73,652
  • 13
  • 125
  • 172