Alex Denisov via llvm-dev
2020-Jul-23 18:00 UTC
[llvm-dev] Windows vs Mac/Linux distribution discrepancy
Hi folks, I’m trying to port some code built on top of LLVM/Clang to Windows, however I just discovered that the precompiled versions from releases.llvm.org are missing all the libLLVM* and libclang* dlls. Also, some tools (e.g. opt) are missing on Windows as well. I’m curious whether it’s a technical limitation (i.e. certain things don’t work on Windows), or something else? For the others out there building cross-platform tools based on LLVM: how do you deal with this issue? Am I supposed to build LLVM myself there? Cheers, Alex.
Dimitry Andric via llvm-dev
2020-Jul-23 18:32 UTC
[llvm-dev] Windows vs Mac/Linux distribution discrepancy
On 23 Jul 2020, at 20:00, Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > I’m trying to port some code built on top of LLVM/Clang to Windows, > however I just discovered that the precompiled versions from releases.llvm.org > are missing all the libLLVM* and libclang* dlls.This is controlled by the following CMake settings (see https://llvm.org/docs/CMake.html#llvm-specific-variables): LLVM_BUILD_LLVM_DYLIB:BOOL If enabled, the target for building the libLLVM shared library is added. This library contains all of LLVM’s components in a single shared library. Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS. Tools will only be linked to the libLLVM shared library if LLVM_LINK_LLVM_DYLIB is also ON. The components in the library can be customised by setting LLVM_DYLIB_COMPONENTS to a list of the desired components. This option is not available on Windows. LLVM_LINK_LLVM_DYLIB:BOOL If enabled, tools will be linked with the libLLVM shared library. Defaults to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB to ON. This option is not available on Windows. E.g. these options are off by default (probably because it saves build time, but I'm just guessing here), and are not available on Windows (for reasons unknown to me).> Also, some tools (e.g. opt) are missing on Windows as well.I don't know about that, but maybe Hans Wennborg has more information.> I’m curious whether it’s a technical limitation (i.e. certain things don’t work on Windows), > or something else? > > For the others out there building cross-platform tools based on LLVM: > how do you deal with this issue? Am I supposed to build LLVM myself there?Either you can link against distro-provided LLVM dynamic libraries, like those shipped by Debian and Ubuntu, or you can link against the static libraries in the release tarballs. But obviously, you could always build them yourself, and ship them with your tools. This would give you the most flexibility. -Dimitry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 223 bytes Desc: Message signed with OpenPGP URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200723/64c1364c/attachment.sig>
Aaron Smith via llvm-dev
2020-Jul-23 19:09 UTC
[llvm-dev] Windows vs Mac/Linux distribution discrepancy
The Visual Studio installer has an option to install Clang tools for Windows or you can build from source. I believe all the tools are not included in the prebuilt package because of size. On Thu, Jul 23, 2020 at 11:32 AM Dimitry Andric via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 23 Jul 2020, at 20:00, Alex Denisov via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > I’m trying to port some code built on top of LLVM/Clang to Windows, > > however I just discovered that the precompiled versions from > releases.llvm.org > > are missing all the libLLVM* and libclang* dlls. > > This is controlled by the following CMake settings (see > https://llvm.org/docs/CMake.html#llvm-specific-variables): > > LLVM_BUILD_LLVM_DYLIB:BOOL > > If enabled, the target for building the libLLVM shared library is added. > This library contains all of LLVM’s components in a single shared library. > Defaults to OFF. This cannot be used in conjunction with BUILD_SHARED_LIBS. > Tools will only be linked to the libLLVM shared library if > LLVM_LINK_LLVM_DYLIB is also ON. The components in the library can be > customised by setting LLVM_DYLIB_COMPONENTS to a list of the desired > components. This option is not available on Windows. > > LLVM_LINK_LLVM_DYLIB:BOOL > > If enabled, tools will be linked with the libLLVM shared library. Defaults > to OFF. Setting LLVM_LINK_LLVM_DYLIB to ON also sets LLVM_BUILD_LLVM_DYLIB > to ON. This option is not available on Windows. > > E.g. these options are off by default (probably because it saves build > time, but I'm just guessing here), and are not available on Windows (for > reasons unknown to me). > > > > Also, some tools (e.g. opt) are missing on Windows as well. > > I don't know about that, but maybe Hans Wennborg has more information. > > > > I’m curious whether it’s a technical limitation (i.e. certain things > don’t work on Windows), > > or something else? > > > > For the others out there building cross-platform tools based on LLVM: > > how do you deal with this issue? Am I supposed to build LLVM myself > there? > > Either you can link against distro-provided LLVM dynamic libraries, like > those shipped by Debian and Ubuntu, or you can link against the static > libraries in the release tarballs. > > But obviously, you could always build them yourself, and ship them with > your tools. This would give you the most flexibility. > > -Dimitry > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200723/dade3745/attachment.html>
Tobias Hieta via llvm-dev
2020-Jul-23 21:14 UTC
[llvm-dev] Windows vs Mac/Linux distribution discrepancy
Hello, I can only speak from my own experience - I was relying on llvm.org binaries for our toolchain but that has many drawbacks, missing tools, different configs, not all optimization turned on (LTO+PGO). So I would highly recommend you build your own binaries that are more targeted for what you really need. It's a bit of a learning curve but it was very much worth it for us. Thanks, Tobias On Thu, Jul 23, 2020, 20:00 Alex Denisov via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi folks, > > I’m trying to port some code built on top of LLVM/Clang to Windows, > however I just discovered that the precompiled versions from > releases.llvm.org > are missing all the libLLVM* and libclang* dlls. Also, some tools (e.g. > opt) are missing on Windows as well. > > I’m curious whether it’s a technical limitation (i.e. certain things don’t > work on Windows), > or something else? > > For the others out there building cross-platform tools based on LLVM: > how do you deal with this issue? Am I supposed to build LLVM myself there? > > Cheers, > Alex. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200723/0c60d4cd/attachment-0001.html>
Hans Wennborg via llvm-dev
2020-Jul-24 10:08 UTC
[llvm-dev] Windows vs Mac/Linux distribution discrepancy
Hi Alex, As others have answered already, it's a mix of technical things -- exposing everything as a DLL is problematic, and also we'd like to keep the size of the binaries down. The current situation is that the Windows binaries are focused on providing an LLVM toolchain by shipping Clang, LLD, runtimes, etc. -- but not the internal tools like opt, llc, and so on. The recommendation is that those who need to build stuff with LLVM rather than just use the toolchain should build it themselves. Thanks, Hans On Thu, Jul 23, 2020 at 8:00 PM Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hi folks, > > I’m trying to port some code built on top of LLVM/Clang to Windows, > however I just discovered that the precompiled versions from releases.llvm.org > are missing all the libLLVM* and libclang* dlls. Also, some tools (e.g. opt) are missing on Windows as well. > > I’m curious whether it’s a technical limitation (i.e. certain things don’t work on Windows), > or something else? > > For the others out there building cross-platform tools based on LLVM: > how do you deal with this issue? Am I supposed to build LLVM myself there? > > Cheers, > Alex. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Apparently Analagous Threads
- D16945: LLVM overhaul to avoid linking LLVM component libraries with libLLVM
- D16945: LLVM overhaul to avoid linking LLVM component libraries with libLLVM
- How to build only the necessary components with MSVC
- Problem with the way BUILD_SHARED_LIBS=ON handled in llvm 3.8
- Problem with the way BUILD_SHARED_LIBS=ON handled in llvm 3.8