holdenlee / depgraph

Draw dependency graphs for math theorems
MIT License
7 stars 3 forks source link

depgraph missing #1

Open jstover79 opened 2 years ago

jstover79 commented 2 years ago

There is no file named "depgraph". Is that file supposed to be in there somewhere or maybe there are missing instructions on how to create it?

holdenlee commented 2 years ago

You will need to compile LatexDepGraph.hs on your machine and name the executable depgraph.

jstover79 commented 2 years ago

Aha! This is progress! Maybe not an issue on your end, but here is what ghc gives me:

$ ghc LatexDepGraph
[1 of 4] Compiling Utilities        ( Utilities.hs, Utilities.o )

Utilities.hs:17:1: error:
    Failed to load interface for ‘Data.Hashable’
    Use -v to see a list of the files searched for.

I assume this is not an issue on your end, and in that case, you can close this issue. Thanks for any hints, if you have any quick ideas on this -- but otherwise, thanks for the quick response!

holdenlee commented 2 years ago

You can try cabal install hashable which installs the package globally. Alternatively (and really this is preferred to keep the project self-contained, though I did not do it at the time), you can set up the project with stack and do stack install hashable. Ditto with any other missing package.

jstover79 commented 2 years ago

I got it with installing cabal, updating it, and then cabal install hashable. Thanks!

I was able to install a few other things with cabal, but here are two I can't figure out what to install for, any hints? I don't want to take too much of your time, so no pressure for a response as this isn't an issue with your code presumably.

$ ghc LatexDepGraph
[2 of 4] Compiling ParseUtilities   ( ParseUtilities.hs, ParseUtilities.o )

ParseUtilities.hs:16:1: error:
    Failed to load interface for ‘Data.Graph.Inductive’
    Use -v to see a list of the files searched for.

ParseUtilities.hs:17:1: error:
    Failed to load interface for ‘Data.List.Ordered’
    Use -v to see a list of the files searched for.
holdenlee commented 2 years ago

Search for the package and find the (lower-case) name that it's listed under. For example Data.Graph.Inductive gives https://hackage.haskell.org/package/fgl-5.7.0.3/docs/Data-Graph-Inductive-Graph.html, so the package name is actually fgl.

jstover79 commented 2 years ago

Ok, I was able to figure out which packages to install and compiling depgraph worked! I ran the code and go t this:

$ ./LatexDepGraph stover_mpp.tex mpp_out.dot dot.exe -Tpdf mpp_out.dot > mpp_out.pdf
LatexDepGraph: Prelude.!!: index too large

Also, I think there is a typo in the dep file and your instructions as it calls for depgraph, but mine was named LatexDepGraph it seems.

holdenlee commented 2 years ago

Looks like I overrode the default name and compiled it to depgraph on my machine, hence the discrepancy. I wouldn't know what the problem is without looking at the tex file. Unfortunately the parser is far from a full LaTeX parser, so there are some things that throw it off.

jstover79 commented 2 years ago

Thank you so much for the help!