Building An Executable: Difference between revisions

From NARS2000
Jump to navigationJump to search
Line 10: Line 10:
* Make program
* Make program
* Resource Compiler
* Resource Compiler
* Windows SDK
* Parser Generator
* Parser Generator
* Zip Utility
* Zip Utility
* Windows SDK
* PHP (Hypertext Preprocessor)
* PHP (Hypertext Preprocessor)
* NARS2000 Source Code
* NARS2000 Source Code
Line 20: Line 20:
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 [http://www.delorie.com/djgpp/ DJGPP], [http://www.cygwin.com/ Cygwin] or [http://www.mingw.org/ MinGW]) can't be used, a task I'm hoping someone will volunteer to investigate.  In particular, the tools currently used are as follows:
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 [http://www.delorie.com/djgpp/ DJGPP], [http://www.cygwin.com/ Cygwin] or [http://www.mingw.org/ 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:  [http://www.microsoft.com/express/download/ Microsoft Visual C++ Express 2008] '''(requires Windows XP or later)''' — includes Link, Make, and a Resource Compiler
* C Compiler and Linker:  [http://www.microsoft.com/express/download/ Microsoft Visual C++ Express 2008] '''(requires Windows XP or later)''' — includes Link, Make, a Resource Compiler, and an SDK (among others)
* Parser Generator:  [http://cygwin.com/setup.exe Bison]
* Parser Generator:  [http://cygwin.com/setup.exe Bison] (Choose '''All (Default)''', '''Devel''', and '''bison''')
* Zip Utility:  [http://www.7-zip.org/ 7-Zip]
* Zip Utility:  [http://www.7-zip.org/ 7-Zip]
* Windows SDK:  [http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC Windows SDK for Windows Server 2008 and .NET Framework 3.5]
* PHP (Hypertext Preprocessor):  [http://www.php.net/downloads.php Downloads]
* PHP (Hypertext Preprocessor):  [http://www.php.net/downloads.php Downloads]
* NARS2000 Source Code:  [http://svn.nars2000.org/viewvc.cgi/trunk.tar.gz?view=tar tar ball]
* NARS2000 Source Code:  [http://svn.nars2000.org/viewvc.cgi/trunk.tar.gz?view=tar tar ball]

Revision as of 02:17, 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.

Tools, Libraries, and Source Code

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:

Directories

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.

Under the root directory, make a directory called trunk and 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. Under the trunk directory, unzip the NARS2000 Source Code and External Libraries taking care to preserve the directory structure from inside the zip files.

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\

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 is in the trunk directory and is called NARS2000.vcproj.

Environment Variables

If you are building from the makefile, you'll need to set some environment variables as in the following batch file:

@echo off

REM Path and name of zip program (7-zip)
Set ZIPPRG="C:\Program Files\7-Zip\7za"

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.1")
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.1"
subst V: "C:\Program Files\Microsoft Visual Studio 9.0"

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.