lcn2 / calc

C-style arbitrary precision calculator
http://www.isthe.com/chongo/tech/comp/calc/index.html
Other
346 stars 52 forks source link

Bug: Make/Build Failure on Linux With 2.15.0.5 [Makefile:764: longbits.h] Error 1 #145

Closed LAP6282 closed 5 months ago

LAP6282 commented 5 months ago

Attempting to build 2.15.0.5 on Linux by running make causes this error. The complete make output is shown:

[calc-2.15.0.5]# make forming have_ban_pragma.h have_ban_pragma.h formed forming have_const.h have_const.h formed forming have_stdbool.h have_stdbool.h formed forming have_string.h have_string.h formed forming have_newstr.h have_newstr.h formed forming have_memmv.h have_memmv.h formed forming have_stdlib.h have_stdlib.h formed forming have_unistd.h have_unistd.h formed forming endian_calc.h endian_calc.h formed forming have_limits.h have_limits.h formed forming charbit.h make: [Makefile:728: charbit.h] Error 127 (ignored) charbit.h formed forming longbits.h make: *** [Makefile:764: longbits.h] Error 1

This error does not occur on calc-2.14.3.5 which is the previous version that I have built successfully.

uname -a: Linux 6.8.1 #1 SMP Fri Mar 15 16:04:06 EDT 2024 x86_64 Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz GenuineIntel GNU/Linux

Make version: 4.4.1

Bash version: 5.2_p26

I have found a similar issue reported with MacOS:

https://trac.macports.org/ticket/67833

lcn2 commented 5 months ago

Thank you @LAP6282 for the bug report.

Please run make clobber debug and attach the debug.out file to this issue.

LAP6282 commented 5 months ago

Running "make clobber debug" actually successfully built the calc executable and libraries.

I then unpacked the 2.15.05 source and ran "make clobber all." The executable and libraries were successfully built and passed all tests.

Possibly, there were some environmental variables set on my system that interfered with my initial build.

From now on I will start a new terminal and use "make clobber all."

lcn2 commented 5 months ago

We recommend make clobber all chk as a general best practice.

Adding the chk runs the extensive calc regression test suite. The calc regression test suite had been built over the years of experience of compilers doing bad things, as well as verifying that previously fixed bugs stay fixed. It also attempts exercise as much of the code paths as possible.

Any new feature added to calc now must always include additional regression tests to exercise the new feature. So you will stay up to date on the regression test.

While the calc regression test suite takes a little bit longer to run, it gives you a much higher degree of confidence that the compiled calc will behave in a "numerically satisfying" way. 🤓

You may substitute check for chk if you like verbosity. We prefer chk because, it is much less verbose, and yet it will print any errors in context should they be discovered.

UPDATE 0

If you're trying to test/run a recently compiled calc (before it has been installed) on machines with things like shared libraries, doing a make run will only run the calc you just compiled with the shared libraries you just compiled from your current directory.

A make run will not run any previously installed calc nor previously installed calc share library. It'll also run calc with the -q option to disable anything you might have put in some calc startup file (such as your ~/.calcrc file) so you know you are running a plain vanilla just compiled calc.

The chk rule does this (running only the compiled calc in the local directory and with -q) as well.

lcn2 commented 5 months ago

Perhaps you should provide feedback to the to the Mac ports folks about trying a make clobber first?

There was a reference to a power PC problem earlier in the Mac ports issue from an earlier version of calc. That issue was fixed when we ported Calc to the IBM mainframe.

lcn2 commented 5 months ago

QUESTION

Should we close this bug, @LAP6282?

We do appreciate the report, but it sounds like you have fixed the problem. Please advise.

LAP6282 commented 5 months ago

On Tue, 02 Apr 2024 12:10:20 -0700 Landon Curt Noll @.***> wrote:

Should we close this bug? We do appreciate the report, but it sounds like you have fixed the problem. Please advise.

Yes, please close.

lcn2 commented 5 months ago

Thank you @LAP6282 and best wishes.