-
Notifications
You must be signed in to change notification settings - Fork 108
module naming issue #114
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
Comments
Right, it's an important detail. :) I'm curious, did you read the Packaging Guide beforehand? If not, perhaps we need to link to it more prominently from the README. Currently it's at the bottom. If you did read it, was any part of the guide confusing? |
Yes, I read it. Let me rephrase, the problem was not with the same name, I already had my files and modules named the same. The problem is with the particular style: |
Okay, I see. I don't think that should be the case. @everythingfunctional can you confirm this behavior? Is it expected? |
We discussed the naming convention in #39 a bit. I think the above seems to be a bug either way, but in general, we were thinking that we could simply name the modules by a name, and then |
The other issue related to this is that all modules should probably be prefixed by the name of the package, again, enforced by |
CCing @everythingfunctional, it's important that we get this right soon. I think the way we could do it is to implement what I described above by default and For example, in |
I agree that we need some solution to prevent name clash with dependencies, but this solution doesn't look like a good one to me. Consider datetime-fortran, which has the package name "datetime", and one module that contains a derived type The way it's named currently ( |
If I think enforcing modules in a library be prefixed by the project name is probably overkill. If namespacing is needed, we have a way to do that. Just put everything in a folder with the name of the library. I'm not sure having that be the default is necessary. |
I tried to replicate my issue with a smaller test case, and I couldn't, this time, fpm worked fine with modules with prefix mod_. I also tried https://github.com/wavebitscientific/functional-fortran from @milancurcic (since his modules are with mod_) and it also worked fine. I can only guess that I am missing something in my main project. I am going to look into it and will come back when I figure it out. Sorry for this false alarm. Regardless, your comments were very interesting and helpful. Thank you all! |
@smeskos I am glad it works! @everythingfunctional I don't know. We should discuss it. I feel module names without prefixes should be reserved for the main (user) application. Libraries should hide their modules behind a prefix. That is the common convention in C, which has the same problem (all functions being global). So if we agree that is a good convention, then we should enforce it (users can opt-out). |
The naming restrictions have been relaxed in both Fortran fpm in the current release. Therefore, I'm closing this issue as resolved. Feel free to reopen if this is not the case. |
I found out after a lot of trouble that I couldn't build my project because I had all the modules files in
src/
in the formmod_name.f90
, when I renamed all files tom_name.f90
and the modules tomodule m_name
respectively, it recognized them all and built successfully.The text was updated successfully, but these errors were encountered: