Bug 261185 - devel/ispc: Fails to build with LLVM 13 on on FreeBSD-12.3-RELEASE amd64: Assertion failed: (PointeeType && "Must specify element type"), function Create, file /usr/local/llvm13/include/llvm/IR/Instructions.h, line 971.
Summary: devel/ispc: Fails to build with LLVM 13 on on FreeBSD-12.3-RELEASE amd64: Ass...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Yuri Victorovich
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2022-01-13 20:18 UTC by ddrinnon
Modified: 2022-01-14 23:38 UTC (History)
2 users (show)

See Also:
koobs: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ddrinnon 2022-01-13 20:18:22 UTC
From the build log:
...
-- Configuring done
-- Generating done
-- Build files have been written to: /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build
[ 95% 148/155] cd /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build && /usr/local/bin/cmake --build . && /usr/local/bin/cmake -E touch /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-stamp/ispc_xpu_examples-build
FAILED: xpu_examples/src/ispc_xpu_examples-stamp/ispc_xpu_examples-build /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-stamp/ispc_xpu_examples-build 
cd /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build && /usr/local/bin/cmake --build . && /usr/local/bin/cmake -E touch /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-stamp/ispc_xpu_examples-build
[  2% 10/34] Building CXX object noise/CMakeFiles/host_noise.dir/noise_serial.cpp.o
[  5% 11/34] Building CXX object mandelbrot/CMakeFiles/host_mandelbrot.dir/mandelbrot_serial.cpp.o
[  8% 12/34] Building ISPC GPU object /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build/sgemm/genx_sgemm.spv
FAILED: sgemm/CMakeFiles/genx_sgemm_naive_sgemm_spv /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build/sgemm/CMakeFiles/genx_sgemm_naive_sgemm_spv 
cd /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build/sgemm && /wrkdirs/usr/ports/devel/ispc/work/.build/bin/ispc -I /wrkdirs/usr/ports/devel/ispc/work/ispc-1.16.1/examples/xpu/sgemm -I /wrkdirs/usr/ports/devel/ispc/work/ispc-1.16.1/examples/xpu/../../ispcrt -O3 -DISPC_GPU --addressing=64 --target=genx-x16 --emit-spirv --woff -o /wrkdirs/usr/ports/devel/ispc/work/.build/xpu_examples/src/ispc_xpu_examples-build/sgemm/genx_sgemm.spv /wrkdirs/usr/ports/devel/ispc/work/ispc-1.16.1/examples/xpu/sgemm//naive_sgemm.ispc
Assertion failed: (PointeeType && "Must specify element type"), function Create, file /usr/local/llvm13/include/llvm/IR/Instructions.h, line 971.
/wrkdirs/usr/ports/devel/ispc/work/ispc-1.16.1/src/main.cpp(392): FATAL ERROR: Unhandled signal sent to process; terminating.
***
*** Please file a bug report at https://github.com/ispc/ispc/issues
*** (Including as much information as you can about how to reproduce this error).
*** You have apparently encountered a bug in the compiler that we'd like to fix!
***
...
Comment 1 Yuri Victorovich freebsd_committer 2022-01-13 22:26:33 UTC
Thanks for reporting.

The problem should be fixed now.

Regards,
Yuri
Comment 2 commit-hook freebsd_committer 2022-01-13 22:27:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=427b549432cf3606803c0802d53f9d32abb4d713

commit 427b549432cf3606803c0802d53f9d32abb4d713
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-01-13 22:23:36 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-01-13 22:26:25 +0000

    devel/ispc: Revert the previous LLVM version change to 13 back to 11

    Various systems have llvm-13 crashing with assertions on ISPC.

    PR:             261185
    Reported by:    ddrinnon@cdor.net, fallout

 devel/ispc/Makefile | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Comment 3 ddrinnon 2022-01-14 00:03:03 UTC
Thank you Yuri - that fixed it.
Comment 4 VVD 2022-01-14 02:13:56 UTC
Can you please keep possibility to build ispc with other versions of LLVM?
Comment 5 Yuri Victorovich freebsd_committer 2022-01-14 03:44:17 UTC
(In reply to VVD from comment #4)

But you can currently build manually with this command:
> make LLVM_VERSION=13

Is this sufficient?


Yuri
Comment 6 Tatsuki Makino 2022-01-14 04:36:06 UTC
My 12.3-STABLE (after LLVM was changed to 13) was not able to build 1.16.1_2 due to the same problem.
Comment 7 Tatsuki Makino 2022-01-14 04:43:24 UTC
As far as freshports is concerned, LLVM_VERSION=13 of 1.16.1_2 seems to be fine on i386.
Comment 8 VVD 2022-01-14 16:49:27 UTC
(In reply to Yuri Victorovich from comment #5)
+LLVM_VERSION=   11
-LLVM_VERSION?=   11

Yes, make LLVM_VERSION=13 or echo LLVM_VERSION=13 >> /etc/make.conf is what I want.
Comment 9 VVD 2022-01-14 16:50:03 UTC
(In reply to Tatsuki Makino from comment #6)
Try to turn off option GENX.
Comment 10 VVD 2022-01-14 16:51:07 UTC
(In reply to VVD from comment #8)
Correct patch is:
-LLVM_VERSION=   11
+LLVM_VERSION?=   11
Comment 11 commit-hook freebsd_committer 2022-01-14 16:53:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ff5cc300f44abef42dfa6013266581b917fb71bb

commit ff5cc300f44abef42dfa6013266581b917fb71bb
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-01-14 16:51:53 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-01-14 16:51:53 +0000

    devel/ispc: Make LLVM_VERSION overridable

    PR:             261185

 devel/ispc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)