install.txt 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. Installation
  2. ============
  3. Installation on Linux/UNIX
  4. --------------------------
  5. The GNU C Compiler is fully supported, other compilers may work. The C compiler
  6. should be in your ``$PATH`` (most likely the case). Note that some few Linux
  7. distributions do not ship with a GCC compiler preinstalled - then you have to
  8. install it.
  9. Install Nim by downloading the appropriate ``.tar.xz`` file and extracting it
  10. to a directory of your choice. The Nim Compiler will stay in this
  11. directory (unless you copy it somewhere else). The compiler does not need
  12. write access to its directory, so copying the nim folder to ``/opt``
  13. works.
  14. Then run the following command::
  15. sh build.sh
  16. Unlike other software, Nim does not distribute its files over the whole file
  17. hierarchy. This has the advantage that you can deinstall it by just deleting
  18. its folder. The disadvantage is that you have to add it to your ``PATH``
  19. manually. An alternative is to create a symbolic link in ``/usr/bin``::
  20. [sudo] ln -s $your_install_dir/bin/nim /usr/bin/nim
  21. There are also ``install.sh`` and ``deinstall.sh`` scripts for distributing
  22. the files over the UNIX hierarchy. However, updating your Nim installation
  23. is more cumbersome then.
  24. To complete the installation you should also build Nim's tools like
  25. ``nimsuggest``, ``nimble`` or ``nimgrep`` via::
  26. nim c koch
  27. koch tools
  28. Note that these tools should also end up in your ``PATH`` so adding
  29. ``$your_install_dir/bin/nim`` to your ``PATH`` is preferred over the symlink
  30. solution.
  31. Installation on the Macintosh
  32. -----------------------------
  33. Only MacOS X is supported.
  34. Since MacOS X is UNIX based too, it works like the installation on Linux.
  35. However, for unknown reasons the symbolic link method does not work on MacOS X.
  36. You need to install Apple's developer's tools for the GNU Compiler Collection
  37. or clang.
  38. Installation on Windows
  39. -----------------------
  40. Install Nim by downloading and unzipping the ``nim_$version.zip`` file.
  41. Run ``finish.exe`` to detect and setup your MingW environment.
  42. Currently, the following C compilers are supported under Windows:
  43. - | Microsoft's Visual C++
  44. | http://msdn.microsoft.com/visualc
  45. | (You need the SDK too - but not the full one: Only
  46. the win32api header files and import libraries are essential.)
  47. - | Gnu C Compiler (the mingw version; the cygwin version has not been tested!)
  48. | http://www.mingw.org/download.shtml
  49. - | LLVM with Clang or GNU C/C++ frontend
  50. | http://llvm.org/releases/download.html
  51. However, most testing is done with GCC.
  52. Bootstrapping from GitHub
  53. -------------------------
  54. Take a look at the readme file on github `here <https://github.com/nim-lang/Nim#readme>`_
  55. for instructions.
  56. Installation of Nimble
  57. ----------------------
  58. Nimble is Nim's package manager. For the source based installations where you
  59. added Nim's ``bin`` directory to your ``$PATH`` the easiest way of installing
  60. Nimble is via::
  61. nim c koch
  62. koch nimble