Installation
Note
These instructions are derived from c3-lang.org and were originally written by Josh Ring.
Choose your operating system:
Set up
Download the C3 compiler or the debug build and unzip the contents into an empty folder.
Requirement
If you have Visual Studio 17 installed, you can skip ahead to step 5. If you don’t have Visual Studio 17 installed keep on reading.
Python script
There should be a msvc_build_libraries.py Python script in the folder where you unzipped the C3 compiler (called c3c). This script will download the necessary files for compilation on Windows. Python can be installed from the official website or the Microsoft Store.
Moving the folder
Move the folder to C:\Program Files and navigate into it. Now copy the path to the folder.
Adding a Directory to PATH
Note
PATH specifies the directories where executable programs are located, enabling the operating system to find and run them. Modifying PATH will allow you to access the C3 compiler from anywhere by using the c3c command.
Use the Windows search to find Environment properties. You should now see a menu titled System Properties. Head to the Advanced tab, where on the bottom right you will find Environment Variables.... Under User variables double click on PATH. Click on New and paste the folder path to the C3 compiler. For a tutorial with images click here.
Congratulations
You should now be able to access the C3 compiler from anywhere on your system. Try running the following command in the terminal to check if the installation was successful.
c3c --versionRequirement
In order to follow the tutorial, you must have XCode with command line tools installed.
Set up
Download the C3 compiler or the debug build and unzip the contents into an empty folder.
Check your shell
Check, which shell you are running by using this command in your terminal.
ps -p $$ -o comm=If the output is zsh you can simply go to the next step. If the output is bash go to step 3 in the Ubuntu/Debian install instructions.
Adding a Directory to PATH
Note
PATH specifies the directories where executable programs are located, enabling the operating system to find and run them. Modifying PATH will allow you to access the C3 compiler from anywhere by using the c3c command.
Copy the path to the folder into which you placed the C3 compiler (called c3c). Then open the .zshrc file by using this command in the terminal.
nano ~/.zshrcUsing the arrow keys navigate to the bottom of the .zshrc file and paste the following line by pressing Command + Shift + V.
export PATH="/path/to/your/folder:$PATH"You must now replace /path/to/your/folder with the path you copied at the beginning of this step.
Once you have done this press Control + O then press Enter then Control + X.
Sourcing
Now just execute this command in order for zshell to reload its configuration file.
source ~/.zshrcCongratulations
You should now be able to access the C3 compiler from anywhere on your system. Try running the following command in the terminal to check if the installation was successful.
c3c --versionSet up
Ubuntu: Download the C3 compiler (Ubuntu) or the debug build (Ubuntu) and unzip the contents into an empty folder.
Debian: Download the C3 compiler (Debian) or the debug build (Debian) and unzip the contents into an empty folder.
Check your shell
Check, which shell you are running by using this command in your terminal.
ps -p $$ -o comm=If the output is bash you can simply go to the next step. If the output is zsh go to step 4 in the MacOS install instructions.
Adding a Directory to PATH
Note
PATH specifies the directories where executable programs are located, enabling the operating system to find and run them. Modifying PATH will allow you to access the C3 compiler from anywhere by using the c3c command.
Copy the path to the folder into which you placed the C3 compiler (called c3c). Then open the .bashrc file by using this command in your terminal.
nano ~/.bashrcUsing the arrow keys navigate to the bottom of the .bashrc file and paste the following line by pressing Command + Shift + V.
export PATH="/path/to/your/folder:$PATH"You must now replace /path/to/your/folder with the path you copied at the beginning of this step.
Once you have done this press Control + O then press Enter then Control + X.
Sourcing
Now just execute this command in order for bash to reload the configuration file.
source ~/.bashrcCongratulations
You should now be able to access the C3 compiler from anywhere on your system. Try running the following command in the terminal to check if the installation was successful.
c3c --versionInstalling via AUR
There are multiple packages available for C3 in the AUR with the most recent one being: c3c-bin-latest. The following command should download the package.
# For yay
yay -S c3c-bin-latest
# For paru
paru -S c3c-bin-latest
# For aura
aura -A c3c-bin-latestInstalling via Cloning
Run these commands to clone the AUR package manually.
git clone https://aur.archlinux.org/packages/c3c-git
cd c3c-git
makepkg -siCongratulations
You should now be able to access the C3 compiler from anywhere on your system. Try running the following command in the terminal to check if the installation was successful.
c3c --version