Craft
llvm OCAML 

所属分类:collect
开发工具:OCaml
文件大小:0KB
下载次数:0
上传日期:2017-12-21 07:15:07
上 传 者sh-1993
说明:  2D游戏:编程语言
(2D Games: programming language)

文件列表:
Craft (1).pdf (274057, 2017-12-20)
CraftLRM.pdf (217949, 2017-12-20)
CraftProposal.pdf (134423, 2017-12-20)
Craft_Final_Report.pages (822633, 2017-12-20)
Craft_Final_Report.pdf (591489, 2017-12-20)
Makefile (1535, 2017-12-20)
_tags (22, 2017-12-20)
ast.ml (5117, 2017-12-20)
c_interface/ (0, 2017-12-20)
c_interface/Makefile (252, 2017-12-20)
c_interface/hello_world.bmp (86454, 2017-12-20)
c_interface/main.c (5217, 2017-12-20)
c_interface/main.h (587, 2017-12-20)
c_interface/world.c (3554, 2017-12-20)
codegen.ml (20334, 2017-12-20)
craft.ml (1922, 2017-12-20)
exceptions.ml (722, 2017-12-20)
helloworld.crf (315, 2017-12-20)
main.c (12293, 2017-12-20)
main.h (2427, 2017-12-20)
parser.mly (5904, 2017-12-20)
pong.crf (1608, 2017-12-20)
scanner.mll (2112, 2017-12-20)
semant.ml (9981, 2017-12-20)
shell_to_compile.sh (647, 2017-12-20)
simple_version/ (0, 2017-12-20)
simple_version/CraftLRM.pdf (217949, 2017-12-20)
simple_version/Makefile (1360, 2017-12-20)
simple_version/Makefile_microc (2451, 2017-12-20)
simple_version/_tags (22, 2017-12-20)
simple_version/ast.ml (1002, 2017-12-20)
simple_version/c_interface/ (0, 2017-12-20)
simple_version/c_interface/Makefile (248, 2017-12-20)
simple_version/c_interface/hello_world.bmp (86454, 2017-12-20)
simple_version/c_interface/main.c (3550, 2017-12-20)
... ...

# CRAFT: Programming language for 2D Game Design The CRAFT language needs to have the OCaml llvm library, which is most easily installed through opam. Install LLVM and its development libraries, the m4 macro preprocessor, and opam, then use opam to install llvm. The version of the OCaml llvm library must match the version of the LLVM system installed on your system. ------------------------------ Installation under Ubuntu 16.04 LLVM 3.8 is the default under 16.04. Install the matching version of the OCaml LLVM bindings: sudo apt install ocaml llvm llvm-runtime m4 opam opam init opam install llvm.3.8 eval `opam config env` make ------------------------------ Installation under Ubuntu 15.10 LLVM 3.6 is the default under 15.10, so we ask for a matching version of the OCaml library. sudo apt-get install -y ocaml m4 llvm opam opam init opam install llvm.3.6 ocamlfind eval `opam config env` make ------------------------------ Installation under Ubuntu 14.04 The default LLVM package is 3.4, so we install the matching OCaml library using opam. The default version of opam under 14.04 is too old; we need to use a newer package. sudo apt-get install m4 llvm software-properties-common sudo add-apt-repository --yes ppa:avsm/ppa sudo apt-get update -qq sudo apt-get install -y opam opam init eval `opam config env` opam install llvm.3.4 ocamlfind ------------------------------ Installation under OS X 1. Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2. Verify Homebrew is installed correctly: brew doctor 3. Install opam: brew install opam 4. Set up opam: opam init 5. Install llvm: brew install llvm Take note of where brew places the llvm executables. It will show you the path to them under the CAVEATS section of the post-install terminal output. For me, they were in /usr/local/opt/llvm/bin. Also take note of the llvm version installed. For me, it was 3.6.2. 6. Have opam set up your enviroment: eval `opam config env` 7. Install the OCaml llvm library: opam install llvm.3.6 Ensure that the version of llvm you install here matches the version you installed via brew. Brew installed llvm version 3.6.2, so I install llvm.3.6 with opam. IF YOU HAVE PROBLEMS ON THIS STEP, it's probably because you are missing some external dependencies. Ensure that libffi is installed on your machine. It can be installed with brew install libffi If, after this, opam install llvm.3.6 is still not working, try running opam list --external --required-by=llvm.3.6 This will list all of the external dependencies required by llvm.3.6. Install all the dependencies listed by this command. IF THE PREVIOUS STEPS DO NOT SOLVE THE ISSUE, it may be a problem with using your system's default version of llvm. Install a different version of llvm and opam install llvm with that version by running: brew install homebrew/versions/llvm37 opam install llvm.3.7 Where the number at the end of both commands is a version different from the one your system currently has. 8. Create a symbolic link to the lli command: sudo ln -s /usr/local/opt/llvm/bin/lli /usr/bin/lli Create the symlink from wherever brew installs the llvm executables and place it in your bin. From step 5, I know that brew installed the lli executable in the folder, /usr/local/opt/llvm/bin/, so this is where I symlink to. Brew might install the lli executables in a different location for you, so make sure you symlink to the right directory. IF YOU GET OPERATION NOT PERMITTED ERROR, then this is probably a result of OSX's System Integrity Protection. One way to get around this is to reboot your machine into recovery mode (by holding cmd-r when restarting). Open a terminal from recovery mode by going to Utilities -> Terminal, and enter the following commands: csrutil disable reboot After your machine has restarted, try the `ln....` command again, and it should succeed. IMPORTANT: the prevous step disables System Integrity Protection, which can leave your machine vulnerable. It's highly advisable to reenable System Integrity Protection when you are done by rebooting your machine into recovery mode and entering the following command in the terminal: csrutil enable reboot Another solution is to update your path, e.g., export PATH=$PATH:/usr/local/opt/llvm/bin A third solution is to modify the definition of LLI in testall.sh to point to the absolute path, e.g., LLI="/usr/local/opt/llvm/bin/lli" 9. To run and test, navigate to the Craft folder. Once there, run make ; ./testall.sh ------------------------------ To run and test: $ make $ ./testall.sh test-while...OK test-pong...OK test-new-stmt...OK ... fail-binop...OK fail-binop2...OK

近期下载者

相关文件


收藏者