Open Usalabs opened 8 months ago
In the ReadMe is full instructions. As mentioned therein, the Go you will need to install: https://go.dev/doc/install Then just follow the "Configuration" for the other stuff. She did mention she has not compiled the binaries yet, so you may have to compile it yourself.
In the ReadMe is full instructions. As mentioned therein, the Go you will need to install: https://go.dev/doc/install Then just follow the "Configuration" for the other stuff. She did mention she has not compiled the binaries yet, so you may have to compile it yourself.
I'm looking at the readme now, and I don't see anything that refers to an 'Installation', there is only 'Purpose' explaining how goswi came about, 'Configuration' on how to configure it, 'TLS' on how to use Secure Sockets Layer, 'New Relic' and 'Disclaimers and License', there is nowhere in that 'Readme' is anything that says how to install or even compile it.
Show me where is says something like "To install goswi, you will need to install these packages ........., then blah blah blah"
Oh!... you're right, @Usalabs, the installation instructions are not obvious at all if you're not a Go developer :-)
First, of course, you need to install Go. Go is a programming language, BTW, which essentially compiles under any platform/operating system, and can cross-compile to any other platform without changing anything but an environment variable. It was originally developed in the mid-2000s by Google's compiler workgroup, which includes famous celebrities from the compiler development community, namely, one of the inventors of the C programming language (55 years ago) and the inventor of the Perl language. As a result, few still living people have more experience in developing programming languages than this Dream Team, and Go is one of their 'modern' creations.
That said, and assuming you're on a Debian/Ubuntu variant (or else you'd not use apt
...), you'll need to do
sudo apt install golang
and that should be it. Mind you, the bundled version with Ubuntu is insanely outdated (as most Ubuntu packages are, especially on the LTS versions). I sincerely recommend using the backport from the longsleep PPA: https://launchpad.net/~longsleep/+archive/ubuntu/golang-backports
Simon Eisenmann, the maintainer of that repository, is usually just one or two minor versions behind (and very rarely he even manages to release the binaries as quickly as Google releases them!... but this is not always the case).
If you don't trust third-party PPAs on your system, well, you can always grab the package directly from Google: https://go.dev/dl/
Note that the first entry on the list is usually the bundle with the source code, which you will not need (note: Go compiles itself); you'd be better off with one of the many binaries, depending on the architecture you're on. Go runs natively on lots of processor architectures, but you need the correct binaries. Installing it is quite straightforward (how I wish that other programming languages were that easy...), just download the tar file to /usr/local
and extract it. That's all it takes. You might wish to add a symlink to the Go binary afterwards (e.g. sudo ln -s /usr/local/go/bin/go /usr/local/bin
, assuming that you do have /usr/local/bin
on your path). BTW, Ubuntu and Eisenmann seem to prefer a not-so-obvious installation path for Go, but that's ok, Go can run from anywhere. If you want, you can run it in userland, under your own account (I do that on shared hosting providers, such as Dreamhost and Bluehost, because it's so easy to install and does not require tinkering with any privileged — i.e., root-only — files or directories).
Once you've got the Go compiler up and running, you have a few options to install gOSWI...
The easiest is go install github.com/GwynethLlewelyn/goswi@latest
. It will download/upgrade all required dependencies automagically and finally compile everything into a binary, which is dropped on your path. On a decent machine, this should take a few minutes, most of which will be spent downloading everything it requires. The Go compiling tool (called, well, go
...) is notoriously quiet, and most of the time it won't write anything on the screen for a long while. You can use the -v
flag to show some progress. The theory is that, on most scenarios, Go compiles so fast that it takes far longer to download everything it needs than actually compiling it, so, in most cases, you won't 'need' to see what it's doing.
That's the theory, of course. On a fresh Go installation — or one that has been kept around for quite a long time without any upgrades — the first time it runs, it should take considerably longer (afterwards, the Go compiler tools work incrementally, compiling on demand whatever has been changed on disk (but only that!) and linking every component together.
Go is statically compiled, which means it can run from anywhere and you don't need ever to worry about having the correct libraries in the right places, etc. That also means that the binary will be much bigger than expected! But don't mind its size; it does not mean that the actual application will have to launch everything into memory! Rather, it only loads what it needs, and calls the rest on demand. It's remarkable how this is accomplished so easily across every supported system.
The next step, of course, is to actually install gOSWI itself.
By far, the easiest way is to do go install github.com/GwynethLlewelyn/goswi@latest
, which should drop you a freshly compiled binary under $GOPATH/bin/goswi
(or $HOME/go/bin
if the GOPATH
environment variable is not set).
If by any chance you get some errors related to ImageMagick, try installing the required header files with sudo apt install libmagick-dev libmagick-cor-dev libmagickwand-dev
. ImageMagick is perhaps the trickiest bit on the whole setup, ranging from "it gives too many errors and is impossible to fix" to "what's ImageMagick and why did I have to worry about it?" YMMV, but I've tested on four different machines, with different architectures and operating systems, and each had its own share of issues.
This might make me reconsider the usage of ImageMagick as a compiled-in library, and delegate it to whatever executable is installed. We'll see what I'll come up with...
Once you've got gOSWI installed, you're welcome to continue reading the rest of the instructions to see how to configure it!
@GwynethLlewelyn I do indeed use Ubuntu, I use headless Ubuntu version 20.04 LTS, on a Dell PowerEdge T710 server with 2x octa core Zeon CPU's each with 8x2 cores (8 physical cores, 8 logical cores), totaling 32 cores, 212GB RAM, and 16TB SSD (8x 2TB) in RAID 5.
I think I would consider this a "decent" machine lol.
If you're wondering why I haven't upgraded Ubuntu to 22.04 LTS, it's because 20.04 has not reached it's EOL yet.
I'll try the golang install and keep you informed of what happens.
Oh! All right then — replace "minutes" by "seconds" then :-) I was thinking more along the lines of the time it takes on a Raspberry Pi Zero 2 W (which is one of the machines I use to do the testing :) ).
Either 20.04 or 22.04 is fine; I believe I have even managed to test it back in the 16.04 days (!). Well, admittedly, it was a very early and rudimentary version... not that the current version is really "advanced"... anyway, the trick, of course, is to use either the longsleep PPA (which also supports many earlier Ubuntu versions), or simply download it from go.dev/dl — your choice!
@GwynethLlewelyn OK, well nothing worked, well, the downloads worked with the go install command:-
go install github.com/GwynethLlewelyn/goswi@latest
Which created a go directory in my user root, oh nobody said if it should be installed as a root or normal user, so I'm trying at as a normal user, but I don't have permissions to delete the go folder to start again, so I had to use root command to recursively delete the go folder, but anyway, when it gets imagemagick, it throws a fit, with:-
gopkg.in/gographics/imagick.v3/imagick go/pkg/mod/gopkg.in/gographics/imagick.v3@v3.5.0/imagick/affine_matrix.go:8:10: fatal error: MagickWand/MagickWand.h: No such file or directory 8 | #include <MagickWand/MagickWand.h> | ^~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
And I have installed everything imagemagick by using:- sudo apt install imagemagic magicwand libmagic*-dev and still there's the error.
A google search found that your latest version of GoSWI needs imagick v3, whereas the latest imagick is 6, and that's probably why it's throwing up that error, it's looking for imagemagick version 3, whereas in fact version 6 is installed, and a full drive search using sudo find / -name MagicWand.h yields nothing found.
/usr/include/ImageMagick-6/wand/MagickWand.h
@Usalabs sorry for the lack of reply :(
Soooo some things...
go help clean
for more instructions! It's safer and sure to catch all broken things (well, those that matter, at least.gopkg.in/gographics/imagick.v3/imagick
, of which the latest version is 3.7.0. That's the version of the Go package — not of ImageMagick.README
). Version 2 is for ImageMagick 6.9 — what everybody has by default on Debian & derivatives. And version 1 is for ImageMagick 6.7, which nobody should be using right now, except possibly for some embedded devices (such as NAS and similar things) which might not be upgradeable.go.mod
and go.sum
. The first shows the direct and indirect dependencies used by the package; go.sum
goes far further, showing all versions and subversions it has downloaded over time and which are available for the current package to use. These are generated automatically, and are in plain ASCII (not even JSON or XML or YAML). There are no surprises there: either a package is listed there, or it isn't used. Granted, these are just Go packages, not any external non-Go libraries. A cool thing is that the first column of these files is actually an URL to where the package is hosted, and, in most cases, it will open directly into its README
.That said... you have essentially two options.
The first is to simply change everything in the Go code to use gopkg.in/gographics/imagick.v2/imagick
. It's a simple search & replace, really. Then build everything from scratch again. Obviously, you really need to have a working ImageMagick development environment — libraries and header files — which apparently are either missing or misplaced in your system. As @Deiiji explained, if MagickWand.h
is not on that path, it means that something is missing (or, worse, broken).
As far as I could figure it out, these are the two only Ubuntu packages you need to install:
$ sudo apt install libmagickcore-6.q16-dev libmagick++-6.q16-dev
Give it a try :) Check for /usr/include/ImageMagick-6/wand/MagickWand.h
. Once it's there, you know that you have installed everything you needed to compile things with ImageMagick support (not only Go-related software).
The second option is to go wild and install ImageMagick 7, and let the Go code alone :)
Depending on what else you do on your system, this might be either an excellent idea, or a very very bad one.
There are plenty of instructions how to accomplish that:
https://stackoverflow.com/questions/74951619/how-to-install-imagemagick-7-on-ubuntu-image https://askubuntu.com/questions/1042436/how-to-install-delegate-libraries-for-image-magick-7-0-7
It's not too hard to do, just a bit... challenging, IMHO. It requires lots of dependencies to get just the basic formats to be understood and manipulated. At the very least, you should make sure you get support for JPEG, PNG, JPEG2000, Targa (TGA) — all of which are actively being used by OpenSimulator — and optionally BMP and TIFF (mostly for supporting ancient formats which have been more popularly used a couple of decades ago, and a few of those might still be around).
The main problem with self-compiling ImageMagick is its side-effects. For instance, since PHP also encapsulates ImageMagick as part of its php-magick
module, it means that you'll need to recompile it and link it to the new library — otherwise, Apache/nginx/etc. won't be able to load that module, and that can have some terrible consequences for some web-based applications.
But if you're not running anything that uses PHP (or none of them require ImageMagick to work), then you'll be fine.
Happy compiling 😁
Oh dear, I guess unless there's instructions on how to compile or even use goswi, how would anyone know how to use it?
What is the 'Go' package? When I do 'apt search go', there's about 500 lines of everything that contains the word go, so unless we know exactly what package go is, how can we install it?
How is go compiled? Only the developer knows this, as there is no instructions.
How does one integrate it into an opensim grid? again only the developer knows this, because there's no instructions.