Re: HP-UX Compilation

Al Davis <[email protected]> Sat, 30 Mar 2002 02:10:33 -0700
Newsgroups gmane.comp.gnu.gnucap.bugs
Message-ID <[email protected]>
On Friday 29 March 2002 17:20, Kamlesh Kumar wrote:
> I compiled gnucap source code on HP-UX machine successfully.
> I alway find compilation error in src/e_storag.cc at line 192 where
> it complains about max(INT, DOUBLE) not being defined. I fixed it
> by typecasting first argument to double. Then it build
> successfully.

I think the problem is the abs bug that some older C++ libraries had. 
 That line calls std::abs(double), which is part of the standard 
library but some older systems didn't have it.

> But at run time it does not give right output.
>
> If under examples directory, if I run the command
> '../src/O/gnucap -O eq-145.ckt' then the first part
> of output comes correctly. But in the second part
> of output all values are printed as "0." which shows
> some serious run time error.

That's AC analysis.  That code in e_storag.cc is transient step 
control.  I think the problem is the abs bug again.

I think the problem is a combination of that and you are using an 
older compiler that does not do the std:: namespace correctly.  As a 
result, it is substituting the integer abs function.

If that is the case, the work-around is to add "-DABS_IS_BROKEN" to 
the Make2.___ file.  That adds a function std::abs(double) that does 
the right thing.

What compiler are you using?  What libraries?