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

Add additional include path #200

Merged
merged 1 commit into from
Aug 1, 2020
Merged

Add additional include path #200

merged 1 commit into from
Aug 1, 2020

Conversation

adarshp
Copy link
Contributor

@adarshp adarshp commented Aug 4, 2019

Adding an additional include path to find graphviz/cgraph.h. For example, running

pkg-config --cflags-only-I libcgraph

with MacPorts returns

-I/opt/local/include/graphviz

(and similarly for Homebrew, except for usr instead of opt)

Adding an additional include path to find `graphviz/cgraph.h`. For example, running 

```
pkg-config --cflags-only-I libcgraph
```

with MacPorts returns

```
-I/opt/local/include/graphviz
```

(and similarly for Homebrew, except for `usr` instead of `opt`)
@coveralls
Copy link

Coverage Status

Coverage remained the same at 82.001% when pulling fa41efb on adarshp:patch-1 into 37208d1 on pygraphviz:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 82.001% when pulling fa41efb on adarshp:patch-1 into 37208d1 on pygraphviz:master.

@jarrodmillman jarrodmillman added this to the 1.6 milestone Jul 8, 2020
@dschult
Copy link
Contributor

dschult commented Jul 20, 2020

This seems reasonable to me -- though I wonder how many of these we might eventually get.
Is there a way to make pkg-config return what we want? We could also merge this and then add an issue to explore other ways of finding include paths.

@adarshp
Copy link
Contributor Author

adarshp commented Jul 20, 2020

This solution does use pkg-config though - it doesn't add any hard-coded paths.

The command pkg-config --cflags-only-I libcgraph returns the following:

  • -I/opt/local/include/graphviz on macOS with MacPorts
  • -I/usr/include/graphviz on CentOS and Ubuntu

The line below:

#include "graphviz/cgraph.h"

Seems to work on Linux, but I think (and this is just a guess) that is because it is using /usr/local/include as a default path to search for include declarations (in this case, it would find <graphviz/cgraph.h> whether or not pkg-config was used). To really utilize the info provided by pkg-config and not implicitly rely on the /usr/local prefix, I would suggest changing

#include <graphviz/cgraph.h>

to

#include <cgraph.h>

@dschult dschult merged commit fa5710f into pygraphviz:master Aug 1, 2020
@adarshp adarshp deleted the patch-1 branch September 27, 2020 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants