-
Notifications
You must be signed in to change notification settings - Fork 120
Resolve overlap between cmake/make #55
Comments
@tomaszkapela and @GBuella, just looking for your guidance here. I really like the set of top-level commands that we have today -- for example, being able to make a code change and run What cmake does better is in managing all of the little compiler switches that I tend to screw up anyway, so I would love to build the shared library (and executables) exclusively through cmake. But I think the rest of what the Makefile provides today works fairly well. So what I was thinking is that we'd remove the
The
Other top-level targets like Is this what you had in mind? The other obvious alternative would be to define all of our custom targets in cmake...but that seems more verbose and less descriptive than what we have now. I'm not so much a purist in the end -- I don't like having duplicate logic in the build today, and I prefer cmake for building libraries/binaries, but I wouldn't at all be bothered to still have top-level make commands as described in the README today. (https://github.com/pmem/pmemkv#installation) I'm curious if anybody has a different take on this. Thanks! |
Well, the main advantage here of a manually maintained Makefile is allowing a build without cmake. So one doesn't have to install it. If cmake would be required even for builds with the prepared Makefile, then I believe just keeping cmake would be preferred.
We already use most of this in pmemfile and syscall_intercept.
mkdir pmemkv_dbg
cd pmemkv_dbg
ccmake ~/code/pmemkv # and choose Debug build in ccmake
make pmemkv_stress
./pmemkv_stress
cd ..
mkdir pmemkv_release
cd pmemkv_release
ccmake ~/code/pmemkv # and choose Release build in ccmake
make pmemkv_stress
./pmemkv_stress
|
By the way, if a single command build is really needed, one can always add a build.sh to the source, which does something like: |
I'm with @GBuella on this one. Maintaining both will almost certainly become a bother, probably sooner than later. Calling cmake from the Makefiles provides no benefit besides backward compatibility, which at this point in time should not be taken into account. I don't see a reason why this shouldn't be ported to Windows, although I might be missing something. Speaking from experience, maintaining two build systems is tedious. I opt for dropping Makefiles in favor of cmake. |
OK, you have me convinced that all heavy lifting done by the build should be done exclusively by cmake. If you look at our latest build, you'll see that no build logic is duplicated now. I also documented out-of-source builds in the README. That said, I still greatly prefer to use a top-level Makefile rather than copy/paste long cmake commands from the README, like is being done in pmemfile. I don't want to have to manually copy/paste at all. I'd like to have all scripts under source control, and the be able to easily handle when the directory structure changes (like we just did, getting rid of the So while you've completely convinced me of the power and utility of cmake, let me try to convince you that the user experience shown by NVML is the right one. For a first-time user, we shouldn't ever be doing anything more complicated than I think this latest version gives the power and benefits of cmake without giving up full automation for what we consider our "standard build" -- but as always, I'm open to better ideas and strong feelings. I also reached out to @sarahjelinek on this issue, and it sounds like she would prefer a higher level of automation rather than what's being done there with cmake today. I'll let her comment for herself. If it really bothers people that the top-level script is a Makefile script, rather than a bash script or a Ruby script or whatever...then we can have that debate. Let's acknowledge though that this latest version puts all significant build logic in cmake, so we're not maintaining two build systems any more. (the current version also enforces minimal dependencies when it comes to rebuilding, because all the real logic is handled by cmake) |
@GBuella, @tomaszkapela, ok to close this, or are there unaddressed concerns? I'm definitely open if there are still suggestions about how to improve this, but if not then let's move on to other things. 😀 |
OK, I think.
But let's just make a ticket about install/uninstall and packaging for different distros. |
Thanks for all the help on this thread. I created #62 to handle building native packages, which doesn't need to be done yet. I also modeled the build system in the pmemkv-jni repo after our work here. |
blog: modeling strings with cpp bindings
The build system currently has duplicate logic for downloading 3rd party libraries and building the shared library and test programs. This logic appears in both CMakeLists.txt and the Makefile (specifically the
thirdparty
andsharedlib
targets).The installation section of the README (https://github.com/pmem/pmemkv#installation) should be updated accordingly to fit the new approach.
The text was updated successfully, but these errors were encountered: