more iMac rambling, this time a little more OT



#33

Fusion has allowed me to install a Linux virtual machine as well, and I have discovered Ubuntu. I find that Thomas Okken's Free42 precompiled Linux binaries run beautifully--both Motif and GTK versions. Alas, I haven't been able to compile his source code myself in that OS--I am assuming I am missing in Ubuntu some key packages and libraries. I know there is nothing wrong with the source code files--I happen to have an overly complete implementation of Cygwin (i.e., more packages than I will ever use) in my XP virtual machine and Thomas's code compiles beautifully there by simply typing make or make -e BCD_MATH=1 in both gtk and motif subdirs. If anyone has any advice about compiling Thomas' source code in Ubuntu Linux 32-bit I would be grateful. Keep in mind I am a real Linux virgin, but still I would like to learn more. I have been able to compile the Free42 code in VC++ too, and it is indeed fun to tinker with some of the math algorithms. I am really liking this Ubuntu too--pretty spiffy for a free OS!

I have learned that my new iMac has an empty memory slot--the 1GB in situ. My Apple retailer has extra 1GB RAM in stock, and it is pretty cheap too! I am finding that 1GB is still a bit sluggish if I want to get good performance out of my XP virtual machine. It would be nice to have more RAM available to dedicate to the virtual machine. Unfortunately the 2GB sticks are still pretty expensive, so it will be a while before I upgrade to 3GB or 4GB.

The Free42 Mac widget is not bad, but I must say I prefer the appearance of the Windows and Linux versions.

With this new computer, I have been neglecting my new 35s!

Les


#34

I'm not familiar with Ubuntu -- I use Fedora myself and I'm too stubborn to change, the hype be damned. ;-) However, if you send me the output from make I might still be able to figure out which packages are missing, though I wouldn't be able to tell you their exact names. The smart money is on missing development libraries and headers, though (in Fedora, those are typically recognizable by package names including the word devel) -- from what I recall of the few occasions I played with Ubuntu's Live CDs, development stuff is not part of the basic Ubuntu install.

The Free42 MacOS widget is missing some event handling code, which causes running programs on it to fail. Unfortunately, Jeff Dionne hasn't gotten around to fixing this yet, and I don't have a Mac so I can't do it either. Just so you know -- if you plan on running programs in Free42 on the Mac, I'd recommend compiling the Unix version for MacOS; it will run as an X client on the Mac desktop. If I remember correctly, it takes a little configuration twiddling to get the X server going (I don't think it is run by default), and to run the build, you'll need the Mac versions of gcc etc., available for free at developer.apple.com; you may want to read this document about porting Unix applications to MacOS to get the big picture before you dive in.

- Thomas


#35

Thomas, I do have gcc in Ubuntu (needed it to configure VMware Tools), and it effectively compiles simple text based C programs, but when I get into anything graphical the compiler error output is inscrutable to me.

I know that Cygwin is not a real Linux, and that programs compiled there won't run on true Linuxes, but I have liked it since the distribution includes an absurd number of packages, so I just decided to install them all to be sure I have what I need. Maybe one day I will just spend the money for Red Hat, which seems expensive. I am having a heck of a time wrapping my brain around this--I thought many good Linuxes were free, but save Ubuntu and a basic version of Mandriva I am not having much luck here!

many thanks,

Les
iMac 2.4GHz Intel w/1GB RAM


#36

I've used both SUSE and RedHat in the past - but I think that their support for the free versions of Linux they provide has waned somewhat from the early years. They are putting more effort and resources into the versions that they sell to corporations - their "enterprise" versions. Who can blame them, I guess...

Ubuntu was founded by an "internet millionaire" - who, I think, has already made is fortune and, it seems, is starting to capture a little more of the spirit that linux started with. I've just gotten the latest Ubuntu CD but have not installed it yet. I couldn't believe that they don't even charge for shipping! That's not right - you know that they have mailing costs...

BTW, I have bootcamp on a Mac Pro laptop (you boot either windows XP or Mac - but not both at the same time). It is free from Apple and works great - very impressive piece of software.

#37

Hi Les,

Quote:
Thomas, I do have gcc in Ubuntu (needed it to configure VMware Tools), and it effectively compiles simple text based C programs, but when I get into anything graphical the compiler error output is inscrutable to me.

...but maybe not to me. Hey, I'm a pro. ;-) Feel free to capture the output in a text file and email it to me. Be sure to do it like this:

    make -e BCD_MATH=1 2>&1 | tee logfile.txt

so you really will capture everything (standard output and standard error). The important bit is the 2>&1, which merges the standard error stream (file descriptor 2) into the standard output stream (file descriptor 1). Welcome to the Unix command line! :-)

