quinta-feira, 28 de junho de 2012

Installing GNAT and AWS 2012 on Linux

In the past I have tried to install AWS on Windows and found it terribly difficult and, most importantly, never succeeded in building an SSL application (which is mission-critical for me). From several sources including the excellent people on the AWS forum I gathered the intuition that I might succeed on Linux. So I installed a Linux and... indeed succeeded building an SSL application!

The installation of GNAT GPL 2012 and, principally, AWS, on Linux, is not without a few difficulties. For myself and others, hereby I try to record the process step-by-step. This instalation is for AWS with SSL, sans any other extras.

1. Install Linux

I wanted to work on my Windows laptop (I need it for other projects), so I installed Linux on a virtual machine on that system.

1.1 Install VirtualBox

IIRC, this free software from Oracle installs out of the box, no difficulties here.

1.2 Install Ubuntu Desktop
Ubuntu is a Linux. The principal trick here is to install the Desktop version, not the Server version.
1.2.1 Download the ISO image of the Ubuntu Desktop installation CD.
1.2.2 Create a virtual machine on VirtualBox. IIRC, I used all default values.
1.2.3 Setup the virtual machine with a virtual CD-drive from the ISO image.
1.2.4 Turn on the virtual machine and install Ubuntu from the virtual CD.
1.3 From this point on, all operations are done on this Ubuntu system.

2. Install GNAT

2.1 Make a download package with GNAT GPL 2012 and AWS, from libre.adacore.com (the AWS part is a preparation for part 3); download, unzip, untar the package.
2.2 Run the installation program as superuser:
2.2.1 sudo ./doinstall
2.2.2 accept all default values.
2.3 Set the paths
2.3.1 export PATH=/usr/gnat/bin:$PATH
2.3.2 export LIBRARY_PATH=/usr/lib/i386-linux-gnu (or similar)
2.4 Test: write, build and run "hello.adb"

3. Install OpenSSL

3.1 Download the latest package and install thus (takes a while):
3.1.1 ./config
3.1.2 make
3.1.3 make test
3.1.4 sudo make install

4. Install AWS

4.1 Unzip and untar the AWS package downloaded in step 2.1

4.2 Change to the directory ending in "-src"

4.3 Edit "makefile.conf" as follows:
4.3.1 prefix = /usr/gnat
4.3.2 SOCKET = openssl

4.4 Edit "config/makefile" as follows:
4.4.1 LPATH = /usr/local/ssl/lib

4.5 Set the path
4.5.1 export C_INCLUDE_PATH=/usr/include/i386-linux-gnu (or similar)

4.6 Issue the commands:
4.6.0 make clean
4.6.0.1 this is absolutely required if previous installations have been attempted and have failed
4.6.1 make SOCKET=openssl setup
4.6.1.1 ignore the error "Can not generate system tags. The test are disabled" (sic)
4.6.2 make
4.6.2.1 ignore the warnings "no compiler specified for language "makefile", ignoring all its sources"; ignore the warnings about ZLib licensing
4.6.3 sudo make install
4.6.3.1 ignore the errors about not being able to stat aws.html/txt/info

4.7 Test AWS
To test AWS I use the provided demos. Make on the "demos" directory does not work; we must go into each demo subdir and try make, or else gnatmake the provided project file
4.7.1 Change to a subdirectory of "demos", e.g. "demos/runme"
4.7.2 Try make
4.7.2.1 Upon success, goto 4.7.4; upon the error "make: Nothing to be done for `all'.", try 4.7.3
4.7.2.2 Probably method 4.7.3 always works i.e. there is always a valid .gpr file, so we can skip 4.7.2 entirely
4.7.3 Build the provided project, e.g.
4.7.3.1 gnatmake -P runme.gpr
4.7.4 Execute the program e.g.
4.7.4.1 ./runme

terça-feira, 12 de junho de 2012

Ada Annex E for cloud computing anyone?

