Re: Another computer algebra system : smib
- From: Dave <foo@xxxxxxx>
- Date: Thu, 01 Oct 2009 23:20:15 +0100
Richard Fateman wrote:
* A colleage of mine wrote some finite element software on a dual
processor linux machine. I then got a quad processor Sun, and he found
it would mis-behave. When he found the bug, he realised it was a
genuine bugs, which had simply not shown up on his machine, but did on
mine.
Certainly sometimes a bug is discovered only after a program is ported to a new environment -- a bug that existed in the old environment too, but just had not been exercised. Spending time porting a program is
worthwhile if you want the program to run on other machines. Is it the way you should spend your time if you want to learn about computer algebra programs, or if you want to debug them? I think there are better
ways of spending time.
To be honest, if code has no GUI, and I get the feeling this program is a command line tool, then it should need no porting really.
I think that using the now commercially common multiple processors is a challenge for implementers of compilers, operating systems, and indeed computer algebra systems. Getting a CAS working well on a particular (one hopes, common) multiple-processor machine would be worthwhile. Debugging it for each and every one? Unlikely to be as worthwhile.
If the code is a command line drive program (like for example the kernel), then there should be few differences between for platform A and code for platform B. If one uses portable thread libraries, then if code breaks on platform B, but not on A, I would certainly think it is worth while spending time on platform B to find the problem, as it is highly likely to be a logical error in the program.
If you are writing in assembly code, then that is a different issue. Years ago it seemed the norm to write in assembler, but I don't see much of it now. Machines have got much faster, so there is less need for it.
In the mid 1980s there were a host of multiple-processor machines, typically motorola 68020s with a shared memory bus, but also processors from MIPS. And a history of multiple-processor systems from SUN, etc. Some ran Lisp, Macsyma, Maple, etc. Also, there is a history of
research on parallel computer algebra (search on Google Scholar).
Such research does not consist of porting program X to many different implementations of multi-core machine OS/compiler/etc by diddling with compiler flags.
<snip>
... Your speculation about someone who doesn't share your view about the value/importance of porting his program to Solaris ... is that such
a programmer must be guilty of various inadequacies. Like lax testing etc.
No, it was his view that he did not have time to test it.
I don't know enough about the specifics, but disagree with your view,
and see no reason to believe this person's code is inadequately tested
if it runs really robustly on the machine for which it was programmed.
It's been my experience that people who pay attention to detail, tend to write portable code.
Anyway, to take a look at the specifics of this package, I looked at the Makefile and read:
# 2. Compile it. (For Power PC and other big endian machines,
# first add -DMAC to CFLAGS below.)
#
# $ cd smib
# $ make
Now my machine it big-endian, but I hit the problem there is no CFLAGS in the Makefile, other than in the comment.
This is however CXXFLAGS, so lets add it to there.
drkirkby@swan:[~/smib/smib-0.8/sources] $ make
/usr/local/gcc-4.4.1-sun-linker/bin/g++ -Wall -Wuninitialized -O -DLINUX -g -mfpmath=sse -msse2 -funroll-loops -DMAC -c -o madd.o madd.cpp
cc1plus: error: unrecognized command line option "-mfpmath=sse"
cc1plus: error: unrecognized command line option "-msse2"
make: *** [madd.o] Error 1
Lets go back to the makefile, and I see two lines. Lets take a guess and and see if the one without -msse2 and -DLINUX works, since this machine ie neither linux or has mme2 instructions.
CXXFLAGS = -Wall -Wuninitialized -O -DLINUX -g -mfpmath=sse -msse2 -funroll-loops -DMAC
#CXXFLAGS = -Wall -Wuninitialized -O -DLINUX -g
After 1615 warnings from the g++ 4.0.1 (GNU C++ compiler), it did build and run on Solaris.
The fact this is new code, I would not release it with over 1600 warnings messages from the compiler.
With a couple of changes:
CXXFLAGS = -O -g -DMAC -m64
smib : $(objects)
$(CXX) -m64 -o smib $(objects) -lm
I manged to build a 64-bit version with Sun's compiler, but I could not build a workable 64-bit version with the GNU compiler.
--
I respectfully request that this message is not archived by companies as
unscrupulous as 'Experts Exchange' . In case you are unaware,
'Experts Exchange' take questions posted on the web and try to find
idiots stupid enough to pay for the answers, which were posted freely
by others. They are leeches.
.
- Follow-Ups:
- Re: Another computer algebra system : smib
- From: Dave
- Re: Another computer algebra system : smib
- References:
- Re: Another computer algebra system : smib
- From: David Kirkby
- Re: Another computer algebra system : smib
- From: Richard Fateman
- Re: Another computer algebra system : smib
- Prev by Date: Re: Example 7.16 of Elementary Algorithms (simplify-trig)
- Next by Date: Re: Example 7.16 of Elementary Algorithms (simplify-trig)
- Previous by thread: Re: Another computer algebra system : smib
- Next by thread: Re: Another computer algebra system : smib
- Index(es):
Relevant Pages
|
Loading