+1 vote
asked by (280 points)
edited by

I am trying to install itensor library in my ubuntu linux virtualbox. I followed all the instructions. After that, I run some sample code like hello_itensor.cc provided in ITensor Basics Quick Start.
However, it keep showing error like LAPACKINT has not been declared and LAPACKREAL has not been declared.
It seems like the identifier PLATFORM_lapack isn't defined so the lapack_wrap.h file is not working well.

Does it mean I didn't setup the options.mk properly?
In options.mk BLAS/LAPACK Related Options, I set

BLAS_LAPACK_LIBFLAGS=-lpthread -L/usr/lib -lblas -llapack

OR is that because I didn't install lapack correctly?
I followed the instruction from here
And I can see the files liblapack.a liblapack.so liblapack.so.3 libblas.a libblas.so libblas.so.3 in the path /usr/lib .


commented by (280 points)
sorry there is a typo, PLATFORMlapack should be PLATFORM_lapack

1 Answer

+1 vote
answered by (47.7k points)

It might be because you need to specify the BLASLAPACKINCLUDEFLAGS as well. There should be a flag starting with -I followed by the directory where your header (.h) files are for your LAPACK installation.

For example,

Please check the folder to make sure it has header files such as lapacke.h (or some set of relevant headers).

Another thing to check is whether you are setting PLATFORM=lapack correctly. Like, for example, is the PLATFORM variable set again to a different value further down in your options.mk file? The reason I ask is that if PLATFORM=lapack is set correctly then things like LAPACKINT should be set by ITensor itself. So if those aren't getting set then maybe the PLATFORMlapack variable is not being defined.

Finally, please make sure the options.mk file you made is from a recent version of ITensor. If you upgraded from a much older version of ITensor, then you should make a brand new options.mk from scratch from the most recent options.mk.sample file. (If you are just installing ITensor for the first time I assume that's what you did.)


Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.