Skip to content
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

I cannot run call graph on my mac #9

Open
JohnCheeKinChow opened this issue Jul 6, 2022 · 14 comments
Open

I cannot run call graph on my mac #9

JohnCheeKinChow opened this issue Jul 6, 2022 · 14 comments

Comments

@JohnCheeKinChow
Copy link

Hi,

I am a rookie in this, but I want to get this tool works.
I saw the issue of luke: #1.
I tried following his advice but that don't work.

  1. brew install graphviz. I get this error:

Warning: No available formula with the name "graphviz".
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
It was migrated from homebrew/cask to homebrew/core.

  1. sudo cpan install GraphViz. I get this message:

Configuring R/RS/RSAVAGE/GraphViz-2.24.tgz with Makefile.PL
Can't exec "dot": No such file or directory at Makefile.PL line 21.
Please install Graphviz from http://www.graphviz.org/.
No 'Makefile' created RSAVAGE/GraphViz-2.24.tgz
/usr/bin/perl Makefile.PL -- NOT OK

  1. I downloaded the github from callGraph, perl_call_graph, graphviz-perl, and IPC-Run but don't know what to do with them.

Is someone that can help me?

Thanks a lot!

@JohnCheeKinChow
Copy link
Author

After some trying. I got some done. But still not working.

  • 1-3 is working now. after running perl_call_graph I get:

callGraph/perl_call_graph/bin/perl_call_graph ; exit;
Please specify some files to parse!
=> That is good

and running callgraph is succesfully. but still the last step when I type callGraph . It does not work and I get:

command not found: callGraph

@koknat
Copy link
Owner

koknat commented Jul 6, 2022

I'm guessing here since I don't have a Mac:
cd to the directory with callGraph executable
./callGraph

@mujtabaat
Copy link

@JohnCheeKinChow if you are able to run the callGRAPH guide me through this i'm unable to figured out this followed the issue 1
@koknat if possible kindly make a video or detailed READme that would be a great aid to new rookies

@koknat
Copy link
Owner

koknat commented Aug 29, 2022

Hi @mujtabaat
Sorry, but I don't have a mac myself, so I can't advise you on how to install the 'graphviz' dependency.
What happens when you run ./callGraph ?

@mujtabaat
Copy link

mujtabaat commented Aug 30, 2022

now i'm able to run your callGraph test file for dart and swift etc, but upon running my code of dart used for flutter mobile application i got this
Screenshot 2022-08-30 at 12 20 18 PM
any possible reason

@JohnCheeKinChow
Copy link
Author

Have you installed graphviz succesfully? My files are javascript and it worked

@mujtabaat
Copy link

Yeah i did callGraph is running, don't know why it didn't find the function calls[found 3 function definition] in the code of flutter application.

@koknat
Copy link
Owner

koknat commented Aug 30, 2022 via email

@koknat
Copy link
Owner

koknat commented Aug 30, 2022

Also, could you share how you installed graphviz for mac?
Did you use 'brew' or something else?
Asking in case it helps someone else with mac installation.

@thegoatinthemachine
Copy link
Contributor

It's possible that at the time you raised the issue, graphviz may not have had a successful formula in homebrew, though I doubt that since I've been using that for years.

brew install graphviz should successfully get you that. Make sure you run brew dr before calling it quits on that.

If you don't want to futz around with cpan configuration, which I didn't, you can brew install cpanminus which puts an executable cpanm in the /usr/local/bin path.

Then for the dependencies for callGraph on cpan packages, sudo cpanm GraphViz

All that'd be left is to make sure that callGraph is either being called explicitly, or that it's in your path. I cloned the repo and used stow (a GNU project perl script, actually, also in homebrew) to manage its symlink.

@koknat
Copy link
Owner

koknat commented Sep 7, 2022

Thank you @thegoatinthemachine

@cosmojg
Copy link
Contributor

cosmojg commented Oct 3, 2022

Just to provide another data point, callGraph works just fine on my machine running macOS Monterey (version 12.6), Homebrew (version 3.6.4), and GraphViz (version 6.0.1). Also, everything works as expected after adding callGraph to $PATH in Fish, Zsh, and Bash.

Notably, I ran into configuration issues (loadable library and perl binaries are mismatched) when trying to run callGraph with Homebrew's version of Perl. For lack of time, I ended up uninstalling Homebrew's Perl, nuked my Perl-related configuration files, unset my Perl-related environment variables, and switched to using the native Perl and CPAN binaries that ship with macOS by default. After starting from scratch, all I had to do was run cpan GraphViz with sudo and everything else worked as expected. (This was definitely user error, and I suspect I could get things running swimmingly with Homebrew's Perl if I tried hard enough.)

@koknat
Copy link
Owner

koknat commented Oct 3, 2022

Thanks @cosmojg for sharing your config and experience

@mkessy
Copy link

mkessy commented Nov 11, 2022

Figured I leave another data point for those looking to get it running on macOS (Monterey 12.6). Thanks to @thegoatinthemachine instructions I got it working without any fuss.

brew install graphviz && brew install cpanminus && sudo cpanm GraphViz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants