I have been trying for 3 days to install clang 5.0 on an Ubuntu 16.04 machine. I have tried various guides, but nothing seems to work. When I try to simply grab the latest from SVN and build/install (as detailed here), trying to compile a simple program leads to:
> clang++ basic.cpp /usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found # include <stdarg.h>
I then tried setting the
-DGCC_INSTALL_PREFIX flag for
cmake before building, but that leads to the even better error:
> clang++ basic.cpp fatal error: 'iostream' file not found #include <iostream>
The steps I've been following are (from the above guide):
> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/ \ -G "Unix Makefiles" path/to/llvm ... > make ... > make check-clang ... > make install-clang ...
Could someone treat me like an idiot and explain step-by-step how to install clang 5.0? Or point me to a guide that even basic fools like me can follow? If you also can explain how to build and install libc++ for C++17, I would be eternally grateful.
Update: It seems I'm not installing clang correctly, since this is the the output of a verbose compilation with clang:
... #include <...> search starts here: /usr/local/include /usr/include/x86_64-linux-gnu /usr/include
and this is the output for g++:
#include <...> search starts here: /usr/include/c++/5 /usr/include/x86_64-linux-gnu/c++/5 /usr/include/c++/5/backward /usr/lib/gcc/x86_64-linux-gnu/5/include /usr/local/include /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed /usr/include/x86_64-linux-gnu /usr/include ...