Home | News | Documentation | Download

Is it possible to run compiled standalone application from anywhere on a system?

Hi, ROOTers

I have compiled a standalone GUI application successully. However, there is a problem which I describe below.

Preliminaries

The structure of the working directory is the following

Before make

.
├── DummyLinkDef.h
├── inc
│   ├── Dummy.h
│   └── Includes.h
├── Makefile
└── src
    ├── Dummy.cpp
    └── Main.cpp

Where make is the following lines

g++ -I./inc -c src/Dummy.cpp `root-config --cflags --glibs` 
g++ -I./inc -c src/Main.cpp `root-config --cflags --glibs`
rootcling -f Dummy.cxx inc/Dummy.h inc/Includes.h DummyLinkDef.h 
g++ -I./inc Dummy.o Main.o Dummy.cxx `root-config --cflags --glibs` -o Dummy 

After make:

.
├── Dummy
├── Dummy.cxx
├── DummyLinkDef.h
├── Dummy.o
├── Dummy_rdict.pcm
├── inc
│   ├── Dummy.h
│   └── Includes.h
├── Main.o
├── Makefile
└── src
    ├── Dummy.cpp
    └── Main.cpp

The Problem

I can run Dummy executable successfully only in the working directory. However, If I add it to stanard PATH (e.g. /usr/bin) and try to execute it, say, from a directory above I get the following message:

Error in <TCling::RegisterModule>: cannot find dictionary module Dummy_rdict.pcm

However, it seems that slots, for example, work fine. Anyway my question is is there a way to run Dummy from anywhere properly?

I attach full directory if it is needed. Test.zip (2.4 KB)

You probably need to copy the .pcm file to the same PATH as the binary, as the binary searches for it in the same directory. This is a restriction that started with ROOT 6.18 as far as I know (pcms have to be in the same directory as libraries or binaries that make use of them).

No, it doesn’t work. I copied *.pcm to the /usr/bin/ but nothing changed. The same error. BTW, I cannot see any errors in my program. All works fine but at the start of execution I see errors:

Error in <TCling::RegisterModule>: cannot find dictionary module Dialogs_rdict.pcm
Error in <TCling::RegisterModule>: cannot find dictionary module CaenGUI_rdict.pcm

It seems it is not a problem but I don’t like mysterious errors anyway. Is it a possibility to extend the path for searching *.pcm files?

It is not the same error, now you are missing other dictionaries (Dialogs_rdict.pcm and CaenGUI_rdict.pcm instead of Dummy_rdict.pcm). If the dictionaries are in the same place as their respective libraries/binaries, and you have LD_LIBRARY_PATH set to contain the path to the libraries, it should work.

1 Like

Sorry for the confusion. The original post was a simple example in order to other users could reproduce the error. But I am working on a more complicated example. So the last errors are from it.

Affirmative. Thank you. However, I also had to extend CPLUS_INCLUDE_PATH. Otherwise, I had errors. But I am not sure this problem is relevant here.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.