Pre-compiled gmic CLI bundle for OSX ready for testing

That is a bit above my level. Still I must confess, I have reinstalled MacPorts after upgrading to Mojave, hence… Downgrading in MacPorts is afaik not possible. To build all new similar to partha.com 's approach for Gimp & plugins is far beyond my possibilities. I don’t know if it is possible to build MacPorts packages with minos=10.8

Possibly the problem could be resolved or reduced using the program optool mentioned and used by @Carmelo_DrRaw to correct or change versions of libraries? Actually I could not try optool, there are missing header files!

Unfortunately this can only be used for the case of the GIMP plug-in, which uses run-time libraries that are different from compile-time ones.

In the CLI version we need to do things properly, i.e. recursively pick and fix all dependent libraries, which is what I am trying to do right now (see here). However, there seems to be something strange with the OpenCV libraries provided by Homebrew, that I am still investigating. Currently macdylibbundler stops before copying all dependencies.

Hmm I don’t see that. Some time ago I built gmic cli against the libraries bundeled in the Gimp app. Perhaps one can consider that as an independent plugin. Of course several things didn’t work like opencv or net access, at least everything not built in Gimp.

The behavior of macdylibbundler is difficult, with MacPorts libraries it finished properly…

One big benefit of using github+Travis is the availability of the osx_image: xcode6.4 based on OS X 10.10. Anything built in that environment with that sdk should work for 10.10+.

This is actually an advantage only in theory, because:

  • this old image will be removed very soon
  • a lot of homebrew packages do not have bottles for such old system, and compiling from sources is not an option

For the moment I only encountered backward compatibility problems with Qt and I had to roll back the homebrew package to Qt-5.9

Another trial of gmic-cli.tgz (http://karo03.bplaced.net/gmic/git/gmic-cli.tgz) with downgraded ffmpeg (3.4.1) is put on my server. No change in SDK 10.14 and minos 10.14, however.

Under Mojave this gmic is working! Maybe there is another trial possible?

Still no luck under 10.10.5:

dyld: Library not loaded: /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
  Referenced from: /Users/aferrero/Downloads/gmic-cli 8/libs/libavcodec.57.107.100.dylib
  Reason: image not found

I do not have the CoreImage framework on my system…

Thank you @Carmelo_DrRaw for the test. Most probably CoreImage framework started with 10.11 sdk.

I will not try further the next time. Maybe you come to a solution with your approach.

Many of the binary homebrew packages also depend on MacOS >= 10.11
Looks like one needs to compile a certain number of packages from sources…

I’ll keep working on this, but it will take longer than I was hoping.

@KaRo @HIRAM
I am happy to say that I did quite some progress on this topic, and I have now a working version of gmic-cli for MacOs 10.9 and later. However, it comes without opencv support for the moment.

The code is built on TravisCI and uploaded on GitHub: Release Continuous build · aferrero2707/gmic-osx · GitHub

The main problem I had to face is the availability of binary packages that are compatible with MacOS versions earlier than the one being used for the builds. I have discovered that most of the bottles that homebrew provides for High Sierra (the system used for my Travis CI jobs) are only compatible with MacOS 10.13 and later, which is too restrictive.

After some thinking and researching I ended up making my own bottles, built with the following additional compiler flags:

-mmacosx-version-min=10.8 -march=nocona -mno-sse3 -mtune=generic

Those bottles are also created under TravisCI, using the same OSX image as the one used to compile GMIC, to guarantee as much as possible the consistency of the builds.
The repository with the custom homebrew formulas is here: GitHub - aferrero2707/homebrew-bottles: Custom bottles for building universal bundles on Travis CI. It should be expanded to include other common packages that do not provide enough backward compatibility… requests are welcome.

What do you think? Could you test the gmic-cli package and let me know if it works for you as well?

Here is a screenshot taken on my 10.10.5 system:

2 Likes

Congratulations ! I tried gmic on my actual Mojave 10.14.1 as well as on my Yosemite 10.10.5, both with MacPorts, no HomeBrew, no problem. Besides that I tried it on an empty Mac Mojave, no packagemanager however, no problem however. For display I had to install XQuartz only.

I think the lack of opencv is acceptable, at least for me. I used the camera mostly for testing purposes. There is still the stable gmic package in MacPorts with opencv. Perhaps something similar exist in HomeBrew.

That is a large progress Andrea. If you plan to prepare regularly builds, I think we should convince David to replace my dead link in the downloads by yours. Under these circumstances I think I will stop to build gmic from git even for my private use, your built is better! What about the plugin? Will it be actualized too?

Thanks again, large progress…

3 Likes

Yes, this is exactly my plan. It will work in the following way: 1) the builds will save the git HEAD hash of the gmic repository together with the generated tar archive 2) the next build will first clone the gmic repository and compare the current hash with the one previously saved 3) if they differ, the job will proceed building a new tar archive, otherwise it will stop.

I will set up a daily cron schedule for the jobs, so that new versions will be available at most 24h after the corresponding commit.

I have just triggered a new build, and then I will set-up a similar mechanism for automated updates…

1 Like

Super!

Just for the built, it might be good to let the pre_release tag with the date for these git builds gmic and gmic-qt set to have some info about the source and time used either in version or in the window header.

1 Like


Seems to work ok on 10.12 and 10.11 after installation of https://www.xquartz.org Xquartz.

1 Like

gmic cli hangs at 2.4.2 from Nov 6th. Is there a way to actualize it?

@Carmelo_DrRaw @KaRo

I forked two repos and made some changes to a couple of files to get it to build:

  • gmic-osx/.travis.yml:

    brew cask uninstall oclint

Build crashed on uninstalling oclint (I believe it is automatically uninstalled), so I commented it out:

# brew cask uninstall oclint

  • homebrew-bottles/install-bottles.sh

    echo "brew reinstall --force-bottle --verbose -f $B"
    brew reinstall --force-bottle --verbose -f $B || exit 1
    

Build failed with --force-bottle and -f options. I removed those flags:

  echo "brew reinstall --verbose $B"
  brew reinstall --verbose $B || exit 1

Build success!

3 Likes

Thank you @HIRAM, I could load and run gmic.

1 Like

The cron-based building of GMIC CLI for OSX was on my TODO list before the Christmas vacations, now it is definitely time to have this finished.

@HIRAM thanks for the fixes, I will introduce them in my own repos.

1 Like

Thank you Andrea too. I could load and try it from your repository too. Seemingly camera support is not built in, perhaps intended?
Still thank you for the quick improvement,
Mac users are often quickly discouraged by any problems, still gmic is worth to be tried without the development and packager stuff. Although there are guys who seemingly are interested to hear from the app what to do, perhaps a new way of creativity!
The script development under the cli is by far easier compared to the Gimp plugin command window!

I’ve got it working in Catalina 10.15.7