How to build SPIR-V supported LDC?

Sobaya sobaya007 at gmail.com
Tue Apr 24 08:09:18 UTC 2018


On Monday, 23 April 2018 at 23:54:51 UTC, Nicholas Wilson wrote:
> On Monday, 23 April 2018 at 16:03:13 UTC, Sobaya wrote:
>> I'd like to try dcompute.(https://github.com/libmir/dcompute)
>>
>> This requires SPIR-V supported LLVM and LDC built with it.
>>
>> But I don't understand how to build LDC with SPIR-V support.
>>
>> Please tell me the way.
>>
>> Thanks, Sobaya
>
> If you want SPIR-V support you'll need to check out my fork of 
> llvm (https://github.com/thewilsonator/llvm) and its git 
> submodules. Then build LLVM (this takes a while, I'd recommend 
> only building the arch you use (e.g. X86) + SPIR-V and 
> optionally NVPTX). Then build LDC against that LLVM. There's a 
> chance it might not build against LDC, I apologise if that 
> happens I've been very busy and haven't been able to keep on 
> top of changes.
>
> Hopefully this will become much simpler once there is an 
> official SPIR-V backend (hopefully June at the earliest).
>
> I provide prebuilts for OS X, and I can do them for Windows and 
> Linux but don't have them on hand. I might be able to build 
> them before I leave for DConf, but don't bet on it, after that 
> sure.

I tried like below.


git clone https://github.com/thewilsonator/llvm.git
git checkout compute
git mkdir build
cd build
cmake ..


But cmake error occured.
The error message is
"
CMake Error at CMakeLists.txt:659 (message):
   Unexpected failure executing llvm-build: llvm-build: fatal 
error: missing
   LLVMBuild.txt file at:
   '/home/sobaya/git/llvm/lib/Target/SPIRV/LLVMBuild.txt'
"

What's wrong?


More information about the digitalmars-d-ldc mailing list