Building An Executable: Difference between revisions
Sudleyplace (talk | contribs) |
Sudleyplace (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
The current version of NARS2000 runs on Windows platforms only, however the goal is to move it to Linux, Mac OS, etc. as per user requests and developer interests. As such, for the moment, the following description for building an executable is necessarily biased towards Windows. | The current version of NARS2000 runs on Windows platforms only, however the goal is to move it to Linux, Mac OS, etc. as per user requests and developer interests. As such, for the moment, the following description for building an executable is necessarily biased towards Windows. | ||
== | ==Downloads== | ||
To build the executable you'll need the following | To build the executable you'll need the following | ||
Line 28: | Line 28: | ||
* Source Control program: [http://tortoisesvn.net/downloads Tortoise SVN] | * Source Control program: [http://tortoisesvn.net/downloads Tortoise SVN] | ||
== | ==Install Tools== | ||
To install the Parser Generator (Bison), run the Cygwin '''setup.exe''' program and choose the '''Devel''' category, then '''bison'''. Install the rest of the tools as per their separate instructions. | |||
For VC Express users, the project file will be in the '''trunk''' directory (see below) and is called '''NARS2000.vcproj'''. | |||
==Install Source Code== | |||
First create a '''root directory''' somewhere on one of your hard drives, perhaps calling it '''NARS2000''', as in '''C:\NARS2000''' or perhaps at some lower level. The source code and external libraries are installed below this level. | |||
Download the source code tar ball ('''trunk.tar.gz''') into the root directory and decompress it with '''tar zxvf trunk.tar.gz'''. The '''tar''' program is part of Cygwin and is found in '''C:\Cygwin\bin''' (or wherever you installed Cygwin). This command also creates the '''trunk''' directory and several directories below that. | |||
Under the root directory (at the same level as the '''trunk''' directory), also make a directory called '''branches'''. The former directory holds the main body of code. The latter directory is used for developer-specific branches not as yet incorporated into the main trunk. | |||
Download the '''qdebug.zip''' and '''gsldir.zip''' files into the '''trunk''' directory and unzip them using '''7z.exe''' as in '''7z x qdebug.zip''' and '''7z x gsldir.zip'''. | |||
==Directories== | |||
After unzipping the above files, the directory structure under the root directory should look something like | After unzipping the above files, the directory structure under the root directory should look something like | ||
Line 97: | Line 109: | ||
trunk\WineHQ\Include\msvcrt\Wine\ | trunk\WineHQ\Include\msvcrt\Wine\ | ||
</pre> | </pre> | ||
==Environment Variables== | ==Environment Variables== | ||
If you are building from the '''makefile''', you'll need to set some environment variables as in the following batch file: | If you are building from the '''makefile''', you'll need to set some environment variables as in the following batch file (name it whatever you like): | ||
<pre>@echo off | <pre>@echo off | ||
REM Path and name of zip program (7- | REM Path and name of zip program (7-Zip) | ||
Set ZIPPRG="C:\Program Files\7-Zip\ | Set ZIPPRG="C:\Program Files\7-Zip\7z" | ||
REM Path and name of parser generator (bison) | REM Path and name of parser generator (bison) | ||
Set PARGEN=C:\Cygwin\bin\bison | Set PARGEN=C:\Cygwin\bin\bison | ||
REM Directory of SDK ("C:\Program Files\Microsoft SDKs\Windows\v6. | REM Directory of SDK ("C:\Program Files\Microsoft SDKs\Windows\v6.0A") | ||
Set SDK=U:\ | Set SDK=U:\ | ||
Line 125: | Line 131: | ||
I find it convenient to use the Windows '''subst''' command to map drive letters as in the references to drives '''U:''' and '''V:''' above. | I find it convenient to use the Windows '''subst''' command to map drive letters as in the references to drives '''U:''' and '''V:''' above. | ||
<pre>subst U: "C:\Program Files\Microsoft SDKs\Windows\v6. | <pre>subst U: "C:\Program Files\Microsoft SDKs\Windows\v6.0A" | ||
subst V: "C:\Program Files\Microsoft Visual Studio 9.0" | subst V: "C:\Program Files\Microsoft Visual Studio 9.0" | ||
</pre> | </pre> | ||
You will also have to append the directories '''V:\Common7\IDE''' and '''V:\VC\bin''' to your path so the C compiler can find some of its DLLs and tools. | |||
==Building The Executable== | ==Building The Executable== | ||
At this point you should be ready to build the executable. To do this from VC Express (having already opened the project file), click on the menu item '''Build''' and '''Build Solution''' or press '''F7'''. To do this from a '''makefile''', type '''mk32'''. | At this point you should be ready to build the executable. To do this from VC Express (having already opened the project file), click on the menu item '''Build''' and '''Build Solution''' or press '''F7'''. To do this from a '''makefile''', type '''mk32'''. |
Revision as of 01:28, 13 January 2009
Platforms
The current version of NARS2000 runs on Windows platforms only, however the goal is to move it to Linux, Mac OS, etc. as per user requests and developer interests. As such, for the moment, the following description for building an executable is necessarily biased towards Windows.
Downloads
To build the executable you'll need the following
- C Compiler and Linker
- Make program
- Resource Compiler
- Windows SDK
- Parser Generator
- Zip Utility
- PHP (Hypertext Preprocessor)
- NARS2000 Source Code
- NARS2000 External Libraries
- Optionally, Source Control program
All of the tools you'll need are freely available. Some of them happen to be Microsoft-specific, however there is no reason more generic tools (such as DJGPP, Cygwin or MinGW) can't be used, a task I'm hoping someone will volunteer to investigate. In particular, the tools currently used are as follows:
- C Compiler and Linker: Microsoft Visual C++ Express 2008 (requires Windows XP or later) — includes Link, Make, a Resource Compiler, and an SDK (among others)
- Parser Generator: Bison (Choose All (Default), Devel, and bison)
- Zip Utility: 7-Zip
- PHP (Hypertext Preprocessor): Downloads
- NARS2000 Source Code: tar ball
- NARS2000 External Libraries: qdebug Library gsl Library
- Source Control program: Tortoise SVN
Install Tools
To install the Parser Generator (Bison), run the Cygwin setup.exe program and choose the Devel category, then bison. Install the rest of the tools as per their separate instructions.
For VC Express users, the project file will be in the trunk directory (see below) and is called NARS2000.vcproj.
Install Source Code
First create a root directory somewhere on one of your hard drives, perhaps calling it NARS2000, as in C:\NARS2000 or perhaps at some lower level. The source code and external libraries are installed below this level.
Download the source code tar ball (trunk.tar.gz) into the root directory and decompress it with tar zxvf trunk.tar.gz. The tar program is part of Cygwin and is found in C:\Cygwin\bin (or wherever you installed Cygwin). This command also creates the trunk directory and several directories below that.
Under the root directory (at the same level as the trunk directory), also make a directory called branches. The former directory holds the main body of code. The latter directory is used for developer-specific branches not as yet incorporated into the main trunk.
Download the qdebug.zip and gsldir.zip files into the trunk directory and unzip them using 7z.exe as in 7z x qdebug.zip and 7z x gsldir.zip.
Directories
After unzipping the above files, the directory structure under the root directory should look something like
branches\ trunk\ trunk\binaries\ trunk\binaries\COM\ trunk\Extensions\ trunk\Extensions\aplchars\ trunk\Extensions\aplchars\chrome\ trunk\Extensions\aplchars\chrome\content\ trunk\Extensions\aplchars\chrome\content\aplchars\ trunk\Extensions\aplchars\chrome\locale\ trunk\Extensions\aplchars\chrome\locale\en-US\ trunk\Extensions\aplchars\chrome\locale\en-US\aplchars\ trunk\Extensions\aplchars\chrome\skin\ trunk\Extensions\aplchars\chrome\skin\classic\ trunk\Extensions\aplchars\chrome\skin\classic\aplchars\ trunk\Extensions\aplchars\defaults\ trunk\Extensions\aplchars\defaults\preferences\ trunk\gsl\ trunk\gsl\.libs\ trunk\gsl\blas\ trunk\gsl\block\ trunk\gsl\cblas\ trunk\gsl\cblas\.libs\ trunk\gsl\complex\ trunk\gsl\eigen\ trunk\gsl\include\ trunk\gsl\include\arpa\ trunk\gsl\include\asm\ trunk\gsl\include\cygwin\ trunk\gsl\include\gsl\ trunk\gsl\include\machine\ trunk\gsl\include\mingw\ trunk\gsl\include\mingw\sys\ trunk\gsl\include\net\ trunk\gsl\include\netinet\ trunk\gsl\include\sys\ trunk\gsl\include\w32api\ trunk\gsl\include\w32api\ddk\ trunk\gsl\include\w32api\GL\ trunk\gsl\linalg\ trunk\gsl\matrix\ trunk\gsl\permutation\ trunk\gsl\sort\ trunk\gsl\specfunc\ trunk\gsl\statistics\ trunk\gsl\vector\ trunk\htdocs\ trunk\htdocs\art\ trunk\htdocs\download\ trunk\htdocs\styles\ trunk\images\ trunk\MediaWiki\ trunk\MediaWiki\art\ trunk\MediaWiki\extensions\ trunk\ReleaseNotes\ trunk\WineHQ\ trunk\WineHQ\Include\ trunk\WineHQ\Include\msvcrt\ trunk\WineHQ\Include\msvcrt\sys\ trunk\WineHQ\Include\msvcrt\Wine\
Environment Variables
If you are building from the makefile, you'll need to set some environment variables as in the following batch file (name it whatever you like):
@echo off REM Path and name of zip program (7-Zip) Set ZIPPRG="C:\Program Files\7-Zip\7z" REM Path and name of parser generator (bison) Set PARGEN=C:\Cygwin\bin\bison REM Directory of SDK ("C:\Program Files\Microsoft SDKs\Windows\v6.0A") Set SDK=U:\ REM MSVC compiler ("C:\Program Files\Microsoft Visual Studio 9.0") (Version 15.00.30729.01) Set MSVC=V:\VC\
I find it convenient to use the Windows subst command to map drive letters as in the references to drives U: and V: above.
subst U: "C:\Program Files\Microsoft SDKs\Windows\v6.0A" subst V: "C:\Program Files\Microsoft Visual Studio 9.0"
You will also have to append the directories V:\Common7\IDE and V:\VC\bin to your path so the C compiler can find some of its DLLs and tools.
Building The Executable
At this point you should be ready to build the executable. To do this from VC Express (having already opened the project file), click on the menu item Build and Build Solution or press F7. To do this from a makefile, type mk32.