Install ROOT in my directory in a share server

I did cmake as follows

        cmake .. \
        -DCMAKE_INSTALL_PREFIX="/home/XXXXX /software/root/root-6.26.00/install" \
        -DPYTHON_EXECUTABLE=/usr/local/bin/python3 \
        -DPYTHON_LIBRARY=/usr/local/lib/libpython3.9.

but, I got error

-- ROOT default compression algorithm: zlib
-- PyROOT will be built for version 3.9.13
-- Looking for ZLib
-- Looking for Freetype
CMake Warning (dev) at /home/XXXXX /software/cmake/cmake-3.24.1/install/share/cmake-3.24/Modules/ExternalProject.cmake:3071 (message):
...
...
Call Stack (most recent call first):
  /home/XXXXX /software/cmake/cmake-3.24.1/install/share/cmake-3.24/Modules/ExternalProject.cmake:4167 (_ep_add_download_command)
  builtins/pcre/CMakeLists.txt:37 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Looking for LZMA
-- Looking for X11
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:357 (message):
  libXpm and Xpm headers must be installed.
Call Stack (most recent call first):
  CMakeLists.txt:245 (include)


-- Configuring incomplete, errors occurred!

I got error
libXpm and Xpm headers must be installed.

since I can not use sudo, yum … etc

I install libXpm.so.4, individually

ll /home/XXXXX /software/rpm/install/usr/lib
lrwxrwxrwx 1 XXXXX users    16 10月 11  2023 libXpm.so.4 -> libXpm.so.4.11.0
-rwxr-xr-x 1 XXXXX users 85308 10月 11  2023 libXpm.so.4.11.0

I did again cmake

       cmake .. \
        -DCMAKE_INSTALL_PREFIX="/home/XXXXX/software/root/root-6.26.00/install" \
        -DPYTHON_EXECUTABLE=/usr/local/bin/python3 \
        -DPYTHON_LIBRARY=/usr/local/lib/libpython3.9. \
        -DCMAKE_PREFIX_PATH=/home/XXXXX/software/rpm/install/usr/lib

But, still I got errors

-- Looking for LZMA
-- Looking for X11
CMake Error at cmake/modules/SearchInstalledSoftware.cmake:357 (message):
  libXpm and Xpm headers must be installed.
Call Stack (most recent call first):
  CMakeLists.txt:245 (include)


-- Configuring incomplete, errors occurred!

How shoud I modify at first??

Hi @tomy!

ROOT uses the standard find_package to look for the required X11 components:

So most likely this is not a ROOT problem but an issue with your environment.

You should make sure that you can get this simple CMake example to work (create a directory, put this snippet in CMakeLists.txt and run cmake .).

cmake_minimum_required(VERSION 3.5)

project(test)

find_package(X11 REQUIRED)

# All these need to be true for ROOT to compile
message(STATUS ${X11_FOUND})
message(STATUS ${X11_Xpm_FOUND})
message(STATUS ${X11_Xft_FOUND})
message(STATUS ${X11_Xext_FOUND})

In general we strongly advise against such an environment where you install system packages outside the system to circumvent the need to sudo.

Have you asked your server administrator to install the required dependencies for building ROOT? Especially if you are in a particle physics institute, I’m sure they will have no problem installing the dependencies of ROOT with with system package manager. That would save everyone a lot of headache.

Cheers,
Jonas

Thanks for the yor reply.

the above cmake worked properly.

I guess My problem seems to be that cmake has not found “xpm.h”, whcih was actually installed manually via “libXpm-devel…rpm”

rpm -ivh --nodeps \
        --dbpath=/home/XXXXX/software/rpm/install/ \
        --relocate /=/home/XXXXX/software/rpm/install/ \
        --badreloc libXpm-devel-3.5.13-10.el9.x86_64.rpm

[XXXXX @YY rpm]$ ll install/usr/
drwxr-xr-x 2 XXXXX users 42  7月 10 13:53 bin
drwxr-xr-x 3 XXXXX users 25  7月 10 13:53 include
drwxr-xr-x 3 XXXXX users 82  7月 10 13:54 lib
drwxr-xr-x 3 XXXXX users 52  7月 10 13:53 lib64
drwxr-xr-x 4 XXXXX users 40  7月 10 13:54 share

[XXXXX @YY rpm]$ ll install/usr/include/
drwxr-xr-x 2 t221344 users 27  7月 10 13:53 X11

[XXXXX @YY rpm]$ ll install/usr/include/X11/
-rw-r--r-- 1 t221344 users 16213 10月 11  2023 xpm.h

I somehow include the above xpm.h in “cmake” command with option?

If you advice me something, it would be really helpfull…

My server administrator unfortunately denied my request …

w/ Singularity, I could successfully use ROOT in the server!
thanks for the comments!