Opened 2 years ago

Closed 18 months ago

#65484 closed enhancement (fixed)

sbcl fails to build on PPC: add support for PPC

Reported by: acjones8 (Alex Jones) Owned by: KubaO (Kuba Ober)
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: powerpc ppc leopard haspatch Cc: easye, kakuhen
Port: sbcl

Description

Hello! I've used Maxima for quite a long time on other platforms, but I noticed that it's currently impossible to build the port on a PowerPC version of OSX. The issue is that SBCL doesn't support PowerPC for Macs and hasn't for a very long time, and ABCL relies on Java, of which a modern version currently isn't available for PowerPC either.

However, I noticed that there's a clisp variant in the Portfile, originally intended for non-darwin systems it seems. On a whim, I removed the check for a non-darwin system and built the +clisp variant on my PowerBook running 10.5, and surprisingly that worked fine - it compiled without errors and I have yet to see any issues crop up in my usage so far.

I've attached my patch. It exposes the clisp variant for all users, and then adds it as the default for PowerPC OS X and the non-darwin, non-i386 users it was originally meant for. My thinking is that the only changes this will make is allowing PowerPC OS X users to have it compile successfully by default, and it adds another option for regular x86 or ARM users if they want to use clisp for any reason.

I don't have much experience writing patches for MacPorts, so I welcome any guidance on if I'm doing this correctly. I also only have my PowerBook to test on, so while I don't think this should introduce any problems on modern Macs (if I correctly understand how variants work and how they're being applied), it would be helpful if someone could confirm that.

Attachments (3)

maxima_enable_powerpc.diff (1.2 KB) - added by acjones8 (Alex Jones) 2 years ago.
Patch to Enable Clisp Backend
Portfile (2.6 KB) - added by kakuhen 2 years ago.
Experimental Portfile for building SBCL on PPC
sbcl222_10.5.8.log (87.9 KB) - added by barracuda156 2 years ago.
And same error on 10.5.8

Download all attachments as: .zip

Change History (20)

Changed 2 years ago by acjones8 (Alex Jones)

Attachment: maxima_enable_powerpc.diff added

Patch to Enable Clisp Backend

comment:1 Changed 2 years ago by acjones8 (Alex Jones)

Cc: acjones8 added

comment:2 Changed 2 years ago by tomio-arisaka (Tomio Arisaka)

I have installed CCL-1.4, ECL-21.2.1, and SBCL-2.0.9 on PPC-Tiger.

If you are interested in SBCL-2.0.9, see here: comment:ticket:65188:19

Last edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: acjones8 removed
Keywords: maxima removed
Port: sbcl added
Summary: Add Support for PowerPCsbcl: add support for PPC

comment:4 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: easye added
Keywords: haspatch added
Owner: set to KubaO
Status: newassigned

comment:5 in reply to:  2 Changed 2 years ago by acjones8 (Alex Jones)

Replying to tomio-arisaka:

I have installed CCL-1.4, ECL-21.2.1, and SBCL-2.0.9 on PPC-Tiger.

If you are interested in SBCL-2.0.9, see here: comment:ticket:65188:19

Thanks! I overlooked this ticket. I tried out your portfiles and they worked perfectly, Maxima compiles and is functional with SBCL 2.0.9. As long as there's a working version of SBCL for PPC that Maxima is functional with, it probably makes more sense to leave it as the default then, given its considerable performance advantages.

That said, CLISP would make for a nice backup option should we have difficulties getting newer of SBCL to work in the future, so there might still be some value in keeping the part of the patch that offers it as a global variant instead of restricting it to the non-darwin, non-i386 usecase.

Last edited 2 years ago by acjones8 (Alex Jones) (previous) (diff)

comment:6 Changed 2 years ago by kakuhen

Note that you can get CCL-1.7 running on PPC64. The latest SVN revision that supports PowerPC Macintosh is 14469. According to rme himself, there also exists a full release of 1.7 for PowerPC, but I was unable to find it. Obtaining revision 14469 of CCL's trunk can be done by accessing their Trac page, going to that revision, then scrolling down to "Download Archive."

As for ABCL, you can bootstrap a headless openjdk8u60 from https://github.com/nilsvanvelzen/mac_ppc_openjdk8u60. This allows me to run the latest Clojure on my PowerMac G5. It may also allow you to run an old copy of ABCL.

I also managed to compile SBCL 2.2.2 using SBCL 1.0.47 and patching a file to cope with the lack of CLOCK_MONOTONIC in clock_gettime().

All of these was done outside of a MacPorts build environment, except for Clojure. But I am leaving this comment to denote what is possible to do. I am running OS X 10.5.8.

Last edited 2 years ago by kakuhen (previous) (diff)

comment:7 Changed 2 years ago by kakuhen

Cc: kakuhen added

comment:8 in reply to:  6 ; Changed 2 years ago by tomio-arisaka (Tomio Arisaka)

Replying to kakuhen:

Note that you can get CCL-1.7 running on PPC64. The latest SVN revision that supports PowerPC Macintosh is 14469. According to rme himself, there also exists a full release of 1.7 for PowerPC, but I was unable to find it. Obtaining revision 14469 of CCL's trunk can be done by accessing their Trac page, going to that revision, then scrolling down to "Download Archive."

I don't think this is an important info, but:)

  • Support for PPC-macOS has been removed since CCL-1.7.

https://web.archive.org/web/20110721110920/http://trac.clozure.com/ccl/wiki/ReleaseNotes/1.7

  • The revision 14469 of CCL is included in CCL-1.6. It is a bootstrap of CCL-1.6.

