David Jones via llvm-dev
2016-Jan-14 11:24 UTC
[llvm-dev] Building SVN head with CMake - shared libraries?
Thanks - I'll try this tonight. Assuming it works, should these variables be added to the docs at http://llvm.org/docs/CMake.html ? On Wed, Jan 13, 2016 at 10:26 PM, Andrew Wilkins <axwalk at gmail.com> wrote:> > > On Thu, 14 Jan 2016 at 11:02 David Jones via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Now that autoconf is going away soon, I figured I'd try building using >> CMake. >> >> I checked out llvm, cfe and lldb from the SVN server, and followed the >> basic build instructions. >> >> cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/tools/llvm/svn_head >> -DLLVM_TARGETS_TO_BUILD="X86;CppBackend" -DCMAKE_BUILD_TYPE=Release >> -DLLVM_ENABLE_ASSERTIONS=ON ../llvm >> >> Everything worked well, and in the end I got the following shared >> libraries: >> >> /tools/llvm/svn_head/lib/BugpointPasses.so >> /tools/llvm/svn_head/lib/libclang.so >> /tools/llvm/svn_head/lib/libclang.so.3.9 >> /tools/llvm/svn_head/lib/liblldb.so >> /tools/llvm/svn_head/lib/liblldb.so.3.9.0 >> /tools/llvm/svn_head/lib/libLTO.so >> /tools/llvm/svn_head/lib/LLVMHello.so >> >> However, with an autoconf build, I am used to seeing a libLLVM.so. From a >> 3.7.1 autoconf build: >> >> /tools/llvm/3.7.1dbg/lib/BugpointPasses.so >> /tools/llvm/3.7.1dbg/lib/libclang.so >> /tools/llvm/3.7.1dbg/lib/liblldb.so >> /tools/llvm/3.7.1dbg/lib/libLLVM-3.7.1.so >> /tools/llvm/3.7.1dbg/lib/libLLVM-3.7.so >> /tools/llvm/3.7.1dbg/lib/libLTO.so >> /tools/llvm/3.7.1dbg/lib/LLVMHello.so >> >> I'd like to get libLLVM with the CMake build as well. But if I try >> -DBUILD_SHARED_LIBS=ON, lldb-server fails to link properly and I cannot >> install anything. >> >> Is this a bug in the make scripts for lldb-server? >> How can I get libLLVM.so in addition to liblldb.so? >> > > -DBUILD_SHARED_LIBS=ON will give you shared libraries for each component > (libLLVMSupport.so instead of libLLVMSupport.a, etc.) > > What you want to set is -DLLVM_BUILD_LLVM_DYLIB=ON. For this to work, you > must *not* set -DBUILD_SHARED_LIBS=ON. > > If you also want all the tools (clang, llvm-*, etc.) to link against > libLLVM.so, you'll want to set -DLLVM_LINK_LLVM_DYLIB=ON, otherwise you'll > have libLLVM.so but the tools will be linked against the static libraries. > > HTH, > Andrew > > _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://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/20160114/4968a570/attachment-0001.html>
Dan Liew via llvm-dev
2016-Jan-14 13:18 UTC
[llvm-dev] Building SVN head with CMake - shared libraries?
On 14 January 2016 at 11:24, David Jones via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Thanks - I'll try this tonight. > > Assuming it works, should these variables be added to the docs at > http://llvm.org/docs/CMake.html ?Yes. We should probably be updating [1] too given that this document talks exclusively about compiling with the Autoconf/Makefile build system. @Hans @Chris: Should the packaging instructions refer to the CMake or Autoconf/Makefile build system for the LLVM 3.8 release? [1] http://llvm.org/docs/Packaging.html
Chris Bieneman via llvm-dev
2016-Jan-14 17:38 UTC
[llvm-dev] Building SVN head with CMake - shared libraries?
> On Jan 14, 2016, at 5:18 AM, Dan Liew <dan at su-root.co.uk> wrote: > > On 14 January 2016 at 11:24, David Jones via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> Thanks - I'll try this tonight. >> >> Assuming it works, should these variables be added to the docs at >> http://llvm.org/docs/CMake.html ? > > Yes.It probably makes sense to add LLVM_BUILD_LLVM_DYLIB, but I would discourage adding BUILD_SHARED_LIBS to that document. BUILD_SHARED_LIBS is rarely what people actually want, and a lot of people gravitate to it because the wording is similar to the autoconf —enable-shared flag.> > We should probably be updating [1] too given that this document talks > exclusively about compiling with the Autoconf/Makefile build system.Yes, we should update that too. I actually have been meaning to put a section up there documenting the Apple Clang packaging because that is almost entirely open source now. I’ll try to get that done this week.> > @Hans @Chris: > > Should the packaging instructions refer to the CMake or > Autoconf/Makefile build system for the LLVM 3.8 release?Maybe, I’ll defer that to Hans. I believe the packaging scripts are on CMake, so we’ve at least gotten that far.> > > [1] http://llvm.org/docs/Packaging.html
Andrew Wilkins via llvm-dev
2016-Jan-15 01:36 UTC
[llvm-dev] Building SVN head with CMake - shared libraries?
On Thu, 14 Jan 2016 at 19:24 David Jones <djones at xtreme-eda.com> wrote:> Thanks - I'll try this tonight. > > Assuming it works, should these variables be added to the docs at > http://llvm.org/docs/CMake.html ? >http://reviews.llvm.org/D16208 Cheers, Andrew> > On Wed, Jan 13, 2016 at 10:26 PM, Andrew Wilkins <axwalk at gmail.com> wrote: > >> >> >> On Thu, 14 Jan 2016 at 11:02 David Jones via llvm-dev < >> llvm-dev at lists.llvm.org> wrote: >> >>> Now that autoconf is going away soon, I figured I'd try building using >>> CMake. >>> >>> I checked out llvm, cfe and lldb from the SVN server, and followed the >>> basic build instructions. >>> >>> cmake -DBUILD_SHARED_LIBS=OFF >>> -DCMAKE_INSTALL_PREFIX=/tools/llvm/svn_head >>> -DLLVM_TARGETS_TO_BUILD="X86;CppBackend" -DCMAKE_BUILD_TYPE=Release >>> -DLLVM_ENABLE_ASSERTIONS=ON ../llvm >>> >>> Everything worked well, and in the end I got the following shared >>> libraries: >>> >>> /tools/llvm/svn_head/lib/BugpointPasses.so >>> /tools/llvm/svn_head/lib/libclang.so >>> /tools/llvm/svn_head/lib/libclang.so.3.9 >>> /tools/llvm/svn_head/lib/liblldb.so >>> /tools/llvm/svn_head/lib/liblldb.so.3.9.0 >>> /tools/llvm/svn_head/lib/libLTO.so >>> /tools/llvm/svn_head/lib/LLVMHello.so >>> >>> However, with an autoconf build, I am used to seeing a libLLVM.so. From >>> a 3.7.1 autoconf build: >>> >>> /tools/llvm/3.7.1dbg/lib/BugpointPasses.so >>> /tools/llvm/3.7.1dbg/lib/libclang.so >>> /tools/llvm/3.7.1dbg/lib/liblldb.so >>> /tools/llvm/3.7.1dbg/lib/libLLVM-3.7.1.so >>> /tools/llvm/3.7.1dbg/lib/libLLVM-3.7.so >>> /tools/llvm/3.7.1dbg/lib/libLTO.so >>> /tools/llvm/3.7.1dbg/lib/LLVMHello.so >>> >>> I'd like to get libLLVM with the CMake build as well. But if I try >>> -DBUILD_SHARED_LIBS=ON, lldb-server fails to link properly and I cannot >>> install anything. >>> >>> Is this a bug in the make scripts for lldb-server? >>> How can I get libLLVM.so in addition to liblldb.so? >>> >> >> -DBUILD_SHARED_LIBS=ON will give you shared libraries for each component >> (libLLVMSupport.so instead of libLLVMSupport.a, etc.) >> >> What you want to set is -DLLVM_BUILD_LLVM_DYLIB=ON. For this to work, you >> must *not* set -DBUILD_SHARED_LIBS=ON. >> >> If you also want all the tools (clang, llvm-*, etc.) to link against >> libLLVM.so, you'll want to set -DLLVM_LINK_LLVM_DYLIB=ON, otherwise you'll >> have libLLVM.so but the tools will be linked against the static libraries. >> >> HTH, >> Andrew >> >> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://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/20160115/18c3d8be/attachment.html>
Dan Liew via llvm-dev
2016-Jan-15 14:09 UTC
[llvm-dev] Building SVN head with CMake - shared libraries?
On 15 January 2016 at 01:36, Andrew Wilkins via llvm-dev <llvm-dev at lists.llvm.org> wrote:> On Thu, 14 Jan 2016 at 19:24 David Jones <djones at xtreme-eda.com> wrote: >> >> Thanks - I'll try this tonight. >> >> Assuming it works, should these variables be added to the docs at >> http://llvm.org/docs/CMake.html ? > > > http://reviews.llvm.org/D16208That got accepted before I could review it. I have left some comments with suggestions on how to improve what has been committed to trunk. http://reviews.llvm.org/D16208
Maybe Matching Threads
- Building SVN head with CMake - shared libraries?
- Building SVN head with CMake - shared libraries?
- Building SVN head with CMake - shared libraries?
- Problem with the way BUILD_SHARED_LIBS=ON handled in llvm 3.8
- Building SVN head with CMake - shared libraries?