When running a 32-bit version of IES on a 64-bit machine, there are a couple of items to be aware of in using the gcc compiler.
1) there are switches to control the binaray output as 32 bit or 64 bit. The switches -m32 and -m64 explicitly control the output type and it is recommended they always be used as a mean of self-documentation for the intent of the compile command line.
2) On x86_64 architecutre machines the DEFAULT is to give 64 bit output as if -m64 was present on the command line. On i386 or i686 machines the DEFAULT is to give 32 bit output as these machiens are incapable of generating 64 bit output at all.
For any C code with IUS or Specman usage:
If the user has their own C code (PLI, VPI, VHP, or /DPI ) to compile and link into the simulation, they will need to ensure that the object file created is also 32-bit compatible if they want to use the 32 bit IES executables.
Typically a user will compile their C code on an 64 bit machine just as they would while running on a 32-bit machine. The user will need to add the "-m32" switch to their gcc compilation in order to produce a 32-bit compatible object file.
UNIX> gcc -m32 <C code> <options>
Then they can load the shared object dynamically ( if that is the approach they have ) or continue to link a static executable using the 32 bit *.o files they have created with the gcc command.
For Specman sn_compile script:
there is a setting within the system.specman file which forces the sn_compile.sh script to compile in 32-bit mode using a "-m32" switch. This will guarantee that the executable or shared object file produced by the sn_compile.sh is 32-bit compatible.
# Force 32-bit Specman on 64-bit Linux machines case `uname -m` in x86_64)
SPECMAN_CCOMPILER="gcc -m32";
SPECMAN_LINKER="gcc -m32";
SPECMAN_SHLIB_LDFLAGS="${SPECMAN_SHLIB_LDFLAGS} -m elf_i386 -L/usr/lib";
SPECMAN_LDFLAGS="-Wl,--undefined=__ctype_b
$SPECMAN_HOME/linux/libctype_compat.a ${SPECMAN_LDFLAGS}"
;;
esac;