FAQ
Hi. First post. I'm a graphviz developer (http://www.graphviz.org/), but
a newbi to Go.

I'm trying to extend graphviz' language support so that it can be used from
Go, as I've done already for multiple other languages using SWIG. I'm
struggling with how to use the SWIG generated components from Go. The swig
documentation seems to be out of date as it refers to things that don't
appear to exist in golang-1.1.2-3.fc20.x86_64.

I want to provide a graphviz package that can be imported into a Go main()
with: import ( "gv" )

SWIG has generated the following files:
       gv.go
       gv_gv.c
and a gv_go.cpp which is compiled into a library that is linked to the rest
of graphviz: libgv_go.so

So my questions are:
      1) how to I generate a "gv" module from here
      2) where do I install the result on Fedora so that Go can find it
trivially.

(There is a graphviz-lang-go rpm available for fc20 from
http://www.graphviz.org/ with my work on this so far.)

John

(( And yes, please feel free to rewrite graphviz in Go :-) I'm doing
this now mostly so I can learn Go in an application area I'm familiar with.
))

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ian Lance Taylor at Nov 19, 2013 at 11:23 pm

    On Tue, Nov 19, 2013 at 2:20 PM, wrote:
    I'm trying to extend graphviz' language support so that it can be used from
    Go, as I've done already for multiple other languages using SWIG. I'm
    struggling with how to use the SWIG generated components from Go. The swig
    documentation seems to be out of date as it refers to things that don't
    appear to exist in golang-1.1.2-3.fc20.x86_64.

    I want to provide a graphviz package that can be imported into a Go main()
    with: import ( "gv" )

    SWIG has generated the following files:
    gv.go
    gv_gv.c
    and a gv_go.cpp which is compiled into a library that is linked to the rest
    of graphviz: libgv_go.so

    So my questions are:
    1) how to I generate a "gv" module from here
    2) where do I install the result on Fedora so that Go can find it
    trivially.
    Most Go developers use the go tool. The go tool understands how to
    invoke swig directly. For this I recommend that you use the latest Go
    1.2 release candidate available at
    https://code.google.com/p/go/downloads/list , though it may also work
    in Go 1.1.2, I'm not sure.

    See http://blog.golang.org/organizing-go-code . Name your SWIG
    interface file with an extension of .swig.

    Hope this helps.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • John Ellson at Nov 20, 2013 at 7:59 pm

    On Tuesday, November 19, 2013 6:23:44 PM UTC-5, Ian Lance Taylor wrote:
    On Tue, Nov 19, 2013 at 2:20 PM, <john....@gmail.com <javascript:>>
    wrote:
    I'm trying to extend graphviz' language support so that it can be used from
    Go, as I've done already for multiple other languages using SWIG. I'm
    struggling with how to use the SWIG generated components from Go. The swig
    documentation seems to be out of date as it refers to things that don't
    appear to exist in golang-1.1.2-3.fc20.x86_64.

    I want to provide a graphviz package that can be imported into a Go main()
    with: import ( "gv" )

    SWIG has generated the following files:
    gv.go
    gv_gv.c
    and a gv_go.cpp which is compiled into a library that is linked to the rest
    of graphviz: libgv_go.so

    So my questions are:
    1) how to I generate a "gv" module from here
    2) where do I install the result on Fedora so that Go can find it
    trivially.
    Most Go developers use the go tool. The go tool understands how to
    invoke swig directly. For this I recommend that you use the latest Go
    1.2 release candidate available at
    https://code.google.com/p/go/downloads/list , though it may also work
    in Go 1.1.2, I'm not sure.

    See http://blog.golang.org/organizing-go-code . Name your SWIG
    interface file with an extension of .swig.

    Hope this helps.

    Ian
    Thanks. It helps some.

    Next question: How do I pass additional flags to the builtin swig
    invocation? My graphviz wrapper uses overloaded functions, so I need
    the -c++ flag.

    John

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ian Lance Taylor at Nov 20, 2013 at 8:42 pm

    On Wed, Nov 20, 2013 at 11:58 AM, wrote:
    Next question: How do I pass additional flags to the builtin swig
    invocation? My graphviz wrapper uses overloaded functions, so I need the
    -c++ flag.
    To get C++ support, name your SWIG file with an extension of .swigcxx.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 19, '13 at 11:09p
activeNov 20, '13 at 8:42p
posts4
users2
websitegolang.org

2 users in discussion

Ian Lance Taylor: 2 posts John Ellson: 2 posts

People

Translate

site design / logo © 2022 Grokbase