[cfe-dev] Problem building llvm and clang 7.0.0

Jonas Hahnfeld via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 15 00:03:57 PDT 2018


Hi John,

On 2018-08-15 00:33, Fletcher, John P wrote:
> _______________________________________
> From: Jonas Hahnfeld [hahnjo at hahnjo.de]
> Sent: 10 August 2018 18:08
> To: Fletcher, John P
> Cc: cfe-dev ‎[cfe-dev at lists.llvm.org]‎
> Subject: Re: [cfe-dev] Problem building llvm and clang 7.0.0
> 
> On 2018-08-10 18:34, Fletcher, John P via cfe-dev wrote:
>> I am building LLVM and Clang using gcc 7.1 with Cmake and Ninja on a
>> system based on Ubuntu 12.04.
>> 
>> The following commands worked for clang 6.0.0 with all the source
>> files installed:
>> 
>> /opt/cmake/bin/cmake -GNinja \
>> -DCMAKE_C_COMPILER=/opt/gcc-7.1/bin/gcc \
>> -DCMAKE_CXX_COMPILER=/opt/gcc-7.1/bin/g++ \
>> -DGCC_INSTALL_PREFIX=/opt/gcc-7.1 \
>> -DCMAKE_INSTALL_PREFIX=/home/fletcher/LLVM/llvm-6.0.distrib/local
>> -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_LLVM_DYLIB=ON
>> -DLLVM_TARGETS_TO_BUILD="host" -DLLVM_PARALLEL_LINK_JOBS=1
>> -DCMAKE_EXE_LINKER_FLAGS="-Xlinker -R/opt/gcc-7.1/lib64
>> -L/opt/gcc-7.1/lib64" ../llvm
>> 
>> Some things seem to have changed with version 7.0.0
>> 
>> (1)  There has been a change associated with libomptarget and now it
>> fails as it is picking up an old version of cuda on my computer and
>> complaining that the gcc is too new.  The only way I could find to get
>> rid of this is to remove openmp.
> 
> libomptarget uses the default FindCUDA.cmake. Can you try setting
> CUDA_TOOLKIT_ROOT_DIR and / or CUDA_BIN_PATH to pont to the "right"
> version of CUDA?
> Alternatively you can point LIBOMPTARGET_NVPTX_ALTERNATE_HOST_COMPILER
> to an older version of GCC that is compatible with the detected version
> of CUDA.
> 
> Cheers,
> Jonas
> 
> ------------------------
> 
> Jonas
> 
> Thank you for your suggestion.  I have tried various things and in the
> end I have renamed my out of date link to cuda as cudaold so that it
> is no longer picked up.  That is not enough as it still fails in
> openmp so I have taken that out.
> 
> To the CLANG community.
> 
> (1) I am concerned that something has changed and I cannot find any
> documentation, in particular something which worked does not and is
> NOT picked up by Cmake so that it crashes after 2.5 hours of running.
> What is it that has changed?

Of course something has changed, we are not standing still after all. If 
there were no changes what would be the point of new releases?
In this particular case the OpenMP runtime for Nvidia GPUs is now 
included in the release.

> (2) There has been no response on this problem.
> -------
> (2) When I did this it still does not build as it cannot link a
> library with the following messages:
> 
> FAILED: lib/clang/7.0.0/lib/linux/libclang_rt.fuzzer_no_main-x86_64.a
> --localize-hidden: not found
> 
> --localize-hidden seems to be an option for ld.  I have not traced any
> documentation.
> --------
> I now think that the problem about --localize-hidden: not found is
> because it should be preceded by objcopy, for which it is an argument,
> so that something in the command processing is broken.

Or CMake just didn't find your objcopy - which would be bad. You have 
that installed, haven't you?

> I am spending my time building on rc1 to help you get things sorted.
> Where are you all?

Please keep in mind that you are not guaranteed to get support from the 
community.
To maximize chances you should post as much information as possible to 
narrow down the problem:
  - Are there errors during configuration?
  - What are the exact error messages you get when building?
  - What versions of software are you using? You already mentioned GCC 
7.1, but which version of CUDA?
  - Does CMake find the versions you are intending to use? A log file 
might help here...

Regards,
Jonas



More information about the cfe-dev mailing list