Giter Club home page Giter Club logo

Comments (12)

cmacmackin avatar cmacmackin commented on May 27, 2024

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.

from ford.

acroucher avatar acroucher commented on May 27, 2024

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.

from ford.

cmacmackin avatar cmacmackin commented on May 27, 2024

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?

from ford.

acroucher avatar acroucher commented on May 27, 2024

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?

from ford.

cmacmackin avatar cmacmackin commented on May 27, 2024

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.

from ford.

acroucher avatar acroucher commented on May 27, 2024

Thanks very much Chris, will give it a try.

from ford.

acroucher avatar acroucher commented on May 27, 2024

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?

from ford.

cmacmackin avatar cmacmackin commented on May 27, 2024

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.

from ford.

acroucher avatar acroucher commented on May 27, 2024

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?

from ford.

cmacmackin avatar cmacmackin commented on May 27, 2024

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.

from ford.

acroucher avatar acroucher commented on May 27, 2024

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.

from ford.

cmacmackin avatar cmacmackin commented on May 27, 2024

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

from ford.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.