0 votes
asked by (170 points)

Hi,

I am new to c++ and itensor. When I try to do some svd with tensor version, I get a link error from the compiler as:

Undefined symbols for architecture x8664:
"itensor::svd(itensor::ITensor const&, itensor::ITensor&, itensor::ITensor&, itensor::ITensor&, itensor::Args)", referenced from:
_main in myappname.o
ld: symbol(s) not found for architecture x86
64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [myappname] Error 1

But it works well with itensor version 2. Can anyone help me solve this error?
Thanks.

1 Answer

0 votes
answered by (70.1k points)
selected by
 
Best answer

Hi, thanks for reporting this issue. However, I was not able to reproduce it unfortunately. Could you please post some minimal code that you were trying to compile that led to getting this message? (So like the contents of myappname.cc?) Thanks!

Miles

commented by (170 points)
#include "itensor/all.h"
#include "myclass.h"

using namespace itensor;

int
main()
    {
        auto i = Index(2);
        auto j = Index(2);

        auto T = randomTensor(i,j);
        ITensor U(i),D,V;
        svd(T,U,D,V);

        PrintData(T);
        PrintData(U);
        PrintData(D);
        PrintData(V);

        return 0;
    }

This is the code I tried. Thanks for your response.
commented by (70.1k points)
Hi, thanks, however I do not get the error you get with that code.
Could you please try:
1. change "randomTensor" to "randomITensor" (we have deprecated randomTensor).
2. do a "make clean" and then "make" to fully recompile the ITensor library
3. then recompile your code
and see if that helps?
commented by (170 points)
I solved the error by "make clean" and "make".

Thanks.
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.

Categories

...