sb-simd fails to build on macos

Bug #1988798 reported by Cyrus Harmon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Incomplete
Undecided
Unassigned

Bug Description

When trying to build SBCL (2.2.8, 2.2.7, current HEAD, etc...) on macOS, the SB-SIMD contrib fails to build with errors such as the following:

; in: DEFINE-CUSTOM-VOP SB-SIMD-SSE::F32!-FROM-P128
; (SB-VM::DEFINE-CUSTOM-VOP SB-SIMD-SSE::F32!-FROM-P128
; (:ARGS (SB-VM::SRC :TARGET SB-VM::DST))
; (:TEMPORARY (:SC SB-VM::SINGLE-SSE-REG :FROM (:ARGUMENT 0)) SB-VM::TMP)
; (:RESULTS (SB-VM::DST))
; (:GENERATOR (SB-C:MOVE SB-VM::TMP SB-VM::SRC)
; (SB-ASSEM:INST SB-VM::XORPS SB-VM::DST SB-VM::DST)
; (SB-ASSEM:INST SB-VM::MOVSS SB-VM::DST SB-VM::TMP)))
;
; caught ERROR:
; (during macroexpansion of (DEFINE-VOP (SB-SIMD-SSE::%F32!-FROM-P128)
; ...))
; failed AVER:
; (= (LENGTH SB-C::VALUE) (LENGTH (REMOVE-DUPLICATES SB-C::VALUE)))
; This is probably a bug in SBCL itself. (Alternatively, SBCL might have been
; corrupted by bad user code, e.g. by an undefined Lisp operation like
; (FMAKUNBOUND 'COMPILE), or by stray pointers from alien code or from unsafe
; Lisp code; or there might be a bug in the OS or hardware that SBCL is running
; on.) If it seems to be a bug in SBCL itself, the maintainers would like to know
; about it. Bug reports are welcome on the SBCL mailing lists, which you can find
; at <http://sbcl.sourceforge.net/>.

Revision history for this message
Tomas Hlavaty (tomas-hlavaty) wrote : Re: [Bug 1988798] [NEW] sb-simd fails to build on macos

not sure if it is relevant here
but on nixos x86_64, I get the following failures often:

; caught WARNING:
; Constant :INTERPRET conflicts with its asserted type (MEMBER :COMPILE).

Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                          {1004610113}>:
  COMPILE-FILE-ERROR while
  compiling #<CL-SOURCE-FILE "sb-simd" "instruction-sets" "sb-simd">

WARNING! Some of the contrib modules did not build successfully or pass
their self-tests. Failed contribs:"
  sb-simd

Revision history for this message
Tomas Hlavaty (tomas-hlavaty) wrote :

On Tue 06 Sep 2022 at 10:26, Tomas Hlavaty <email address hidden> wrote:
> ; caught WARNING:
> ; Constant :INTERPRET conflicts with its asserted type (MEMBER :COMPILE).

the attached patch should fix the interpreter issue

Revision history for this message
Douglas Katzman (dougk) wrote :

The patch is fine, but is there a reason to build without an interpreter? If your intent is to produce a stripped-down SBCL, it hardly seems worth building sb-simd, indeed anything complicated, as you end up with an incomplete albeit working SBCL.

As to the reported problem: I build on macOS all the time.

Douglas Katzman (dougk)
Changed in sbcl:
status: New → Incomplete
Revision history for this message
Cyrus Harmon (ch-launchpad) wrote :
Download full text (4.0 KiB)

Interesting. Admittedly I've only tried this on one macOS running computer so far, but this fails reliably for me. I've tried a few older versions to no avail (going back to pre sb-simd landing) but haven't done so rigorously. Perhaps I have some wrong/missing libraries via homebrew?

In any event, what information would be most useful in figuring out what the problem might be?

First the preliminaries,

I'm using SBCL 2.2.8.32 on macOS 12.5.1 on an Apple M1 MacBookAir.

In order to get any evidence of failure (other than not having the obj/asdf-cache/sb-simd/uild-passed.test-report, I have to manually do

sh ./make-target-contrib.sh sb-simd

When I do so, I see:

sbcl % sh ./make-target-contrib.sh sb-simd
sh ./make-target-contrib.sh sb-simd
//entering make-target-contrib.sh
sh ./build-contrib asdf
mkdir -p ../..//obj/sbcl-home/contrib/
../..//src/runtime/sbcl --noinform --core ../..//output/sbcl.core --lose-on-corruption --disable-debugger --no-sysinit --no-userinit --eval '(setf (sb-ext:readtable-base-char-preference *readtable*) :both)' --eval '(compile-file #p"SYS:CONTRIB;ASDF;UIOP.LISP" :print nil :output-file (merge-pathnames (parse-native-namestring "../..//obj/sbcl-home/contrib//uiop.fasl")))' </dev/null
; compiling file "SYS:CONTRIB;ASDF;UIOP.LISP.NEWEST" (written 06 SEP 2022 08:09:17 AM):

; wrote /Users/sly/src/sbcl/sbcl-master/sbcl/contrib/asdf/../../obj/sbcl-home/contrib/uiop.fasl
; compilation finished in 0:00:01.676
* if [ -d asdf-upstream ] ; then rm -rf asdf-upstream ; fi
mkdir -p ../..//obj/sbcl-home/contrib/
../..//src/runtime/sbcl --noinform --core ../..//output/sbcl.core --lose-on-corruption --disable-debugger --no-sysinit --no-userinit --eval '(setf (sb-ext:readtable-base-char-preference *readtable*) :both)' --eval '(compile-file #p"SYS:CONTRIB;ASDF;ASDF.LISP" :print nil :output-file (merge-pathnames (parse-native-namestring "../..//obj/sbcl-home/contrib//asdf.fasl")))' </dev/null
; compiling file "SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST" (written 06 SEP 2022 08:09:17 AM):

; wrote /Users/sly/src/sbcl/sbcl-master/sbcl/contrib/asdf/../../obj/sbcl-home/contrib/asdf.fasl
; compilation finished in 0:00:01.430
* true
sh ./build-contrib sb-simd
../..//src/runtime/sbcl --noinform --core ../..//output/sbcl.core --lose-on-corruption --disable-debugger --no-sysinit --no-userinit --eval '(setf (sb-ext:readtable-base-char-preference *readtable*) :both)' \
  --eval '(declaim (muffle-conditions (and compiler-note (not sb-c::unknown-typep-note))))' \
  --load ../asdf-stub.lisp \
  --eval '(asdf::build-asdf-contrib "sb-simd")'
; compiling file "/Users/sly/src/sbcl/sbcl-master/sbcl/contrib/sb-simd/../../obj/asdf-cache/sb-simd/module-setup.lisp" (written 06 SEP 2022 08:21:12 AM):

; wrote /Users/sly/src/sbcl/sbcl-master/sbcl/contrib/sb-simd/../../obj/asdf-cache/sb-simd/module-setup.fasl
; compilation finished in 0:00:00.000
; compiling file "SYS:CONTRIB;SB-SIMD;CODE;PACKAGES.LISP.NEWEST" (written 06 SEP 2022 08:09:17 AM):

...

; in: DEFINE-CUSTOM-VOP SB-SIMD-SSE::F32!-FROM-P128
; (SB-VM::DEFINE-CUSTOM-VOP SB-SIMD-SSE::F32!-FROM-P128
; (:ARGS (SB-VM::SRC :TARGET SB-VM::DST))
; (:TEMPORARY (:SC SB-VM::SINGLE-SSE-REG :FROM (:ARGUMEN...

Read more...

Revision history for this message
Tomas Hlavaty (tomas-hlavaty) wrote : Re: [Bug 1988798] Re: sb-simd fails to build on macos

On Tue 06 Sep 2022 at 11:42, Douglas Katzman <email address hidden> wrote:
> The patch is fine,

thank you, it works now

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.