Why is LLC.exe missing in LLVM windows? - clang

I've been trying to use emscripten to build C into WASM and Javascript. Emscripten requires clang so I installed it but then it says "emcc: error: llc executable not found at C:\Program Files\LLVM\bin\llc.exe" when running emcc and em++. Is there a reason that LLC.exe is missing in the windows version? If so how do I get it.

llc is a developer tool. If you want it, build it from llvm-project source. This is/will not included in the release binary.

Related

Visual Studio 2019, Win10, and HDF5 installed using vcpkg. Unresolved external symbol H5T_IEEE_F64BE_g

Any help is much appreciated. I'm having link errors when trying to use HDF5 libraries installed using vcpkg with Visual Studio 2019 on Windows 10.
I installed HDF5 1.12.0 on Windows 10 using vcpkg:
PowerShell: .\vcpkg install hdf5 hdf5:x64-windows
I then attempted to use Visual Studio 2019 to build my project that uses HDF5, but I keep getting the following LNK2001 errors.
unresolved external symbol H5T_IEEE_F64BE_g
unresolved external symbol H5T_STD_I64BE_g
unresolved external symbol H5T_C_S1_g
unresolved external symbol H5T_NATIVE_INT_g
unresolved external symbol H5T_NATIVE_DOUBLE_g
I tried to solve this by directly adding the additional library directories that are under the vcpkg/packages/ for HDF5, SZIP, and ZLIB, that were automatically installed as part of the HDF5 installation step given previously, and I also added the library files to the additional dependencies in the order prescribed by the HDF5 documentation:
hdf5_hl.lib
hdf5.lib
szip.lib
zlib.lib
But I still have the unresolved external symbol errors.
All those symbols are prefixed with H5_DLLVAR. As such you need to explicitly set the preprocessor definitionH5_BUILT_AS_DYNAMIC_LIBif you are not using CMake and only the MSBuild integration vcpkg provides. You could also open and issue with vcpkg since it should embedded that definition into the correct hdf5 header if the library is built dynamically.
The vcpkg command that I used installs the dynamic version of the libraries. Instead I installed the static version of the libraries using:
./vcpkg install hdf5:x64-windows-static
No manual inclusion of the library directories or libraries themselves is needed. Just be sure to run this command as well (when first installing vcpkg):
./vcpkg.exe integrate install
Once that was done, Visual Studio 2019 was able to properly use the HDF5 libraries for my project and the linker error was gone (binary produced).
Hope this helps someone in the future!

clang/clang++ not detecting standard header files like iostream.h and stdio.h

I ran clang++ -v testfile.cpp and found that many standard headers were missing from the directory C:\LLVM\lib\clang\3.9.0\include. I downloaded a pre-built binary of clang 3.9.0 for 32 bit windows from this link.
Can someone please help me sort out this mess and explain me why the standard libraries are missing in the pre-build version of clang? I've searched the web for hours to get the answer and solution to this problem but couldn't find one. Thanks in advance.
why the standard libraries are missing in the pre-build version of clang?
Your Windows binary download comprises only binary build tools
plus a handful of clang-specific headers because you are supposed
to use clang, on Windows, in lieu of another native compiler that provides your
standard library. Similarly if you install clang on Linux you'll build against
the GCC standard library by default.
Your internet search seemingly failed to lead you to Installing clang++ to compile and link on Windows, which
explains how to integrate clang with the mingw-w64 GCC standard library for 32- and/or 64-bit work
in the manner that clang for Windows expects and supports.

lldb on Windows, possible?

I just build clang on Windows following this. To make it kind of complete it seems the compiler lldb should be made also.
How do I build lldb with mingw? Or it should be build with clang?
The people who work on the Windows port of lldb use Visual Studio. The instructions for building lldb on Windows are here:
http://lldb.llvm.org/build.html#BuildingLldbOnWindows
Basically follow the build instructions for Linux:
http://lldb.llvm.org/build.html#BuildingLldbOnLinux
I recommend you to use ninja for windows instead of make (it's faster) but that's up to you.
Preferably use a mingw build of python. You find instructions on this here:
Build Python with Mingw and gcc
Alternatively you can use cmake for python build:
https://github.com/python-cmake-buildsystem/python-cmake-buildsystem
In the chapter "Building LLDB" itself use the latest stable source from llvm, cland and lldb and rename the folder as shown in the directory hierarchy image.
If you want to try building llvm and clang with clang, try to put a build of clang + llvm in your path (and avoid VC + gcc). In this case you might need a clang-build of python too. I did not try this out.
If you get build errors try to use the headers from predef.sf.net.

clang on Windows - incorrect header file path

I built clang using VS2013 and then ran it from the command line with a -v option (clang -v testfile.c). Among the things it reported was:
#include <...> search starts here:
C:\Program Files (stand-alone)\LLVM\bin..\lib\clang\3.7.0\include
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
I don't understand why it is even looking at the Microsoft headers in the first place. I do not have an environment variable named INCLUDE. I verified this by doing "set INCLUDE" from the command line getting a message saying there was no such environment variable. So, where and why is clang getting this information and how do I stop it? During the compile several warnings (not errors) occur regarding some of the things in Microsoft header files too.
The version it reports is:
clang -cc1 version 3.7.0 based upon LLVM 3.7.0svn default target i686-pc-windows-msvc
I understand the i686-pc-windows part, but why the msvc part? If that means it was built with msvc then that makes sense, but if it means that clang was built to run with msvc support, I don't understand why.

Building Clang, libstdc++4.6 to libstdc++4.7

I am trying to build Clang following this: http://clang.llvm.org/get_started.html
At step 6 the command ../llvm/configure runs a series of checks and one tells me:
checking whether Clang will select a modern C++ standard library... no
configure: error:
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.
If this error is incorrect or you need to force things to work, you may pass
'--disable-compiler-version-checks' to configure to bypass this test.
I don't know how to resolve this and google searches for libstdc++4.7 did not produce anything useful to me or something I understand. How do I go about replacing / upgrading this? I am on a Mac (10.7.5)
I ran into the same problem. The easiest way to build Clang is to use libc++ instead of libstdc++. If you don't have libc++, you can obtain it by installing XCode 4.2 (or newer) or you can build it yourself by following the instructions here: http://libcxx.llvm.org/
After you have libc++ installed, you can use the --enable-libcpp=yes flag with the configure command.
Just this week, the LLVM & Clang project upped the minimal compiler version requirement to gcc 4.7, with its libstdc++. You'll need to install or build a newer gcc.
Here's a blog post I wrote earlier today about building gcc 4.8 on Ubuntu 12.04 and using that to compile trunk LLVM & Clang. Hope this helps!
i have the same error on mac 10.8.5 xcode 5.0
configure option --enable-libcpp resolve my problem
../llvm/configure --enable-cxx11 --enable-optimized --enable-libcpp
For me this happened because I had the old clang and clang++ that I'd previously built from source (the one I was attempting to build to replace) coming first in my PATH. These were too old. Removing those two files so that the build process would use the clang and clang++ that comes with XCode's Command Line Tools and then rebuilding worked fine.

Resources