Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread Dan Kortschak
Thanks, Ian and Andrey. On Thu, 2019-12-05 at 21:06 -0800, Ian Lance Taylor wrote: > On Thu, Dec 5, 2019 at 9:02 PM andrey mirtchovski < > mirtchov...@gmail.com> wrote: > > > > i think cgo does some magic with defining functions called via > > C.funcname. if you have the same func defined in the

Re: [go-nuts] Multiple processes in parallel for cgo service

2019-12-05 Thread Ian Lance Taylor
On Thu, Dec 5, 2019 at 2:41 AM Nitish Saboo wrote: > > I am having a cgo(go + c) service.Is it possible to run multiple processes of > the same service in parallel ? Well, it depends on what the service does. But there is nothing in the Go tools or standard library that prevents you from doing

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread Ian Lance Taylor
On Thu, Dec 5, 2019 at 9:02 PM andrey mirtchovski wrote: > > i think cgo does some magic with defining functions called via > C.funcname. if you have the same func defined in the C preamble as > well as call it from the same Go file you get the same func defined > twice. putting it elsewhere as

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread andrey mirtchovski
i think cgo does some magic with defining functions called via C.funcname. if you have the same func defined in the C preamble as well as call it from the same Go file you get the same func defined twice. putting it elsewhere as an extern seems to work. to be honest i never dug into it. i did it

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread Dan Kortschak
Thanks. Can you explain the reason for this so it sticks in my head? On Thu, 2019-12-05 at 21:03 -0700, andrey mirtchovski wrote: > you just need to split it in two files. the cfuncs go into another > (sorry for lack of playground link): > > $ go build cgo.go cfunc.go > $ ./cgo > Hello from

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread andrey mirtchovski
you just need to split it in two files. the cfuncs go into another (sorry for lack of playground link): $ go build cgo.go cfunc.go $ ./cgo Hello from stdio $ cat cgo.go package main /* #include extern void myprint(char *s); */ import "C" import "unsafe" //export Example func Example() { cs

[go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread Dan Kortschak
I am trying to write a shared module that will be called from C, but I have run into a problem in using the work-around in https://github.com/golang/go/wiki/cgo#the-basics for calling variadic C functions. The case that I have is more complex, but altering the example at the wiki demonstrates

Re: [go-nuts] Looking for an app w/ mult. versions of a dependency

2019-12-05 Thread Andy Balholm
I’m pretty sure there is no “otherwise simple” example, because depending on two versions of the same library isn’t usually something a project does deliberately (except as a last resort). It’s normally the consequence of an extremely complex forest of dependencies. Andy > On Dec 5, 2019, at

[go-nuts] Looking for an app w/ mult. versions of a dependency

2019-12-05 Thread George Hartzell
Hi All, I'm working on improving the Spack (https://spack.io) package managers support for Go-based application (https://github.com/spack/spack/issues/13023). I'm trying to wrap my head around what Go's support for simultaneously using multiple major versions of a dependency means to Spack.

[go-nuts] Re: [ANN] Arhat: an experimental deep learning framework implemented in Go

2019-12-05 Thread Tong Sun
On Monday, December 2, 2019 at 12:56:14 PM UTC-5, Alexey wrote: > > I would like to announce the first public release of Arhat, an > experimental deep learning framework implemented in Go. > > Unlike most mainstream frameworks that perform training and inference > computations directly, Arhat

[go-nuts] Re: Is a public go benchmarking database/dashboard available

2019-12-05 Thread Tong Sun
On Monday, December 2, 2019 at 10:33:25 PM UTC-5, Xiangdong JI wrote: > > Hi, > > Wondering if there is any public database/dashboard of Go's benchmarking > data available? Thanks. > And by "public database" you meant a central one that covers everything? I.e., the purpose of benchmarking

[go-nuts] Plot Go's benchmark result

2019-12-05 Thread Tong Sun
Hi, Any existing tools out there that can turn Go's benchmark result from text into chart? I'm looking for a simple/light-weighted solution, like using gnuplot, or web -- Found one using Python to plot Go's benchmark result, but don't like the overhead. thx -- You received this message

Re: [go-nuts] tricks for installing go a single time on Windows 10 with Bash for Windows

2019-12-05 Thread Bruno Albuquerque
Can you clarify what exactly your problem is? I am asking because the only configuration that should be needed for go is to make sure it is in your system path (which mishandled by the installer). There is nothing else that you *MUST* configure for it to work. What is the actual problem you are

Re: [go-nuts] tricks for installing go a single time on Windows 10 with Bash for Windows

2019-12-05 Thread Pat Farrell
On Thursday, December 5, 2019 at 12:27:20 PM UTC-5, Rodrick Brown wrote: > > The first thing > Thanks. But that was not what I was asking for. I have the shells working. But go's installation has a lot of config stuff that needs to be setup. I want to have go work the same no matter which shell

[go-nuts] golang on z/os

2019-12-05 Thread tpfaff100
Are there any complete distros for golang 1.x on Z/OS? It seems that an IBM group in china had it working but is currently not supporting it. The "raleigh" server at IBM seems to be down so cross-compiling it has become not possible. Is there anyone here who knows where the distributions are?

Re: [go-nuts] log may block the entire program if stderr pipe gets full

2019-12-05 Thread Robert Engels
Nothing to be done here. This is the expected behavior and has been that way since the start of Unix. You can get around this by piping to an intermediate process that spools to disk and reads from that - until you run out of disk space. Honestly you probably should fix the consumer. > On

Re: [go-nuts] tricks for installing go a single time on Windows 10 with Bash for Windows

2019-12-05 Thread Rodrick Brown
The first thing you need to do is to enable Windows Subsystem for Linux feature from PowerShell. Go to the Start menu and search for PowerShell. Run it as administrator: Once you have the PowerShell running, use the command below to enable Bash in Windows 10. Enable-WindowsOptionalFeature -Online

[go-nuts] Re: golang gcc c++ existing static library can not be used when making a PIE object; recompile with -fPIC

2019-12-05 Thread nju04zq
I also run into this problem these days. Finally I found that adding "env CGO_LDFLAGS=-no-pie" to go build command line could solve this problem. For example, "env CGO_LDFLAGS=-no-pie go build -o main main.go". On Monday, July 1, 2019 at 8:22:08 AM UTC+8, czha...@gmail.com wrote: > > I posted

[go-nuts] log may block the entire program if stderr pipe gets full

2019-12-05 Thread peter . juhasz83
I've run into an insidious issue. The log package writes to the standard error. However, at least on linux, if stderr is redirected to a pipe and the other end of that pipe is not drained, then the kernel buffer associated with that pipe eventually gets full, and once that happens, subsequent

[go-nuts] manifest file of releases

2019-12-05 Thread uldericofilho
Hi, I did a quick investigation but I could not find a post that confirms whether there is a machine-friendly URL for Go releases? I would hope there would be a JSON file from which I could use to monitor releases and obtain download URLs. Something similar to what CoreOS does:

[go-nuts] Multiple processes in parallel for cgo service

2019-12-05 Thread Nitish Saboo
Hi, I am having a cgo(go + c) service.Is it possible to run multiple processes of the same service in parallel ? Thanks, Nitish -- 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,

[go-nuts] Re: GOMAXPROCS > num of CPU

2019-12-05 Thread Vincent Blanchon
Hello Serhat, Yes, I do not see a use case either. This is why I opened this thread, to know if someone sees a use case since it has been mentioned on GitHub :) Le jeudi 5 décembre 2019 11:33:10 UTC+4, Serhat Şevki Dinçer a écrit : > > In runtime it says: > > The GOMAXPROCS variable limits