Comments (4)
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:
-
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.
-
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 theINSTALL
project to install to Program Files (x86) by default. Congratulations, you installed llvm on windows!
Building Ante:
-
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).
-
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 thesrc
directory. Move the generated headers to the correct directory withmv 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.
-
The function
f32_from_f16
is bootstrapped in the compiler. To link correctly, the easiest way is to replace the function stubextern "C" float f32_from_f16(float f);
(in src/operator.cpp) withextern "C" float f32_from_f16(float f){ return f; }
-
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
-
Build
-
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 toante -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.
Is building of LLVM really necessary? Do you think there is any chance to try a prebuilt binary?
from ante.
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.
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)
- Improve Location for "type variable is already in scope" error
- Codegen crash when using a trait that defines multiple methods
- What kind of memory management does ante use? HOT 3
- Implement Named Constructor syntax HOT 2
- Adding type annotations to an unbound type variable can crash the compiler HOT 1
- Implement `can Effect` syntax for annotating effects HOT 1
- Check declared variable's types with equality instead of unification HOT 1
- Add a proper error message for unhandled effects
- Incorrect Pointer Offset Calculation When Using -O3 Optimization Level HOT 1
- Add shorthand for casting integer types
- Malloc Panics with -O0 or crane_lift HOT 1
- Require the package name to prefix all imports
- Add `./deps` as a relative root by default
- Add a command-line flag to configure the "relative_root" directories
- Create a LSP server for Ante HOT 4
- WebAssembly HOT 2
- Values declared inside conditional blocks and match arms leak to module export list HOT 2
- Monomorphisation panic HOT 3
- Implement effect variable ellision
- Panic: `Recursion limit reached in occurs`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ante.