I of course first needed an Erlang installation. I am running SuSE 10.2 on my main development machine, no Erlang package was available with the distribution, so I had to do a source install.
I downloaded it from erlang.org, the build went very unproblematic, only caveat was that the package pam-devel was not installed. After successfull build Erlang got installed in /usr/local/lib/erlang.
I then went on to install Yaws as I plan to try out some web-development using Erlang as well, this later turned out to be a lucky move.
As my project need to access the serial port (my GPS receiver connects to USB using the serial profile and as such mounts under Linux as a serial device /dev/ttyUSB0), I need a serial library for Erlang luckily not only one but two exists (named sl and serial) I selected the one named sl, solely based on the fact the it is the newer of the two. To get hold of it I decided to use CEAN (Comprehensive Erlang Archive Network) which is Erlang's pendant to Perl's well known CPAN. I managed to get CEAN installed using their FAQ (not without some trouble though).
So with CEAN working, I fired up my erlang shell and typed cean:install(sl). (note the trailing dot). Success! The sl library got installed under /usr/lib/local/erlang/lib/sl-1.0.
After reading the the sl.txt (placed in the doc subfolder under the sl installation folder) to get a clue of how the library worked.
I eagerly did a P = sl:start(). in the erlang shell. only to be met with:
sh: line 0: exec: sl_drv: not found
#Port<0.100>
Alas something was clearly not working!
Next time I will tell how I got this solved and it includes why it was a lucky move to have installed Yaws.
No comments:
Post a Comment