Code Monkey home page Code Monkey logo

Comments (4)

jfecher avatar jfecher commented on August 19, 2024

Note that the instructions below are only for building the most recent commit that updated the windows version to llvm 4.0

The majority of steps are for building llvm:

  1. Build llvm using these instructions http://llvm.org/docs/GettingStartedVS.html

    • Make sure you have CMake and GnuWin32 installed. The binaries from GnuWin32 should be in your PATH as well.
    • When you get to the CMake step in the link above if CMake complains it cannot find a CMAKE_C_COMPILER or CMAKE_CXX_COMPILER then make sure you have visual studio and visual studio c++ redistributable installed. The later should be installed upon creating a fresh c++ project in visual studio. If after verifying these are installed cmake still gives the same error message open powershell and cd to the directory you extracted llvm to. Execute cmake with cmake . and it should build properly.
  2. Open the directory llvm was installed to. If installing using the CMake GUI it will be the directory you specified, if installed through the CLI, it will be the same directory as the source. Open the visual studio solution file and build the ALL_BUILD project in debug configuration. Then, build the INSTALL project to install to Program Files (x86) by default. Congratulations, you installed llvm on windows!

Building Ante:

  1. Download the most recent release as a zip and setup a visual studio project with each source file (in the src directory) and each include file (in the include directory).

  2. To build the parser and output the correct files open powershell and cd to Ante's root directory. Build the parser with bison -Lc++ -o 'src/parser.cpp' --defines=include/yyparser.h src/syntax.y. This will create several files in the src directory. Move the generated headers to the correct directory with mv src/*.hh include

    • If you plan on changing Ante's syntax by editing syntax.y you should set the above as a custom build step in VS to run before the Build and Rebuild steps.
  3. The function f32_from_f16 is bootstrapped in the compiler. To link correctly, the easiest way is to replace the function stub extern "C" float f32_from_f16(float f); (in src/operator.cpp) with extern "C" float f32_from_f16(float f){ return f; }

  4. Under project settings, add the C:\llvm-download-directory\include under the C++ include directories. Under the linker tab, add every installed llvm library found in C:\Program Files (x86)\LLVM\lib

  5. Build

  6. When testing, using powershell would be the quickest way to test multiple files (test files can be found in the tests directory). If you want to test in visual studio without the console window closing, you should test a command similar to ante -r filename.an -e to open the REPL after filename.an is compiled and run.

    • Make sure Ante's stdlib is installed! Copy stdlib/prelude.an to C:\Program Files (x86)\Ante\prelude.an"
    • Ante currently uses gcc to link files, copy or move the gcc executable in GnuWin32 to "C:\MinGW\bin\gcc.exe" if no file is there already. Alternatively, change this directory to the directory of the desired linker in include/target.h

from ante.

PavelVozenilek avatar PavelVozenilek commented on August 19, 2024

Is building of LLVM really necessary? Do you think there is any chance to try a prebuilt binary?

from ante.

jfecher avatar jfecher commented on August 19, 2024

It is necessary, the llvm binaries do not include the headers for VS to reference nor does it include the library files to link with.

from ante.

jfecher avatar jfecher commented on August 19, 2024

Closing this since with the compiler rewrite these instructions are now outdated, and there are new instructions for windows in the README.

from ante.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.