New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wanted to share a tip for Linux and OpenImageIO installation #118
Comments
Thank you for opening an issue and helping to make Gimel Studio better! |
@MostHated Thanks for the suggestion. 👍 We will look into that. The difficult part is that we need OpenImageIO built for Python with the extensions for EXR, RAW files and OpenColorIO support. Do you know offhand if installing via linuxbrew meets those requirements? |
Shoot, well, I know I saw EXR in the long list of things during install, but I don't know if it was a dependency of something else and I had closed the terminal after it was done. Is there a way I can check now that I have it installed? |
Basically, the first thing to check is if it is built with Python support, which you can do quite easily by creating a .py file with The way to test for EXR support would be to run something like: import OpenImageIO as oiio
from OpenImageIO import ImageBuf, ImageSpec, ImageBufAlgo
def write_image (image, filename, format=oiio.UNKNOWN) :
if not image.has_error :
image.write (filename, format)
if image.has_error :
print ("Error writing", filename, ":", image.geterror())
img = ImageBuf ("input.exr")
write_image (img, "output.exr", oiio.FLOAT) (You will need an EXR file called |
I was taking a look at what it included(openimageio's install guide is what gave me the idea to try it in the first place) : https://formulae.brew.sh/formula/openimageio I will give what you mentioned a try as well. |
Okay, that is a good sign. Thanks for testing this. 😄 Could you summarize what you did to get it to work so we can test it on our end? |
Sure thing. This is assuming you already have linux brew installed, as I installed it a long time ago and can't exactly remember if there was anything special about doing so. # install oiio from brew
brew install openimageio # Add the location of the oiio library to path
import sys
from os.path import dirname
sys.path.append(dirname('/home/linuxbrew/.linuxbrew/Cellar/openimageio/2.3.9.1/lib/python3.9/site-packages'))
import OpenImageIO as oiio
from OpenImageIO import ImageBuf, ImageSpec, ImageBufAlgo
def write_image(image, filename, format=oiio.UNKNOWN):
if not image.has_error:
image.write(filename, format)
if image.has_error:
print("Error writing", filename, ":", image.geterror())
img = ImageBuf("input.exr")
write_image(img, "output.exr", oiio.FLOAT) That was honestly all it took. This should work as well to make it available to a project. # copy the resulting oiio library into python virtual environment
cp /home/linuxbrew/.linuxbrew/Cellar/openimageio/2.3.9.1/lib/python3.9/site-packages/OpenImageIO.cpython-39-x86_64-linux-gnu.so /mnt/x/GitHub/GimelStudio/GimelStudio/venv2/lib/python3.9/site-packages/ |
Thanks for doing this. I am going to work on getting a CI going via Github Actions to automate building the executables soon. I will let you know if I need any further information. 😄 Also, if your willing, you could add the commands you used to install everything and build the executable in the |
Yeah, sure thing, would be glad to 👍 . |
Still working on this, ran into some issues due to pyenv, but I have it nearly worked out. |
Looks like I got the issue worked out. Turns out that the binary file just really really doesn't like to be started while your current directory is elsewhere. I kept building and testing with: $ python build.py
$ ./dist/GimelStudio/GimelStudio It just wasn't having it. But as soon as I did: $ python build.py
$ cd dist/GimelStudio
$ ./GimelStudio Worked great. I had been fighting with trying to figure out why it was "failing" to build properly, turns out I was just failing to run it right, lol. |
To be honest, it makes sense. The Gimel Studio source code makes use of relative paths. This is why I changed the readme instructions in this commit. |
So, something I came across that I have been trying to look into is, everything builds solid and works well, but only when not using the --onefile flag. Without it, and dropping the nodes folder into [INFO] Registered core nodes
[INFO] Registered custom nodes But when building with --onefile, I get the following when trying to launch the application: [WARNING] Error registering core nodes:
No module named 'nodes'
[WARNING] Error registering custom nodes:
No module named 'nodes'
Traceback (most recent call last):
File "main.py", line 74, in OnInit
File "gimelstudio/application.py", line 399, in __init__
File "gimelstudio/interface/nodegraph_pnl.py", line 57, in __init__
File "gimelstudio/interface/nodegraph_pnl.py", line 102, in BuildUI
File "gsnodegraph/graph/base.py", line 671, in AddNode
KeyError: 'corenode_image'
OnInit returned false, exiting...
Error in atexit._run_exitfuncs:
wx._core.wxAssertionError: C++ assertion "GetEventHandler() == this" failed at /tmp/pip-install-qsybg005/wxpython_f435023263b242dab41e0f141d57147d/ext/wxWidgets/src/common/wincmn.cpp(469) in ~wxWindowBase(): any pushed event handlers must have been removed
I was going to try to see if I could come up with anything, but its getting a bit late, so if it's not something silly that you already know about, I will try to take a peek at it tomorrow. |
@MostHated thanks for your perseverance with this. 🙂 Yes I think there is a bug with using the --onefile flag. But, I don't think we need to use that anyway. Not only is there a performance decrease vs the normal build but as you pointed out, the nodes aren't found. So, if everything else is working with the normal build, feel free to open a PR and we will go from there. |
Ok, good deal. I wanted to make sure that was ok first before submitting. I am just doing one final test on my laptop, as I never installed brew or pyenv, etc on it, so its more of a fresh/typical test. |
Okay, sounds great. 👍 Kind of a side question: If I may ask, what's the inspiration for your username? I really hope people don't hate you. 😟 |
Lol, na, quite the opposite, usually. The name was from back when I used to play a lot of PVP in WoW. I apologize that it's taking a bit longer than expected. I like to be as thorough as I can, though. The script ensures you are running the correct version of python, then makes sure build-essentials, libgtk3, and GCC are installed (I figured it was a good idea, since my laptop was missing some of them), checks for homebrew, if that's missing, asks to install it. Once detected it builds openimageio, checks for and installs venv if missing (since my laptop was), then goes on to do the actual application build. All said and done, as long as you have python 3.9, the rest should be taken care of. I just wiped it all out one last time to run through it again after adding the build tools and venv installs, and my laptop isn't the fastest thing in the world, so a run-through takes a little bit. |
Ok, finally got things worked out. #121 When I was running things on my desktop, I already had a large number of the dependencies installed, so some of them were not taken into account until I got on my laptop, so I started with a fresh VM and made sure everything worked out of the box on it, starting with the default python3 install it had. (using Pop_OS 21.04) (Sorry about the commit list, I only ever really commit my own stuff, which is always just me doing whatever, lol, so trying to do it "properly" ended up with me hard resetting my fork 3 times.) |
Thanks for your work on this. I think we can now say that we officially have Linux support and it brings us closer to closing that long-standing blocker issue! 🎉 |
Hey there,
I just wanted to share with folks who might be having an issue getting OpenImageIO built / installed on linux. If you simply install the Linux version of Homebrew (Linuxbrew), you can install OIIO using brew. It takes a bit (took about 10 minutes) but it will get the job done. 👍
Thanks,
-MH
The text was updated successfully, but these errors were encountered: