<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML Strict//EN"> <HTML> <HEAD> <TITLE>Building SP</TITLE> </HEAD> <BODY> <H1>Building SP</H1> <P> You will need a C++ compiler with good template support to build this. Support for exceptions is not required. <P> In most cases you should be able to port to a new compiler just by editing <code>include/config.h</code>. <H2>Unix</H2> <P> To build on Unix, edit the Makefile, and do a make. You can also build in a different directory. This requires GNU make or another make that implements VPATH. Copy or link the top-level Makefile to the build directory, change srcdir in the Makefile to point to the original directory, and do a make in the build directory. <P> <SAMP>make install</SAMP> installs the programs. <P> You can use the following compilers: <DL> <DT> gcc <DD> gcc 2.7.2 works (gcc 2.7.0 won't work at least on the sparc). You will also an iostream library (eg as provided by libg++ 2.7). This distribution builds on Solaris 2.3 and on Linux 1.2. I expect it will build on SunOS 4 as well with little difficulty. <P> With gcc 2.6.3/SunOS 4, you'll need to compile with <CODE>-Dsig_atomic_t=int</CODE>, and, if you want to compile with -DSP_HAVE_SOCKET, you'll need to make netdb.h and arpa/inet.h C++ compatible. <DT> Sun C++ <DD> To compile with Sun C++ 4.0.1, run first sunfix.sh. Also in the top-level Makefile, change set libMakefile to Makefile.lib.sun. This makes the library build use the -xar option. </DL> <P> Nelson Beebe has ported SP to a variety of other Unix systems and has produced some <A HREF="http://www.math.utah.edu/~beebe/sp-notes-1.0.1.html">notes</A> about his experiences. <H2>DOS/Windows</H2> <P> You must use a compiler that generates 32-bit code. <H3></H3> <P> The following compilers have been tested: <DL> <DT> Visual C++ 4.2 <DD> Open SP.mak as a Makefile in the Developer Studio and build whatever you want. Don't use <SAMP>Batch Build</SAMP> or <SAMP>Rebuild All</SAMP>: these rebuild the library repeatedly. You can build all the targets in a particular configuration by building the all target. The <SAMP>sp-generate.mak</SAMP> makefile can be used to make all the .cxx and .h files that are automatically generated. (These are included in the distribution, so you don't need to do this unless you want to modify SP.) <P> To create a new program, make a new project in the SP project workspace using the <SAMP>Build>Subprojects</SAMP> command, and include <SAMP>lib</SAMP> and maybe <SAMP>generic</SAMP> as subprojects. You may also want to add your project as a subproject to <SAMP>all</SAMP>. Then, in <SAMP>Build>Settings</SAMP> under the <SAMP>C/C++</SAMP> tab in the <SAMP>Preprocessor</SAMP> category, copy the <SAMP>Preprocessor definitions</SAMP> and <SAMP>Additional include directories</SAMP> entries from the nsgmls subproject. In the <SAMP>Code Generation</SAMP> category make sure you've selected the same run-time library as that used by the corresponding configuration of <SAMP>lib</SAMP>. <DT> Visual C++ 5.0 <DD> Use SP.mak as with Visual C++ 4.2. Visual C++ 5.0 has a bug which will cause it to crash when converting the makefile. To work around this, rename the lib directory to x, say, before converting the makefile and then, after conversion but before building, rename it back to lib. Then proceed as with Visual C++ 4.2. <P> You should be aware that Visual C++ 5.0 also has some optimization bugs. There are workarounds for those I've discovered, but it would be safer to use Visual C++ 4.2. <DT> Visual C++ 6.0 <DD> Use jade.dsw. Build debug with all.dsp, release with jadedist.dsp. <P> The style library needs cleaning between builds, but rebuild all takes care of this. <P> OpenJade 1.3.1 has only been built with VC++ 6.0 SP3. <P> Remember you need perl installed on your system - www.activestate.com. <DT> Watcom C++ 11.0 <DD> Use Makefile.wat. <P> You must compile on a platform that supports long filenames. </DL> <P> <ADDRESS> James Clark<BR> jjc@jclark.com </ADDRESS> </BODY> </HTML>