NOTE: The reason for creating this library is to allow the programmer to use the functions/classes declared and defined therein in any of the programs written throughout the book.
In the writing of this software, every attempt has been made to conform to the ANSI C++ standard. Software development and testing were performed on an Intel processor based PC running Redhat Linux version 8.0. Compilation was accomplished using the GNU gcc 3.2 compiler. Although some compilation tests were accomplished using native compilers under AIX, IRIX and SunOS operating systems, proper compilation and execution are not guaranteed. No compilation tests were performed under the Microsoft Windows or Macintosh operating systems.
Navigation of this CD has been tested under both the Linux and the Microsoft Windows operating systems.
A Note to Macintosh Users: Mac OS X is required for properly navigating this CD. Prior versions of the Mac operating system appear to interpret the filenames on this CD using the 8.3 character convention, and hence filenames with the first eight characters being identical are not distinguishable.
(1) Enter the directory CODE. If you do a directory
listing, you should see a file called Makefile.
(2) type: gmake
After hitting return, you should see something similar (depending on what system you are running on) to the following:
g++ -O3 -c SCmathlib.cpp
g++ -O3 -c SCchapter2.cpp
g++ -O3 -c SCchapter3.cpp
g++ -O3 -c SCchapter4.cpp
g++ -O3 -c SCchapter5.cpp
g++ -O3 -c SCchapter6.cpp
g++ -O3 -c SCchapter7.cpp
g++ -O3 -c SCchapter8.cpp
g++ -O3 -c SCchapter9.cpp
ar rv libSCmathlib.a SCmathlib.o SCchapter2.o
SCchapter3.o
SCchapter4.o SCchapter5.o
SCchapter6.o SCchapter7.o
SCchapter8.o SCchapter9.o
a - SCmathlib.o
a - SCchapter2.o
a - SCchapter3.o
a - SCchapter4.o
a - SCchapter5.o
a - SCchapter6.o
a - SCchapter7.o
a - SCchapter8.o
a - SCchapter9.o
(3) If you now do a directory listing, you should see that the file libSCmathlib.a has been created.
(2) type: gmake MPISRC=1
After hitting return, you should see something similar (depending on what system you are running on) to the following:
g++ -O3 -DMPISRC -c SCmathlib.cpp
g++ -O3 -DMPISRC -c SCchapter2.cpp
g++ -O3 -DMPISRC -c SCchapter3.cpp
g++ -O3 -DMPISRC -c SCchapter4.cpp
g++ -O3 -DMPISRC -c SCchapter5.cpp
g++ -O3 -DMPISRC -c SCchapter6.cpp
g++ -O3 -DMPISRC -c SCchapter7.cpp
g++ -O3 -DMPISRC -c SCchapter8.cpp
g++ -O3 -DMPISRC -c SCchapter9.cpp
ar rv libSCmathlibP.a SCmathlib.o SCchapter2.o
SCchapter3.o
SCchapter4.o SCchapter5.o
SCchapter6.o SCchapter7.o
SCchapter8.o SCchapter9.o
a - SCmathlib.o
a - SCchapter2.o
a - SCchapter3.o
a - SCchapter4.o
a - SCchapter5.o
a - SCchapter6.o
a - SCchapter7.o
a - SCchapter8.o
a - SCchapter9.o
(3) If you now do a directory listing, you should see
that the file libSCmathlibP.a has been created.
g++ -o myprog myprog.cpp
g++ -o myprog myprog.cpp -lmath
g++ -o myprog myprog.cpp -I/users/kirby/includes -L/users/kirby/libsThe string following the `-I' flag designates the location of the user-defined header files to be included. The string following the `-L' flag designates the location of the user-defined libraries to be included. The string `-lSCmathlib' links the program with the user-defined library we created, and the string `-lmath' links the program with the system math library corresponding to math.h
-lSCmathlib -lmath
g++ -o myprog myprog.cpp -lmpi
g++ -o myprog myprog.cpp -lmath -lmpi
g++ -o myprog myprog.cpp -I/users/kirby/includes -L/users/kirby/libsThe string following the `-I' flag designates the location of the user-defined header files to be included. The string following the `-L' flag designates the location of the user-defined libraries to be included. The string `-lSCmathlib' links the program with the user-defined library we created, and the string `-lmath' links the program with the system math library corresponding to math.h. The string `-lmpi' links the MPI libraries. You will need to contact your system administrator to verify the exact command used on your computing architecture to run an MPI program. In general, most architectures execute MPI programs in a fashion similar to the following:
-lSCmathlib -lmath -lmpi
mpirun -np 4 myprogwhere mpirun is a special program used for starting execution on the parallel machine, `-np 4' indicates the number of processes requested, and myprog denotes the program executable compiled as discussed above.