Tutorials - Building and installing
You can choose to build the project from source (which requires some knowledge like git, cmake and using shell commands) or get a build from a ZIP file.
Setup
You can setup an environment variable named
ARKSCRIPT_PATH
, with the path to the installation directory of ArkScript, so that the standard library can be located without using --lib <path>
. This step is optional.
The environment variable should direct to a folder with the folder lib/
inside. Multiple path can be provided if your installation separates the modules and the standard library,
by separating the different paths with a single ;
.
Installing from a release
Windows
Download the
windows-msvc-{version}.zip
from the releases, and unpack it wherever you want, as long as you remember where (or add the location to
an environment variable as specified in the setup section, to avoid using --lib <path>
). To use the command ark
from everywhere, you will need to
add it to your PATH environment variable.A (maybe easier) alternative is to download
windows-installer.exe
, an InnoSetup installer for ArkScript. It will install it as well as the standard library (modules included) in your C:/Program Files
folder, and create the appropriate ARKSCRIPT_PATH
environment variable.
Linux
Download the
linux-{compiler}-{version}.zip
from the releases. You can put the binaries and the lib anywhere you want, as long as you add it to your
path to execute ArkScript without giving the complete path (in your .bashrc
for example). You can also create an environment variable as stated in the setup above.
Installing through Docker
Just launch
docker pull arkscript/stable:latest
and you're good to go! To run it, use docker run -it arkscript/stable:latest ... arkscript executable options here
.
Installing from source
Clone the repository and go in the newly created repository, then init and update all the git submodules, as follows:
> git clone https://github.com/ArkScript-lang/Ark.git
> cd Ark
> git submodule update --init --recursive
If you want a specific revision or tag, you can do this right before initializing and updating the git submodules:
# for a specific revision
> git checkout <commit>
# for a specific tag
> git checkout tags/<tag>
Different CMake switches are available to customize the build:
-DARK_BUILD_EXE
to generate an executable, defaults to Off, building a shared library-DARK_ENABLE_SYSTEM
to enable `sys:exec` (execute shell commands without restrictions), defaults to On-DARK_PROFILER_COUNT
to count every creation/copy/move of the internal value type, defaults to Off-DARK_PROFILER_MIPS
to enable the MIPS counting, defaults to Off-DARK_BUILD_MODULES
to build the modules, defaults to Off-DARK_NO_STDLIB
to avoid the installation of the ArkScript standard library-DARK_BUILD_MODULES
to trigger the modules build-DARK_SANITIZERS
to enable ASAN and UBSAN
Windows
Requirements:
- Windows 10 x64
- Visual Studio 15 2017
- cmake >= 3.9
Commands:
PS> cmake . -Bbuild -DARK_BUILD_EXE=On -G "Visual Studio 15 Win64"
PS> cmake --build build --config Release
PS> cmake --install build --config Release # might need administrator rights
Linux
Requirements:
- g++ 9
- 64 bits computer
- cmake >= 3.9
Commands:
~/ark$ cmake . -Bbuild -DARK_BUILD_EXE=On
~/ark$ cmake --build build --config Release
~/ark$ sudo cmake --install build --config Release # needs administrator rights to install under /usr/bin
MacOS
Requirements:
- g++ 9
- cmake >= 3.9
On MacOS versions prior to 10.15, libc++
lacks filesystem
in the standard library.
You will need to :
- Install a newer compiler using Homebrew:
brew install gcc && brew link gcc
- Pass compiler path to
cmake
in the build step:-DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
Commands:
~/ark$ cmake . -Bbuild -DARK_BUILD_EXE=On -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
~/ark$ cmake --build build --config Release
~/ark$ cmake --install build --config Release # might need administrator rights