I want to create a 100% Ada complex web system.
The database component should be distributed, for safety thru redundancy.
So naturally I wanted to use Annex E.
Seemingly at the momemnt only one Ada compiler supports Annex E: GNAT.
The support comes from Adacore in the form of their Polyorb product, which also supports CORBA and other middleware items.
Good thing: these technologies are free.
Bad thing: there are no other, failsafe, Annex E technologies, free or otherwise.
Just a few bits of (essential) information for now.
To be continued, hopefully.
I will try build an Ada Distributed Application (check the acronym of this) based on Adacore GNAT GPL 2011 and Polyorb.
It will take a long time...
Anyone care to help?

sexta-feira, 4 de novembro de 2011

The Internet Business - build me one, I'll pay you

Occasionally I peek into Freelancer.com; today I found this project:

http://www.freelancer.com/projects/PHP-Website-Design/Make-Adsense-Profitable-Website.html

In sum, they are hiring people who can build a Adsense profitable website... on whatever topic!

Perhaps the main silliness here is: why would people who can build such websites be doing it for others?

It's like those books that reveal the secret of finantial freedom. If the author knew the "secret" would he be trying to (and seemingly succeeding in) selling such books? (Maybe that's the secret, selling such books...)

This is just one in a million silly projects around the Internet Business, on Freelancer.com and elsewhere. Although it is well established, by both reason and observation, that any Internet marketing sans real, proper content is a bust, we keep seeing this vast market grow of precisely that, Internet marketing sans content. Thank Google for doing precisely the opposite of what these people seem to thing they do.

(I just could not help it letting off some steam generated by watching stupidity grow each day in quantity and degree on the Human Web, despite the nice rational havens still out there.)

sexta-feira, 28 de outubro de 2011

LaTeX package listings bug with greek letters

Nice Ada source code, with greek letter variables, UTF-8 encoded:


And here is how LaTeX typesets it, via package listings:


Note how line 49 is perfectly typeset, but the variables at the start of lines 42, 43 have moved to end of the previous line. Man, I hate LaTeX!"#$%&/()=?»

sábado, 22 de outubro de 2011

Porquê "Marius"

Eis uma razão porque me intitulo "Marius", e não "Mário", na Internet. Porque, passadas várias décadas, os computadores continuam a não saber grafar acentos. Eis a detestável visão que acabo de ter na minha caixa de correio-e. Outras vezes é Mrio, ou coisas como M$%rio. Cinco décadas de informática! Uma década de Unicode!

segunda-feira, 22 de agosto de 2011

Sem/sans facebook

Abaterei minha conta Facebook muito em breve.
Principal razão: privacidade (no sentido técnico).
Segui-me aqui, ou em http://soundcloud.com/amadoalves, ou noutro sítio decente.

I shall close my Facebook account soon.
Main reason: internet privacy.
Follow me here, or at http://soundcloud.com/amadoalves, or at any other decent place.

sábado, 9 de julho de 2011

D. Quixote destroi João Sem Medo

Comprei um exemplar das Aventuras de João sem Medo, de José Gomes Ferreira, numa edição chancelada pela D. Quixote (ISBN 978-972-20-3553-8). Era para oferecer à minha melhor aluna de Língua Portuguesa de 2010/2011. Felizmente (?), antes de o entregar à aluna, dei uma olhadela ao texto. Terríveis gralhas! Logo na primeira frase, "os homens haviam estalado um Parque". Até fui verificar na "minha" edição (6ª edição, Diabril Editora, 1976), para confirmar o óbvio: é "haviam instalado". Pensei: bem, corrijo isto a caneta, e entrego... se não houver mais gralhas—enquanto ia lendo mais um pouco. Não precisei de avançar muito. Logo na segunda página do texto: "essa Floresta Maltida"! Fui verificar de novo, até porque agora até podia ser um ferreirismo, contração de "mal tida". Não, a minha edição regista "Maldita". Fico muito triste por ver assim tão maltratada uma obra prima da literatura portuguesa. Duas páginas, duas gralhas. O texto tem 170 páginas...

Atualização em Novembro 2011:
Comuniquei este facto à editora em Julho 2011. Nenhuma resposta até agora. (Será que a próxima edição terá uma errata de 170 linhas?)