# GraphML support on MacOS

**URL:** <https://igraph.discourse.group/t/graphml-support-on-macos/1040>\
**Category:** Usage\
**Tags:** R\
**Created:** [13 December 2021 12:59 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040 "2021-12-13T12:59:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![luukvdmeer](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/luukvdmeer/32/655_2.png) [@luukvdmeer](https://igraph.discourse.group/u/luukvdmeer)\
**Post date:** [13 December 2021 12:59 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/1 "2021-12-13T12:59:52Z")

</div>

Dear igraph maintainers!

I am maintainer of an R package (sfnetworks) that depends on igraph. I have been contacted by CRAN that I am “using a optional feature of igraph, one that the igraph maintainer has broken the detection of on macOS”. I have looked through all recent igraph changelogs and cannot find anything that mentions something like that.

Given the warnings resulting from the CRAN checks on MacOS ([CRAN Package Check Results for Package sfnetworks](https://cran.r-project.org/web/checks/check_results_sfnetworks.html)) it seems to me the issue relates to support for reading GraphML files:

```auto
At foreign-graphml.c:1446 : GraphML support is disabled, Unimplemented function call

```

My question is: is it true that, as stated by CRAN, support for GraphML is recently disabled on MacOS by the igraph maintainers? The only thing I can find about it relates to Windows and not MacOS: [Reading GraphML files not enables · Issue #32 · conda-forge/python-igraph-feedstock · GitHub](https://github.com/conda-forge/python-igraph-feedstock/issues/32) If yes, should this be mentioned somewhere in the igraph changelogs?

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [13 December 2021 14:20 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/2 "2021-12-13T14:20:18Z")

</div>

Thanks for the heads up; `libxml2` is an optional component of the core C igraph library so it may be the case that the environment in which the R packages are built on CRAN does not have `libxml2` available (or something goes wrong with the auto-detection) and the igraph versions on CRAN were built without `libxml2`.

I’ll look into this and post an update to CRAN if it is the case. We definitely did not mean to remove GraphML support from igraph on CRAN.

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [13 December 2021 15:14 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/3 "2021-12-13T15:14:18Z")

</div>

So it seems like the versions on CRAN were indeed compiled without GraphML support. However, I don’t know how it could have happened because a recent build on RHub detected `libxml2` correctly on macOS:

> **[R-hub package builder](https://builder.r-hub.io/status/igraph_1.2.9.9059.tar.gz-5d6316c88f7c4b899e1686b1f7533f36)**
>
> R package builder, by the R-hub project of the R Consortium, easing the R package development process.

I need to investigate this in more detail.

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [13 December 2021 15:34 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/4 "2021-12-13T15:34:18Z")

</div>

Just checking: is `libxml2` also disabled in the Windows binary from CRAN?

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [13 December 2021 15:57 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/5 "2021-12-13T15:57:21Z")

</div>

Most likely not, otherwise the checks for `sfnetworks` should have failed on Windows as well.

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [14 December 2021 08:56 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/6 "2021-12-14T08:56:17Z")

</div>

It looks like the `libxml2` detection code can fail in igraph’s `configure.ac` script under special circumstances because we are not using all the flags from the output of `xml2-config --libs` when trying to link to `libxml2`. This happens to be okay 99% of the time on macOS because `libxml2` is on the system path so no special linker flags are needed, but it is not okay on the machines where CRAN builds the packages so the detection fails there. (Thanks to Prof Ripley for finding this).

I’ll submit a patched version to CRAN soon.

---

<div class="post-metadata">

**Author:** ![tamas](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/tamas/32/1261_2.png) [@tamas](https://igraph.discourse.group/u/tamas)\
**Post date:** [15 December 2021 07:54 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/7 "2021-12-15T07:54:11Z")

</div>

igraph 1.2.10 is now on its way to CRAN; the sources are already there. Please give it a go when the macOS version is ready (you can follow the progress [here](https://cran.r-project.org/web/checks/check_results_igraph.html) ).

---

<div class="post-metadata">

**Author:** ![loreabad6](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/loreabad6/32/659_2.png) [@loreabad6](https://igraph.discourse.group/u/loreabad6)\
**Post date:** [15 December 2021 17:19 UTC](https://igraph.discourse.group/t/graphml-support-on-macos/1040/8 "2021-12-15T17:19:59Z")

</div>

Just to clarify, `sfnetworks` is failing now on `r-devel-windows-x86_64-new-TK` as well. Since we are urged by CRAN to make `libxml2` conditional on our end, we will remove the GraphML use for now. We will come back to you when we manage to fix this from our side if someone else finds it useful.
