Antes de continuar leyendo esta guía deberías comprobar si cumples con
los requerimientos para usar las Compaq Tools. Si necesitas usar cualquier
cosa que no sean las librerías de ejecución
El Software debe usarse solamente con fin individual, personal y "entusiasta" o para educación y estudio de carácter personal. No debe ser usado con fines comerciales, empresariales o institucionales ya sea con o sin animo de lucro. Cualquier trabajo realizado o resultante del uso de este Software no puede usarse en beneficio de terceras personas a cambio de cualquier tipo de pago, compensación o cualquier otro método de reembolso o remuneración.
Si tu calificación es suficiente para una licencia gratuita, debes registrarte
en HP usando el formulario ubicado en
Si estas familiarizado con la optimización de PC's seguramente habrás
oido hablar deI
Las siguientes herramientas estan disponibles para los usuarios de Gentoo:
Herramienta | Descripción | Nombre en Portage |
---|---|---|
El primer paso para instalar las Herramientas de Desarrollador es obtener las bibliotecas de ejecucion. A causa de restricciones en la licencia, Gentoo no puede distribuir los RPM y debes descargarlos desde Compaq.
Descarga los rpms libots y libcpml, y ponlos en tu directorio distfiles.
# uname -p # comprueba la revision de tu procesador EV56 # mv libots-2.2.7-2.alpha.rpm cpml_ev?-5.2.0-1.alpha.rpm /usr/portage/distfiles
Ahora los rpms están en tu directorio distfiles, portage será capaz de encontrarlos y de instalarlos en tu sistema. Usar las siguientes instrucciones para emerger las librerias.
# emerge -pv dev-libs/libots dev-libs/libcpml # comprueba que todo este correcto # emerge dev-libs/libots dev-libs/libcpml
Ahora las librerias están instaladas en tu sistema y estás preprarado para instalar los compiladores y las utilidades.
Si todavia no te has registrado para obtener una licencia de entusista o academica en HP, ahora seraia un buen momento. Parece ser que la licencia se obtiene 24 horas despues de rellenar el formulario en la web.
When your license is issued, your notification email will contain the license key. Use it in the command below to install the ccc and cxx compilers.
# emerge -pv dev-lang/ccc # check everything looks okay # CCC_LICENSE_KEY=0123456789 emerge dev-lang/ccc # ebuild /var/db/pkg/dev-lang/ccc-6.5.9.001.ebuild config
If everything went okay, you now have the Compaq C Compiler installed and can use it to start compiling applications from portage or your own applications. If you would also like to use the C++ compilers, use the commands below to install them. Don't forget to run "cxx" at the end to agree to the EULA.
# emerge -pv dev-lang/cxx # check everything looks okay # CXX_LICENSE_KEY=0123456789 emerge dev-lang/cxx # ebuild /var/db/pkg/dev-lang/cxx-6.5.9.31-r1.ebuild config # cxx # read and agree to the EULA.
If you would like to take advantage of the enhanced debugger ladebug, you should install it now.
# emerge -pv dev-util/ladebug # emerge dev-util/ladebug
Compiling programs from portage with ccc is simple. In the following example we will demonstrate installing gzip, an application known to perform very well with ccc.
# emerge -pv gzip # check everything looks okay # CC=ccc CFLAGS="-host -fast" emerge gzip
ccc has many optimization features. There is an overview and explanation of the CFLAGS used here and some other common options farther below.
The same method can be used to compile C++ programs. The following example uses groff, which benchmarks much better when compiled with cxx.
# emerge -pv groff # check everything looks okay # CXX=cxx CXXFLAGS="-host -fast" emerge groff
Optimizing applications for Alpha with ccc/cxx is simpler than with gcc. Similar options are grouped together, making command lines shorter and simpler. The table below demonstrates some of the common flags you might want to try in your programs.
Flag | Description | Safety |
---|---|---|
The compaq compilers really excel at optimizing applications that involve intensive floating point maths. They can also outperform GCC at integer maths in most situations. During my experiments I have found many applications that benchmark almost identically with ccc as with gcc, but I haven't found any applications that perform worse with ccc/cxx.
Remember however that GCC has received more extensive testing and provides many extensions to the standards that programmers might make use of. CCC might not support these extensions or not support them as fully as gcc. You should take this into account when choosing what to optimize with ccc.
If you want to experiment with different CCC flags and compare them to GCC, you
need to benchmark them. For this purpose, I recommend the
Here are some examples I have prepared:
Test | Summary |
---|---|
If you've been using Alpha for more than a few minutes, you know about Unaligned accesses, programming errors that affect Alpha users and cause applications to incur performance penalties as the kernel fixes them.
Unaligned accesses aren't serious; programs will run fine even with them. However the kernel can't fix these instantly and every time it does a fix, your application will run slower. Usually this isn't a problem, but on some programs you might notice the slowdown.
Apr 9 01:05:55 amnesiac bash(20147): unaligned trap at 0000039db4526d98: 000003 9db4662e26 28 1 Apr 9 01:05:55 amnesiac bash(20147): unaligned trap at 0000039db4526d9c: 000003 9db4662e2a 28 3 Apr 9 01:06:03 amnesiac snort(23800): unaligned trap at 000000012003fe60: 00000 00120161a92 2c 2 Apr 9 01:06:03 amnesiac snort(23800): unaligned trap at 000000012003fe78: 00000 00120161a96 2c 2 Apr 9 01:06:03 amnesiac snort(23800): unaligned trap at 000000012003feb0: 00000 00120161a9e 2c 4 Apr 9 01:06:03 amnesiac snort(23800): unaligned trap at 000000012003feb4: 00000 00120161aa2 2c 5
There are 2 ways to fix these errors so as to minimize the performance hit. If you're a programmer, you can fix the errors. This is usually simple, but some applications are riddled with them or are very subtle. If you think you can do this, HP has some documentation for programmers on how to identify and fix these bugs at the link below.
The second way is using the Compaq Compiler and the -misalign flag, this will add extra checking code to make sure that all code is aligned. This will make your program run slower, so you need to experiment and check if it's worth it.
If possible run the application through
# time your_application real 0m2.011s user 0m0.004s sys 0m2.007s # CC=ccc CFLAGS="-host -fast -misalign" emerge your_application # time your_application 0m0.811s 0m0.804s 0m0.007s
$ grep unaligned /proc/cpuinfo kernel unaligned acc : 3 (pc=fffffc000035c7e0,va=120000f1a) user unaligned acc : 6623 (pc=28d361e4c1c,va=28d36320f62)