|
|
Sage-ST ä Getting Started |
How do I start using Sage-ST ä ?
If you've purchased the StonyBrook compiler and downloaded the latest Sage-ST ä installation then you're ready to start. If you're not sure you have everything or you do need something else you can get it from the Free Downloads Page .
The development environment for StonyBrook and most of the Sage-ST ä tools are in Windows so development will have to be on a 32 bit Windows environment (Win 95, 98, ME, NT, 2000) even if the final application is for DOS. One caution is that we've found that the DOS applications (all DOS apps, not just those from StonyBrook) do not seem to run well on Windows 2000. An additional caution is that both StonyBrook and Sage-ST now have files that have long file names. Be cautious that you do not use tools or commands that will truncate the names to the old DOS 8.3 type format.
Installing the Compiler
The base compiler installation is done by putting the Setup.exe, Setup.w02 and Setup.w03 files in a temp directory and running Setup.exe. As you install you can choose to install for DOS (X32) and for Win 32. The Sage-ST ä installation will provide libraries for developement under both of DOS and Windows.
Install any patches for the compiler so that you have the exact version that was also used to compile the Sage-ST ä libraries. Not using the same version can result in problems compiling and linking. See the Free Downloads Page for information regarding any current patches that are available and for the instructions on installing them.
Installing Sage-ST ä
Install Sage-ST ä by running the installation program. During the install you can select the folder you want to install it into (default \SageST) and what components you want. For most users the 'Typical' selection should work well. Under the base folder it will create several sub folders in which it will put the actual library files and the tools such as Thor and Rebuild. It will also add entries to your start menu and puts some shortcuts on your desktop for the tools.
In the original installation of Sage-ST ä Thor will limit the user to only 20 relations unless you register the product and get a registration key. U.S. Government agencies can freely use the product and simply need to contact us to receive the registration key. All others should inquire about a license for the product. Once the key information has been entered there are no restrictions imposed in Thor other than the system maximum values.
Creating a Project
At this point the compiler and Sage-ST ä should be ready for use. The next step is to create a project using the StonyBrook environment. Although the creation of the project and linking to Sage-ST ä can be done manually the easiest process is to use a script file. This is done by starting the StonyBrook environment and then selecting File - Run Script from the menu. Then you give it the script file and it runs through all the steps of project creation including compiling and linking the main program. Provided below is a sample script file. This file would typically by saved with an extension of .SBS (i.e. MYPROJ.SBS). For this example it would be saved in the same directory as the source code and when the project file is created (MYPROJ.SBP) it would also be in this direcotory. Using this example script file the .OJB and .SYM files are placed in sub folders named DOSOBJ32 and DOSSYM32 (or WINOBJ32 and WINSYM32 for Windows). This example should be enough to get you started with a basic project. For additional information about StonyBrook scripts see the compiler documention directories and on-line help.
DOS Project Example Script
SCRIPT MYPROJ;
BEGIN
CreateProject(X32, "D:\MyProject\MYPRJ32.sbp");
(* Add imported projects *)
AddModule(Project, "D:\SageST\Ada\Sage\SAGE32");
AddModule(Project, "D:\SageST\Ada\Sgk\SGK32");
SetDirectory(SPEC, "");
SetDirectory(BODY, "");
SetDirectory(SYM, "DosSym32");
SetDirectory(OBJ, "DosObj32");
SetDirectory(RES, "");
SetVersionTags("OS_DOS");
(* Project options *)
SetProjectOption(PrjRecompileForDebug, No);
SetProjectOption(PrjDebugFormat, StonyBrook);
SetProjectOption(PrjSafetyBelts, No);
SetProjectOption(PrjRestrictCpu, No);
SetProjectOption(PrjStackSize, 96);
SetProjectOption(PrjObjFormat, OMF);
SetProjectOption(PrjScanProjectsFirst, No);
SetProjectOption(PrjCheckRemoteDirectories, No);
SetProjectOption(PrjImportsAreReadWrite, No);
SetProjectOption(PrjLinkDllRtl, No);
(* Global compiler options *)
SetCompilerOption(CheckSubscripts, GlobalOption, Yes);
SetCompilerOption(CheckAssignments, GlobalOption, Yes);
SetCompilerOption(CheckVariants, GlobalOption, No);
SetCompilerOption(CheckPointers, GlobalOption, Yes);
SetCompilerOption(CheckOverflow, GlobalOption, Yes);
SetCompilerOption(CheckStack, GlobalOption, Yes);
SetCompilerOption(ModuleCheck, GlobalOption, No);
SetCompilerOption(CheckUninitialized, GlobalOption, No);
SetCompilerOption(InitializeData, GlobalOption, No);
SetCompilerOption(Lines, GlobalOption, Yes);
SetCompilerOption(Debug, GlobalOption, Yes);
SetCompilerOption(MakeDebuggable, GlobalOption, Yes);
SetCompilerOption(AliasGlobalLocal, GlobalOption, No);
SetCompilerOption(AliasParams, GlobalOption, No);
SetCompilerOption(AliasPointers, GlobalOption, Yes);
SetCompilerOption(EmulateFloating, GlobalOption, Yes);
SetCompilerOption(SparseCase, GlobalOption, Yes);
SetCompilerOption(PackedRecords, GlobalOption, Yes);
SetCompilerOption(InlineSingleCalls, GlobalOption, Yes);
SetCompilerOption(ModuleInitCode, GlobalOption, Yes);
SetCompilerOption(Cmain, GlobalOption, No);
SetCompilerOption(Alignment, GlobalOption, Align4);
SetCompilerOption(InlineLimit, GlobalOption, Inline0);
SetCompilerOption(ForceTraceableCode, GlobalOption, No);
SetCompilerOption(TargetProcessor, GlobalOption, i486);
SetCompilerOption(CodeListing, GlobalOption, No);
SetCompilerOption(ExtendedSyntax, GlobalOption, Yes);
SetCompilerOption(TypedPointers, GlobalOption, No);
SetCompilerOption(OutputLibrary, GlobalOption, No);
SetCompilerOption(WarnCodeGen, GlobalOption, No);
SetCompilerOption(WarnAlignment, GlobalOption, No);
SetCompilerOption(WarnCaseSelectors, GlobalOption, No);
SetCompilerOption(WarnDead, GlobalOption, Yes);
SetCompilerOption(WarnCast, GlobalOption, Yes);
SetCompilerOption(WarnProcNotImplemented, GlobalOption, Yes);
SetCompilerOption(WarnFuncCalledAsProc, GlobalOption, No);
SetCompilerOption(WarnRange, GlobalOption, Yes);
SetCompilerOption(WarnWith, GlobalOption, Yes);
SetCompilerOption(OptimizeSpace, GlobalOption, Yes);
SetCompilerOption(EnableSrcOptimize, GlobalOption, Yes);
SetCompilerOption(CommonSubs, GlobalOption, Yes);
SetCompilerOption(ConditionalCommonSubs, GlobalOption, Yes);
SetCompilerOption(LoopInvariants, GlobalOption, Yes);
SetCompilerOption(InductionVariables, GlobalOption, Yes);
SetCompilerOption(LoopRewriting, GlobalOption, Yes);
SetCompilerOption(Propagation, GlobalOption, Yes);
SetCompilerOption(DeadCode, GlobalOption, Yes);
SetCompilerOption(DeadStores, GlobalOption, Yes);
SetCompilerOption(JumpChaining, GlobalOption, Yes);
SetCompilerOption(LiveVariables, GlobalOption, Yes);
SetCompilerOption(RegisterParameterPassing, GlobalOption, Yes);
SetCompilerOption(CrossModuleRPP, GlobalOption, No);
SetCompilerOption(EnableAsmOptimize, GlobalOption, Yes);
SetCompilerOption(PeepholeFlow, GlobalOption, Yes);
SetCompilerOption(PeepholeLife, GlobalOption, Yes);
SetCompilerOption(InstructionHoisting, GlobalOption, Yes);
SetCompilerOption(TailMerging, GlobalOption, Yes);
(* Linker options *)
SetLinkerOption(LinkDebug, Yes);
SetLinkerOption(LinkPackDebug, Yes);
SetLinkerOption(LinkMap, Yes);
SetLinkerOption(LinkMapLines, Yes);
SetLinkerOption(LinkIgnoreCase, No);
SetLinkerOption(LinkDefaultLibs, Yes);
SetLinkerOption(LinkAllowUndefined, No);
SetLinkerOption(LinkSmartVMethods, No);
SetLinkerOption(LinkResponseFormat, StonyBrook);
SetLinkerOption(LinkOtherLinker, No);
SetLinkerOption(LinkPostProcess, No);
SetLinkerOption(LinkTransBuffer, Buf4k);
(* Librarian options *)
SetLibrarianOption(LibMaxSize, Max8Mb);
SetLibrarianOption(LibDeleteObj, No);
SetLibrarianOption(LibOtherLibrarian, No);
(* Add sources to project *)
AddModule(AdaProgram, "MYMAIN");
Select(AdaProgram, "MYMAIN");
SetStackSize(50);
AddModule(AdaProgram, "MYPROG2");
Select(AdaProgram, "MYPROG2");
SetStackSize(50);
LinkAllPrograms;
ExitProgram;
END MYPROJ.
Windows Project Example Script
SCRIPT MYPROJ;
BEGIN
CreateProject(Win32, "D:\MyProject\MYPRJ32W.sbp");
(* Add imported projects *)
AddModule(Project, "D:\SageST\Ada\Sage\SAGE32W");
AddModule(Project, "D:\SageST\Ada\Sgk\SGK32W");
SetDirectory(SPEC, "");
SetDirectory(BODY, "");
SetDirectory(SYM, "WinSym32");
SetDirectory(OBJ, "WinObj32");
SetDirectory(RES, "");
SetVersionTags("OS_WINDOWS");
(* Project options *)
SetProjectOption(PrjRecompileForDebug, No);
SetProjectOption(PrjDebugFormat, StonyBrook);
SetProjectOption(PrjSafetyBelts, No);
SetProjectOption(PrjRestrictCpu, No);
SetProjectOption(PrjStackSize, 96);
SetProjectOption(PrjObjFormat, msCOFF);
SetProjectOption(PrjScanProjectsFirst, No);
SetProjectOption(PrjCheckRemoteDirectories, No);
SetProjectOption(PrjImportsAreReadWrite, No);
SetProjectOption(PrjLinkDllRtl, No);
(* Global compiler options *)
SetCompilerOption(CheckSubscripts, GlobalOption, Yes);
SetCompilerOption(CheckAssignments, GlobalOption, Yes);
SetCompilerOption(CheckVariants, GlobalOption, No);
SetCompilerOption(CheckPointers, GlobalOption, Yes);
SetCompilerOption(CheckOverflow, GlobalOption, Yes);
SetCompilerOption(CheckStack, GlobalOption, Yes);
SetCompilerOption(ModuleCheck, GlobalOption, No);
SetCompilerOption(CheckUninitialized, GlobalOption, No);
SetCompilerOption(InitializeData, GlobalOption, No);
SetCompilerOption(Lines, GlobalOption, Yes);
SetCompilerOption(Debug, GlobalOption, Yes);
SetCompilerOption(MakeDebuggable, GlobalOption, Yes);
SetCompilerOption(AliasGlobalLocal, GlobalOption, No);
SetCompilerOption(AliasParams, GlobalOption, No);
SetCompilerOption(AliasPointers, GlobalOption, Yes);
SetCompilerOption(EmulateFloating, GlobalOption, Yes);
SetCompilerOption(SparseCase, GlobalOption, Yes);
SetCompilerOption(PackedRecords, GlobalOption, Yes);
SetCompilerOption(InlineSingleCalls, GlobalOption, Yes);
SetCompilerOption(ModuleInitCode, GlobalOption, Yes);
SetCompilerOption(Cmain, GlobalOption, No);
SetCompilerOption(Alignment, GlobalOption, Align4);
SetCompilerOption(InlineLimit, GlobalOption, Inline0);
SetCompilerOption(ForceTraceableCode, GlobalOption, No);
SetCompilerOption(TargetProcessor, GlobalOption, PentiumII);
SetCompilerOption(CodeListing, GlobalOption, No);
SetCompilerOption(ExtendedSyntax, GlobalOption, Yes);
SetCompilerOption(TypedPointers, GlobalOption, No);
SetCompilerOption(OutputLibrary, GlobalOption, No);
SetCompilerOption(WarnCodeGen, GlobalOption, No);
SetCompilerOption(WarnAlignment, GlobalOption, No);
SetCompilerOption(WarnCaseSelectors, GlobalOption, No);
SetCompilerOption(WarnDead, GlobalOption, Yes);
SetCompilerOption(WarnCast, GlobalOption, Yes);
SetCompilerOption(WarnProcNotImplemented, GlobalOption, Yes);
SetCompilerOption(WarnFuncCalledAsProc, GlobalOption, No);
SetCompilerOption(WarnRange, GlobalOption, Yes);
SetCompilerOption(WarnWith, GlobalOption, Yes);
SetCompilerOption(OptimizeSpace, GlobalOption, Yes);
SetCompilerOption(EnableSrcOptimize, GlobalOption, Yes);
SetCompilerOption(CommonSubs, GlobalOption, Yes);
SetCompilerOption(ConditionalCommonSubs, GlobalOption, Yes);
SetCompilerOption(LoopInvariants, GlobalOption, Yes);
SetCompilerOption(InductionVariables, GlobalOption, Yes);
SetCompilerOption(LoopRewriting, GlobalOption, Yes);
SetCompilerOption(Propagation, GlobalOption, Yes);
SetCompilerOption(DeadCode, GlobalOption, Yes);
SetCompilerOption(DeadStores, GlobalOption, Yes);
SetCompilerOption(JumpChaining, GlobalOption, Yes);
SetCompilerOption(LiveVariables, GlobalOption, Yes);
SetCompilerOption(RegisterParameterPassing, GlobalOption, Yes);
SetCompilerOption(CrossModuleRPP, GlobalOption, No);
SetCompilerOption(EnableAsmOptimize, GlobalOption, Yes);
SetCompilerOption(PeepholeFlow, GlobalOption, Yes);
SetCompilerOption(PeepholeLife, GlobalOption, Yes);
SetCompilerOption(InstructionHoisting, GlobalOption, Yes);
SetCompilerOption(TailMerging, GlobalOption, Yes);
(* Linker options *)
SetLinkerOption(LinkDebug, Yes);
SetLinkerOption(LinkPackDebug, Yes);
SetLinkerOption(LinkMap, Yes);
SetLinkerOption(LinkMapLines, Yes);
SetLinkerOption(LinkDefaultLibs, Yes);
SetLinkerOption(LinkAllowUndefined, No);
SetLinkerOption(LinkSmartVMethods, No);
SetLinkerOption(LinkConsoleApp, No);
SetLinkerOption(LinkResponseFormat, StonyBrook);
SetLinkerOption(LinkOtherLinker, No);
SetLinkerOption(LinkPostProcess, No);
SetLinkerOption(LinkSectionAlign, Align4k);
SetLinkerOption(LinkSystemVersion, 4.00);
SetLinkerOption(LinkStackReserve, 128h);
SetLinkerOption(LinkHeapReserve, 1024h);
SetLinkerOption(LinkHeapCommit, 4h);
SetLinkerOption(LinkOutputFixups, Default);
(* Librarian options *)
SetLibrarianOption(LibDeleteObj, No);
SetLibrarianOption(LibOtherLibrarian, No);
(* Add sources to project *)
AddModule(AdaProgram, "MYMAIN");
Select(AdaProgram, "MYMAIN");
SetStackSize(50);
AddModule(AdaProgram, "MYPROG2");
Select(AdaProgram, "MYPROG2");
SetStackSize(50);
AddModule(ObjectLibrary, "D:\SageST\Ada\Sage\SAGEDLL.LIB");
AddModule(ObjectLibrary, "D:\SageST\Ada\SGK\SGKDLL.LIB");
LinkAllPrograms;
ExitProgram;
END MYPROJ.
Send mail to
warren.merrill@inl.gov
with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance