I was wondering if anyone had success getting ITensor running in Jupyter notebooks using Xeus-Cling. [I am new to Xeus-Cling, so I am undoubtedly doing something naive.] If you have any suggestions, please let me know.
What I did so far:
- Installed Xeus-Cling using conda
- Compiled Itensor, using the flag: ITENSORMAKEDYLIB=1
I start up a notebook, and run:
#pragma cling add_include_path("/Users/emueller/Itensor3Clean/itensor")
#pragma cling add_library_path("/Users/emueller/Itensor3Clean/itensor/lib")
#include "itensor/index.h"
Everything works fine, I can create and manipulate index objects.
The problem comes when I try to include some of the other header files. For example:
#include "itensor/itensor.h"
yields an error (quoted below so as not not mess up the flow of the question) -- along with the errors that I get when I try to include a few other headers.
In case it matters, I am using Mac OSX 10.14.6, Cling 0.6, Xeus 0.23.3. ITensor 3.0.
ITensor works great for me when run in the regular way (compiling and linking using Clang). I think that getting it running in a Jupyter notebook would be great for teaching, and also make for a good development workflow (at least for me).
Erich
Sample include's, and the error messages:
#include "itensor/itensor.h"
yeilds
In file included from inputline1:1:
In file included from /Users/emueller/anaconda/envs/cling/include/c++/v1/new:90:
In file included from /Users/emueller/anaconda/envs/cling/include/c++/v1/exception:80:
In file included from /Users/emueller/anaconda/envs/cling/include/c++/v1/cstddef:110:
/Users/emueller/anaconda/envs/cling/include/c++/v1/typetraits:1078:75: error: no member named 'value' in 'std::1::integral_constant<bool, true>'
_IsNotSame<decltype(isreferenceable_impl::__test<_Tp>(0)), __two>::va...
and so on...
#include "itensor/util/readwrite.h"
yields
In file included from inputline37:1:
In file included from /Users/emueller/Itensor3Clean/itensor/itensor/util/readwrite.h:19:
In file included from /Users/emueller/anaconda/envs/cling/include/c++/v1/fstream:188:
/Users/emueller/anaconda/envs/cling/include/c++/v1/filesystem:852:13: error: no viable overloaded '+='
__pn_ += preferred_separator;
and so on...
#include "itensor/tensor/lapack_wrap.h"
yields
In file included from inputline39:1:
In file included from /Users/emueller/Itensor3Clean/itensor/itensor/tensor/lapackwrap.h:84:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h:20:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h:64:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/Solve.h:4462:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h:53:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/usr/include/os/log.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/usr/include/os/trace.h:8:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
/MacOSX.sdk/usr/include/os/tracebase.h:95:27: error: expected unqualified-id
extern struct mach_header __dso_handle;
and so on...