64bit example program: The README describes the program in this directory which illustrates 64-bit features and compilation environment. The program creates and writes a huge data set to a large file and allows you to access the data and, optionally, sort it. The data is a set of random numbers (of type 'short'). About large files: If the program is compiled as a 64-bit binary, you can use it to create and access files larger than 2**32 bytes (see below on how to compile a 64 bit binary). Using a 32-bit program, you can only access a file size upto 2*32 bytes. To create, access or sort a larger data set, compile and run the 64-bit binary. NOTE: When creating such huge data files, ensure that you have enough disk space available. Creating a 64-bit, v9 executable: In the Makefile provided in this directory, uncomment the following line to a create a v9 64-bit binary. #ARCH = -xarch=v9 Usage See Step 4 below. Example Scenario: Step 1: Make a copy of the program Copy the contents of the 64bit directory to your own private working area with the following command: cp -r /opt/SUNWspro/examples/WorkShop/64bit ~/64bit NOTE: /opt/SUNWspro is the base directory where the product is installed. This directory may be different in your environment. For fun, you could also use TeamWare to create your own workspace of this program. For more information on how to do that, refer to the manuals. Step 2: Open Project File for 64bit Program Start WorkShop with the the "workshop" command. From WorkShop main window, select "Open Project..." from the "Project" menu and open the Project file, "~/64bit/64bit.prd". This Project file provides some pre-set file, compiler, debugger, and build-related settings for you. Step 3: Build your own copy of 64bit program. From the WorkShop main window, go to the Build menu and select the "64bit in ..." target in the lower part of the menu. This launches a build of the program, bringing up the build-output window. The program should build successfully. Close the Build Output window when done. (or) Point WorkShop's Build window to the 64bit directory by selecting 'Build->New Target ...' from either the main window, or from the Build window if it's already open. A dialog pops-up. Change the value of 'Directory' to the location of 64bit and select '64bit' as the new 'Target'. Click the 'Build' button on the dialog. Close the Build Output window when done. Step 4: Program usage 64bit -g -n <#> create and sort a data set of n items in file 64bit -s sort data in file Using the '-g' flag, you can create a data set of "n" random numbers. The program then presents you an interface that allows you to access a particular number in the file just the way you would access a particular value in an array (for example, provide a value for index in data[0...n]). Or, you can choose to sort the data. Using the '-s' flag, you can sort a data file (the file is assumed to be created during a previous run of main -g -n <#>) containing random, unsorted data. The program again presents a similar interface to the user to access or sort the elements. NOTE: Sorting a huge data set takes a considerable amount of time. The program uses the qsort(3C) library funtion which is an implementation of the quick-sort algorithm. Copyright 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303, U.S.A. All rights reserved.