Closed acroucher closed 9 years ago
Sorry for the delayed response. I've been doing a lot of coding for work lately and haven't had the mental energy to do much when I get home in the evening.
I'm failing to reproduce this bug. I'm wondering what version of Ford you're running. Don't bother trying to run ford -V
, because it turns out that I'd forgotten to update that information when I released 2.0.0. You might need to check with pip/PyPI. In any case, between versions 1.1.0 and 2.0.0 I found some major bugs in my module dependency resolution which could cause it to break in various situations. It was shear luck that none of my test codes had broken it before. If you're running an old version of the code, try upgrading it to 2.0.0 or the GitHub version. If the bug still persists, let me know.
Thanks Chris. I upgraded to the latest version in pip and the fred/bob test above now works.
However FORD still gets the same error on my actual code. I have boiled it down to a simpler example which still fails. There are 3 source files- I have taken all the actual code out of them, leaving pretty much just the use statements:
fson_mpi.F90:
module fson_mpi_module
use kinds_module
use mpi_module
use fson
implicit none
private
end module fson_mpi_module
kinds.F90:
module kinds_module
implicit none
private
end module kinds_module
mpi.F90:
module mpi_module
implicit none
private
end module mpi_module
Here fson, used by fson_mpi_module, is an external library. If I remove the use fson
statement it works.
I'm still not able to reproduce this bug, using either v2.0 of FORD, or my development version. I copied the code samples you've provided here exactly. Would you be able to provide the contents of your project file?
Here it is:
project: Weird problem
project_dir: ./src
output_dir: ./doc/dev
extensions: F90
extra_vartypes: PetscErrorCode
MPI_Comm
PetscMPIInt
PetscInt
PetscReal
PetscScalar
PetscBool
Vec
NormType
DM
DMLabel
PetscSection
IS
Mat
KSP
SNES
SNESConvergedReason
Test FORD
However, I just tried taking out the extra_vartypes stuff (which isn't needed for these empty files- but is needed for my actual project), and then it works again. So maybe the problem is really something to do with the new extra_vartypes option?
Okay, that was an embarrassing one on my part. The problem was that ford/toposort were not designed to be able to compare strings to the objects representing Fortran modules. This meant that any modules not included in the code-base (represented as strings) could end up breaking FORD/toposort. Because toposort uses a dictionary, which is an unordered object, sometimes no comparison would be needed between a string and a module and everything would run fine. Other times (somewhat randomly) a comparison would be made and you'd get the error message.
Anyway, moral of the story was that I needed to make sure no strings were being passed to toposort. This is now done and the fixed version is on GitHub. Hopefully I'll be authoring a new release on PyPI soon, which will include the bugfix.
Thanks very much Chris, will give it a try.
Strange, I just installed FORD v2.1.0 via PIP, and gave the above problem a try (with the extra_vartypes stuff in the project file), and I'm still getting the exact same error. I've double-checked with pip freeze that I'm running the updated version. Any ideas?
I can't reproduce this at all, in either Python 2.7 or Python 3.4.2. I have absolutely no idea what the problem could be. Are you using any command-line options? The only other thing I can think to suggest as a way forward would be to do a completely fresh install of FORD in a virtualenv and see if that works. I don't know why it would behave any differently, but at least that way we'd know for certain that you are using exactly the same version of all of the packages as I am.
I just tried uninstalling FORD and installing again, but no difference. The versions of everything I'm using are:
Python: 2.7.3 FORD: 2.1.0 markdown: 2.6.2 markdown-include: 0.5.1 toposort: 1.4 jinja2: 2.7.3 pygments: 2.0.2 beautifulsoup4: 4.3.2 markupsafe: 0.23
Would any of these be likely to cause trouble?
The only difference between what you have and my local install is that I have Python 2.7.9 rather than 2.7.3. I wouldn't have thought that would cause problems, but who knows? I'm not aware of a way to install a previous patch-level release of Python on my system, so that makes testing the differences difficult. The only other route forward is if you could tar up the directory you're doing these tests in and send it to me as is, just to ensure that no changes have crept in since what you posted here. Of course, I understand if you're not willing to do that. Sorry I can't be more help.
Oops, sorry, this was my fault- I had cloned FORD at some point and still had the directory in my PYTHONPATH. Once I got rid of that, this test example worked fine.
Okay, glad to hear it!
On 22/06/15 11:42 PM, Adrian Croucher wrote:
Oops, sorry, this was my fault- I had cloned FORD at some point and still had the directory in my PYTHONPATH. Once I got rid of that, this test example worked fine.
— Reply to this email directly or view it on GitHub https://github.com/cmacmackin/ford/issues/41#issuecomment-114334239.
Chris MacMackin Saint Mary's University Curriculum Vitae http://ap.smu.ca/%7Ecmacmack/CV.pdf
hi, I have come across a weird problem: if I set up a test project with a source directory containing these two files:
bob.F90:
fred.F90:
and run FORD on it with the following config file:
I get the following error:
There is no npk_module defined in the source files. (It could be a module defined in a library that I link to- that usually seems to work OK.)
FORD works fine if:
Am I doing something silly or is this a problem?