From: Jason Cox Date: 2003-12-20T06:54:49+09:00 Subject: PATCH for Cray X1 UNICOS/mp Hi Matz and everyone, I have built Ruby on the Cray X1 supercomputer and have a patch below based on the ruby-1.8.1-preview3.tar version. With these changes, the "make test" passes. Hopefully, you can add the changes to the your Ruby distribution. Thanks for the language. It's one of my favorites. -Jason Cox ----------------------------------------------------------------------------- Index: ruby-1.8.1/dln.c diff -u ruby-1.8.1/dln.c:1.1 ruby-1.8.1/dln.c:1.2 --- ruby-1.8.1/dln.c:1.1 Fri Dec 12 13:56:46 2003 +++ ruby-1.8.1/dln.c Fri Dec 19 15:03:24 2003 @@ -91,7 +91,7 @@ int eaccess(); -#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) +#if defined(HAVE_DLOPEN) && !defined(USE_DLN_A_OUT) && !defined(_AIX) && !defined(__APPLE__) && !defined(_UNICOSMP) /* dynamic load with dlopen() */ # define USE_DLN_DLOPEN #endif Index: ruby-1.8.1/numeric.c diff -u ruby-1.8.1/numeric.c:1.1 ruby-1.8.1/numeric.c:1.2 --- ruby-1.8.1/numeric.c:1.1 Fri Dec 12 13:56:45 2003 +++ ruby-1.8.1/numeric.c Fri Dec 19 15:03:25 2003 @@ -19,6 +19,10 @@ #include #endif +#ifdef _UNICOSMP +#include +#endif + #ifdef HAVE_FLOAT_H #include #endif @@ -1824,6 +1828,9 @@ #if defined(__FreeBSD__) && __FreeBSD__ < 4 /* allow divide by zero -- Inf */ fpsetmask(fpgetmask() & ~(FP_X_DZ|FP_X_INV|FP_X_OFL)); +#elif defined(_UNICOSMP) + /* Turn off floating point exceptions for divide by zero, etc. */ + _set_Creg(0, 0); #endif id_coerce = rb_intern("coerce"); id_to_i = rb_intern("to_i"); Index: ruby-1.8.1/missing/isinf.c diff -u ruby-1.8.1/missing/isinf.c:1.1 ruby-1.8.1/missing/isinf.c:1.2 --- ruby-1.8.1/missing/isinf.c:1.1 Fri Dec 12 13:57:07 2003 +++ ruby-1.8.1/missing/isinf.c Fri Dec 19 15:04:10 2003 @@ -16,6 +16,17 @@ } } +#elif _UNICOSMP + +#include + +int +isinf(n) + double n; +{ + return !finite(n); +} + #else #include "config.h"