Re: Favorite Linux flavor: I use Fedora, which is Red Hat's free offering, and I believe they also use it as a test bed for their commercial distro, which means it tends to be bleeding-edge. I find it very developer-friendly. Newbies may find it less appealing, though. Anyway, like I said it is free; I just download the ISOs from one of the many mirrors every blue moon and burn my own CDs.

- Thomas


Edited: 14 Aug 2007, 3:23 p.m.

#38

You'll need GTK+, possibly Motif/Lesstif to compile Free42.

Navigate to System > Administration > Synaptic Package Manager. Look for GTK+ and install it, then try to build.


#39

In cygwin I find I like the GTK version better over the Motif, so I will look for that package tonight.

I decided to remove the Ubuntu virtual machine (for an unrelated reason) so I will need to reinstall it. I have both the 32-bit and 64-bit ISOs. Fusion will let me install both. I assume Free42 needs the 32-bit.

FWIW, the thing I like about Ubuntu is that the VMware tools permit seamless movement between it and the Mac OS. However, installing VMware tools in Ubuntu is a chore, though I did find one link that was spot on.

Kelly, if you have any luck compiling Free42 in your implementation of Ubuntu I would be glad to know it can be done.

Les


#40

Quote:
I assume Free42 needs the 32-bit.

I have compiled it successfully on an AMD x86-64 machine running Fedora 6, so I guess in principle you should be able to get it to work under 64-bit Ubuntu as well. If it doesn't work, you can always tell the compiler to generate 32-bit code; that code will also execute on a 64-bit machine. I'd say don't bother with the 32-bit OS unless you specifically need it for something.

- Thomas


#41

Thanks Thomas!

I will do that, then.

When I get home tonight I will install the 64 bit version, try to add those packages like Kelly suggested, and see if I have any luck

The good thing about setting up a virtual machine in Fusion is that if I muck it up one just goes into the virtual machine folder on the Mac and delete the package in question. This is one thing I am liking about the Mac--it doesn't seem to splash system files all over the place in mysterious ways and things are easy to find to take off. Not so in windows--you often can't tell from file names what a DLL or EXE is for!

I have found that your precompiled Free42 Linux binaries run beautifully in Ubuntu, so I don't want to get fancy yet trying to do a Unix build for Mac OS. Maybe some day.

Fedora core is a huge download, BTW!

Les


#42

Kelly's probably right; Free42 doesn't have any external dependencies other than GTK and Motif/Lesstif, so as long as the development packages for those toolkits are installed, you should be OK. Building the Motif version can require some Makefile twiddling because the exact set of libraries to be linked differs between the many Unix and X11 versions, but building the GTK version should cause no such problems.


Quote:
Fedora core is a huge download, BTW!

Yes, unless you have a decent broadband connection, you're probably better off buying their CDs -- the download page for which I gave you the link earlier also has links to companies that sell Fedora CDs at a reasonable price. If you *do* have a good DSL or cable connection, you can grab the ISOs and install from them into a VM without even burning any CDs.

- Thomas

#43

Quote:
one thing I am liking about the Mac--it doesn't seem to splash system files all over the place in mysterious ways and things are easy to find to take off. Not so in windows--you often can't tell from file names what a DLL or EXE is for!

