Difference between revisions of "Yhc/Building"

From HaskellWiki
< Yhc
Jump to navigation Jump to search
(somewhat reflect the current status of the build systems)
(Change instructions to scons)
Line 1: Line 1:
 
{{Yhc}}
 
{{Yhc}}
 
<p style="border:2px solid red;background-color:#ffb;margin:20px;margin-left:50px;margin-right:50px;padding:3px;">
 
Work has begun on replacing the build system described below with a cross platform script using scons. If you want to try this new system please read [[Yhc/Scons]]. The system described below "will continue to work for some time while the Scons based system is being finalised" --- however it seems to be deprecated and not expected to work anymore; use [[Yhc/Scons|scons]] now.
 
</p>
 
   
 
== Requirements ==
 
== Requirements ==
Line 9: Line 5:
 
You need a C compiler - both gcc and MS Visual C are known to be OK.
 
You need a C compiler - both gcc and MS Visual C are known to be OK.
   
  +
You need scons, which in turn requires Python to be installed.
If you want to build the yhc compiler itself (not strictly necessary), you will need a very recent Haskell compiler, e.g. ghc >= 6.4. The supplied configure script will not detect if your compiler version is too old, and will not accept alternative names like ghc-6.4 instead of ghc.
 
   
  +
The process of building Yhc requires ghc-6.4 or later, Subversion and darcs.
The build requires Cpphs, but the makefiles will detect if this is missing and download it for you. This downloading requires darcs.
 
   
 
== Getting the Code ==
 
== Getting the Code ==
Line 21: Line 17:
 
You can browse the code and its history on-line through a [http://www.cs.york.ac.uk/fp/darcs/ darcsweb] interface.
 
You can browse the code and its history on-line through a [http://www.cs.york.ac.uk/fp/darcs/ darcsweb] interface.
   
There is a buildbot script that runs on every change, the results of which are available [http://www.indiegigs.co.uk:8010/ here]. If the build is busted, hopefully the developers will fix it soon. If your build is busted, but the buildbot succeeds, consider adding your machine as a buildbot slave - then it will never get broken again.
+
There is a buildbot script that runs on every change, the results of which are available [http://www.indiegigs.co.uk:8010/ here]. If the build is busted, hopefully the developers will fix it soon. If your build is busted, but the buildbot succeeds, [[Yhc/Buildbot| consider adding your machine as a buildbot slave]] - then it will never get broken again.
 
== Building on Windows ==
 
 
Open a console at the root of the yhc tree. There is a file called Makefile.bat, which is used to build the various components. Just typing Makefile should give you a list of the options.
 
 
The modes are:
 
 
* yhc - build the compiler, requires GHC
 
* yhi - build the runtime, requires Visual Studio 2003 (ask for support for other compilers)
 
* yhe - build the evaluator, requires GHC
 
* gyhe - build the graphic evaluator, requires GHC and Gtk2Hs (Gtk2Hs HEAD only)
 
* doc - build the documentation, requires haddock and GHC
 
* lib - build the base libraries
 
* test - run the standard tests
 
 
The standard options are:
 
 
* debug - build in debug mode [default]
 
* release - build in release mode
 
 
All compiled binaries will go into \inst\bin. To compile and run the test suite do:
 
 
$ Makefile yhc
 
$ Makefile yhi
 
$ Makefile yht
 
$ Makefile lib
 
$ set YHC_BASE_PATH=<current directory>\inst
 
$ Makefile test
 
 
You may wish to set your YHC_BASE_PATH globally, in which case go to My Computer, Properties, Advanced, Environment Variables, New.
 
 
To ensure you have the latest version of all the source, run:
 
 
$ Makefile pull
 
 
== Building on Linux/Unix ==
 
 
The standard unix thing will should get you most of the way.
 
 
chmod +x configure # because darcs does't record the executable bit
 
./configure
 
make
 
 
There currently isn't a 'make install', but it is fairly trivial: simply copy the contents of the 'inst' directory into where
 
everything should be installed. If it complains about the YHC_BASE_PATH environment variables, set this in by editing /etc/bash.bashrc and add the line
 
 
export YHC_BASE_PATH=/usr/lib/yhc/
 
 
(if your system uses bash as the default shell), where /usr/lib/yhc is wherever you put your /inst folder.
 
   
 
== Building ==
If your Haskell compiler has a name other than ghc, edit the file Makefile.inc in the root, and change <tt>HC=ghc</tt> to <tt>HC=your_compiler</tt>.
 
   
  +
To build yhc simply type 'scons' into a console Window. This should automatically detect your build environment and place the Yhc binaries into inst/
== Building on Mac OS X ==
 
   
  +
To build parts of Yhc separately the following commands can be used:
You will need to have libraries like GMP (Gnu multi-precision arithmetic) installed. Most people do this with Fink or DarwinPorts, or some such. You need the header files in addition to the library archive, and these are often distributed in a 'devel' version of the package.
 
  +
* scons configure - Just configure.
  +
* scons build - Don't update dependencies, just build.
  +
* scons build yhi - Only build the interpretor.
 
* scons build yhc - Only build the compiler.
 
* scons build library - Only build the libraries.
   
  +
Other commands available are:
If your packaging system uses a separate directory hierarchy (Fink uses /sw) then you may need to set up some environment variables so that the C compiler can find the includes and libraries:
 
  +
* scons clean - Remove temporary files.
  +
* scons fullclean - Completely wipe everything created by the build process.
  +
* scons depends - Download or update the dependencies
   
  +
To test Yhc has been build correctly type 'scons test'.
LD_LIBRARY_PATH=/sw/lib # for dylibs
 
LIBRARY_PATH=/sw/lib # for static linking
 
CPATH=/sw/include # for header files
 
   
  +
Please report any problems you have to the mailing list.
Then just follow the usual unix-like procedure, as above.
 

Revision as of 11:47, 9 August 2006

Part of Yhc

(Download)

Requirements

You need a C compiler - both gcc and MS Visual C are known to be OK.

You need scons, which in turn requires Python to be installed.

The process of building Yhc requires ghc-6.4 or later, Subversion and darcs.

Getting the Code

The source code is stored in a darcs repo, to get the code do:

darcs get http://www.cs.york.ac.uk/fp/darcs/yhc-devel/

You can browse the code and its history on-line through a darcsweb interface.

There is a buildbot script that runs on every change, the results of which are available here. If the build is busted, hopefully the developers will fix it soon. If your build is busted, but the buildbot succeeds, consider adding your machine as a buildbot slave - then it will never get broken again.

Building

To build yhc simply type 'scons' into a console Window. This should automatically detect your build environment and place the Yhc binaries into inst/

To build parts of Yhc separately the following commands can be used:

* scons configure - Just configure.
* scons build - Don't update dependencies, just build.
* scons build yhi - Only build the interpretor.
* scons build yhc - Only build the compiler.
* scons build library - Only build the libraries.

Other commands available are:

* scons clean - Remove temporary files.
* scons fullclean - Completely wipe everything created by the build process.
* scons depends - Download or update the dependencies

To test Yhc has been build correctly type 'scons test'.

Please report any problems you have to the mailing list.