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

[legacy][nov20] Errors installing Geant4 #371

Closed
fuhlig1 opened this issue Jan 14, 2021 · 8 comments
Closed

[legacy][nov20] Errors installing Geant4 #371

fuhlig1 opened this issue Jan 14, 2021 · 8 comments
Assignees

Comments

@fuhlig1
Copy link
Member

fuhlig1 commented Jan 14, 2021

There are two problems with the Geant4 installation at least on macosx 10.15 but probably also for other versions.

  1. OpenGL isn't found if xquartz is not available. I encountered the problem after I uninstalled the brew xquartz package and use the new libx11 and mesa-glu packages from brew. The problem is that /usr/local isn't in the search path for GL on macosx. This can be fixed with the following patch.
--- a/cmake/Modules/FindXQuartzGL.cmake 2020-05-29 14:46:48.000000000 +0200
+++ b/cmake/Modules/FindXQuartzGL.cmake 2021-01-13 11:14:19.000000000 +0100
@@ -49,17 +49,17 @@
 set(CMAKE_FIND_FRAMEWORK NEVER)
 
 find_path(XQuartzGL_INCLUDE_DIR GL/gl.h
-  PATHS /usr/X11R6/include /opt/X11/include
+  PATHS /usr/X11R6/include /opt/X11/include /usr/local/include
   NO_DEFAULT_PATH
   )
 
 find_library(XQuartzGL_gl_LIBRARY GL
-  PATHS /usr/X11R6/lib /opt/X11/lib
+  PATHS /usr/X11R6/lib /opt/X11/lib /usr/local/lib
   NO_DEFAULT_PATH
   )
 
 find_library(XQuartzGL_glu_LIBRARY GLU
-  PATHS /usr/X11R6/lib /opt/X11/lib
+  PATHS /usr/X11R6/lib /opt/X11/lib /usr/local/lib
   NO_DEFAULT_PATH
   )

  1. I had to switch of the GEANT4_USE_PYTHON option when compiling Geant4. Enabling of this option depends on boost_python which is not build with FairSoft legacy. I never saw the problem before since I had boost_python in /usr/local which was found automatically but which I removed recently. To solve the issue I would propose to install boost_python when building boost. I am not sure why this isn't done since with FairSoft legacy jun19 it is installed.
@dennisklein
Copy link
Member

  • Can you pls provide the boost build logs (configure, build, install) to get to the bottom why boost_python is not built for you?
  • Have you installed the system prerequisites listed in legacy/setup_macos.sh (minus xquartz which you have commented on)?

@fuhlig1
Copy link
Member Author

fuhlig1 commented Jan 14, 2021

The problem is that the autodetection of boost does not find the python installion from brew properly. The issue is described in their recipe. By the way the have a separate recipe for boost-python.

https://github.com/Homebrew/homebrew-core/blob/d1c9b3c3bba5c83a16f146a29dcef3120c0f4a29/Formula/boost-python3.rb#L48

If I pass the proper information to b2 at the configuration stage libboost_python is build. My command is

./bootstrap.sh --prefix=/opt/fairsoft/nov20 --with-python=python3 --with-python-root=/usr/local/opt/python@3.9

After the successful installation of libboost_python also the compilation of Geant4 work without problems

@dennisklein
Copy link
Member

I am preparing a patch release for nov20 also covering the other reported issues from last week, regarding:

  • boost_python: I will include this fix for the python arguments
  • opengl: We will track the development in homebrew package: Replace depends_on :x11 #369, but for now I tend to stick with xquartz. We can switch to brew's mesa-gl in the next FairSoft release. Unless we find a very good reason why we need to support it for the nov20 release. What do you think?

@fuhlig1
Copy link
Member Author

fuhlig1 commented Jan 15, 2021

For the OpenGL issue I opened a pull request upstream (Geant4/geant4#17)

@fuhlig1
Copy link
Member Author

fuhlig1 commented Jan 15, 2021

  • boost_python: How do you want to fix it? Do you want to use FindPython before and use the found information as input for the boost installation?
  • openGL: Would it hurt to add the patch? In case xquartz is installed it will not make a difference, in case xquartz isn't installed but libx11 and mesa-glu the Geant4 configuration would not fail.

@dennisklein
Copy link
Member

dennisklein commented Jan 15, 2021

boost_python: How do you want to fix it? Do you want to use FindPython before and use the found information as input for the boost installation?

See

if(APPLE)
execute_process(COMMAND brew --prefix python OUTPUT_VARIABLE python_prefix)
string(STRIP "${python_prefix}" python_prefix)
set(PYTHON_EXECUTABLE "${python_prefix}/bin/python3" CACHE FILEPATH "Python executable" FORCE)
endif()
. I would pass the python root dir like this and wired it up properly in the boost configuration.

openGL: Would it hurt to add the patch? In case xquartz is installed it will not make a difference, in case xquartz isn't installed but libx11 and mesa-glu the Geant4 configuration would not fail.

Ok, I will add the patch. But let it be noted, that it is a very dirty hack in the current form:

  • The patched CMake file is called FindXQuartzGL.cmake and now it will find brew mesa...
  • The hard-coded prefix might be wrong, it should rather be generated from brew --prefix.

@fuhlig1
Copy link
Member Author

fuhlig1 commented Jan 15, 2021

Ok, I will add the patch. But let it be noted, that it is a very dirty hack in the current form:

- The patched CMake file is called FindXQuartzGL.cmake and now it will find brew mesa...

I think the name is not very well chosen. If I understand the code correctly they want to avoid that GL from the system is used.

- The hard-coded prefix might be wrong, it should rather be generated from brew --prefix.

That's much better.

Better don't add the patch. n the moment I am the only person with such an installation and I know what I have to do manually. If we keep xquartz in the setup description for mac the probability that anyone else has such an installation is low.

@dennisklein dennisklein self-assigned this Jan 21, 2021
@dennisklein
Copy link
Member

The fixes are included in the nov20_patches branch:

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

No branches or pull requests

2 participants