https://trac.clozure.com/ccl/wiki

Anyway, I think CCL has nice features for PPC-macOS. (e.g. IDE, support for Cocoa and Threads)

Last edited 2 years ago by tomio-arisaka (Tomio Arisaka) (previous) (diff)

comment:9 Changed 2 years ago by kakuhen

My copy of CCL reports the version "1.7-dev." Maybe I am not remembering the correct revision. But this the latest version I was able to compile on DarwinPPC64.

With that said, CCL 1.7-dev does not seem able to compile SBCL 2.2.2. Moreover, other lisps (such as the latest version of ECL), seems to introduce a bug into SBCL that messes with GET-INTERNAL-RUN-TIME.

With that said, I was able to compile SBCL 2.2.2 using 1.0.47 on Mac OS X Leopard. It does not seem to work on Mac OS X Tiger, based on the discussion above. So on Darwin 9 (ppc), it may be easiest to start the compilation process with SBCL 1.0.47. I will try to make a minimal Portfile to build SBCL 2.2.2 in this manner soon and report results.

comment:10 Changed 2 years ago by kakuhen

I attempted to build SBCL 2.2.2 from SBCL 1.0.47 within a Portfile. Here are my observations.

unhandled SIMPLE-ERROR: make-host-1 stopped due to unexpected STYLE-WARNING.

Enabling the debugger will stop the error from happening, but MacPorts does not offer a way to interactively select a restart, or programmatically select a restart. The problematic code comes from src/code/class.lisp L1285-1358. The STYLE-WARNING is signalled with message "IGNORABLE declaration for an unknown variable: TRANS-P."

Note: My own copy of SBCL 2.2.2 does not signal the STYLE-WARNING when compiling SBCL. This is properly an SBCL 1.0.47 issue.

Another note: my non-MacPorts SBCL 2.2.2 build succeeded because I was compiling SBCL without the --fancy argument. This explains why I did not run into issues with threads. More concretely, here are the entries in *FEATURES*.

(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-MACOSX 
 :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :PPC :GENCGC :ANSI-CL 
 :BIG-ENDIAN :BSD :COMMON-LISP :DARWIN :IEEE-FLOATING-POINT :MACH-O 
 :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SBCL
 :UNIX)

With that said, I have uploaded a Portfile that I am experimenting with. Everything is done on Mac OS X 10.5.8.

Changed 2 years ago by kakuhen

Attachment: Portfile added

Experimental Portfile for building SBCL on PPC

comment:11 in reply to:  10 Changed 2 years ago by barracuda156

Replying to kakuhen:

Sorry, been away from PPC hardware until now, gonna return to this soon. Thank you for the portfile, it is perhaps a better solution that what I had in May, where I used an extra port to bootstrap SBCL first.

By the way, threads are still broken, right? There was [at least] one part in PPC assembler which lacked Darwin version.

comment:12 in reply to:  10 Changed 2 years ago by barracuda156

Replying to kakuhen:

I attempted to build SBCL 2.2.2 from SBCL 1.0.47 within a Portfile. Here are my observations.

unhandled SIMPLE-ERROR: make-host-1 stopped due to unexpected STYLE-WARNING.

Failing with the same error on 10.6 PPC (tried building from your portfile).

Changed 2 years ago by barracuda156

Attachment: sbcl222_10.5.8.log added

And same error on 10.5.8

comment:13 Changed 2 years ago by kakuhen

You can select the "CONTINUE" restart when that appears. Unfortunately, MacPorts is non-interactive and it is not possible to do so in a Portfile. I forgot how I restarted from this error, sorry. But you should be able to build locally anyway (or in any environment that lets you select a restart).

comment:14 in reply to:  8 Changed 22 months ago by barracuda156

Replying to tomio-arisaka:

Replying to kakuhen:

Note that you can get CCL-1.7 running on PPC64. The latest SVN revision that supports PowerPC Macintosh is 14469. According to rme himself, there also exists a full release of 1.7 for PowerPC, but I was unable to find it. Obtaining revision 14469 of CCL's trunk can be done by accessing their Trac page, going to that revision, then scrolling down to "Download Archive."

I don't think this is an important info, but:)

  • Support for PPC-macOS has been removed since CCL-1.7.

https://web.archive.org/web/20110721110920/http://trac.clozure.com/ccl/wiki/ReleaseNotes/1.7

  • The revision 14469 of CCL is included in CCL-1.6. It is a bootstrap of CCL-1.6.

https://trac.clozure.com/ccl/wiki

Anyway, I think CCL has nice features for PPC-macOS. (e.g. IDE, support for Cocoa and Threads)

Just for the info of anyone who has not seen it, CCL 1.6 for PPC is now in Macports.

comment:15 Changed 21 months ago by kencu (Ken)

Summary: sbcl: add support for PPCsbcl fails to build on PPC: add support for PPC

perhaps all these SBLC-fails-to-build-on-PPC tickets might be usefully amalgamated into one location?

comment:16 Changed 21 months ago by kencu (Ken)

Port: maxima removed

comment:17 Changed 18 months ago by catap (Kirill A. Korinsky)

Resolution: fixed
Status: assignedclosed

In a3cf7fd3e526e62a9437521c1b34228447249293/macports-ports (master):

sbcl: update to 2.3.5; pin for old macOS; add myself as co-maintainer

I also fixed build on old macOS

Closes: #61717
Closes: #65188
Closes: #65484
Closes: #66002

Note: See TracTickets for help on using tickets.