In order to test GNU APL on my biggest machine that I have available (80
cores), I needed to port it to Solaris.

Here are my notes I made while getting the application to build on Solaris:

*ES is defined as a macro in sys/regset.h*

On Solaris, this file eventually becomes included when one includes
sys/signal.h. This causes ID_Quad_ES to become the symbol ID_Quad_2, which
then leads to errors about undeclared identifiers.

The solution is to add the following at the beginning of Id.def:

#ifdef ES
#undef ES
#endif


*DIR structure has no d_type member*

It seems as though the d_type member of the DIR structure is a Linux
extension.

The solution is to issue a separate stat() call to resolve the type of file
entry in the places where d_type is checked (if this member doesn't exist).

*Call to pow() for int64_t is ambiguous*

This problem reveals itself with an error that looks like this:

IntCell.cc: In member function `virtual void IntCell::bif_power(Cell*,
const Cell*) const':
IntCell.cc:353: error: call of overloaded `pow(const int64_t&, const
int64_t&)' is ambiguous
/usr/include/iso/math_iso.h:63: note: candidates are: double pow(double,
double)
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:361:
note:                 long double std::pow(long double, int)
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:357:
note:                 float std::pow(float, int)
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:353:
note:                 double std::pow(double, int)
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:349:
note:                 long double std::pow(long double, long double)
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/cmath:345:
note:                 float std::pow(float, float)


Casting the arguments to double works around this problem.

*Solaris curses.h defines erase as a macro, screwing up vector::erase*

The Solaris version of curses.h contains this little beauty:

#define   erase()         werase(stdscr)


This definition will be in effect unless the parameter *-DNOMACROS* is
passed to the compiler (or NOMACROS is set prior to including the file).
When using C++, this is obviously necessary.

*Solaris tputs() requires an output function accepting char instead of int*

Changing the definitions of putc_stderr and putc_stdout to accept a
charinstead fixes this (they still need to be
int on Linux though, so an #ifdef is needed here).

I believe the difference is between Ncurses vs. Curses, so it's not really
a Solaris vs. Linux issue. I'll check on FreeBSD when I get home (which
uses Curses as well, as far as I remember).

*tparm() takes nine (9!) numeric arguments instead of being variadic*

Showing its age, the tparm() function in Curses accepts a total of 10
arguments (parameter name + 9 numeric arguments) instead of using the
variadic passing style.

The solution is to change a call like this:

tparm(set_foreground, color_UERR_foreground)


to:

tparm(set_foreground, color_UERR_foreground, 0, 0, 0, 0, 0, 0, 0, 0)


Such a change should be compatible with Linux as well.

*Programs using sockets need to link with libsocket and libnsl*

The list of libraries on Solaris needs to include *-lsocket* and *-lnsl*

*The libcurses library needs to be added to the link command*

Simply need to add -lcurses to the linker command line.

*FD_ZERO expands to memset() which requires <string.h>*

In APL_keyboard_show.cc, there is a call to FD_ZERO. On Solaris, this macro
expands to a call to memset(). Unless you include string.h, you'll get an
error saying that memset() has not been declared.

After these changes, it seems to run at least will the small tests I've
made so far.

I'll update you later on the results of the parallelism test.

Regards,
Elias

Reply via email to