clang 3.9 installation

Hi Team,

We are trying to install clang 3.9 in Linux Server. We tried installing using the steps available in the website, we are getting errors.

Could you please assist us with the procedure to do so.

Thanks & Regards**,**

Suryakanta Sahoo

Project Engineer,

Wipro Technology Services Ltd

Hi,

You will need to provide more information for anyone to be able to help you.

For example:
- Which Linux distribution/version are you running?
- What steps have you performed?
- What error messages do you receive?

Best regards
David

We can't help you if you don't tell us the problems you are seeing.

Joerg

Hi David/Joerg,

Below are requested details.

Your quick support is highly appreciated!

Thanks,
Chandini

CMakeOutput.log (30.1 KB)

clang_error.txt (1.82 KB)

According to the attached files you are using too old gcc (4.4.6 but 4.8+ is needed) and python (2.6 but 2.7+ is needed).

Hi Serge,

Thanks for the response!

We are using the latest version of gcc (6.2)and python(3.3) but the cmake is picking up the server installed packages only.

Kindly suggest.

Regards,

Chandini

The problem is sudo.

Once you run sudo, you are root and have a completely different environment. My guess is that the newer version of gcc is installed in a non-standard location. If that’s the case, you may need a few more options.

Try running cmake and make without sudo, then, if needed, run “sudo make install” to actually do the installation step.

hth…
don

Hi Hinton,

Will check and revert back.

Thanks,

Chandini

Btw, sudo only explains the gcc version issue.

The other errors seem to indicate cmake can’t find the llvm directory. Did you download llvm? Normally, you download clang under the llvm/tools directory (renaming or linking cfe as clang), then run cmake like this:

cmake …/llvm

where …/llvm points to the llvm root directory.

again, hth…
don

Hi Don,

Tried without sudo but still the same issue.

llvm 3.9 is downloaded. Do you want me to link clang to llvm/tools?

FYI

[sainu@oulnxc55 xfer/sainu/cfe-3.9.0.src]$ls

bindings CMakeLists.txt docs include INSTALL.txt LICENSE.TXT NOTES.txt runtime tools utils

cmake CODE_OWNERS.TXT examples INPUTS lib ModuleInfo.txt README.txt test unittests www

[sainu@oulnxc55 xfer/sainu/llvm-3.9.0.src/tools]$ls

bugpoint llvm-ar llvm-cov llvm-extract llvm-mcmarkup llvm-shlib msbuild yaml2obj

bugpoint-passes llvm-as llvm-c-test llvm-go llvm-nm llvm-size obj2yaml

CMakeLists.txt llvm-as-fuzzer llvm-cxxdump llvm-jitlistener llvm-objdump llvm-split opt

dsymutil llvm-as-parasitic-coverage-repro llvm-diff llvm-link llvm-pdbdump llvm-stress sancov

gold llvm-bcanalyzer llvm-dis llvm-lto llvm-profdata llvm-symbolizer sanstats

llc LLVMBuild.txt llvm-dwarfdump llvm-mc llvm-readobj llvm-vtabledump verify-uselistorder

lli llvm-config llvm-dwp llvm-mc-fuzzer llvm-rtdyld lto xcode-toolchain

[sainu@oulnxc55 xfer/sainu/llvm-3.9.0.src/tools]$

Thanks,

Chandini

If you want to build llvm+clang from scratch, please follow these instructions:

http://clang.llvm.org/get_started.html

But, if you just want to use it, I’d suggest you download one of the pre-built binaries found here:

http://llvm.org/releases/download.html

Hi Don,

I have downloaded the binaries from the below mentioned site and trying to compile but facing issues.

http://llvm.org/releases/download.html

Could you please help me with the steps to be performed in linux for compiling clang.

Thanks,

Chandini

Hi Don,

Greetings for the day!

As the clang 4.0 been released, can you help me in selecting the correct version from the pre-built binaries for RHEL7 - x86_64

http://llvm.org/releases/download.html

image001.png

Your quick reply would be highly appreciated.

Thanks,
Chandini

Hi Chandini:

I’ve never used any of the pre-built binaries, so I really don’t know. Perhaps someone else could give a better answer.

take care…
don

image001.png

Hi,

Can someone help me with the below query.

image001.png

Hi,

Can I have update on the below mail.

Your quick reply would be highly appreciated.

image001.png

Can’t help with the prebuilt versions – they are mostly provided to test new versions and not used for anything else.

But I will try to help you build it, so please run the following commands (and never run sudo or login as root unless you absolutely have to). Please provide both the command and the output – just cut-n-paste both from your terminal:

$ uname -a
$ cmake --version
$ gcc -v
$ python -V

This should tell you the defaults that cmake will use. Also, as Serge noted above, the cmake_error.txt file you provided showed that you were using the wrong versions of both gcc and python.

If you have newer versions for gcc and python installed on your box, you can always use the CC and CXX environment variables to select a different compiler or different version, e.g.,

$ CC=gcc-6.2 CXX=g+±6.2 cmake …/llvm …

Not sure the best way to set your python version, other than symlink or alias, but a google search should provide plenty of alternatives.

Once you have fixed those 2 problems, we can try running cmake.

hth…
don

image001.png

They should be tarball, why not extracting and trying them out?

Regards,
chenwj

image001.png

Hi Chenwj,

Thanks for the reply. I have tried to install the below linux binaries but receiving below error.

-bash: ./clang: cannot execute binary file

$uname -a

Linux oulng127.emea.nsn-net.net 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

image002.jpg

image001.png