-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add modules support #7
Comments
Looking at 3, a module name could be units::quantity<units::isq::si::dim_length, units::isq::si::metre, int> would then look like units::quantity@units<units::isq::si::dim_length@units.isq.si.length, units::isq::si::metre@units.isq.si.length, int> |
Thanks for pointing that. Anyway, over time I changed my initial plans here. I do not think that Modules with granularity smaller than the entire system are a good idea. Some time ago I refactored the library's file system to represent the intended modules hierarchy. So as of now, I think that we should end up with something like:
I still have doubts how the final tree of modules should look like so please do share your feedback, ideas, and experience. |
BTW, I met with @DanielaE at NDC TechTown and she offered her help here if the time will allow this. |
Related discussion #279. |
For example, I am not sure if we should put |
Yes, I actually did 🤦♀️ |
Other issues are |
No module can look at macros defined outside the compilation of the PMI (except for given from to the compiler at its invocation) |
@DanielaE, please let me know when you will have free time and we can meet online and I will guide you through the compilation on VS2022 and provide a short introduction to the framework of the library (if needed). |
@DanielaE, do you know how STD library will handle freestanding with modules? What about the types that have predefined |
I have no clue at all. This discussion happens at the library side and I'm sitting in EWG (i.e. core language) |
It seems like you intent to claim |
Thanks for pointing this out. In the names above I assumed we are talking about potential future STD library. But this good point that for the library itself the identifier should be different. Let's go with |
The |
Right, what does the expression |
Right! 😃 |
Well, even though one other library pretending for standardization already use |
@DanielaE mp-units on VS2022 is officially enabled now 😃 Please let me know if you need any assistance. |
I have made some progress at https://github.com/JohelEGP/units-1/tree/modules. It depends on appending to This CMake support still has its shortcomings that I'll eventually fix. Now I'm at the point where I need to deal with I've lost GCC (probably due to running out of source locations, or just a compound of bugs). |
I've also lost Clang.
|
I've opened llvm/llvm-project#54340, llvm/llvm-project#54457, llvm/llvm-project#54574, llvm/llvm-project#54590, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104993, and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105044, so far. Anything that touches the downcasting facility also has the constant expression issue of the second LLVM issue. And turning off the downcasting facility doesn't work due to bugs. |
e1f7266 broke GCC further. Now I'm sure that what's significantly blocking progress on GCC's modules is the modularization of My approach is to compile an importable header that So I'd like to know if anyone knows a better way to use the C++ standard library headers in GCC modules to unblock progress. |
@DanielaE, do you have some experience with the problem described above? |
Before I commence digging deeper I'd love to know if the library can be built with VS2022 and the build system used in the failed attempts (CMake I guess). Is CMake even capable of doing something meaningful with modules these days? Last time I looked it was a total desaster. I cannot comment on anything gcc or clang-specific. My machine is running VS2022 on Windows - no Linux with a working development environment. AFAIK, the current state of gcc and clang is so poor that I wouldn't even bother to install a dev environment in WSL on my own. If someone is willing to baby-step me there such that I can see the same failures as above, I might spend some of my meager spare time on that. And I don't understand what an importable header of the C++ standard library should buy here. I've experimentally done that for my last year's talks on modules and found this to be particularily hard and mostly not worth the effort. Without #include-translation you have to do a lot of preprocessor gymnastics to even be able to use something like |
No, it only supports Clang and GCC. |
@DanielaE, @JohelEGP has issues with C++ modules on Clang and GCC as described above. However, the library compiles just fine on VS2022 (but without using modules). You can find all the information here: https://mpusz.github.io/units/usage.html. In case you will have any issues please let me know. We can also meet online to get you started. |
-This CMake support still has its shortcomings that I'll eventually fix.
+This CMake support still has its shortcomings that I'll eventually fix and document. An important one is that only the Unix Makefiles generator is supported because Ninja wasn't usable, and I haven't tried out the supposedly fixed Ninja 1.10. |
@mpusz a short feedback: I'm still at step The troublemaker is the dependency |
@DanielaE please try: |
Thanks - this helps! 😊
|
I must admit I never used VS generator (always Ninja) but it seems it works nearly OK for me. The only problem I see is that VS generator seems to not work with generator expressions for This is my
and this is how I run it:
I am on the latest VS2022 version (with all updates). |
Modules:
Framework types that should not be explicitly used by the user (i.e.
dimension
,unit
) should be private in a module and only a helper interface should be publicly exposed to the user.The text was updated successfully, but these errors were encountered: