# Installation on Linux Ubuntu

+1 vote
asked Aug 9, 2017

Hi, I am trying to install ITensor library on my Ubuntu (v. 16.04.3) virtual machine.
I followed the instruction, but when I compile the library, the error shows up at the stage of compiling mps module. The error reads:

...
Compiling itensor/mps/mps.cc with optimizations
mps/mps.cc: In member function 'void itensor::MPSt<Tensor>::copyWriteDir() [with Tensor
= itensor::ITensorT<itensor::Index>]':
mps/mps.cc::1035:9: warning: ignoring return value of 'int system(const char*)', declared with
attribute warn_unused_result [-Wunused-result]
system(cmdstr.c_str());
^
mps/mps.cc: In member function 'void itensor::MPSt<Tensor>::copyWriteDir() [with Tensor
= itensor::ITensorT<itensor::IQIndex>]':
mps/mps.cc::1035:9: warning: ignoring return value of 'int system(const char*)', declared with
attribute warn_unused_result [-Wunused-result]
mps/mps.cc: In member function 'void itensor::MPSt<Tensor>::cleanupWrite() [with Tensor
= itensor::ITensorT<itensor::Index>]':
mps/mps.cc::1051:9: warning: ignoring return value of 'int system(const char*)', declared with
attribute warn_unused_result [-Wunused-result]
system(cmdstr.c_str());
^
mps/mps.cc: In member function 'void itensor::MPSt<Tensor>::cleanupWrite() [with Tensor
= itensor::ITensorT<itensor::Index>]':
mps/mps.cc::1051:9: warning: ignoring return value of 'int system(const char*)', declared with
attribute warn_unused_result [-Wunused-result]


Other modules were compiled without errors.
The makefile was used with options below:
[1]
## GNU GCC compiler
CCCOM=g++ -m64 -std=c++11 -fPIC
[2]
PLATFORM=lapack
BLASLAPACKLIBFLAGS=-lpthread -L/usr/lib -lblas -llapack

Thank you!

commented Aug 9, 2017 by (20,240 points)
Hi, did the code continue to compile or did compilation not finish? In the printout above I see that you did get warnings but I don't see a line where it says "error". Depending on the answer I can help you more with your question -

(If you're not sure if the code compiled or not, check the lib/ folder underneath where options.mk is located to see if there is a file libitensor.a located there.)
commented Aug 9, 2017 by (130 points)
Thank you for your superfast answer!
The code continued compiling, so compilation was finished with a file libitensor.a in /lib folder.
Since I got same warning messages (ignoring return value...) on compiling sample files, so I just worried about some missing parts in my procedure.
However, I just rechecked the compiled executable files, and I think it works pretty nice.
Anyway, I really appreciate your reply!

## 1 Answer

0 votes
answered Aug 11, 2017 by (20,240 points)

Ok thanks for posting this question. For the answer see the discussion above ^

I'd recommend turning off this particular warning, actually. The reason is it's a "catch 22" warning, meaning that if you do assign the return value to a variable, the warning goes away. But then if you don't use the assigned variable, you get a different warning about "unused variable". So you get a warning either way. That's why I just turn this one off because there can be perfectly good reasons to ignore return values.

Miles