True; the Macintosh Way has been, right from the first, that applications (and all their baggage) get installed in their own directories, while the System Folder was basically off-limits to anyone except Apple.

Even though I have had a major soft spot for Apple for a long time (i.e., since I bought my first Macintosh back in 1984), I'm not going to give Apple too much credit for this MacOS "tidiness" aspect, though. One of the main things that tends to make Windows (and to a lesser extent, also Unix) such a mess, is how applications are built using libraries, which in turn are potentially shared between several apps. MacOS is a latecomer to the whole notion of shared libraries... Once you start thinking about how to manage software installs/upgrades/uninstalls in a shared-library environment, you'll realize how very hard it is to get that right. Longtime Linux users can sing you sad, sad songs about failed attempts to upgrade their systems because of inter-package dependencies... Bottom line: Linux tries to cope but doesn't do so very well; Windows leaves the coping to third-party installers so Microsoft can always deflect the blame when things get messed up; and MacOS simply doesn't deal with the issue at all.
Now that personal computers all have hundreds of megabytes of RAM, and many gigabytes of disk storage, and ridiculously fast CPUs, the whole notion of shared libraries actually starts to feel like a bit of an anachronism -- it solves a problem that isn't really a problem any more, and it introduces problems that no one has yet figured out how to solve.

My apologies to everybody for this 100% off-topic post. I will cease and desist on this thread, unless someone re-introduces the HP Calculator topic somehow. :-)

- Thomas

#44

I actually don't have Ubuntu currently installed, but this thread has inspired me to load it up in Bootcamp. Burning the image as I type. I'll let you know if I have any luck, Les.

Edit: Yeah, just needed gtk+ to build. The package name for the gtk headers under the Synaptic package manager is libgtk2.0-dev.


Edited: 14 Aug 2007, 8:38 p.m. after one or more responses were posted


#45

i downloaded the 64-bit ubuntu version 7.04 (feisty fawn--what a name!) from their website last night and created an os image using vmware fusion. i had quite the time getting the vmtools to install and i got a couple of error messages along the way, but i think perhaps the vmtools don't completely support 64-bit. i'm just happy the tools worked at all--vmware is the first emulator that i've run that has supported such niceties for any non-windows os.

i used to run a redhat server 24/7 and hosted my website on it until mac os x with its unix underpinnings arrived, so i no longer have to depend so much on a separate linux distro.

in any case, ubuntu runs great under vmware. i also have parallels and both virtualization products have their pros and cons, which is why i run both.

i have a 64-bit version of win xp coming from newegg (hopefully) this afternoon and i'm going to use it as my bootcamp os. i understand some 64-bit drivers are missing, but from the research i've done so far they are mostly minor--for laptop support and things like the brightness keys on the keyboard.

/guy


#46

I've run the 64 bit version of SUSE Linux and found that it was really more trouble than it was worth. I didn't really see any performance improvement and while 99% of 32 bit software works just fine with the 64 bit linux there were just a very few compatibility issues that I ran into that made life difficult. I eventually went back to 32 bit linux.

I've heard of a lot of 64 bit driver issues with windows... you might consider 32 bit...

but if you do 64 bit linux and windows... let us know how it goes. Good Luck... ;-)


#47

kevin: i could have just used your conclusion and saved myself about 14 hours of pain and frustration!

my bootcamp install of 64-bit xp pro was a very mixed bag indeed. i used the bootcamp assistant to burn a driver cd and partition off 20gb of my startup drive for windows. i then inserted my xp pro cd and told the assistant to install.

it booted into windows and started the setup process which took maybe 45 minutes. but once a last restart brought up the familiar windows desktop the problems started.

