-
Notifications
You must be signed in to change notification settings - Fork 9
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
Clean up executable assignment in RDASApp/rrfs-test/CMakeLists.txt #79
Comments
CMake doesn't directly support dictionary data structures but you can get around it by using a list and then splitting elements via regex. @TingLei-NOAA, is the this the sort of solution you were looking for? Instead of:
We can combine both lists into a more compact "dict-like" structure as in:
And then we can retrieve the keys/pairs through:
|
@SamuelDegelia-NOAA Sure. this version would make this step more readable and less prone to errors. But, i would prefer a more "generic"/friendlier interface with a cost of a few additional functions. |
@TingLei-NOAA Yes that way looks good too and more user-friendly. BTW, what kind of message do you type in to ChatGPT to get something like this? |
@SamuelDegelia-NOAA Interesting question. I checked the records:). My prompts were as |
@TingLei-NOAA Gotcha, that is helpful. I also like how you thanked ChatGPT, hah! |
Both are great solutions! I liked @SamuelDegelia-NOAA's method. It is straightforward and easy to read. |
I think I slightly prefer the method @TingLei-NOAA got from ChatGPT since the lines to add a CTest are a little easier to look at (at least in my opinion). I have a version of this that builds successfully, I just need to run the CTests to confirm it works and then will put up a PR.
|
Either one works for me at the moment. FYI, are you aware that GDASApp now builds one single executable for all tests? I think this may be our final solution: issue: NOAA-EMC/GDASApp#1085 |
Good point @guoqing-noaa. We actually discussed this option just yesterday. I think the mega executable route will be necessary eventually no matter what per NCO compliance rules. But even if the CTests all use the same executable, we will still need an argument to specify the run type such as:
So getting this "dictionary-like" structure for CMake will be useful in the future. |
If we want to go this route (one single exe), I think the earlier the better. Yes, I agree that the "dictionary-like" feature is good to have. We can add them when needed. |
We can discuss this at our next meeting on Tuesday but I agree that it is probably better to work on this sooner rather than later. |
@SamuelDegelia-NOAA Great. You has already had a working version using dictionary-like structure. |
Closed per PR #81. |
I am planning to come up with a compact way to deal with the increasingly long list of executables in
RDASApp/rrfs-test/CMakeLists.txt
.The text was updated successfully, but these errors were encountered: