David Lobron via llvm-dev
2015-Oct-20 20:26 UTC
[llvm-dev] Building llvm so it can be installed by other users
Hey All, I'm working on packaging the current version of llvm for use by other people at my company. As part of this, I'd like to make a tarball of my build, so that other users do not have to rebuild from source in order to use llvm for their builds. Ideally, I'd like my makefile to un-tar my build output, and then do a "make install" to install anything that has been updated - we have a standard install root called "common" that lives one directory up from the build directory on our build machines. The tricky thing I'm running into is that all of the makefiles generated by cmake contain absolute paths, e.g., "/home/dlobron/build/clangport/akamai/llvm/llvm-3.7/llvm/include/llvm" I was wondering if it's possible to build llvm in such a way that all of these files contain relative paths. It would be perfect for me if the above line, and all other generated makefile paths, would read like this: "../common/include/llvm" I tried setting -DCMAKE_INSTALL_PREFIX, but it picked up the full path- I wasn't sure how to tell it to keep the path relative. Thanks for any help you can give! --David -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2863 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151020/104e3ed5/attachment.bin>
Jonathan Roelofs via llvm-dev
2015-Oct-20 20:37 UTC
[llvm-dev] Building llvm so it can be installed by other users
On 10/20/15 2:26 PM, David Lobron via llvm-dev wrote:> Hey All, > > I'm working on packaging the current version of llvm for use by other > people at my company. As part of this, I'd like to make a tarball of > my build,Build directories aren't easily redistributable, nor are they really meant to be. Install directories on the other hand can be, provided you build with the right options, and package together all the dependencies. Is there a particular reason why you want to distribute your build dir instead of your install dir? Jon> so that other users do not have to rebuild from source in > order to use llvm for their builds. Ideally, I'd like my makefile to > un-tar my build output, and then do a "make install" to install > anything that has been updated - we have a standard install root > called "common" that lives one directory up from the build directory > on our build machines. > > The tricky thing I'm running into is that all of the makefiles > generated by cmake contain absolute paths, e.g., > > "/home/dlobron/build/clangport/akamai/llvm/llvm-3.7/llvm/include/llvm" > > I was wondering if it's possible to build llvm in such a way that > all of these files contain relative paths. It would be perfect for > me if the above line, and all other generated makefile paths, would > read like this: > > "../common/include/llvm" > > I tried setting -DCMAKE_INSTALL_PREFIX, but it picked up the full > path- I wasn't sure how to tell it to keep the path relative. > > Thanks for any help you can give! > > --David > > > > _______________________________________________ LLVM Developers > mailing list llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Jon Roelofs jonathan at codesourcery.com CodeSourcery / Mentor Embedded
David Lobron via llvm-dev
2015-Oct-21 13:45 UTC
[llvm-dev] Building llvm so it can be installed by other users
Hi Jon,> Build directories aren't easily redistributable, nor are they really meant to be. Install directories on the other hand can be, provided you build with the right options, and package together all the dependencies. > > Is there a particular reason why you want to distribute your build dir instead of your install dir?Oops, you are right: I think it's the install directory that I want to be rooted in a relative directory path. My goal here is for other users to be able to install and use clang and the required headers and libraries, without having to build from scratch. The install path for a given user would be, e.g., /home/USERNAME/build/common/ So for example, clang would be installed to /home/USERNAME/build/common/bin. When I did my initial build, I set -DCMAKE_INSTALL_PREFIX to the "common" path above, but the Makefiles and cmake_makefiles that were generated have a full path (/home/dlobron/build/common), which of course is not portable to other users if they were to do a "make install". Is it possible to set DCMAKE_INSTALL_PREFIX (or another variable) such that I could package my install directory and another user could use it to install to their /home/OTHER-USERNAME/build/common root? Can I get it to write a relative path in the generated makefiles? I checked CMake.html in docs, but I did not see mention of this. Please also let me know if I appear to be thinking about this the wrong way- I've never attempted to package up a compiler collection for others' use before and I might be missing something obvious. Thanks! --David -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2863 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151021/48a95c8d/attachment.bin>
Tyler Hardin via llvm-dev
2015-Oct-23 06:00 UTC
[llvm-dev] Building llvm so it can be installed by other users
You could just tar up the files that will be installed and write a script to put them in their respective subdirs in /usr/local. (You could probably even steal their install script from the "install" target in their makefile.) If you look in the build directory (or it might be some subdir thereof*), there's usually a 1-1 correspondence between the folder names and the names of the folders where the files go in /usr or /usr/local. (Of course, you should check for conflicts/overwrites.) *: It's been a while since I've compiled LLVM. I just follow the list out of interest in their progress. On Tue, Oct 20, 2015 at 4:26 PM, David Lobron via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hey All, > > I'm working on packaging the current version of llvm for use by other > people at my company. As part of this, I'd like to make a tarball of my > build, so that other users do not have to rebuild from source in order to > use llvm for their builds. Ideally, I'd like my makefile to un-tar my > build output, and then do a "make install" to install anything that has > been updated - we have a standard install root called "common" that lives > one directory up from the build directory on our build machines. > > The tricky thing I'm running into is that all of the makefiles generated > by cmake contain absolute paths, e.g., > > "/home/dlobron/build/clangport/akamai/llvm/llvm-3.7/llvm/include/llvm" > > I was wondering if it's possible to build llvm in such a way that all of > these files contain relative paths. It would be perfect for me if the > above line, and all other generated makefile paths, would read like this: > > "../common/include/llvm" > > I tried setting -DCMAKE_INSTALL_PREFIX, but it picked up the full path- I > wasn't sure how to tell it to keep the path relative. > > Thanks for any help you can give! > > --David > _______________________________________________ > 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/20151023/114357f5/attachment-0001.html>
Bruce Hoult via llvm-dev
2015-Oct-23 09:57 UTC
[llvm-dev] Building llvm so it can be installed by other users
The usual way to handle this is: The "--prefix" argument or PREFIX env variable is used to specify the location in which the final program/libraries etc will be stored. The "--destdir" argument or DESTDIR env variable is used to specify the location in which the build products will be placed when you do "make install". It will probably not be possible to run the program from this location, because it will look for libraries at the "PREFIX" location. This makes it easy to simply tar up the entire contents of DESTDIR and then untar them in PREFIX on the same or other machines. Untarring does not affect existing files in the tree you are untarring into. On Fri, Oct 23, 2015 at 9:00 AM, Tyler Hardin via llvm-dev < llvm-dev at lists.llvm.org> wrote:> You could just tar up the files that will be installed and write a script > to put them in their respective subdirs in /usr/local. (You could probably > even steal their install script from the "install" target in their > makefile.) If you look in the build directory (or it might be some subdir > thereof*), there's usually a 1-1 correspondence between the folder names > and the names of the folders where the files go in /usr or /usr/local. (Of > course, you should check for conflicts/overwrites.) > > *: It's been a while since I've compiled LLVM. I just follow the list out > of interest in their progress. > > On Tue, Oct 20, 2015 at 4:26 PM, David Lobron via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> Hey All, >> >> I'm working on packaging the current version of llvm for use by other >> people at my company. As part of this, I'd like to make a tarball of my >> build, so that other users do not have to rebuild from source in order to >> use llvm for their builds. Ideally, I'd like my makefile to un-tar my >> build output, and then do a "make install" to install anything that has >> been updated - we have a standard install root called "common" that lives >> one directory up from the build directory on our build machines. >> >> The tricky thing I'm running into is that all of the makefiles generated >> by cmake contain absolute paths, e.g., >> >> "/home/dlobron/build/clangport/akamai/llvm/llvm-3.7/llvm/include/llvm" >> >> I was wondering if it's possible to build llvm in such a way that all of >> these files contain relative paths. It would be perfect for me if the >> above line, and all other generated makefile paths, would read like this: >> >> "../common/include/llvm" >> >> I tried setting -DCMAKE_INSTALL_PREFIX, but it picked up the full path- I >> wasn't sure how to tell it to keep the path relative. >> >> Thanks for any help you can give! >> >> --David >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> > > _______________________________________________ > 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/20151023/4c5c7208/attachment.html>