Install

From vishap oberon compiler
Jump to: navigation, search

Deutsch (de) | English (en) | Հայերեն (hy)

This document was written to guide you to install voc on various platforms.

we assume that you know at least how to work with the command line interface :)

Prerequisites

on Debian GNU/Linux

on Debian GNU/Linux you might need to install libc6-dev package, usually by running

apt-get install libc6-dev

on RHEL/Fedora

on Fedora and other RHEL-like systems, you might need to install glibc-devel and glibc-static packages, usually by running

yum install glibc-devel glibc-static

Compiling from sources

We will need GCC, GNU build utilities (gnu make, ldconfig, etc) and git.

first, use git to clone the online repository

git clone https://github.com/norayr/voc.git

then cd into the voc directory that we just cloned

cd voc

If you are on 32bit intel or amd PC, and you work under GNU/Linux then run

make -f makefile.linux.gcc.x86

If you are on an ARM Linux computer, like Raspberry Pi or Nokia N900, run

make -f makefile.linux.gcc.armv6j_hardfp

for a PowerPC run

make -f makefile.linux.gcc.powerpc

and finally, on 64bit computers just run

make

or

make -f makefile.linux.gcc.x86_64

because it's the same file.

on Mac with OSX use

make -f makefile.darwin.clang.x86_64

on FreeBSD or OpenBSD use gmake

gmake -f makefile.openbsd.gcc.x86_64


don't get scared if you see errors, if everything went well, usually the last two lines on the console would be

gcc -shared -o libVishapOberon.so *.o
echo ""/opt"/voc-1.1/lib" > 05vishap.conf

now, we need to install the compiler by running

sudo make install

or if you are on mac, then

sudo make -f makefile.darwin.clang.x86_64 install

on 32bit Linux

sudo make -f makefile.linux.gcc.x86 install

on OpenBSD

sudo gmake -f makefile.openbsd.gcc.x86_64

etc.

next we will need to add the voc tools (voc, showdef, ocat) to our shell's path, assuming that you run GNU Bash (check by running echo $SHELL and you should get /bin/bash) just add these two lines to your .bashrc file

PATH=$PATH:/opt/voc/bin
export PATH

Testing the compiler

Now that we have voc installed, let's test it!

first, enter this using your favorite text editor and save it as Hello.Mod

MODULE Hello;

IMPORT Console;

BEGIN
	Console.String("Hello, User!");
	Console.Ln
END Hello.

then run

voc -m Hello.Mod

you will see voc live in action :) to run our program, run

./Hello

and we'll see

Hello, User!

Installation on other platforms