first problem was noticed when i inserted the windows drivers from apple on the cd the assistant had helped me burn. it said that it would only work on xp or vista 32-bit with sp2. i checked my system panel and, sure enough, my xp pro install was only showing as having sp1 installed in spite of the fact that newegg sold this as an sp2 version. i just got off the phone with them and they are allowing me to exchange my disk for one with sp2.

silly me, i thought it would be as easy as just downloading and installing the sp2 upgrade after tracking the 64-bit version down on the labyrith microsoft site, but no, even after that was accomplished, i was still unable to install the apple drivers.

well, most of you know the drill i went through then. took nearly 6 hours because i had no network on the windows install so i had to boot back and forth from mac to pc in order to make a slipstream cd. and roxio toast on the mac would not create a bootable cd, so i had to get a free windows utility to finalize the cd as bootable. luckily i had a parallels vm image of xp so i was able to do most of the slipstream work on it or i would have had to boot back and forth quite a few times. also very helpful was that i had formatted the windows partition as fat32 so my mac could see the files.

but even after i did all that the drivers would not install automatically or manually. without networking it's not a fun experience hunting down drivers. back on my mac i searched forums for solutions but not a single driver i downloaded from intel and other places would work.

bottom line is that the 64-bit xp pro installs, boots and runs fine. but the 64-bit drivers needed are not to be found on a semi-casual search and without network and graphics drivers you might as well not bother.

so i'm going to put my tail between my legs and install a 32-bit version of windows and save the 64-bit for when vista forces more 64-bit driver development.

/guy

#48

guy, this link made everything very clear for the 32-bit installation. I assume the 64-bit install will allow similar installation of vmware tools? haven't tried....

thanks guys so much for developing this thread, even though it is a bit peripheral to the mandate of the Forum. I have learned tons that will save me hours of head scratching, and banging!

Les

Edited: 14 Aug 2007, 9:58 p.m.


#49

wow, great link wes! i sure wish i had that before i installed.

yeah, it took me awhile to realize that i would have to manually ungzip and compile/make on the vmtools, so i fumbled around there until i hit on the formula.

anyone wanting to install 64-bit ubuntu needs to print off the instructions at that link.

thanks,

/guy

#50

Thanks Kelly.

I got the libgtk2.0-dev package + dependencies, installed (actually, the synaptic package manager did it for me), and Thomas' gtk version compiles beautifully, both binary and BCD versions.

Not so lucky with the Motif version. I got libmotif-dev and its dependencies, but still wild errors on attempted compilation. No luck when I try lesstif as well.

I do indeed like the gtk version better, but it is the principle of the thing. If Ubuntu is a reasonably functioning Linux, albeit free, it should be no hardship to find and install the right packages to compile the Motif version too.

If you have any luck let me know!

Les

p.s. I opted for the 64 bit version of Ubuntu. Could that explain it?

Edited: 15 Aug 2007, 2:38 a.m.


#51

Here is the output of make -e BCD_MATH=1 in the Motif directory:


