Getting Crules

Crules is an interpreted language and is implemented in C, code and content is hosted at http://code.redbrain.co.uk/cgit.cgi/crules/ and tracked via http://dev.crules.org

You can download the source code via http://code.redbrain.co.uk/cgit.cgi/crules; by downloading a snapshot tarball or a git clone:

# For read only access:
git clone git://crules.org/git/crules
git clone http://code.redbrain.co.uk/cgit.cgi/crules

# Git daemon is faster...

# Or if i have given you ssh read/write access to the repository
git clone gitosis@crules.org:crules.git

Compiling and Running (Proper Way Unix autotools way)

Debian/Ubuntu:

aptitude install build-essential bison flex autoconf \
 automake libtool libgmp3-dev libmpfr-dev libreadline5-dev

openSuse:

yast -i gcc bison flex mpfr-devel gmp-devel 
#autoconf stuff too not sure of the packages names

openSolaris:

  • Option A: Sun Studio Compilers
   % pfexec pkg install sunstudio SUNWgnu-mpfr SUNWaconf SUNWgnu-automake110 SUNWlibtool SUNWgnu-mp
   # external repo for readline 
   # http://blogs.sun.com/trond/entry/compiling_drizzle_on_opensolaris
   % pfexec pkg set-authority -O http://pkg.opensolaris.org/pending/ pending
   % pfexec pkg install readline5
   # Note i have recently stop supporting the use of AT&T LEX in favour or the more feature rich Flex 
   # but YACC is still supported but you can use Bison if you prefer since its more stable and feature rich.

FreeBSD:

I have tested on FreeBSD some time ago and it should work but it was already a pre-setup system so i didn't install the dependencies from ports.

MacOSX:

 % install xcode from your install dvd to get GCC
 % sudo ports install gmp mpfr
 # readline and rest should already be installed from xcode

Compilers

Quick note i have tested crules being compiled with GCC, Intel ICC, Sun Studio and intend to fully support them throughout the project! Though i have a lot to learn in using them!

Compiling Or Rocking Time!

sh config/autorun.sh
./configure 

 *  --prefix=/usr              # default /usr/local
 *  --with-debug=yes/no        # default no
 *  --with-dmalloc=yes/no      # default no
 *  --with-bignum=yes/no       # Currently doesn't do anything for the language, since that use is being redesigned!

see `./configure --help` for full details!
make
make install

# plus all the normal gnu style make rules
% make clean/distclean/dist/maint.....

Compiling using Cmake (Win32/IDE support)

This is something i didn't think i would support at all! I personally really dislike Cmake, since it really is a hardcoded build system!

Its merit is that it can help port software to windows, since to have a nice native build on windows its preferred to use MSVC(cl.exe+link.exe), and not reverting to CYGWIN. This may also be useful to Mac OSX users wanting to use Xcode, which i want to support so we can access mac osx frameworks easier. But in the end Cmakes is _only_ useful for Windows and MacOSX, but really i support *BSD, *linux, *solaris are my main interests in operating systems!

Like it or not Autoconf+Automake are the STANDARD, and they work beautifully it wasn't until i saw Drizzle (http://drizzle.org) i really understood what a build system should do for developers and with Monty Taylors work on Pandora i hope this is open up Autotools for more people. Cmake just seems like a layer of abstraction to simply get users into an IDE and i dislike IDE's to build software because developers tend to get too focused in small areas and forget about deployment very quickly and the software becomes a maintenance nightmare!

Autotools seem confusing but they are so extensive and very configurable for almost any setup! They really make your code much much much easier to maintain for outsiders. Having a configured build system means, NOTHING is hard-coded to any paths the system literally configures your software without the developers having to worry that much! This makes software Highly portable and clean. Installs work easily, and creating a port very simple! Some people get hung up on autoconf but in my opinion the real benefits come from automake and libtool.

Linux/Unix

# get the sources git clone... or wget a release etc..
$ cd crules
$ cmake .
$ make

Mac OSX + XCode

# install cmake use the shell cd to the toplevel source dir
# of crules
$ cmake -G Xcode .
# open Xcode and file->open-project there should be an xcode
# project file that xcode can open! Now you can work away in
# xcode if you prefer

Windows (7) + MSVC 9.0/nmake

When installing the GNU win32 dependancies _don't_ install to “C:\Program Files”, currently m4 has issues with paths with files and folders with spaces in their name, which is lame.

# install cmake + MSVC express edition
# install gnuwin32 flex + bison
* http://gnuwin32.sourceforge.net/packages/bison.htm
* http://gnuwin32.sourceforge.net/packages/flex.htm
# add the C:\gnuwin32\bin to your system PATH
# test this by opening a command prompt
$ bison.exe ...
$ flex.exe
# if they work your half way
$ cd to the C:\Program Files\Microsoft Visual Studio 9.0\VC
# vssetenv.bat to set the envoirment variables for using cl.exe
# in the shell. Test by exec cl.exe
$ cd to the crules sources
* For nmake simply:
$ cmake .
$ nmake

Most win32 hackers will prefer to use Visual Studio but remember using nmake in, the shell works easier for Emacs/Vim users. To use Visual Studio, download the Visual Studio C++ Express Edition and simply run cmake slightly differently and you will have a project/workspace file visual studio can open.

$ cmake -G <generator-string>
# see cmake --help for the correct generator string
# for your visual studio version

Happy Win32 Hacking there are currently some problems using stdint.h but these are soon to be fixed!

 
crules.txt · Last modified: 2010/03/14 05:23 by redbrain
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki