#1040 closed defect (fixed)
psLib in 2.4-cr-0 needs ieee754.h but not present on system
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | build | Version: | unspecified |
| Severity: | critical | Keywords: | |
| Cc: |
Description
I'm compiling ipp-2.4-cr-0 and it fails when it needs ieee754.h, which doesn't seem to exist on my system, nor did psbuild -extbuild install it.
/bin/sh ../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../src -I../../src -I../../src/sys -I../../src/astro -I../../src/db -I../../src/fft -I../../src/fits -I../../src/imageops -I../../src/jpeg -I../../src/math -I../../src/mathtypes -I../../src/types -D_THREAD_SAFE -I/usr/local/include -pipe -O0 -g -Wall -Werror -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -MT libpslibfits_la-psFitsFloat.lo -MD -MP -MF .deps/libpslibfits_la-psFitsFloat.Tpo -c -o libpslibfits_la-psFitsFloat.lo test -f 'psFitsFloat.c' || echo './'psFitsFloat.c
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../src -I../../src -I../../src/sys -I../../src/astro -I../../src/db -I../../src/fft -I../../src/fits -I../../src/imageops -I../../src/jpeg -I../../src/math -I../../src/mathtypes -I../../src/types -D_THREAD_SAFE -I/usr/local/include -pipe -O0 -g -Wall -Werror -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200112L -MT libpslibfits_la-psFitsFloat.lo -MD -MP -MF .deps/libpslibfits_la-psFitsFloat.Tpo -c psFitsFloat.c -fno-common -DPIC -o .libs/libpslibfits_la-psFitsFloat.o
psFitsFloat.c:5:21: error: ieee754.h: No such file or directory
psFitsFloat.c: In function 'convertF32toFloat16_0':
psFitsFloat.c:39: error: storage size of 'in' isn't known
psFitsFloat.c:45: error: 'IEEE754_FLOAT_BIAS' undeclared (first use in this function)
psFitsFloat.c:45: error: (Each undeclared identifier is reported only once
psFitsFloat.c:45: error: for each function it appears in.)
cc1: warnings being treated as errors
psFitsFloat.c:39: warning: unused variable 'in'
psFitsFloat.c: In function 'convertF32fromFloat16_0':
psFitsFloat.c:54: error: storage size of 'out' isn't known
psFitsFloat.c:58: error: 'IEEE754_FLOAT_BIAS' undeclared (first use in this function)
psFitsFloat.c:54: warning: unused variable 'out'
make[3]: * [libpslibfits_la-psFitsFloat.lo] Error 1
make[2]: * [all-recursive] Error 1
make[1]: * [all] Error 2
make: * [all-recursive] Error 1
problem building psLib : failure in make
Change History (3)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Searched a local Mac for ieee754.h, and couldn't find it.
Moved the required definition out of glibc into psLib --- fixed in CVS head.
You should be able to use the below diff as a patch to get your side working.
price@mithrandir:/home/mithrandir/price/ipp/psLib/src/fits>cvs diff -u -r 1.3 psFitsFloat.c
Index: psFitsFloat.c
===================================================================
RCS file: /cvsroot/pan-starrs/datasys/IPP/psLib/src/fits/psFitsFloat.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- psFitsFloat.c 17 Jan 2008 20:19:34 -0000 1.3
+++ psFitsFloat.c 19 Feb 2008 21:36:33 -0000 1.4
@@ -1,8 +1,26 @@
+/*
+ Copyright (C) 2008 Institute for Astronomy, University of Hawaii
+
+ This is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+*/
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <ieee754.h>
#include <string.h>
#include <assert.h>
@@ -16,33 +34,52 @@
#include "psFitsFloat.h"
-#define BIAS_FLOAT_16_0 10 Exponent bias for FLOAT_16_0
Private functions
-union float_16_0 {
- psS16 s16; 16-bit integer version
+ This definition of IEEE754 floating-point, with some modifications, is from the GNU C Library, ieee754.h
+ Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc.
+union float_ieee754 {
+ float f; Floating point
+ struct { IEEE 754 single-precision format
+#ifdef WORDS_BIGENDIAN
+ unsigned int negative:1;
+ unsigned int exponent:8;
+ unsigned int mantissa:23;
+#else
+ unsigned int mantissa:23;
+ unsigned int exponent:8;
+ unsigned int negative:1;
+#endif
+ } ieee;
+};
+#define BIAS_FLOAT_IEEE754 0x7f Exponent bias for IEEE754
+ End definition from ieee754.h
+
- Floating-point version
- struct {
- unsigned int negative:1; Sign bit
- unsigned int exponent:5; Exponent bits
- unsigned int mantissa:10; Mantissa bits
+ 16-bit floating point
+union float_16_0 {
+ psS16 s16; 16-bit integer version
+ struct { Floating-point version
+ unsigned int negative:1; Sign bit
+ unsigned int exponent:5; Exponent bits
+ unsigned int mantissa:10; Mantissa bits
} f16;
};
+#define BIAS_FLOAT_16_0 10 Exponent bias for FLOAT_16_0
static inline psS16 convertF32toFloat16_0(psF32 value)
{
- union ieee754_float in; Input value
+ union float_ieee754 in; Input value
union float_16_0 out; Output value
XXX What happens to NAN and INF?
in.f = value;
out.f16.negative = in.ieee.negative;
- out.f16.exponent = in.ieee.exponent - IEEE754_FLOAT_BIAS + BIAS_FLOAT_16_0;+ out.f16.exponent = in.ieee.exponent - BIAS_FLOAT_IEEE754 + BIAS_FLOAT_16_0; out.f16.mantissa = in.ieee.mantissa >> 13;
return out.s16;
@@ -51,11 +88,11 @@
static inline psF32 convertF32fromFloat16_0(psS16 value)
{
union float_16_0 in; Input value
- union ieee754_float out; Output value
+ union float_ieee754 out; Output value
in.s16 = value;
out.ieee.negative = in.f16.negative;
- out.ieee.exponent = in.f16.exponent + IEEE754_FLOAT_BIAS - BIAS_FLOAT_16_0;+ out.ieee.exponent = in.f16.exponent + BIAS_FLOAT_IEEE754 - BIAS_FLOAT_16_0; out.ieee.mantissa = in.f16.mantissa << 13;
return out.f;
comment:3 by , 18 years ago
Somehow patch choked on the / line but I copied the working file directly from your home directory and it worked.

PS: This is MacOS 10.4.11 on Intel