No option to install

Hi there, i’m new to graphviz but i’ve been using it within my symfony application to create graphs.

Me and my coworker have a mindmap and our boss wants this to be converted to a png or jpeg or whatever as long as it’s a downloadable image.

We wanted to use GraphViz because, let’s be real, it’s the only quality graph visualizer that connects to our project easily. Though the big issue here is that we got it to work, finished the functions to make it work within the application. Than we tried to install it on the server only to find out we do not have permissions or even availability to install on a cloud based linux server.

This felt like a true bummer and we put the idea on hold for about a month now. Though now we need to get back to it.
After the fail we tried looking for other options since we found that imageMagick was pre-installed and i kid you not, we were finding packages for graph visualizers that actually used magick when we didnt need them but now we can’t find them anywhere anymore.

So now for our big question. Is there a possibility for us to install graphviz within a localized symfony application and than just push it to the server? Or any other option where we can just grab all the source and add it to the server via FTP and than making it work somehow?

I really hope so because our boss wants it done.

Sure. Copy the source to the server and run ‘make’, it will output a binary. Look at the graphviz build instructions.

Or compile it with “static linking” (google the exact flags to pass to ./configure) and that will output a single executable, you can then copy that to the server.

Or if you can change the base image of the machine maybe you can add graphviz to that base image

To build on what Mark said, I think you may find the first option challenging because many of Graphviz’ build dependencies are likely to be unavailable on your server. There’s a bunch of Dockerfiles in the ci/ directory that give you some idea of the various dependencies Graphviz’ test jobs pull in.

My intuition, like Mark, was to suggest a static binary. But I just discovered the --enable-static flag to the build system does not result in a static binary. Not exactly clear why, but that’s a problem for us to debug.

I would probably suggest using something like Docker for this.

Alright well that sounds a lot easier than it is i think?

I don’t assume it’s as easy as just downloading all the files and throwing them on the root?
I have no clue what you mean exactly with statis linking or the base image, could you elaborate?

Oh okay, so i can’t use a static binary at the moment but might be able to later?
And something like Docker? What do you mean by that?

It seems maybe I misunderstood and static linking is possible. So if you can get all the runtime dependencies of Graphviz installed on the server, a statically linked binary may work.

By using Docker, I meant building a Docker image with Symphony and Graphviz and then deploying that image to your server. I have not done such a thing, but I understand this is the common way to do deployments with complex dependencies these days.

Sorry but i am not very experienced with the terms being used here haha.
I tried looking up the Docker CLI but i honestl don’t understand it so i need to do some more research to get it.

Further more i wouldn’t want to disturb you or take too much time away but could you explain more about the static linking stuff perhaps? In the gitlab issue you stated that there is a ‘source tarball’ which i assume is all the source code in 1 huge .tar file. after that its unpack and ./configure --enable-static && make?

If you have any simple references for the docker CLI i would love to see them.

Yes. There’s different versions of this available from the download page.

@Vithanco linked to a more complete example on Stack Overflow, the core of which I believe is ./configure --enable-static=yes --enable-shared=no. This assumes you’re using Linux locally. If you are on another operating system (Windows, macOS, …) or even a different Linux distro to the environment you plan to deploy to, this whole process is unlikely to work.

I’m not particularly knowledgeable about Docker beyond hearing it is the way to do things now. Maybe someone else can address this part.

hmmmm okay interesting, sad to hear it might not be viable. Though i think the servers we use are plain linux with perhaps some extras installed (somehow we cannot install stuff ofcourse)

Also maybe it helps to know we are able to create .dot files but are not able to convert these files to a graph for some reason.

Can you just try to install Graphviz using the package manager on your linux installation: yum, rpm, apt, whatever it is.

Otherwise, it’s probably too difficult, based on what you’re saying.

I wish we could but we use liquidweb for hosting and we use their cloud hosting. We contacted liquidweb because we didn’t really have an easy way of installing something on their server so we asked how we could do it and than they said we’re not actually allowed to install anything on there… That’s the reason why we would like to be able to send graphviz to the server with/within our symfony project

Hi, I don’t think any of us here can help much. It’s been years since I tried to build all the package dependencies by hand in a user directory. It was very tedious and sometimes required patching the code a little or finding another version of some package. In some ways it was really a waste of time.

There seem to be some relevant instructions for your situation:

Liquidweb claims one can install ubuntu packages including from source:

Flathub claims its packages can be installed in any Linux distribution (really?)

So i got some good and bad news depending how you look at it, i straight up just contacted liquid web and they confirmed we are not able to get root acces on the cloud based server or install anything on there. However they do offer dedicated servers and a free transfer to that. I’m going to discuss this with my boss to see what he says since he wants this graph visualization really badly and graphviz is extremely usefull.

Thanks for the help guys, will get back o this incase i have more information

If @Crivian only needs basic DOT->PNG translation, maybe they only need a subset of the dependencies?

Yes, you’re right. This directory contains some of the gory details:
though the versions it names are out of date. For example it specifics cairo-1.11.2 of January 2011, but
shows that cairo is up to cairo-1.17.4 as of November 2020.

I believe a minimal set of libraries for building dot and generating native SVG, and PNG or GIF would be:

To generate PDF or more portable cairo SVG, it will need
which in turn need other things. Homebrew claims that on a Mac, PANGO and CAIRO
also require: GLIB, PNG, PIXMAN and apparently ZLIB or LZO, also HARBUFF, LIBFRIBIDI

To build sfdp with our overlap removal algorithm, add

If you would like to load external shapes, then EXPAT, RSVG, maybe GSLIBS (Ghostview), POPPLER for PDF?

This is how nice small programs turn into bigger less nice programs. It’s better if you can just get a server
with all this stuff pre-installed or at least ready to install from a standard release.

Good to hear, me and my coworker are going to look into it in beginning 2021 because i’m free the upcoming days.
We’re going to try out the dependencies listed and get back to you after trying to install them.

We hope you have had a good christmas and have a good end of the year!

Alright than, after having to work on some other stuff for the project i am now back at the graphviz issues.

I downloaded the main 3 dependencies (GD, FONTCONFIG and FREETYPE) and am busy with trying to install them which didn’t work locally (which i already figured since im using windows)
If i were to use a VM with linux and ran the install commands via a linux bash… Would that make me be able to install it locally on my machine?

Right now i’m going to try and do it via the server which i hope works but we’ll see.

If this doesn’t work i assume our last option is to just get a dedicated server which i assume will be faster too

If I understand what you’re describing correctly, then no. No files in a VM are available to the host system unless you have some kind of shared file system setup. Even if you do, the files in the VM will be Linux binaries and your host Windows system will not be able to run them. Cross-compiling on Linux to target Windows is a path you do not want to go down.

Moreover, getting Graphviz running on your host Windows system is not a step towards getting Graphviz onto your server if your server is Linux.

Maybe we should back up and step through this more fine-grained. First up: what Linux distro is your server running? If you have command line access there, you can find this and other things by running uname -rms && cat /etc/os-release.

Thanks smattr i would appreciate that a lot! (referring to the helping through this in more detail)
However we have to work on some other stuff first again so i’ll get back to you about this later.

We sadly do not have direct command-line acces on the server but we are able to use PHP to activate commands via the ‘exec’ and ‘shell_exec’ commands