Fortran-FOSS-Programmers / ford

Automatically generates FORtran Documentation from comments within the code.
https://forddocs.readthedocs.io
GNU General Public License v3.0
407 stars 133 forks source link

no documentation, no failour message #107

Closed StephenJTurnbull closed 8 years ago

StephenJTurnbull commented 8 years ago

I have a project stored in 3 different directories, (with some excluded directories).

I downloaded ford, pip install ford

checked ford -h. and got the (correct) help file.

Then I built a project.md file seen below. (changed the name to .txt so it would upload. fordproject.txt

when I ran: ~/Clusfinder/gamMaggie/Gam738Maggie$ ford fordproject.md ~/Clusfinder/gamMaggie/Gam738Maggie$ ford --debug fordproject.md

Nothing(including no error messages). I tried again changing /home/path/to/stuff to '/home/path/to/stuff' with no effect, tried changing the number spaces and lines between keys with no effect.

is my project file ill-formated? do I need to specify some files (which main?) directly? do I need to maunally write something at the start of each of the 250+ files?

Thank you for your time.

cmacmackin commented 8 years ago

In the file you posted, all of your metadata is on one line. I don't know if that is the case in your original, but it would certainly make it hard for FORD to interpret where your source directories are.

StephenJTurnbull commented 8 years ago

Thank you for your quick reply. I originally had line ends, but removed them to match the example file: ford/example-project-file.md

I got ford to run and see my files now.
It also sees a bunch of warnings

CONTAINS statement in INTERFACE Preceding documentation lines can not be inline Warning: Error parsing ../DuartGitLab/GGA-library/likelihood_nfw_class.f90. string index out of range

and then crashes:


Processing documentation comments... Correlating information from different parts of your project...

Creating HTML documentation... Traceback (most recent call last): File "/home/sjturnbu/.virtualenvs/JPYter/bin/ford", line 11, in sys.exit(run()) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/init.py", line 312, in run main(proj_data,proj_docs,md) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/init.py", line 299, in main docs = ford.output.Documentation(proj_data,projdocs,project,page_tree) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/output.py", line 76, in init self.graphs.register(item) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/graphmanager.py", line 62, in register ford.graphs.FortranGraph.data.register(obj,type(obj)) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/graphs.py", line 78, in register if obj not in self.programs: self.programs[obj] = ProgNode(obj,self) File "/home/sjturnbu/.virtualenvs/JPYter/lib/python3.4/site-packages/ford/graphs.py", line 253, in init n.called_by.add(self) AttributeError: 'TypeNode' object has no attribute 'called_by'


presumably when I clear the warnings the crash will resolve itself.

cmacmackin commented 8 years ago

The metadata only all appears to be in one line in the example file because GitHub's rendering doesn't understand metadata--it just sees it as a paragraph. If you look at the raw file you'll see that everything is on a separate line.

Without seeing the file which FORD had problems wiith, it's difficult for me to say what is wrong. One of those warnings indicates that you used a predocmark in an inline comment, which isn't allowed. Another says that you have a CONTAINS statement in an interface block which, as far as I know, is not legal Fortran. It's possible that FORD may be misinterpreting something there but, as I say, without being able to see the file it's hard to know.

There's a good chance that you are right and the crash will resolve itself once those warnings have been sorted out.

StephenJTurnbull commented 8 years ago

With 28 warning producing files. I shall attempt to summarize. two files had the warning: Preceding documentation lines can not be inline My Preceding symbol is ">" neither file has any inline comments at all in them they both have comments that start with white space, but so do many other files so that seams unlikely to be the culprit. Both also use ">" in equations.


! if superior to the magnitude limit of Yang et al. (2007)

IF ( dex( log10L ) > self%L_max ) THEN self%photo => get_photometry()


Again other files do the same, so it's not clear why this is a problem..

there are 5 files that fail because ford detects a "**\ in INTERFACE" in each case the code is redefining a basic operator:

PUBLIC:: OPERATOR( // )
PUBLIC:: ASSIGNMENT( = ) PUBLIC:: OPERATOR( - ), OPERATOR( + ),OPERATOR( .DOT. ),OPERATOR( .PROD. ),OPERATOR( * ),OPERATOR( > ), OPERATOR( < )

in a block of code that looks like


INTERFACE OPERATOR( / ) PROCEDURE divide_point_real .... END INTERFACE OPERATOR( / )


I suspect ford might be not catching the 'END INTERFACE" key phrase when operators are involved? It catches them without a problem in codes like


TYPE, EXTENDS(f_halo_mass) :: jenkins PRIVATE CONTAINS PRIVATE PROCEDURE, NOPASS :: fofsigma END TYPE jenkins INTERFACE jenkins PROCEDURE constructor END INTERFACE jenkins


There are 12 cases of Invalid variable declaration: ELEMENTALREAL(kind=dp)
and one of IMPUREELEMENTALREAL(kind=dp)

In each case there are one or more functions that have the ELEMENTAL key word allowing them to operate on arrays one element at a time.

There are two cases of "string index out of range " neither module has any strings defined so I don't know what this refers to.

Lastly 5 files have warnings: 'FortranInterface' object has no attribute 'subroutines' However while none of the code contain the string "subroutines" they call contain at least one "subroutine" nested inside of a function, inside of a module.
I don't know if that is the cause.

cmacmackin commented 8 years ago

Most of these problems should be fixed now that I've corrected a bug I found trying to generate documentation for another project. There's just one more bug I'm going to fix before I make a new release--hopefully that will be out by the end of the weekend. Without seeing the offending files or a minimal example I really can't say what is causing the predocmark problem or the overloaded interfaces problem. FORD is certainly capable of handling the latter in principle, so I don't know what the issue is in your specific case. Still, there's always a chance that my current round of bugfixes will end up solving those ones as well.

cmacmackin commented 8 years ago

I've released v4.5.2. It can be installed with pip install --upgrade ford. Let me know what problems persist.

StephenJTurnbull commented 8 years ago

I downloaded v4.5.2, it still failed, however it did so with fewer warnings so at least one of the problems was resolved.

I have compiled what I hope is a complete catalogue of runtime warning messages and code that reliably generates those messages.

I have stripped out as many lines as possible that did not effect the error messages. As such the code in the .zip is incomplete, and does generate output in FORD but still produces the "Warning: Error parsing " messages which likely are the cause of the subsequent failure.

Thank you for your time and attention.

MinimumExample.zip

diegoSta commented 8 years ago

i'm working on the same project with Sthephen, thanks for the support.

With the version v4.5.2 i have a fewer warnings:

Invalid variable declaration: ELEMENTALREAL(kind=dp), Invalid variable declaration: ELEMENTALLOGICAL Invalid variable declaration: PUREREAL(kind=dp) Invalid variable declaration: IMPUREELEMENTALREAL(kind=dp)

Here is one example: Invalidvariabledeclaration.tar.gz

diegoSta commented 8 years ago

Reading file ../../GGA-library/fhalomass_tinker.f90 Traceback (most recent call last): File "/home/diego/.virtualenvs/hmf/bin/ford", line 11, in sys.exit(run()) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/init.py", line 313, in run main(proj_data,proj_docs,md) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/init.py", line 265, in main project = ford.fortran_project.Project(proj_data) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/fortran_project.py", line 91, in init self.files.append(ford.sourceform.FortranSourceFile(os.path.join(curdir,item),settings,fpp)) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 925, in init FortranContainer.init(self,source,"") File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 585, in init self.MODULE_RE.match(line),self)) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 615, in init permission)) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 477, in init strings) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 174, in init self._initialize(first_line) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 1213, in _initialize rettype, retkind, retlen, retproto, rest = parse_type(attribstr,self.strings,self.settings) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/sourceform.py", line 1921, in parse_type if not match: raise Exception("Invalid variable declaration: {}".format(string)) Exception: Invalid variable declaration: ELEMENTALREAL(kind=dp)

zbeekman commented 8 years ago

Looking at the source code, I suspect this is a deficiency with how FORD handles these function declarations.

The standard says:

The type and type parameters (if any) of the result of the function defined by a function subprogram may be specified by a type specification in the FUNCTION statement or by the name of the result variable appearing in a type declaration statement in the specification part of the function subprogram.

I am not asserting that this is or is not a FORD bug. However, as a work around, you could try moving the type specification of the result variable from the FUNCTION statement to the specification part of the function subprogram.

e.g.,:

ELEMENTAL REAL(kind=dp) FUNCTION foo(bar)

becomes

ELEMENTAL FUNCTION foo(bar)
REAL(kind=dp) :: foo

Or you could use a result clause but this will require more changes through the function bodies (foo ==> result variable).

cmacmackin commented 8 years ago

FORD is supposed to be able to handle inline declaration of the type the function return-type. This looks like it could be an example of me being overzealous with the strip() function when handling text, or something along those lines.

On 24/02/16 14:54, Izaak Beekman wrote:

Looking at the source code, I suspect this is a deficiency with how FORD handles these function declarations.

The standard says:

The type and type parameters (if any) of the result of the
function defined by a function subprogram may be specified by a
type specification in the FUNCTION statement or by the name of the
result variable appearing in a type declaration statement in the
specification part of the function subprogram.

I am not asserting that this is or is not a FORD bug. However, as a work around, you could try moving the type specification of the result variable from the FUNCTION statement to the specification part of the function subprogram.

e.g.,:

ELEMENTALREAL(kind=dp) FUNCTION foo(bar)

becomes

ELEMENTAL FUNCTION foo(bar) REAL(kind=dp):: foo

— Reply to this email directly or view it on GitHub https://github.com/cmacmackin/ford/issues/107#issuecomment-188288544.

Chris MacMackin cmacmackin.github.io http://cmacmackin.github.io

cmacmackin commented 8 years ago

Also, thanks @StephenJTurnbull and @diegoSta for providing these examples. I'll try to take a look at them over the weekend, if not before. Usually these sorts of bugs aren't too difficult to track down once I have the offending piece of Fortran code.

diegoSta commented 8 years ago

Thanks for the suggestion, i'm going to re-factor the code to see if i can remove the warnings

zbeekman commented 8 years ago

@diegoSta Just to be clear @cmacmackin has confirmed this is a defect with FORD and that he will attempt to fix it soon, so depending on how urgent it is, you may just want to leave it as it is and wait.

If you still want to try a work around, please test it before refactoring the code; I have not done any testing to confirm that the work around actually works.

diegoSta commented 8 years ago

Thanks, now i have not warnings, but i have this error: Creating HTML documentation... Traceback (most recent call last): File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/output.py", line 90, in init self.docs.append(TypePage(data,project,item)) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/output.py", line 185, in init self.html = self.render(data,proj,obj) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/output.py", line 306, in render return template.render(data,dtype=obj,project=proj) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/type_page.html", line 1, in top-level template code {% extends "base.html" %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/base.html", line 99, in top-level template code {% block body %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/type_page.html", line 72, in block "body" {{ macros.bound_info(bp) }} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/macros.html", line 443, in template {{ proc_summary(bind) }} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/macros.html", line 378, in template {% if small %}

{% else %}

{% endif %}{{ proc_line(proc,proto=proto) }}{% if proto %}Prototype{% endif %}{% if small %}

{% else %}{% endif %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/ford/templates/macros.html", line 511, in template {% if proc.meta['deprecated'] and proc.meta['deprecated'].lower() == 'true' %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 389, in getitem return obj[argument] UndefinedError: 'str object' has no attribute 'meta' Error encountered.

cmacmackin commented 8 years ago

I believe I have fixed all of the bugs you have sent me. Could you please test it on your complete project before I make a final release? This can be done as follows:

git clone https://github.com/cmacmackin/ford
cd ford
virtualenv venv
source venv/bin/activate
pip install --editable .
cd <your-project-directory>
ford fordproject.txt --debug

The master version won't work on your minimal examples because they won't compile. However, you can get a version which will work as follows:

cd <directory-ford-cloned-into>
git checkout origin/spoof

The --editable flag used when you installed FORD in the virtual environment should mean that your installed version is automatically updated to this one. This branch has an experimental feature which I'm working on. It will prevent FORD from crashing while generating the documentation if a type-bound procedure's actual implementation is not found.

StephenJTurnbull commented 8 years ago

Firstly, Thank you for your time. The good news: All the warnings are gone.
Bad news:


Creating HTML documentation... Traceback (most recent call last): File "/home/sjturnbu/Clusfinder/ford/ford/output.py", line 90, in init self.docs.append(TypePage(data,project,item)) File "/home/sjturnbu/Clusfinder/ford/ford/output.py", line 185, in init self.html = self.render(data,proj,obj) gedit File "/home/sjturnbu/Clusfinder/ford/ford/output.py", line 306, in render return template.render(data,dtype=obj,project=proj) File "/home/sjturnbu/Clusfinder/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/home/sjturnbu/Clusfinder/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/home/sjturnbu/Clusfinder/ford/ford/templates/type_page.html", line 1, in top-level template code {% extends "base.html" %} File "/home/sjturnbu/Clusfinder/ford/ford/templates/base.html", line 99, in top-level template code {% block body %} File "/home/sjturnbu/Clusfinder/ford/ford/templates/type_page.html", line 72, in block "body" {{ macros.bound_info(bp) }} File "/home/sjturnbu/Clusfinder/ford/ford/templates/macros.html", line 443, in template {{ proc_summary(bind) }} File "/home/sjturnbu/Clusfinder/ford/ford/templates/macros.html", line 378, in template {% if small %}

{% else %}

{% endif %}{{ proc_line(proc,proto=proto) }}{% if proto %}Prototype{% endif %}{% if small %}

{% else %}{% endif %} File "/home/sjturnbu/Clusfinder/ford/ford/templates/macros.html", line 511, in template {% if proc.meta['deprecated'] and proc.meta['deprecated'].lower() == 'true' %} File "/home/sjturnbu/Clusfinder/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 389, in getitem return obj[argument] UndefinedError: 'str object' has no attribute 'meta' Error encountered.


Unfortunately, it looks like whatever the problem is, it is deeper than just a parsing problem.

diegoSta commented 8 years ago

Thank you for your time, i have not warnings.

But unfortunately i still getting the same problem. Creating HTML documentation... Traceback (most recent call last): File "/home/diego/cuda-workspaceb/ford/ford/output.py", line 90, in init self.docs.append(TypePage(data,project,item)) File "/home/diego/cuda-workspaceb/ford/ford/output.py", line 185, in init self.html = self.render(data,proj,obj) File "/home/diego/cuda-workspaceb/ford/ford/output.py", line 306, in render return template.render(data,dtype=obj,project=proj) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/home/diego/cuda-workspaceb/ford/ford/templates/type_page.html", line 1, in top-level template code {% extends "base.html" %} File "/home/diego/cuda-workspaceb/ford/ford/templates/base.html", line 99, in top-level template code {% block body %} File "/home/diego/cuda-workspaceb/ford/ford/templates/type_page.html", line 72, in block "body" {{ macros.bound_info(bp) }} File "/home/diego/cuda-workspaceb/ford/ford/templates/macros.html", line 443, in template {{ proc_summary(bind) }} File "/home/diego/cuda-workspaceb/ford/ford/templates/macros.html", line 378, in template {% if small %}

{% else %}

{% endif %}{{ proc_line(proc,proto=proto) }}{% if proto %}Prototype{% endif %}{% if small %}

{% else %}{% endif %} File "/home/diego/cuda-workspaceb/ford/ford/templates/macros.html", line 511, in template {% if proc.meta['deprecated'] and proc.meta['deprecated'].lower() == 'true' %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 389, in getitem return obj[argument] UndefinedError: 'str object' has no attribute 'meta' Error encountered.

StephenJTurnbull commented 8 years ago

Goodmorning,

I missed some errors when I first posted:

Using the SPOOF branch I get:

  1. No warnings while reading the source code.
  2. A lot of warnings while: Correlating information from different parts of your project...

Warning: BOUNDPROC get_values in TYPE blue_fraction could not be matched to corresponding item in code (file blue_fraction_class.F90). Warning: BOUNDPROC set_params in TYPE blue_fraction could not be matched to corresponding item in code (file blue_fraction_class.F90). Warning: BOUNDPROC get_concentration in TYPE concentrations could not be matched to corresponding item in code (file concentrations_class.f90). Warning: BOUNDPROC set_parameters in TYPE concentrations could not be matched to corresponding item in code (file concentrations_class.f90). Warning: BOUNDPROC dispersion in TYPE dispersion could not be matched to corresponding item in code (file dispersion_class.f90). Warning: BOUNDPROC get_values in TYPE fit could not be matched to corresponding item in code (file fitting.f90). Warning: BOUNDPROC phi in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC density in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC mean in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC density in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC mass_profile in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC generate in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC set_parameters_json in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC set_parameters_dictionary in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC integrate in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC double_integrate in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC set_relative_error in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC set_absolute_error in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC distribution in TYPE likelihood could not be matched to corresponding item in code (file likelihood_class.f90). Warning: BOUNDPROC d_lum in TYPE luminosity_distance could not be matched to corresponding item in code (file luminosity_distance_class.f90). Warning: BOUNDPROC get_values in TYPE myinterpolation could not be matched to corresponding item in code (file myinterpolation_class.f90). Warning: BOUNDPROC integrate in TYPE myinterpolation could not be matched to corresponding item in code (file myinterpolation_class.f90). Warning: BOUNDPROC density in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC set_parameters in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC create_index in TYPE sql could not be matched to corresponding item in code (file sql_class.f90). Warning: BOUNDPROC create_database in TYPE sql could not be matched to corresponding item in code (file sql_class.f90). Warning: BOUNDPROC read in TYPE readers could not be matched to corresponding item in code (file readers_class.f90). Warning: BOUNDPROC fofsigma in TYPE f_halo_mass could not be matched to corresponding item in code (file fhalomass.f90). Warning: BOUNDPROC read_line in TYPE read_ascii could not be matched to corresponding item in code (file read_ascii_class.f90). Warning: BOUNDPROC probabilities in TYPE base_probability could not be matched to corresponding item in code (file base_probability_class.f90). Warning: BOUNDPROC initialize in TYPE halo_masses could not be matched to corresponding item in code (file halo_masses_class.f90). Warning: BOUNDPROC is_in_region in TYPE masks could not be matched to corresponding item in code (file masks_class.f90). Warning: BOUNDPROC get_solid_angle in TYPE masks could not be matched to corresponding item in code (file masks_class.f90). Warning: BOUNDPROC anisotropy in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC set_parameters_json in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC set_parameters_dictionary in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC generate in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC line_of_sight in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC set_parameters in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC initialize in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_init in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_creator in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_members in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC before in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_properties in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC update in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC has_converged in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90).


However despite all the warnings, It did produce an html or more accurately lots of html.

Thank you!!!

diegoSta commented 8 years ago

Thanks you !!!, it's working :), we have now a cool map of the classes!!!

cmacmackin commented 8 years ago

Thanks for the update. The fact that you are getting these warnings could mean one of two things:

  1. Your code is missing the actual implementation of these type-bound procedures.
  2. FORD still has bugs causing it not to be able to find the implementations of type-bound procedures.

I'm assuming it is the second--if it were the first then your project wouldn't even compile. If you could send me one of the files causing these errors then I should be able to root out the issue. It would also help if you send me any modules which said files depends on (so probably best to choose a file with as few dependencies as possible).

StephenJTurnbull commented 8 years ago

I looked over the files that cause the warning. In each case the class is an abstract class with deferred implementation. The type bound function does get correctly identified in the subsequent derived class.


    PROCEDURE(get_concentration_int), DEFERRED, PUBLIC:: get_concentration
    PROCEDURE(set_parameters_int), DEFERRED, PUBLIC:: set_parameters

I have attached 3 files:
"concentrations_class.f90" which has the warning "guo_concentrations_class.f90" which extends concentrations_class.f90 and produces Ford documentation without an glitch.

And also "GGA.f90" and a screenshot of GGA's Call graph. I was unsure if the call chart is complete or not.

Line 52, and line 58 have calls to member functions rather than class functions.

The member functions properly appear in the function lists of the associated classes/modules but not in the call tree of the main program. Is this intentional to reduce clutter? Would it be difficult to include a classes call to it's objects functions? Or (as might be in this case) would the sheer overwhelming branching nature of following all the nested object calls make the resulting graph too large to render?

Lastly lines 51 and 55 have allocations lines which call constructor functions which in this case are non-trivial constructors which could in principle, but perhaps not in practice be included in the call graph.

tosend.zip screenshot from 2016-03-03 22 29 28

cmacmackin commented 8 years ago

Okay, so it seems that most (all?) of these warnings arise due to a bug in the logic on when to produce a warning. I had forgotten about deferred procedures and the fact that they won't have a binding. This makes it harder to figure out why FORD crashed when you were running the MASTER version rather than the SPOOF branch. I think it's due to a problem with identifying the abstract interface for a deferred type-bound procedure. I'll push some changes to the SPOOF branch today or tomorrow which should help to identify the problem.

The call graph issue is a known shortcoming of FORD. At present there is no support for including calls to type-bound procedures in the graph. This was, in essence, due to laziness when I implemented the call graphs. At the time I was thinking that doing this would be much harder than it actually is. Adding support for these is on my to do list. However, while I will continue to release bug fixes, I'm taking a break from developing new features for FORD for a little while because I've been trying to devote some effort to another project of mine, FIAT.

cmacmackin commented 8 years ago

I've pushed an update to the SPOOF branch. It has fixed all of the bugs I've found using the selection of files you've sent me. Let me know how it works.

StephenJTurnbull commented 8 years ago

Commit 28b9dd1d354ce82f7afe9b13581c49ff5ec7de71 works

But the new Commit 3d379fe9b0321b986580a64ee73b12403a5786aa does not. Same error as the non-spoof branch:


Creating HTML documentation... Traceback (most recent call last): File "/home/sjturnbu/Clusfinder/ford2/ford/ford/output.py", line 90, in init self.docs.append(TypePage(data,project,item)) File "/home/sjturnbu/Clusfinder/ford2/ford/ford/output.py", line 185, in init self.html = self.render(data,proj,obj) File "/home/sjturnbu/Clusfinder/ford2/ford/ford/output.py", line 306, in render return template.render(data,dtype=obj,project=proj) File "/home/sjturnbu/Clusfinder/ford2/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/home/sjturnbu/Clusfinder/ford2/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/type_page.html", line 1, in top-level template code {% extends "base.html" %} File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/base.html", line 99, in top-level template code {% block body %} File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/type_page.html", line 72, in block "body" {{ macros.bound_info(bp) }} File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/macros.html", line 440, in template {{ proc_summary(bind.bindings[0]) }} File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/macros.html", line 378, in template {% if small %}

{% else %}

{% endif %}{{ proc_line(proc,proto=proto) }}{% if proto %}Prototype{% endif %}{% if small %}

{% else %}{% endif %} File "/home/sjturnbu/Clusfinder/ford2/ford/ford/templates/macros.html", line 511, in template {% if proc.meta['deprecated'] and proc.meta['deprecated'].lower() == 'true' %} File "/home/sjturnbu/Clusfinder/ford2/ford/venv/local/lib/python2.7/site-packages/jinja2/environment.py", line 389, in getitem return obj[argument] UndefinedError: 'str object' has no attribute 'meta' Error encountered.

cmacmackin commented 8 years ago

Commit 3d379fe is not the most recent one--the most recent is 0e6db87f45614. Were you using the latter in your tests? If so, could you please show me what warnings (if any) were issued prior to the crash and backtrace?

StephenJTurnbull commented 8 years ago

WRT the previous it run, it produced no errors or warnings before crashing.

I changed to 3d379fe;

Same errors, still made final html.


Warning: BOUNDPROC get_concentration in TYPE concentrations could not be matched to corresponding item in code (file concentrations_class.f90). Warning: BOUNDPROC set_parameters in TYPE concentrations could not be matched to corresponding item in code (file concentrations_class.f90). Warning: BOUNDPROC dispersion in TYPE dispersion could not be matched to corresponding item in code (file dispersion_class.f90). Warning: BOUNDPROC get_values in TYPE fit could not be matched to corresponding item in code (file fitting.f90). Warning: BOUNDPROC phi in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC density in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC mean in TYPE lf could not be matched to corresponding item in code (file lf_class.f90). Warning: BOUNDPROC density in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC mass_profile in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC generate in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC set_parameters_json in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC set_parameters_dictionary in TYPE profiles could not be matched to corresponding item in code (file profiles_class.f90). Warning: BOUNDPROC integrate in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC double_integrate in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC set_relative_error in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC set_absolute_error in TYPE integrate could not be matched to corresponding item in code (file integrate_class.f90). Warning: BOUNDPROC distribution in TYPE likelihood could not be matched to corresponding item in code (file likelihood_class.f90). Warning: BOUNDPROC d_lum in TYPE luminosity_distance could not be matched to corresponding item in code (file luminosity_distance_class.f90). Warning: BOUNDPROC get_values in TYPE myinterpolation could not be matched to corresponding item in code (file myinterpolation_class.f90). Warning: BOUNDPROC integrate in TYPE myinterpolation could not be matched to corresponding item in code (file myinterpolation_class.f90). Warning: BOUNDPROC density in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC set_parameters in TYPE pps_density could not be matched to corresponding item in code (file pps_density_class.f90). Warning: BOUNDPROC create_index in TYPE sql could not be matched to corresponding item in code (file sql_class.f90). Warning: BOUNDPROC create_database in TYPE sql could not be matched to corresponding item in code (file sql_class.f90). Warning: BOUNDPROC is_in_region in TYPE masks could not be matched to corresponding item in code (file masks_class.f90). Warning: BOUNDPROC get_solid_angle in TYPE masks could not be matched to corresponding item in code (file masks_class.f90). Warning: BOUNDPROC read in TYPE readers could not be matched to corresponding item in code (file readers_class.f90). Warning: BOUNDPROC fofsigma in TYPE f_halo_mass could not be matched to corresponding item in code (file fhalomass.f90). Warning: BOUNDPROC read_line in TYPE read_ascii could not be matched to corresponding item in code (file read_ascii_class.f90). Warning: BOUNDPROC probabilities in TYPE base_probability could not be matched to corresponding item in code (file base_probability_class.f90). Warning: BOUNDPROC initialize in TYPE halo_masses could not be matched to corresponding item in code (file halo_masses_class.f90). Warning: BOUNDPROC anisotropy in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC set_parameters_json in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC set_parameters_dictionary in TYPE anisotropy could not be matched to corresponding item in code (file anisotropy_class.f90). Warning: BOUNDPROC initialize in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_init in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_creator in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_members in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC before in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC groups_properties in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC update in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC has_converged in TYPE algorithm could not be matched to corresponding item in code (file algorithm_class.f90). Warning: BOUNDPROC generate in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC line_of_sight in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC parameters_from_group in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90). Warning: BOUNDPROC set_parameters in TYPE velocity_profiles could not be matched to corresponding item in code (file velocity_profiles_class.f90).


diegoSta commented 8 years ago

when i run the commit 0e6db87f45614 i have not warnings, but i get the following error:

Creating HTML documentation... Traceback (most recent call last): File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/output.py", line 90, in init self.docs.append(TypePage(data,project,item)) File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/output.py", line 185, in init self.html = self.render(data,proj,obj) File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/output.py", line 306, in render return template.render(data,dtype=obj,project=proj) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 989, in render return self.environment.handle_exception(exc_info, True) File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 754, in handle_exception reraise(exc_type, exc_value, tb) File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/type_page.html", line 1, in top-level template code {% extends "base.html" %} File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/base.html", line 99, in top-level template code {% block body %} File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/type_page.html", line 72, in block "body" {{ macros.bound_info(bp) }} File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/macros.html", line 440, in template {{ proc_summary(bind.bindings[0]) }} File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/macros.html", line 378, in template {% if small %}

{% else %}

{% endif %}{{ proc_line(proc,proto=proto) }}{% if proto %}Prototype{% endif %}{% if small %}

{% else %}{% endif %} File "/home/diego/cuda-workspaceb/ford-0e6db87f45614cebdef73dba0f370a0f36d59d78/ford/templates/macros.html", line 511, in template {% if proc.meta['deprecated'] and proc.meta['deprecated'].lower() == 'true' %} File "/home/diego/.virtualenvs/hmf/local/lib/python2.7/site-packages/Jinja2-2.8-py2.7.egg/jinja2/environment.py", line 389, in getitem return obj[argument] UndefinedError: 'str object' has no attribute 'meta' Error encountered.

cmacmackin commented 8 years ago

I encountered this problem, or one very much like it, when using FORD on my own code. I've fixed it and pushed the fix to the SPOOF branch. Try updating to the latest commit and tell me if the problem persists.

diegoSta commented 8 years ago

thanks!! now i have not warnings, and i have the htmls!!

cmacmackin commented 8 years ago

I've just authored a release which contains all of the bug fixes (plus a few more) which I added in order to fix your problems.

StephenJTurnbull commented 8 years ago

Thank you!!

Date: Sun, 27 Mar 2016 13:18:29 -0700 From: notifications@github.com To: ford@noreply.github.com CC: s4turnbu@uwaterloo.ca Subject: Re: [ford] no documentation, no failour message (#107)

I've just authored a release which contains all of the bug fixes (plus a few more) which I added in order to fix your problems.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub