Skip to content
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

Fix installation error with brew GL package #17

Closed
wants to merge 1 commit into from

Conversation

fuhlig1
Copy link

@fuhlig1 fuhlig1 commented Jan 15, 2021

The brew package manager for macosx supports meanwhile the installation of
x11 and GL and is not longer bound to the usage of the unsupported XQuartz
package. Using the brew packages libx11 and mesa-glu the necessary include
and library files are ínstalled in /usr/local. Unfortunately this directory
is not in the search path such that the configuration of Geant4 fails.
The fix add the the missing search path such that GL installation is found
and the configuration succeeds.

The brew package manager for macosx supports meanwhile the installation of
x11 and GL and is not longer bound to the usage of the unsupported XQuartz
package. Using the brew packages libx11 and mesa-glu the necessary include
and library files are ínstalled in /usr/local. Unfortunately this directory
is not in the search path such that the configuration of Geant4 fails.
The fix add the the missing search path such that GL installation is found
and the configuration succeeds.
@drbenmorgan
Copy link
Member

Hi @fuhlig1, for reference, are there any discussions/documents on the install/use of X11 with brew and behaviour vs Xquartz? The only potential problem I could see with this is if both Xquartz and brewed X11 are installed (hence I wondered if brew had a guide/policy here).

@fuhlig1
Copy link
Author

fuhlig1 commented Jan 15, 2021

Hi @drbenmorgan, we stumbled over the issue after one of our recipes showed the following warning

Warning: Calling depends_on :x11 is deprecated! Use depends_on specific X11 formula(e) instead.

Looking for the issue a colleague found the following information from homebrew PRs

Homebrew/homebrew-core#57995
Homebrew/homebrew-core#64308

So in principle there are now two alternatives in brew

  • Installing XQuartz DMG via a cask recipe
  • Installing the proper X11 and GL packages via brew

For sure XQuartz can also be installed directly using the DMG package. The problem I see with the XQuartz DMG package is that the package is not maintained nor even updated since 2016 which could result in serious problems any time.
For example the DMG package doesn't work for Apple Silicon machines.

For me the installation of Geant4 worked without any problems when using the brew packages and not XQuartz. I did not do any tests using Geant4 but a ROOT installation worked without any problems.

In principle I don't see any problem if XQuartz and the brew packages are installed alongside since CMake should find XQuartz since it is the first in the path list. Only if XQuartz isn't found you would check for the brew installation. But I have to confess that I didn't test this yet.

@drbenmorgan
Copy link
Member

Thanks @fuhlig1, my main concern was potential cross-install cases, e.g. build Geant4 against brewed X11 on one platform, build a bottle, install on a machine that has Xquartz and brew. In that case, the Xquartz libs would be picked up when trying to build an application. I'm guessing this will be something of a corner case with the gradual end of Xquartz and brew now packaging things.

We'll get the patch in, as you say the brew path is at the end, so current behaviour is retained.

@fuhlig1
Copy link
Author

fuhlig1 commented Jan 15, 2021

Hi @drbenmorgan, maybe you should get the prefix from brew using

brew --prefix

In principle people could have a different location for their brew installation.

@drbenmorgan
Copy link
Member

@fuhlig1, at the moment we wouldn't get the prefix from brew in the buildscripts as the aim is to avoid direct dependence on any package manager. Anyway, patch is in testing for master and the upcoming patch, so will update here when these are merged.

@vaclavstepan
Copy link

@drbenmorgan Same fix for MacPorts would require addition of /opt/local/ - could you please tell if it's included as well?

@drbenmorgan
Copy link
Member

@vaclavstepan, not at the moment - could you post here the exact paths used by MacPorts for OpenGL and X11 please? How should Homebrew vs MacPorts paths be distinguished, and can one have X11 installed without OpenGL?

I'm a bit worried already about clashes between Xquartz and Homebrew, so introducing another path can be done, but will require some care. Note that we don't have testing capacity to test all of these combinations.

@vaclavstepan
Copy link

@drbenmorgan Default paths for MacPorts are in /opt/local, so it would be:
XQuartzGL_INCLUDE_DIR = /opt/local/include
XQuartzGL_gl_LIBRARY = /opt/local/lib
XQuartzGL_glu_LIBRARY = /opt/local/lib

From my point of view it would be enough to support one of XQuartz/MacPorts/HomeBrew installed, not a combination.
Yes, you can install MacPorts or Brew and have no GL library, but it's the same as on Linux (you have to install the packages).

@drbenmorgan
Copy link
Member

Patches for both Homebrew and MacPorts paths are integrated in the development repo, so will be in the next patch. Thanks for your contributions @fuhlig1, @vaclavstepan!

@vaclavstepan
Copy link

vaclavstepan commented Jan 25, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants