Building SAS
Can't locate strict.pm in @INC (@INC contains:
/import/archperf/local/Riesling/lib/perl5/5.8.0/sun4-solaris
/import/archperf/local/Riesling/lib/perl5/5.8.0
/import/archperf/local/Riesling/lib/perl5/site_perl/5.8.0/sun4-solaris
/import/archperf/local/Riesling/lib/perl5/site_perl/5.8.0
/import/archperf/local/Riesling/lib/perl5/site_perl
.
) at ../../bin/process_xml line 12.
The actual location for the module Perl was looking for is
$(SAM_ROOT)/sam-t1/devtools/64/perl/lib/5.8.0/strict.pm
OpenSPARCT1_Arch_1.2.tar.bz provides Perl. For example, the interpreter is
${SAM_ROOT}/sam-t1/devtools/64/perl/bin/perl
However, the SAS build environment seems to make an assumption about the Perl include path that is not true in general. The PERL5LIB environment variable can be used to add to the include path.
$(SAM_ROOT)/sam-t1/src/riesling-cm/riesling/src/Makefile.prjdefs
defines the PERL5LIB macro, but does not affect the environment variable of the same name.
$(SAM_ROOT)/sam-t1/src/riesling-cm/riesling/src/Makefile.prjrules
has a suffix rule with dependency suffix .xml and target suffix .cc that invokes the Perl program named process_xml. This is the point of failure.
One possible solution is to change that rule to
(PERL5LIB=$(PERL5LIB); export PERL5LIB; $(PERL) $(PERL_FLAGS) $(RIESLING_ROOT)/bin/process_xml $(XMLFLAGS) $<)
Alan Feldstein
Cosmic Horizon
http://www.alanfeldstein.com/
# 1
ld.so.1: python: fatal: libpython2.4.so.1.0: open failed: No such file or directory
This problem can be "solved" by the user simply by using the LD_LIBRARY_PATH environment variable. A natural place for the definition would be
$SAM_ROOT/OpenSPARCT1_SAM.cshrc
where a line such as the following could be added
setenv LD_LIBRARY_PATH $SAM_ROOT/sam-t1/devtools/32/lib
A cleaner solution, in my opinion, might be self-contained by Sun in the successor to OpenSPARCT1_Arch_1.2.tar.bz. From the man page for ld.so.1, "The runtime linker uses a prescribed search path for locating the dynamic dependencies of an object. The default search paths are the runpath recorded in the object, followed by ..." My suggestion is to record the runpath directly in the dynamic object (i.e. in the Python interpreter).
Sun delivers
$SAM_ROOT/sam-t1/devtools/32/bin/python
and
$SAM_ROOT/sam-t1/devtools/32/lib/libpython2.4.so.1.0
Since Python is an open source project, perhaps Sun could construct the dynamic object using the -R option to ld. This would take the LD_LIBRARY_PATH burden off of the user.
# 2
There are number of users using this and they have not run intothese problems (PERL and LD library issues you mentioned), soI am not sure which OS and Shell you are using.In any case, these variables will be set for PERL and LD in thenext release.
# 3
> I am not sure which OS and Shell you are using.Solaris 9, C shell> In any case, these variables will be set for PERL and> LD in the> next release.Thank you.
# 4
/opt/SUNWspro/bin/CC -o ../lib/libriesling_n1.32opt.so -G -KPIC -fast -xO5 -DNDEBUG -DRS_INLINE=inline -DRS_MPSAS_COMPATIBLE-xarch=v8plusa-h libriesling_n1.so trap/obj32opt_n1/libtrap_n1.a strand/obj32opt_n1/libstrand_n1.a core/obj32opt_n1/libcore_n1.a cpu/obj32opt_n1/libcpu_n1.a asi/obj32opt_n1/libasi_n1.a system/obj32opt_n1/libsystem_n1.a mmu/obj32opt_n1/libmmu_n1.a fw/obj32opt_n1/libfw_n1.a register/obj32opt_n1/libregister_n1.a /home/alan/Sun/OpenSPARCT1_Arch_1.2/sam-t1/devtools/32/shade/lib/libspix_sparc. a -lCstd -lCrun -Qoption ld -z,allextract -Qoption ipo -archive -xjobs=0
CC: Illegal value for -xjobs, must be positive integer
This fatal error was the result of my ignoring multiple previous instances of a nonfatal error:
sh: psrinfo: not found
This is just a PATH issue. psrinfo is classified as a system administration command, and is located at
/usr/sbin/psrinfo
The problem can be solved in a number of ways. I chose to make the line in
$(SAM_ROOT)/OpenSPARCT1_SAM.cshrc
look like
set path = ($SAM_ROOT/bin /usr/sbin $path)
# 5
/opt/SUNWspro/bin/CC -o ../lib/libriesling_n1.32opt.so -G -KPIC -fast -xO5 -DNDEBUG -DRS_INLINE=inline -DRS_MPSAS_COMPATIBLE-xarch=v8plusa-h libriesling_n1.so trap/obj32opt_n1/libtrap_n1.a strand/obj32opt_n1/libstrand_n1.a core/obj32opt_n1/libcore_n1.a cpu/obj32opt_n1/libcpu_n1.a asi/obj32opt_n1/libasi_n1.a system/obj32opt_n1/libsystem_n1.a mmu/obj32opt_n1/libmmu_n1.a fw/obj32opt_n1/libfw_n1.a register/obj32opt_n1/libregister_n1.a /home/alan/Sun/OpenSPARCT1_Arch_1.2/sam-t1/devtools/32/shade/lib/libspix_sparc. a -lCstd -lCrun -Qoption ld -z,allextract -Qoption ipo -archive -xjobs=1.5
CC: Illegal value for -xjobs, must be positive integer
This fatal error was the result of
X_JOB_LOAD:sh = /bin/perl -e 'print `psrinfo | wc -l` * 3 / 2 '
in
$(SAM_ROOT)/sam-t1/src/riesling-cm/riesling/src/Makefile.prjdefs
which will work very nicely on a build system with an even number of processors.
Let me break this down:
psrinfo | wc -l
counts the number of processors on the build system.
The documentation for Sun Studio 11 explains that the -xjobs option is "to set how many processes the compiler creates to complete its work ... When you specify -xjobs=n, the interprocedural optimizer uses n as the maximum number of code generator instances it can invoke to compile different files ... A safe value for n is 1.5 multiplied by the number of available processors."
However, as the error message indicates, n must be an integer.
In Perl,
3 / 2
is a floating-point divide.
Adapting Jonathan Jacky's integer division subroutine (http://staff.washington.edu/jon/dsa-perl/quotient) to this problem gave me
X_JOB_LOAD:sh = /bin/perl -e '$r = `psrinfo | wc -l` * 3; $q = 0; while ($r >= 2) { $r = $r - 2; $q = $q + 1; } print $q;'
which was successful.
# 6
/opt/SUNWspro/bin/CC -G -KPIC -fast -xO5 -DNDEBUG -DRS_INLINE=inline -DRS_MPSAS_COMPATIBLE-xarch=v8plusa-DTARGET_VA_BITS=64 -DTARGET_PA_BITS=64 -DRIESLING -DNIAGARA1 -I../../../../include/fw -I../../../../include/strand -I../../../../include/core -I../../../../include/cpu -I../../../../include/system -I../../../../include/asi -I../../../../include/mmu -I../../../../include/trap -I../../../../include/register -I../../../../include/blaze -I../common -I/home/alan/Sun/OpenSPARCT1_Arch_1.2/sam-t1/devtools/32/include/python2.4 -I../../../../src/core -c -o Ni_RegReader.o Ni_RegReader.cc
*** Error code 1
dmake: Fatal error: Command failed for target `Ni_RegReader.o'
Current working directory /space/OpenSPARCT1_Arch_1.2/sam-t1/src/riesling-cm/riesling/src/frontend/pli/ni
From the dmake documentation:
You can use any machine as a build server as long as it meets the following requirements:
* From the dmake host (the machine you are using) you must be able to use rsh, without being prompted for a password, to remotely execute commands on the build server.
...
In my case, I was not satisfying that first requirement as evidenced by:
fonzie% rsh fonzie which dmake
permission denied
The rsh man page explains, "If the name of the local host is not found in the /etc/hosts.equiv file on the remote machine, and the local username and hostname are not found in the remote user's .rhosts file, then the access is denied." That was my problem.
And that was my final problem in building SAS. The build now completes with an exit status of 0.
