Installation problem

+1 vote
asked Apr 18 by alesa (150 points)
reshown Apr 18 by alesa

I use Mac OS EL Capitan and installed Xcode. When I type "CCCOM=clang++ -std=c++11" into the terminal, it says command not found. And I checked my clang version, it seems to be clang 3.6 so it should support c++11 feature. I checked the files in the XcodeDefault.xctoolchain/usr/bin and "clang++" is a "Alias" file while "clang" is a "Unix executable" file. When I type "CCCOM=clang++" alone it seems to work and type "std=c++11" it also works. I don't know if "std=c++11" means the same operation as "-std=c++11". And when I tried to configure other terms I also encounter "command not found". Following is the command shown in my terminal. I doubt in which directory I should make the configurations?

x-10-104-121-90:itensor Alesa$ CCCOM=clang++ -std=c++11
-bash: -std=c++11: command not found

x-10-104-121-90:itensor Alesa$ clang++ --version
Apple LLVM version 7.0.2 (clang-700.1.81)

x-10-104-121-90:itensor Alesa$ BLASLAPACKLIBFLAGS=-framework Accelerate
-bash: Accelerate: command not found

And I tried the optional configuration:
x-10-104-121-90:itensor Alesa$ OPTIMIZATIONS=-O2 -DNDEBUG -Wall
-bash: -DNDEBUG: command not found

commented Apr 18 by siyuphysic (380 points)
Before installing ITensor, I think you should try writing and compiling a simple example code which  requires c++11 feature, such as unordered_map or something like that.
commented Apr 18 by alesa (150 points)
Hi, I compiled the code on this website: http://thispointer.com/unordered_map-usage-tutorial-and-example/ and build succeeded. What should I do next?
commented Apr 18 by miles (15,200 points)
Hi, so those lines from the ITensor Makefile aren't intended to be typed directly into the terminal. Did you try following the installation instructions on the ITensor website? Please follow those steps in detail and let us know if one of them does not work for you. -Miles
commented Apr 18 by alesa (150 points)
Sorry I'm confused. I didn't copy and paste everything in options.mk into the terminal. According to step 1, I should type "CCCOM=clang++ -std=c++11" since I'm using Mac OS, am I not correct? But what I get is "-bash: -std=c++11: command not found".
commented Apr 18 by miles (15,200 points)
Hi so I see where you might be confused. After creating the options.mk file, the instructions numbers 3 and 4 are referring to edits you make to this file. The only command you issue to the terminal is the "make" command in step 5.

By the way, the settings in the default options.mk.sample file happen to be the ones for Mac systems (unless you want a different blas library). So you should only need to create that file then run the "make" command to install ITensor.
commented Apr 19 by alesa (150 points)
You solved my problem ^_^ .
commented Apr 20 by alesa (150 points)
Hi, I didn't make any change to options.mk and "make" this file in my terminal. Every compiling step is successful. I got "libitensor.a" and "libitensor-g.a" in the folder "Users/.../itensor/lib". But when I tried to compile an itensor related file, Xcode says "itensor/all_basic.h" not found. I wonder what is the location of the built library files? In the instruction manual, it says "If all goes well, the built library files should appear in the LIBDIR folder specified in options.mk". Is it "THIS_DIR/lib" (what's this)?
commented Apr 21 by miles (15,200 points)
Hi, please take a look at this article on the website: http://itensor.org/docs.cgi?page=formulas/driver

There is a "project_template" folder you can use as a pattern to make your own custom projects. To answer your specific question, ITensor doesn't install files anywhere else on your computer except inside the ITensor folder itself. So the built library files go into lib/ (below where options.mk is) and the header files just stay put inside the itensor/ folder. Your compiler flags need to have a -I directive telling them the location of the ITensor code. The project_template Makefile has all of this: you just need to set the LIBRARY_DIR variable inside of it.

1 Answer

0 votes
answered Apr 19 by miles (15,200 points)

Glad you got the installation working! (To those reading please see comments above.)

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