Is LLVM 13 (git) really ready for testing/development? libclc didn't compile

Dieter Nützel Dieter at nuetzel-hh.de
Tue Mar 16 23:01:41 UTC 2021


[CC trimmed - excluded Marek]

Too bad  Jan,

'configure' works, now. But compilation brakes after that.
How can we add '-cl-no-stdinc' only to CMAKE_CLC_FLAGS and NOT CXX flags 
(see below)?

Tried

libclc/build> pwd
/opt/llvm-project/libclc/build

libclc/build> cmake ../ -DLLVM_CONFIG=/usr/local/bin/llvm-config 
-DCMAKE_LLAsm_FLAGS=-cl-no-stdinc -DCMAKE_CLC_FLAGS=-cl-no-stdinc

and

libclc/build> cmake ../../../llvm-project/libclc/ 
-DLLVM_CONFIG=/usr/local/bin/llvm-config 
-DCMAKE_LLAsm_FLAGS=-cl-no-stdinc

-- The CXX compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
LLVM version: 13.0.0git
LLVM system libs:
LLVM libs: -lLLVM-13git
LLVM libdir: /usr/local/lib
LLVM bindir: /usr/local/bin
LLVM ld flags: -L/usr/local/lib
LLVM cxx flags: 
-I/usr/local/include;-std=c++14;;;-fno-exceptions;-D_GNU_SOURCE;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS;-fno-rtti;-fno-exceptions;-fno-exceptions;-cl-no-stdinc

clang: /usr/local/bin/clang
llvm-as: /usr/local/bin/llvm-as
llvm-link: /usr/local/bin/llvm-link
opt: /usr/local/bin/opt
llvm-spirv: /usr/local/bin/llvm-spirv

-- Check for working CLC compiler: /usr/local/bin/clang
-- Check for working CLC compiler: /usr/local/bin/clang -- works
-- Check for working LLAsm compiler: /usr/local/bin/llvm-as
-- Check for working LLAsm compiler: /usr/local/bin/llvm-as -- works
-- Found Python3: /usr/bin/python3.8 (found version "3.8.8") found 
components: Interpreter
BUILDING amdgcn--
         DEVICE: tahiti ( 
pitcairn;verde;oland;hainan;bonaire;kabini;kaveri;hawaii;mullins;tonga;iceland;carrizo;fiji;stoney;polaris10;polaris11;gfx900;gfx902;gfx904;gfx906 
)
BUILDING amdgcn--amdhsa
         DEVICE: none (  )
BUILDING amdgcn-mesa-mesa3d
         DEVICE: tahiti ( 
pitcairn;verde;oland;hainan;bonaire;kabini;kaveri;hawaii;mullins;tonga;iceland;carrizo;fiji;stoney;polaris10;polaris11;gfx900;gfx902;gfx904;gfx906 
)
BUILDING clspv--
         DEVICE: none (  )
BUILDING nvptx--
         DEVICE: none (  )
BUILDING nvptx--nvidiacl
         DEVICE: none (  )
BUILDING nvptx64--
         DEVICE: none (  )
BUILDING nvptx64--nvidiacl
         DEVICE: none (  )
BUILDING r600--
         DEVICE: cedar ( palm;sumo;sumo2;redwood;juniper )
         DEVICE: cypress ( hemlock )
         DEVICE: barts ( turks;caicos )
         DEVICE: cayman ( aruba )
BUILDING spirv-mesa3d-
         DEVICE: none (  )
BUILDING spirv64-mesa3d-
         DEVICE: none (  )
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/llvm-project/libclc/build
libclc/build> make -j                                                    
                           Scanning dependencies of target 
generate_convert.cl
Scanning dependencies of target prepare_builtins
[  0%] Generating convert.cl
[  0%] Building CXX object 
CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o
c++: error: unrecognized command-line option ‘-cl-no-stdinc’; did you 
mean ‘-nostdinc’?
make[2]: *** [CMakeFiles/prepare_builtins.dir/build.make:82: 
CMakeFiles/prepare_builtins.dir/utils/prepare-builtins.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:1810: 
CMakeFiles/prepare_builtins.dir/all] Fehler 2
make[1]: *** Es wird auf noch nicht beendete Prozesse gewartet....
[  0%] Built target generate_convert.cl
make: *** [Makefile:160: all] Fehler 2

And YES, my time during these 'Corona-Times' is limited, too...
...my wife is a children's nurse, we 5 aktive doctors (4 pneumologist), 
7 entire in our family and my second discipline was medicine, too. ;-)

Greetings and Gesundheit
to all of you!

Dieter

Am 10.03.2021 18:03, schrieb Jan Vesely:
> One more update. without changing any cmake files the following
> cmdline should work:
> cmake ../llvm-project/libclc/
> -DLLVM_CONFIG=/usr/local/llvm-git/bin/llvm-config
> -DCMAKE_LLAsm_FLAGS=-cl-no-stdinc -DCMAKE_CLC_FLAGS=-cl-no-stdinc
> 
> Jan
> 
> On Wed, Mar 10, 2021 at 1:20 AM Jan Vesely <jan.vesely at rutgers.edu>
> wrote:
> 
>> hi,
>> 
>> sorry the option is actually -cl-no-stdinc. you can add it to
>> 'target_compiler_options'.
>> I should have a patch ready soon(tm), but time is scarce.
>> 
>> Jan
>> 
>> On Sun, Mar 7, 2021 at 9:51 PM Dieter Nützel <Dieter at nuetzel-hh.de>
>> wrote:
>> 
>>> Hello Jan,
>>> 
>>> I very much appreciate your advice.
>>> Tried several places...
>>> ...where to put it?
>>> 
>>> Dieter
>>> 
>>> Am 06.03.2021 17:56, schrieb Jan Vesely:
>>>> Not Marek, but hope this answer will help.
>>>> libclc uses clang CLC preprocessor on .ll files, llvm/clang-13
>>> started
>>>> including clc declarations by default (clang
>>>> cf3ef15a6ec5e5b45c6c54e8fbe3769255e815ce),
>>>> thus corrupting any .ll assembly files that are used by libclc.
>>>> Inclusion of the default declarations can be turned off using a
>>>> cmdline switch but that remains to be implemented in the libclc
>>> build
>>>> system.
>>>> manually adding '-cl-no-stdinc' should work as a workaround.
>>>> 
>>>> Jan
>>>> 
>>>> On Thu, Mar 4, 2021 at 10:27 PM Dieter Nützel
>>> <Dieter at nuetzel-hh.de>
>>>> wrote:
>>>> 
>>>>> Hello Marek,
>>>>> 
>>>>> can't compile anything, here.
>>>>> Poor Intel Nehalem X3470.
>>>>> 
>>>>> Trying LLVM 12-rc2 later.
>>>>> 
>>>>> Greetings,
>>>>> Dieter
>>>>> 
>>>>> llvm-project/libclc> cd build && cmake ../
>>>>> -- The CXX compiler identification is GNU 10.2.1
>>>>> -- Detecting CXX compiler ABI info
>>>>> -- Detecting CXX compiler ABI info - done
>>>>> -- Check for working CXX compiler: /usr/bin/c++ - skipped
>>>>> -- Detecting CXX compile features
>>>>> -- Detecting CXX compile features - done
>>>>> LLVM version: 13.0.0git
>>>>> LLVM system libs:
>>>>> LLVM libs: -lLLVM-13git
>>>>> LLVM libdir: /usr/local/lib
>>>>> LLVM bindir: /usr/local/bin
>>>>> LLVM ld flags: -L/usr/local/lib
>>>>> LLVM cxx flags:
>>>>> 
>>>> 
>>> 
>> 
> -I/usr/local/include;-std=c++14;;;-fno-exceptions;-D_GNU_SOURCE;-D__STDC_CONSTANT_MACROS;-D__STDC_FORMAT_MACROS;-D__STDC_LIMIT_MACROS;-fno-rtti;-fno-exceptions
>>>>> 
>>>>> clang: /usr/local/bin/clang
>>>>> llvm-as: /usr/local/bin/llvm-as
>>>>> llvm-link: /usr/local/bin/llvm-link
>>>>> opt: /usr/local/bin/opt
>>>>> llvm-spirv: /usr/local/bin/llvm-spirv
>>>>> 
>>>>> -- Check for working CLC compiler: /usr/local/bin/clang
>>>>> -- Check for working CLC compiler: /usr/local/bin/clang --
>>> works
>>>>> -- Check for working LLAsm compiler: /usr/local/bin/llvm-as
>>>>> -- Check for working LLAsm compiler: /usr/local/bin/llvm-as --
>>>>> broken
>>>>> CMake Error at cmake/CMakeTestLLAsmCompiler.cmake:40 (message):
>>>>> The LLAsm compiler "/usr/local/bin/llvm-as" is not able to
>>>>> compile a
>>>>> simple
>>>>> test program.
>>>>> 
>>>>> It fails with the following output:
>>>>> 
>>>>> Change Dir: /opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp
>>>>> 
>>>>> Run Build Command(s):/usr/bin/gmake cmTC_87af9/fast &&
>>>>> /usr/bin/gmake
>>>>> -f
>>>>> CMakeFiles/cmTC_87af9.dir/build.make
>>>>> CMakeFiles/cmTC_87af9.dir/build
>>>>> 
>>>>> gmake[1]: Verzeichnis
>>>>> „/opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp“ wird
>>>>> betreten
>>>>> 
>>>>> Building LLAsm object
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc
>>>>> 
>>>>> /usr/local/bin/clang -E -P -x cl
>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> /opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp/testLLAsmCompiler.ll
>>>>> 
>>>>> -o
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp
>>>>> 
>>>>> /usr/local/bin/llvm-as -o
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp
>>>>> 
>>>>> /usr/local/bin/llvm-as:
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp:1:1: error:
>>>>> expected
>>>>> top-level entity
>>>>> 
>>>>> typedef unsigned char uchar;
>>>>> 
>>>>> ^
>>>>> 
>>>>> gmake[1]: *** [CMakeFiles/cmTC_87af9.dir/build.make:86:
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc] Fehler 1
>>>>> 
>>>>> gmake[1]: Verzeichnis
>>>>> „/opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp“ wird
>>>>> verlassen
>>>>> 
>>>>> gmake: *** [Makefile:140: cmTC_87af9/fast] Fehler 2
>>>>> 
>>>>> CMake will not be able to correctly generate this project.
>>>>> Call Stack (most recent call first):
>>>>> CMakeLists.txt:127 (enable_language)
>>>>> 
>>>>> -- Configuring incomplete, errors occurred!
>>>>> See also
>>>>> "/opt/llvm-project/libclc/build/CMakeFiles/CMakeOutput.log".
>>>>> See also
>>> "/opt/llvm-project/libclc/build/CMakeFiles/CMakeError.log".
>>>>> 
>>>>> CMakeError.log
>>>>> Determining if the LLAsm compiler works failed with the
>>> following
>>>>> output:
>>>>> Change Dir: /opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp
>>>>> 
>>>>> Run Build Command(s):/usr/bin/gmake cmTC_87af9/fast &&
>>>>> /usr/bin/gmake
>>>>> -f CMakeFiles/cmTC_87af9.dir/build.make
>>>>> CMakeFiles/cmTC_87af9.dir/build
>>>>> gmake[1]: Verzeichnis
>>>>> „/opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp“ wird
>>>>> betreten
>>>>> Building LLAsm object
>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc
>>>>> /usr/local/bin/clang -E -P     -x cl
>>>>> 
>>>> 
>>> 
>> 
> /opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp/testLLAsmCompiler.ll
>>>>> 
>>>>> -o CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp
>>>>> /usr/local/bin/llvm-as -o
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp
>>>>> /usr/local/bin/llvm-as:
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc.temp:1:1: error:
>>>>> expected
>>>>> top-level entity
>>>>> typedef unsigned char uchar;
>>>>> ^
>>>>> gmake[1]: *** [CMakeFiles/cmTC_87af9.dir/build.make:86:
>>>>> CMakeFiles/cmTC_87af9.dir/testLLAsmCompiler.bc] Fehler 1
>>>>> gmake[1]: Verzeichnis
>>>>> „/opt/llvm-project/libclc/build/CMakeFiles/CMakeTmp“ wird
>>>>> verlassen
>>>>> gmake: *** [Makefile:140: cmTC_87af9/fast] Fehler 2
>>>>> _______________________________________________
>>>>> dri-devel mailing list
>>>>> dri-devel at lists.freedesktop.org
>>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list