ln -s ../common/free42.h
ln -s ../common/core_commands1.cc
ln -s ../common/core_commands1.h
ln -s ../common/core_commands2.cc
ln -s ../common/core_commands2.h
ln -s ../common/core_commands3.cc
ln -s ../common/core_commands3.h
ln -s ../common/core_commands4.cc
ln -s ../common/core_commands4.h
ln -s ../common/core_commands5.cc
ln -s ../common/core_commands5.h
ln -s ../common/core_commands6.cc
ln -s ../common/core_commands6.h
ln -s ../common/core_display.cc
ln -s ../common/core_display.h
ln -s ../common/core_globals.cc
ln -s ../common/core_globals.h
ln -s ../common/core_helpers.cc
ln -s ../common/core_helpers.h
ln -s ../common/core_keydown.cc
ln -s ../common/core_keydown.h
ln -s ../common/core_linalg1.cc
ln -s ../common/core_linalg1.h
ln -s ../common/core_linalg2.cc
ln -s ../common/core_linalg2.h
ln -s ../common/core_math1.cc
ln -s ../common/core_math1.h
ln -s ../common/core_math2.cc
ln -s ../common/core_math2.h
ln -s ../common/core_main.cc
ln -s ../common/core_main.h
ln -s ../common/core_phloat.cc
ln -s ../common/core_phloat.h
ln -s ../common/core_sto_rcl.cc
ln -s ../common/core_sto_rcl.h
ln -s ../common/core_tables.cc
ln -s ../common/core_tables.h
ln -s ../common/core_variables.cc
ln -s ../common/core_variables.h
ln -s ../common/shell.h
ln -s ../common/shell_loadimage.cc
ln -s ../common/shell_loadimage.h
ln -s ../common/shell_spool.cc
ln -s ../common/shell_spool.h
ln -s ../common/skin2cc.cc
ln -s ../common/skin2cc.conf
ln -s ../common/keymap2cc.cc
ln -s ../common/bcd.cc
ln -s ../common/bcd.h
ln -s ../common/bcdfloat.cc
ln -s ../common/bcdfloat.h
ln -s ../common/bcdmath.cc
ln -s ../common/bcdmath.h
touch symlinks
g++ -MMD -Wall -g -I/usr/X11R6/include -fno-exceptions -fno-rtti -DVERSION="\"1.4.36\"" -DBCD_MATH -c -o shell_main.o shell_main.cc
shell_main.cc:36:29: warning: X11/Xmu/Editres.h: No such file or directory
shell_main.cc:37:1: warning: "XK_MISCELLANY" redefined
In file included from /usr/include/X11/Xutil.h:56,
from /usr/include/X11/Intrinsic.h:57,
from /usr/include/Xm/Xm.h:56,
from shell_main.cc:19:
/usr/include/X11/keysym.h:52:1: warning: this is the location of the previous definition
shell_main.cc:39:21: warning: X11/xpm.h: No such file or directory
shell_main.cc: In function \u2018int main(int, char**)\u2019:
shell_main.cc:506: error: \u2018XpmCreatePixmapFromData\u2019 was not declared in this scope
shell_main.cc:538: error: \u2018_XEditResCheckMessages\u2019 was not declared in this scope
shell_main.cc: In function \u2018void selProgButtonCB(_WidgetRec*, void*, void*)\u2019:
shell_main.cc:1851: error: cast from \u2018void*\u2019 to \u2018int\u2019 loses precision
shell_main.cc: In function \u2018void prefsButtonCB(_WidgetRec*, void*, void*)\u2019:
shell_main.cc:2272: error: cast from \u2018void*\u2019 to \u2018int\u2019 loses precision
make: *** [shell_main.o] Error 1

Thomas, I am suspecting that the compiler is not finding the desired X11 headers where it wants them. My Ubuntu Linux is missing some key ingredient here?

Les


#52

Les, I run Centos 5, rather than Ubuntu or Fedora, for reasons that aren't important here. The two missing header files your compiler is complaining about are installed from libXmu-devel-1.0.2-5 and libXpm-devel-3.5.5-3 (on RH/Fedora/Centos-style distributions, the -devel RPM packages contain the header files and libraries nevessary to compile applications that use that subsystem).

You should look for similarly-named packages on Ubuntu and use Synaptic or apt-get to install them, and then you should be able to build Free42 successfully.

Best,

--- Les

[http://www.lesbell.com.au]

[Lots of Linux articles on my site, btw]


#53

I have alas installed all these by now and even though the header files are found the errors regarding the loss of precision typecasting error persist and the build still stops early.

weird.

Les


#54

Quote:
the errors regarding the loss of precision typecasting error persist and the build still stops early

Oops, I forgot to discuss those in my previous reply.


Those errors require changing int to long in shell_main.cc, lines 1851 and 2272 -- 4 changes in total. The reason: in the 64-bit world, pointers are 8 bytes, but int apparently is still 4 bytes, so casting a pointer to an int causes 4 bytes to be chopped off. On 32-bit systems, the size of an int is usually the same as the size of a pointer, which is why I have been getting away with those casts until now.


I'm a bit surprised that gcc considers this loss of precision an error and not a warning (and, for what it's worth, this particular code would still work, despite the loss of precision, because those pointers I'm casting to ints actually happen to contain ints (see shell_main.cc, lines 1568, 1579, 2143, 2201, 2254, and 2265)).

Anyway, try making those changes in lines 1851 and 2272 and let me know how it goes; if it works, then I'll change the code so it automagically uses long instead of int on 64-bit systems.

- Thomas

Edited: 15 Aug 2007, 2:48 p.m. after one or more responses were posted


#55

Thomas,

I won't get to test this until I get home tonight, but I will try the fix and get back to you.

Alternately, I will also set up 32-bit Ubuntu as a virtual machine to see if the errors turn up there.

As I mentioned before, in finding and installing the recommended packages the failure to find those headers has resolved.

Could it be that if I "fix" this code for 64-bit and shell_main.cc compiles similiar stoppages would occur when the compiler moves on to other source files? If I lot of this happens it may be wise for me just to make 32-bit Ubuntu my choice.

I spent a few hours funding downloading and installing the various packages in 64-bit. Knowing where to look will save me time in 32-bit.

Les

P.S. As far as a free OS and programming environment go, I really like Ubuntu so far. I liked Cygwin too when I have played with it, but now being able to compile "real" Linux programs makes me feel like a slightly more accomplished amateur.

P.P.S Did I mention recently how much I love this computer? :)

Edited: 15 Aug 2007, 12:17 p.m.

#56

Thomas, is there perhaps a compiler directive or instruction or option that will generate only a warning here rather than an error? That would save you having to fix code that really isn't broken. Only the makefile would need to be a little different.

Les


#57

I'm not aware of any gcc option that turns the "loss of precision" error into a warning. It is possible that there may be more of those errors lurking in files other than motif/shell_main.cc, but since you mentioned being able to build the GTK version, any problems would be limited to the source files in the motif subdirectory. I can't think of any reason why I would have used pointer/int casting anywhere in the Motif shell apart from the two places you stumbled into (I just took a quick look at the code and I couldn't find any); the only other place that springs to mind where I do tricky stuff with pointers is in the code that reads and writes the state file -- so if your GTK build starts and exits without crashing, and remembers programs and all variable types correctly, everything should be fine.

Generally speaking, you shouldn't have any need to keep a 32-bit image around if the 64-bit OS is working fine for you; even if you try to compile a program that has tons of 64-bit incompatibilities, you can always tell gcc to generate 32-bit code (using the -m32 switch). That should work for Free42, too, if all else fails.

Just out of curiosity, I tried compiling on one of the 64-bit machines at work (Intel Xeon), and interestingly enough, the compiler only issued *warnings* for those two pointer-to-int casts (and only those two; there were no other warnings, although the link failed due to Motif/Lesstif not being present). This machine runs CentOS 4.5; obviously gcc is configured a bit differently under Ubuntu. For what it's worth, g++ --version returns "g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8)".

- Thomas

Edited: 15 Aug 2007, 1:17 p.m.


#58

Quote:
I'm not aware of any gcc option that turns the "loss of precision" error into a warning. It is possible that there may be more of those errors lurking in files other than motif/shell_main.cc, but since you mentioned being able to build the GTK version, any problems would be limited to the source files in the motif subdirectory. I can't think of any reason why I would have used pointer/int casting anywhere in the Motif shell apart from even if you try to compile a program that has tons of 64-bit incompatibilities, you can always tell gcc to generate 32-bit code (using the -m32 switch). That should work for Free42, too, if all else fails.

That could be worth trying too!

I suppose that one would simply adjust the Makefile so that calls to gcc or g++ include the -m32 switch?

Les


#59

Quote:
I suppose that one would simply adjust the Makefile so that calls to gcc or g++ include the -m32 switch?

Yes, just add it to CXXFLAGS.


I'm curious how much of a speed difference there would be between the 32-bit and 64-bit versions. Free42 only uses 8-byte integers in a small number of places (mainly for binary functions, i.e. the BASE menu), but if the compiler is smart enough to use the wider data path to speed up struct and array copy operations, there could be some benefit. And of course I know you're just chomping at the bit to write your first 2,147,483,648-byte program. ;-)

- Thomas


#60

It gets weirder!

I added the -m32 switch. The good news is that *.o compilation is successful.

When the linker is invoked, there are a bunch of warnings from /user/bin/ld advising that the " i386 architecture of input file `shell_main.o' is incompatible with i386:x86-64 output". I think this is okay--the compiler tells us we are making a 32-bit program in a 64-bit environment, right?

But this is where we hit errors:

core_commands2.o: In function `generic_loop_helper':
/home/shrinkie1964/free42/motif/core_commands2.cc:543: undefined reference to `__divdi3'
core_commands5.o: In function `docmd_basediv(arg_struct*)':
/home/shrinkie1964/free42/motif/core_commands5.cc:203: undefined reference to `__divdi3'
bcdfloat.o: In function `BCDFloat':
/home/shrinkie1964/free42/motif/bcdfloat.cc:245: undefined reference to `__moddi3'
/home/shrinkie1964/free42/motif/bcdfloat.cc:247: undefined reference to `__divdi3'
/home/shrinkie1964/free42/motif/bcdfloat.cc:245: undefined reference to `__moddi3'
/home/shrinkie1964/free42/motif/bcdfloat.cc:247: undefined reference to `__divdi3'
collect2: ld returned 1 exit status
make: *** [free42dec] Error 1

Now this tells my tiny mind that there is some library dealing with modular arithmetic and integer division that it just can't find!

Funnily enough, when I add the -m32 directive to the gtk makefile, I get similiar undefined reference errors, only a lot more of them.

My next step is to change the Makefiles back and and try your original advice of changing those int declarations to long. I will report back!

Les


#61

Quote:

Funnily enough, when I add the -m32 directive to the gtk makefile, I get similiar undefined reference errors, only a lot more of them.


Actually the difference is between the binary and decimal builds, not gtk and motif this time. The binary builds generate a boatload of undefined reference errors to _divdi3 and moddi3, BCD build only a handful.

The diagnostics is interesting, eh?

Les


#62

Thomas, I went with your original fix.

Those four "int"s are changed to "long"s, and both binary and decimal motif versions compile beautifully.

I still like the gtk interface better, but I am grateful this could even be done!

Les

#63

It sounds like it's trying to link your 32-bit *.o files to 64-bit libraries. The _divdi3 and _moddi3 are extended-precision integer functions, I'm guessing to do division and remainder on 64-bit integers -- operations that the 64-bit C library won't have since 64-bit CPUs have built-in functions for those.

I'm at home right now, meaning firmly in the 32-bit world :-D so I can only give generic (read: vague) advice on what needs to be done next. First, make sure you have 32-bit versions of all required libraries (I don't know about Ubuntu's filesystem layout, but IIRC, in Fedora the 64-bit libs are under /usr/lib64 and the 32-bit libs are under /usr/lib. Also, you may have to tell the linker to *use* those libraries in preference to the 64-bit ones; whether there is a switch for that (I don't think ld recognizes -m32, but maybe there's something else) or you need to use a -L switch to force it to look in /usr/lib, I don't know.

Good thing this is academic, I guess. I'll change shell_main.cc so those two troublesome lines automatically use long instead of int when sizeof(int) < sizeof(void*). I'll update the source package on my web page shortly.

UPDATE: It's done; the revised code now casts to a long, *then* casts to an int. The loss of precision is not a problem as long as it happens while casting between integer types. I updated the Free42 source package and the project history; I didn't release any new binary packages since this code change doesn't affect any of the existing release builds.

- Thomas

Edited: 15 Aug 2007, 9:53 p.m.

#64

Quote:
Thomas, I am suspecting that the compiler is not finding the desired X11 headers where it wants them. My Ubuntu Linux is missing some key ingredient here?

Yes, that's what it looks like. The warning about XK_MISCELLANY being redefined is interesting but probably harmless; what's also noteworthy is that it indicates that at least *some* of the headers *are* found, but in a different location than specified by the -I directive; in the Makefile, CXXFLAGS has -I/usr/X11R6/include, but the compiler indicates that it has found X11/Xutil.h, X11/Intrinsic.h, Xm/Xm.h, and X11/keysym.h under /usr/include.

It looks like, the X headers no longer live under /usr/X11R6/include, and that some of them have been moved to /usr/include (which is automatically searched by the compiler and does not need to be explicitly specified using a -I option)... But not everything was moved there; the compiler is issuing a warning that it can't find X11/Xmu/Editres.h, which causes the error message about _XEditResCheckMessages later on; also, it is issuing a warning that it can't find X11/xpm.h, which causes the error message about XpmCreatePixmapFromData.

You could try searching for Editres.h and xpm.h:

    find / -name Editres.h -o -name xpm.h -print 2> /dev/null

...it will take a while, but if they exist, this will find them. The 2> /dev/null bit suppresses the zillions of error messages that find will print whenever it tries to recurse into directories for which you do not have read permissions.

If Editres.h and xpm.h are found, you should change the -I option in the makefile to point to the directory they're in, or, to be precise, to the directory that contains X11/Xmu/Editres.h and X11/xpm.h. Note that you can use multiple -I options, if necessary.

If Editres.h and/or xpm.h are not found, you're missing some X11 development packages; I don't know how Ubuntu's X11 packages are structured, but you're probably looking for something called "Miscellaneous Utilities" (containing Editres.h and the libXmu library) and "XPM" (containing xpm.h and the libXpm library). If in doubt, just install everything with X11 or XFree86 or Xorg in its name, and if that still doesn't work, Kelly or some Ubuntu expert should be able to answer these questions easily (Usenet Is Your Friend). :-)

UPDATE: Looks like the packages you need are libxmu-dev and libxpm-dev -- Google "Ubuntu libXmu" and "Ubuntu libXpm" and the first hit in each case is the relevant page at packages.ubuntu.com.

Hope this helps!

- Thomas

Edited: 15 Aug 2007, 7:48 a.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  [HP Prime]How to get Discrete-Time Fourier Transform uklo 0 222 11-18-2013, 08:02 PM
Last Post: uklo
  Date/time formats R. Pienne 4 311 11-01-2013, 12:43 PM
Last Post: Marcus von Cube, Germany
  How to set the Date.Time etc on a WP34S Harold A Climer 4 289 10-29-2013, 09:32 PM
Last Post: FORTIN Pascal
  Prime: Exam mode (possible duplicate after funny response first time) Paul Townsend (UK) 1 174 10-24-2013, 03:09 PM
Last Post: Tim Wessman
  Date/time programs for the HP 35s R. Pienne 0 133 10-03-2013, 02:37 PM
Last Post: R. Pienne
  Nothing like passing the time away... Eddie W. Shore 2 166 03-21-2013, 08:23 AM
Last Post: Eddie W. Shore
  New compile-time options for WP-34S Nigel J Dowrick 15 635 01-29-2013, 03:25 PM
Last Post: Stephan
  Date & Time disappear on WP 34S René Franquinet 16 712 12-10-2012, 08:24 AM
Last Post: Walter B
  In time for HHC 2012 ... Walter B 4 267 09-09-2012, 05:30 AM
Last Post: fhub
  Any informal HHC2012 time set aside for WP34S??? Namir 8 371 09-07-2012, 09:26 AM
Last Post: Eddie W. Shore

Forum Jump: