GUI error while running Allpix2 with docker image && No package Eigen3 found

Hello,

I tried installing Allpix2 but it failed when I tried to make the build. So, I ended up with running Allpix2 with the docker image. The manual states that ROOT and Geant4 are also in the docker image, so I expected that the GUI session in the VisualizationGeant4 module would work too. However, I get the following error:


How do I continue? Is it possible to run the GUI or should I export a .wrl file?

Already thanks for your answer.

Kind regards,

Bas

1 Like

Hi @Basgo355

unfortunately Docker isn’t really designed to provide you a graphical user interface. The software running in it supports it, you are right, but Docker itself doesn’t provide an X-Server that could display the windows.

There are some solutions around such as

but they are all to some extend bricolage.

May I ask on what system you are attempting to install Allpix Squared and what the error/problem during the build was?

Best,
Simon

Hi @simonspa

Thanks for your answer, I will see if the work around helps me.

Regarding the installation of Allpix2, I tried installing it on a private machine running on Ubuntu.
I first had the same problem as posted in this topic:

My idea was that installing a new GCC version would solve the problem. Everything seemed to work with the new GCC version, but running the cmake command did not work anymore:

“Checking for module ‘eigen3’
– No package ‘eigen3’ found”

Eigen3 is installed and this worked before, that was the moment that I decided that I did not want to spend more time on the normal installation. So, I started using the docker image.

Bas

UPDATE:
Additional screenshot with error message and proof of already updated eigen3.

H @Basgo355

okay, this we should be able to figure out. :slight_smile:

  • You definitely need GCC9, this was an oversight on our side and we have in the meantime fixed the compiler version detection (included in v2.1.2)
  • I am developing myself under Ubuntu, so I’d expect this to work just fine
  • Your CMake command looks interesting:
    • There is no need to set CMAKE_CXX_STANDARD=17 since we force this anyway in the CMakelists.txt.
    • Currently, you are setting -DCMAKE_MODULE_PATH=<...> with a missing space to the -DCMAKE_INSTALL_PREFIX - I would expect this to mess things up because that might well be the reason the Eigen3 module is not found by CMake.

Would you mind cleaning your build directory completely and to try once more?

cmake -DCMAKE_INSTALL_PREFIX=/home/bas/allpix-squared/install /home/bas/allpix-squared/

Best,
Simon

Ah, that explains the previous error, I was previously running the build on GCC8, but now I have GCC 11.1.0, that should work.

The ‘-DCMAKE_MODULE_PATH=<…>’ was indeed a mistake, I quickly tried to reproduce the error message and took a wrong command line from a week ago. However, running:

cmake -DCMAKE_INSTALL_PREFIX=/home/bas/allpix-squared/install /home/bas/allpix-squared/

gives the same error message., unfortunately.

Hi @Basgo355

alright, then let’s turn CMake’s head to where Eigen3 is… :slight_smile:

Two options:

  1. cmake -DCMAKE_PREFIX_PATH=/usr/share/eigen3/cmake ..
    For me (Ubuntu 21.10) that’s where the Eigen3 CMake modules live.
  2. Replace in the Allpix Squared CMake files the lines
    FIND_PACKAGE(Eigen3 REQUIRED NO_MODULE)
    ALLPIX_SETUP_EIGEN_TARGETS()
    
    TARGET_LINK_LIBRARIES(${MODULE_NAME} Eigen3::Eigen)
    
    with a corresponding inclusion via PkgConfig:
    FIND_PACKAGE(PkgConfig REQUIRED)
    PKG_CHECK_MODULES(Eigen3 REQUIRED IMPORTED_TARGET eigen3)
    
    TARGET_LINK_LIBRARIES(${MODULE_NAME} ROOT::Graf3d PkgConfig::Eigen3)
    

For 1) you should be able to find where the modules are e.g. with find /usr/ -name eigen3.

Cheers,
Simon

Hi @simonspa,

Yeah I indeed tried to make that reference earlier (step 1), but the eigen3 files are in a weird location,
find /usr/ -name eigen3 gives:
/usr/lib/cmake/eigen3
/usr/include/eigen3
The /cmake/eigen3 folder consists of four .cmake files, but setting this folder as prefix path does not work.

I tried to find the .cmake file that contains the code you showed, but the only code I could find is in the
…/CapactiveTransfer/CmakeLists.txt file (which is referred to by the compiler). The code in this file is as follows;

# Define module and return the generated name as MODULE_NAME
ALLPIX_DETECTOR_MODULE(MODULE_NAME)

# Add source files to library
ALLPIX_MODULE_SOURCES(${MODULE_NAME} CapacitiveTransferModule.cpp)

# Eigen is required for finding the coupling distances
PKG_CHECK_MODULES(Eigen3 REQUIRED IMPORTED_TARGET eigen3)

TARGET_LINK_LIBRARIES(${MODULE_NAME} PkgConfig::Eigen3)

# Register module tests
ALLPIX_MODULE_TESTS(${MODULE_NAME} "tests")

# Provide standard install target
ALLPIX_MODULE_INSTALL(${MODULE_NAME})

Replacing it with:

# Define module and return the generated name as MODULE_NAME
ALLPIX_DETECTOR_MODULE(MODULE_NAME)

# Add source files to library
ALLPIX_MODULE_SOURCES(${MODULE_NAME} CapacitiveTransferModule.cpp)

# Eigen is required for finding the coupling distances
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(Eigen3 REQUIRED IMPORTED_TARGET eigen3)

TARGET_LINK_LIBRARIES(${MODULE_NAME} ROOT::Graf3d PkgConfig::Eigen3)

# Register module tests
ALLPIX_MODULE_TESTS(${MODULE_NAME} "tests")

# Provide standard install target
ALLPIX_MODULE_INSTALL(${MODULE_NAME})

Did not work.

When I paste your ‘original’ lines instead, I have the following code:

# Define module and return the generated name as MODULE_NAME
ALLPIX_DETECTOR_MODULE(MODULE_NAME)

# Add source files to library
ALLPIX_MODULE_SOURCES(${MODULE_NAME} CapacitiveTransferModule.cpp)

# Eigen is required for finding the coupling distances
FIND_PACKAGE(Eigen3 REQUIRED NO_MODULE)
ALLPIX_SETUP_EIGEN_TARGETS()

TARGET_LINK_LIBRARIES(${MODULE_NAME} Eigen3::Eigen)

# Register module tests
ALLPIX_MODULE_TESTS(${MODULE_NAME} "tests")

# Provide standard install target
ALLPIX_MODULE_INSTALL(${MODULE_NAME})

This gives me another error:

That’s exactly the ones you need. Maybe remove the NO_MODULE option were calling the FIND_PACKAGE with?

This library is really annoying me, we had so many issues with finding it on different systems… :confused:

/Simon

Also, there are several modules that need Eigen3:

  • CapacitiveCoupling
  • GenericPropagation
  • TransientPropagation

as far as I remember.

/Simon

Removing NO_MODULE did not change the last error message about the Eigen3Config.cmake file.
This is the code in this config file:

# This file exports the Eigen3::Eigen CMake target which should be passed to the
# target_link_libraries command.


####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was Eigen3Config.cmake.in                            ########

get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)

# Use original install prefix when loaded through a "/usr move"
# cross-prefix symbolic link such as /lib -> /usr/lib.
get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH)
get_filename_component(_realOrig "/usr/lib/cmake/eigen3" REALPATH)
if(_realCurr STREQUAL _realOrig)
  set(PACKAGE_PREFIX_DIR "/usr")
endif()
unset(_realOrig)
unset(_realCurr)

macro(set_and_check _var _file)
  set(${_var} "${_file}")
  if(NOT EXISTS "${_file}")
    message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
  endif()
endmacro()

####################################################################################

include ("${CMAKE_CURRENT_LIST_DIR}/Eigen3Targets.cmake")

# Legacy variables, do *not* use. May be removed in the future.

set (EIGEN3_FOUND 1)
set (EIGEN3_USE_FILE    "${CMAKE_CURRENT_LIST_DIR}/UseEigen3.cmake")

set (EIGEN3_DEFINITIONS  "")
set (EIGEN3_INCLUDE_DIR  "${PACKAGE_PREFIX_DIR}/include/eigen3")
set (EIGEN3_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include/eigen3")
set (EIGEN3_ROOT_DIR     "${PACKAGE_PREFIX_DIR}")

set (EIGEN3_VERSION_STRING "3.3.7")
set (EIGEN3_VERSION_MAJOR  "3")
set (EIGEN3_VERSION_MINOR  "3")
set (EIGEN3_VERSION_PATCH  "7")

Now things really stop making sense to me - that file says

set (EIGEN3_FOUND 1)

So it is definitely set and not FALSE :thinking:

So now you understand why I gave up :sweat_smile:

Which Ubuntu are you on?

Ubuntu 20.04.3 LTS is my OS

I found the following line in Eigen3Targets.cmake:

set_target_properties(Eigen3::Eigen PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/eigen3"
)

Is there a possibility that this _IMPORT_PREFIX is wrong ?

Very unlikely since it’s a system-provided file which gets installed together with the actual Eigen3 library.

I changed the -DCMAKE_PREFIX_PATH=/usr/share/eigen3/cmake …
into: -DCMAKE_PREFIX_PATH=/usr/ …
And I set the …/CapactiveTransfer/CmakeLists.txt file back to its original content.
And suddenly the build succeeded! I am now trying to make the file, but it looks like it is working! I will let you know.

Things are finally working, thank you so much for your help, took me a couple of days!

Great! Happy simulating! :rocket:

1 Like