The Nim compiler currently officially supports the following platform and architecture combinations:
- Windows (Windows XP or greater) - x86 and x86_64
- Linux (most, if not all, distributions) - x86, x86_64, ppc64 and armv6l
- Mac OS X (10.04 or greater) - x86, x86_64 and ppc64
More platforms are supported, however they are not tested regularly and they may not be as stable as the above-listed platforms. Compiling the Nim compiler is quite straightforward if you follow these steps: First, the C source of an older version of
the Nim compiler is needed to bootstrap the latest version because the Nim compiler itself is written in the Nim programming language. Those C sources are available within the nim-lang/csources
repository. Next, to build from source you will need:
- A C compiler such as gcc 3.x/later or an alternative such as clang, Visual C++ or Intel C++. It is recommended to use gcc 3.x or later.
- Either git or wget to download the needed source repositories.
- The build-essential package when using gcc on Ubuntu (and likely other distros as well).
Then, if you are on a *nix system or Windows, the following steps should compile Nim from source using gcc, git and the koch build tool (in the place of sh build.sh you should substitute build.bat on x86 Windows or build64.bat on x86_64 Windows):
Finally, once you have finished the build steps (on Windows, Mac or Linux) you should add the bin directory to your PATH
Nimble is Nim’s package manager and it can be acquired from the nim-lang/nimble
repository. Assuming that you added Nim’s bin directory to your PATH, you may install
Nimble from source by running: