-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMakeList.txt Changes Required for Boost Challenges #330
Comments
Hey @stungeye, Thanks for posting - it's good to get some recent, real-world feedback. And yes, configuring Boost always seems to be troublesome. Big picture, to make sure I grok you: configuring Boost for the Gigasecond and Meetup exercises is difficult, but we could help out by adding a few hints to our A few thoughts on your problem and solution:
I can see why setting
Huh, that's odd. I thought that the version was the minimum allowed unless
Wait, something doesn't make sense yet.... CMake's Some context, in the hope that I'll be corrected if I misunderstand something. In the ideal case, Theoretically, CMake's Theoretically ;) Apparently something in the chain isn't working, though I'm unsure what it is. Is it possible to set the CMake search path ( It's also possible that Visual Studio itself is having issues; for example, see here. Thoughts? |
Hi @KevinWMatthews. Thanks for the super quick and detailed response. Before I continue let me say that I'm enjoying the C++ track on Exercism immensely. I coded in C++ early in my career but spent the past 15 years in the web world with dynamically typed languages. Exercism has been crucial get getting me back up to speed with modern C++. The tests all just work and although there only seems to be one moderator commenting on my solutions the feedback they are providing is amazing. Okay. Back to the issue at hand. You are correct with your assessment of the situation:
Visual Studio was making it hard for me to see the effect of my changes to So, this leaves me with only one required change:
Which hilariously was the first thing that I tried, but due to me not understanding CMake and the required Visual Studio restart described above, it didn't initially solve my problem. This But it can be manually set to the correct path: You then have to persist this change by saving the settings, and in the process creating a After saving that setting I can compile and run the gigasecond program with an unmodified Do you think it would be worth mentioning the |
Hi @stungeye, Thanks for the update - things make a bit more sense now. Thanks also for doing some detective work - I don't have Visual Studio myself, sadly, so I appreciate you experimenting so much. Does Visual Studio provide a way to set
If this works, it seems to be the most straightforward and general solution.
Yes, but.... It's always complicated. Two thoughts thus far:
On the first point, we try to balance how specific our instructions are because IDE's change over time. Ideally, the IDE itself will provide appropriate docs. In practice, your experience shows that we have room for improvement. On the second, it's preferable to set |
Glad to hear that you're having a good experience with Exercism! I do know that the mentors (all volunteers?) have a pretty big workload cut out for them, so I wouldn't be surprised if they tend to follow students through the track. |
I am able to set My One other thing I didn't mention above, but that should be noted in case future Visual Studio users see this thread, is that I had to download Boost from boost.teeks99.com rather than from the official Boost website in order to get the pre-compiled binaries for Visual Studio. Lastly, debugging all this was made much easier by adding the following to the
This setting adds a bunch of helpful details to the CMake cache generation output. After all this I wonder if the gigasecond and meetup exercises should be refactored to use std::chrono instead of Boost's data_time? (I see this has been discussed before in #159 / #224 and that calendar additions are coming to std::chrono in C++20.) |
std::chrono should absolutely replace Boost here once we are able to use it with our minimum supported versions. I think that we need the features coming to std::chrono in C++20 though, so it will be on the order of several years before we can switch. Our current min version doesn't yet support C++17. |
Thanks for all your feedback here @patricksjackson. I have a better understanding of CMake and Visual Studio now. Much appreciated. I'm going to be creating and teaching some college-level C++ courses soon and will be including the Exercism CPP track in the mix. Shall we close this issue now? |
I'm leaning toward leaving it open and adding a small note to either the README or the comment at the start of the tests. Maybe extend this comment with something like:
Thoughts on the verbiage? |
Sounds good to me! I'll likely make a short blog post and/or youtube tutorial on using pre-built Boost binaries with Visual Studio to capture what I've learned. |
Closing this. We now have an online test runner that will work for people who have issues installing it locally. |
Hi all. I know there some closed issues about Boost, specifically its use in the Gigasecond and Meetup questions. For example: #311
I also see that adding instructions for installing Boost was considered but it was thought that students could Google the install instructions relevant to their setup.
That said, I just had a heck of a time getting Boost installed with Visual Studios 2019 in order to attempt the Gigasecond question. It turned out that I had to add/change three lines in the
CMakeLists.txt
file, but finding those three lines took a long time.After I installed the Boost Binaries for Windows I had to hint in
CMakeLists.txt
the location of my Boost binaries, and then change the version number forfind_package
:Then in order for the
boost
namespace and theptime
symbol to resolve in my source code I had to add anINCLUDE_DIRECTORIES
toCMakeLists.txt
:Do y'all think the
INCLUDE_DIRECTORIES
statement should be added to the providedCMakeLists.txt
file with a note about theBOOST_ROOT
in the readme?Knowing these three things up front would have saved me a few hours of Googling and experimentation.
cc: @patricksjackson @KevinWMatthews
The text was updated successfully, but these errors were encountered: