Author Topic: Can't compile on OS/X Snow Leopard  (Read 4668 times)

0 Members and 1 Guest are viewing this topic.

Offline xjas

  • Newbie
  • Posts: 4
    • View Profile
Can't compile on OS/X Snow Leopard
« on: August 07, 2018, 03:09:37 pm »
Hey all,
I'm trying to setup the latest stable release (2018.2.28) on OS/X 10.6.8. Running the installer fails with the following error:

Code: QB64: [Select]
  1. ./setup_osx.command
  2. QB64 Setup
  3.  
  4. rm: /internal/temp/*: No such file or directory
  5. Building library 'LibQB'
  6. In file included from ../../../libqb.mm:1:
  7. ../../../libqb.cpp:103: error: integer constant is too large forlongtype
  8. ../../../libqb.cpp:103: error: integer constant is too large for ‘unsigned longtype
  9. ../../../libqb.cpp:110: error: integer constant is too large forlongtype
  10. Compilation of ./internal/c/libqb/os/osx/libqb_setup.o failed!

I have all the available updates for OS/X and Xcode 3.2 installed (the version off the SL DVD - I'm downloading 3.2.6 right now but it's taking hours over my slow internet.) GCC version i686-apple-darwin10-gcc-4.2.1 (build 5646.)

Note that this is a fully-32 bit machine (2006 Mac Mini / Core Duo.) It looks like the error is in an int64/uint64 definition routine. I'm specifically trying to set this up so I can build software with 32-bit support; none of my own code needs int64 so I'd be happy to build QB64 without it.

What's the best way to fix this?
« Last Edit: August 07, 2018, 03:20:43 pm by xjas »

FellippeHeitor

  • Guest
Re: Can't compile on OS/X Snow Leopard
« Reply #1 on: August 07, 2018, 10:43:49 pm »
Hi and welcome to the forum, xjas.

QB64 does indeed require 64bit macOS, especially considering it started supporting macOS when the version you are using had already been discontinued.

I'm far from versed in C++ and only dabble in the C++ source code of QB64 occasionally. I'm hoping Luke will be able to come back online soon and tell us if the conversion you propose would be feasible or not.

Also, although your failed compilation report only mentions 3 lines where 64bit data types are getting in the way, I highly doubt these are the only occurrences that would need to be changed, so we really should wait, with low hopes, in that case.
« Last Edit: August 07, 2018, 10:44:50 pm by FellippeHeitor »

Offline xjas

  • Newbie
  • Posts: 4
    • View Profile
Re: Can't compile on OS/X Snow Leopard
« Reply #2 on: August 07, 2018, 11:36:13 pm »
Thanks for the reply!

It does compile fine on 32-bit Linux though (Bodhi 4 on a non-PAE Pentium M) & I was able to make 32-bit executables for my game with it (just tested this today.) What does the Linux version do that the OS/X one doesn't?

FellippeHeitor

  • Guest
Re: Can't compile on OS/X Snow Leopard
« Reply #3 on: August 07, 2018, 11:50:02 pm »
Yeah, both 32 and 64bit Linux distributions can compile QB64 fine, which makes this issue even harder to grasp.

Offline xjas

  • Newbie
  • Posts: 4
    • View Profile
Re: Can't compile on OS/X Snow Leopard
« Reply #4 on: August 09, 2018, 07:34:38 am »
Okay, from what I can tell, beginning from line 101 is a routine that tries to feed a huge value into a variable that is int64, and if that fails stuffs it into an uint64 instead and sets the bit flag "qbr" (QB64 bitrate??)

I'm not great with C, and there are some lines of inline ASM in there that I understand even less. If I comment the whole part out I get a bunch of errors later about qbr being undefined.

I'm also having trouble following how the variable i is carried through, it gets ORed with a huge number (0x800000...000) at the end of the routine and returned.

Is this all just part of a clunky way to detect the platform's bit depth? Can I just replace that group of lines with "int qbr=x" to force 32-bit mode? If so, what should I set it to? It looks like it gets set to 'i|0x80000...000' but I have no idea what i was to start with so I can't figure out the result of that.

I have a vague suspicion that this is failing due to the ancient gcc (4.2.1) that installs with Xcode not handling int64/uint64, regardless of the actual CPU's bit size.

This is literally the last hitch holding back a major update to a program I wrote, with a TON of little fixes & upgrades that I really want to see the light of day. I've specifically been asked for 32-bit Mac support (actually I've also been asked for Tiger/Leopard PowerPC support, but we'll get there one step at a time :P) so I have good reason for the trouble.

Did older versions of QB64 support 32 bits on OS/X?

FellippeHeitor

  • Guest
Re: Can't compile on OS/X Snow Leopard
« Reply #5 on: August 09, 2018, 07:47:06 am »
So my suspicion that massive work would be required unfortunately proved true.

Did older versions of QB64 support 32 bits on OS/X?

As I'd told you, when QB64 was first released for macOS (OS X at the time) apple had already discontinued 32bit versions and adopted 64bit as its new standard and thus no work was ever done to get it working on older versions of the OS, especially since no one had ever indicated they needed it to work there.

The macOS user base of QB64 is scarce (I am one of those myself) but the total of people using a 32bit version of macOS and willing to use qb64 was inexistent until you showed up.

Okay, from what I can tell, beginning from line 101 is a routine that tries to feed a huge value into a variable that is int64, and if that fails stuffs it into an uint64 instead and sets the bit flag "qbr" (QB64 bitrate??)
All qbs* functions are of QB64’s internal string type. All qbr* functions are QB64’s internal rounding functions.

This is literally the last hitch holding back a major update to a program I wrote, with a TON of little fixes & upgrades that I really want to see the light of day. I've specifically been asked for 32-bit Mac support.

BTW, what other platform are you using QB64 on to develop your game in that meantime?

We'll need time, as I told you. I need the c++ guy to come  back to give us an insight. That may take a while.
« Last Edit: August 09, 2018, 07:57:59 am by FellippeHeitor »

Offline xjas

  • Newbie
  • Posts: 4
    • View Profile
Re: Can't compile on OS/X Snow Leopard
« Reply #6 on: August 09, 2018, 06:43:50 pm »
[...] the total of people using a 32bit version of macOS and willing to use qb64 was inexistent until you showed up.

Ahaha, fair enough. I'd think there'd be some more interest in compiling retro code on retro platforms, but yeah, I realize my use-case is a little obscure. :P (Just wait 'til I start asking for OS9...)

All qbs* functions are of QB64’s internal string type. All qbr* functions are QB64’s internal rounding functions.

Dammit, now I understand even less about what that routine does. I don't think I quite know what I'm doing in there, but I had to give it a go.

BTW, what other platform are you using QB64 on to develop your game in that meantime?

It's actually a DOS game written in QB4.5, and I'm using QB64 to provide native Linux & OS/X ports. Check it out here. Note that v1.3 which I'm trying to finish has a ton of minor improvements over the 1.2x binaries you can presently download. I could just roll it out for 64-bit platforms (+DOS) and add the 32-bit ones later, but I kinda wanted to drop everything at once.

Is there a way to get QB64 to save the intermediate C source it makes so I can compile it myself? Porting THAT to OS/X-32 might not be too bad, as opposed to porting the whole QB64 environment. Incidentally if I can get a 32-bit version that builds on Snow Leopard, I'm hoping that'd give me Leopard+PPC without too much trouble. The last Xcode for that platform is only a couple revisions earlier (3.1.4 instead of 3.2) and the C compiler is 4.0x rather than 4.2. I would looooove to make this game available on PowerPC.

(BTW I have some old versions of QB64 that aren't on the archive page (specifically v1000 for Linux & OS/X.) I made them available here. I might have more, will check.)
« Last Edit: August 09, 2018, 06:47:24 pm by xjas »