pedlefsen/HMMoC-BFloat-Algebra — Issue #1: Update HMMoC to work with g++ v.>=4.5  AND test on SUSE linux
Author: tedholzman
Created: 2011-11-02 22:09:04+00:00
State: open

The HMMoC-BFloat-Algebra library failed to compile under SUSE linux g++ v. 4.5.0 The current version under OSX 10.6.2 appears to be g++ v. 4.2.1. This URL details some of the problems to be expected in upgrading from 4.2 to 4.5:

http://lists.debian.org/debian-devel-announce/2011/02/msg00012.html

The code in Algebra.hpp exercised one of the problems documented above.

In Algebra.hpp there are four operator overload functions (starting on line 1560) defined like this:

/* old style */
inline
BFloat::BFload&
BFloat::
operator= ...

This fails with error message:
‘hmmoc::BFloat::BFloat’ names the constructor, not the type

It turns out that the initial BFloat:: is unnecessary and confusing. This syntax works:

/* new style */
inline
BFloat&
BFloat::operator= ...

*****

Another problem: starting on line 1653 is a somewhat misleading error message: "declaration of ‘operator=’ as non-function "

This derives from the fact that uint32_t is not defined by default (under SUSE g++). It can be repaired by adding

#include

near the top of the .hpp file.

*****

Linkage problem. In the Makefile, when creating the "tests" executable, it seems to work better to include the libHMMoC-BFloat-Algebra library AFTER including the Tests.o object file on the g++ or ld command.

These changes allow compilation, linking and running the tests executable on both the Mac and SUSE platforms, with identical results.