compile failed when build imagick

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
tynia
Posts: 2
Joined: 2017-10-11T06:29:53-07:00
Authentication code: 1151

compile failed when build imagick

Post by tynia »

i try to use imagick whick is a wrapped lib for golang.
i installed imagemagick successfully, and i could use tools such as convert or magick to make images as i thought.

however, i would like to use the library name imagick, which is based on the MagickWand for C. i built from the source code to product libraries, and installed it. i run the command: go get gopkg.in/gographics/imagick.v3/imagick, and it can pull the source code, but built failed.

it output :

Code: Select all

[userlz@compile ImageMagick]$ go get gopkg.in/gographics/imagick.v3/imagick
# gopkg.in/gographics/imagick.v3/imagick
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:39: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:45: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:85: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:96: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:115: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:125: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:140: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:178: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:186: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:205: undefined: runtime.KeepAlive
../gopath/src/gopkg.in/gographics/imagick.v3/imagick/drawing_wand.go:205: too many errors
i tried to see the code in drawing_wand.go, and the source code in module named runtime. the KeepAlive is a function with empty implement:

Code: Select all

// Mark KeepAlive as noinline so that the current compiler will ensure
// that the argument is alive at the point of the function call.
// If it were inlined, it would disappear, and there would be nothing
// keeping the argument alive. Perhaps a future compiler will recognize
// runtime.KeepAlive specially and do something more efficient.
//go:noinline

// KeepAlive marks its argument as currently reachable.
// This ensures that the object is not freed, and its finalizer is not run,
// before the point in the program where KeepAlive is called.
//
// A very simplified example showing where KeepAlive is required:
// 	type File struct { d int }
// 	d, err := syscall.Open("/file/path", syscall.O_RDONLY, 0)
// 	// ... do something if err != nil ...
// 	p := &File{d}
// 	runtime.SetFinalizer(p, func(p *File) { syscall.Close(p.d) })
// 	var buf [10]byte
// 	n, err := syscall.Read(p.d, buf[:])
// 	// Ensure p is not finalized until Read returns.
// 	runtime.KeepAlive(p)
// 	// No more uses of p after this point.
//
// Without the KeepAlive call, the finalizer could run at the start of
// syscall.Read, closing the file descriptor before syscall.Read makes
// the actual system call.
func KeepAlive(interface{}) {}
with informations above, how could i solve the problem i met?
can you anyone help me?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: compile failed when build imagick

Post by snibgo »

As this is an IMagick problem, I'm moving it to that subforum.

However, people here don't have much experience with IMagick. The developers here created and support ImageMagick, not IMagick.

Perhaps there is a more suitable forum somewhere.
snibgo's IM pages: im.snibgo.com
tynia
Posts: 2
Joined: 2017-10-11T06:29:53-07:00
Authentication code: 1151

Re: compile failed when build imagick

Post by tynia »

snibgo wrote: 2017-10-11T06:55:53-07:00 As this is an IMagick problem, I'm moving it to that subforum.

However, people here don't have much experience with IMagick. The developers here created and support ImageMagick, not IMagick.

Perhaps there is a more suitable forum somewhere.
it seems that the problem cannot be solved on the forum.

i try to develop a image server in soon. for the reason, using the IMagick is a better way for me to do that. so i try IMagick first. :(
Post Reply