Paul C. Anagnostopoulos via llvm-dev
2021-Feb-23 21:59 UTC
[llvm-dev] Moving to a new machine
I've edited CMakeCache.txt so many times that I have no idea what to specify on the 'cmake' command line. Should I just guess, run cmake, copy my existing file on top of CMakeCache.txt, and run cmake again? At 2/23/2021 04:46 PM, Stefanos Baziotis wrote:>Hi Paul, > >Maybe I missed something but why do you need to copy directories if you want to build from scratch? >Just use the same CMake arguments you used in the original build.
On 2021-02-23, Paul C. Anagnostopoulos via llvm-dev wrote:>I've edited CMakeCache.txt so many times that I have no idea what to specify on the 'cmake' command line. Should I just guess, run cmake, copy my existing file on top of CMakeCache.txt, and run cmake again? > >At 2/23/2021 04:46 PM, Stefanos Baziotis wrote: >>Hi Paul, >> >>Maybe I missed something but why do you need to copy directories if you want to build from scratch? >>Just use the same CMake arguments you used in the original build.Hi Paul, You can run cmake on the new machine, and compare the CMakeCache.txt file with the old one to catch needed variables.
Unless everything is installed in the same location, copying the CMakeCache.txt likely won't work, as it includes things like paths to compilers in it, if I remember rightly. I've used diffs to try to identify which variables I've set before, but in practice, I end up just memorizing the three or four variables I tend to change from the defaults. James On Tue, 23 Feb 2021 at 22:06, Paul C. Anagnostopoulos via llvm-dev < llvm-dev at lists.llvm.org> wrote:> I've edited CMakeCache.txt so many times that I have no idea what to > specify on the 'cmake' command line. Should I just guess, run cmake, copy > my existing file on top of CMakeCache.txt, and run cmake again? > > At 2/23/2021 04:46 PM, Stefanos Baziotis wrote: > >Hi Paul, > > > >Maybe I missed something but why do you need to copy directories if you > want to build from scratch? > >Just use the same CMake arguments you used in the original build. > > _______________________________________________ > 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/20210224/69719f40/attachment.html>
I am using a shell script that contains the cmake line and that I edit (&re-run) when I make changes. It also allows me to just delete the build dir and to start from scratch occasionally. I think it is useful because as you noticed the CMakeCache.txt does not indicate which values have been changed from the default, and the default changes occasionally. For instance, recently the default pass manager changed to NewPM and I did not notice until I was notified that the documented workflow does not work anymore and would have to reset the build directory before I could reproduce it. Also, sometimes the host environment changes, e.g. after upgrading the version of the host compiler which requires running cmake again (cmake will refuse to re-use a build directory if the compiler changes). Michael Am Di., 23. Feb. 2021 um 16:06 Uhr schrieb Paul C. Anagnostopoulos via llvm-dev <llvm-dev at lists.llvm.org>:> > I've edited CMakeCache.txt so many times that I have no idea what to specify on the 'cmake' command line. Should I just guess, run cmake, copy my existing file on top of CMakeCache.txt, and run cmake again? > > At 2/23/2021 04:46 PM, Stefanos Baziotis wrote: > >Hi Paul, > > > >Maybe I missed something but why do you need to copy directories if you want to build from scratch? > >Just use the same CMake arguments you used in the original build. > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev