# Rdict.pcm file not found

**URL:** <https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287>\
**Category:** ROOT\
**Created:** [May 10, 2024, 7:19am UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287 "2024-05-10T07:19:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tristan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/tristan/32/36486_2.png) [@Tristan](https://root-forum.cern.ch/u/Tristan)\
**Post date:** [May 10, 2024, 7:19am UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287/1 "2024-05-10T07:19:54Z")

</div>

Hi everyone,

I am building a small project with the following structure with CMake:

```auto
├── App
│ ├── App.cxx
│ └── CMakeLists.txt
├── Reconstruction
│ ├── CMakeLists.txt
│ ├── inc
│ └── src
├── More_Folders
│ ├── CMakeLists.txt
│ ├── inc
│ └── src
└── CMakeLists.txt

```

In the Reconstruction folder, I define dictionaries to write and read custom defined classes. My Reconstruction/CMakeLists.txt is very basic:

```auto
# Add source files
file(GLOB SOURCES "src/*.cxx")

# Add a library target
add_library(ReconstructionLibrary ${SOURCES})

# Set include directories for library target
target_include_directories(ReconstructionLibrary PUBLIC inc)

# Generate ROOT dictionary
root_generate_dictionary(Reconstruction_dict inc/dEdx.h LINKDEF inc/Recon_LinkDef.h MODULE ReconstructionLibrary)
root_generate_dictionary(ERAMinfo_dict inc/LUTs.h LINKDEF inc/Recon_LinkDef.h MODULE ReconstructionLibrary)

# Link the ROOT dictionary to the library
target_link_libraries(ReconstructionLibrary PUBLIC MiscLibrary SignalModelLibrary EvtModelLibrary FittersLibrary SampleToolsLibrary EvtModelToolsLibrary)

```

This library is then linked to the executable in the App directory with this very short App/CMakeLists.txt:

```auto
add_executable(App App.cxx)
target_link_libraries(App MiscLibrary SignalModelLibrary EvtModelLibrary FittersLibrary SampleToolsLibrary EvtModelToolsLibrary ReconstructionLibrary ${ROOT_LIBRARIES})

```

Eventually, the top-level CMakeLists.txt is as follow:

```auto
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(dEdxRecon)

find_package(ROOT REQUIRED COMPONENTS RIO Tree)
include_directories(${ROOT_INCLUDE_DIRS})

# Add subdirectories
add_subdirectory(App)
add_subdirectory(Reconstruction)
add_subdirectory(Other_folders)

```

However, after compilation, during the execution of the code, I get the following error:

```auto
Error in <TCling::LoadPCM>: ROOT PCM path_to_workspace/build/App/libReconstructionLibrary_rdict.pcm file does not exist

```

since the rdict.pcm files are created in the build/Reconstruction folder, not the App one. I believe this is related to this [thread](https://root-forum.cern.ch/t/pcm-file-not-found/48374), even though I couldn’t solve it.  
What should I change so that TCling does not look for the PCM files in the build/App folder but rather in the build/Reconstruction folder, where they were actually created?

Cheers,  
Tristan

* * *

_ROOT Version:_ 6.30/04

* * *

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [May 10, 2024, 12:43pm UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287/2 "2024-05-10T12:43:59Z")

</div>

Dear Tristan,

ROOT expects the “rootpcm” file to sit next to the library that contains its dictionary (rootcling/genreflex output a pcm and a cxx file, which needs to be compiled in a shared object).

Is this the case for your setup?

Best,  
Danilo

---

<div class="post-metadata">

**Author:** ![Tristan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/tristan/32/36486_2.png) [@Tristan](https://root-forum.cern.ch/u/Tristan)\
**Post date:** [May 12, 2024, 12:36pm UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287/3 "2024-05-12T12:36:59Z")

</div>

Hi Danilo,

Here is my file tree of the build folder:

```auto
├── App
│ ├── App
│ ├── CMakeFiles
│ ├── cmake_install.cmake
│ └── Makefile
├── CMakeCache.txt
├── CMakeFiles
│ ├── 3.22.1
│ ├── cmake.check_cache
│ ├── CMakeDirectoryInformation.cmake
│ ├── CMakeOutput.log
│ ├── CMakeRuleHashes.txt
│ ├── CMakeTmp
│ ├── Makefile2
│ ├── Makefile.cmake
│ ├── progress.marks
│ └── TargetDirectories.txt
├── cmake_install.cmake
├── Other_folders
├── Makefile
└── Reconstruction
    ├── CMakeFiles
    ├── cmake_install.cmake
    ├── ERAMinfo_dict.cxx
    ├── libReconstructionLibrary.a
    ├── libReconstructionLibrary_rdict.pcm
    ├── libReconstructionLibrary.rootmap
    ├── Makefile
    ├── module.modulemap
    └── Reconstruction_dict.cxx

```

So I believe that the .pcm file is indeed in the same folder as the .cxx file in the dictionary. Please correct me if I misunderstood something here!

Cheers,  
Tristan

---

<div class="post-metadata">

**Author:** ![Tristan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/tristan/32/36486_2.png) [@Tristan](https://root-forum.cern.ch/u/Tristan)\
**Post date:** [May 14, 2024, 2:11am UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287/4 "2024-05-14T02:11:32Z")

</div>

I believe my issue is similar to [the one addressed here](https://root-forum.cern.ch/t/understanding-cmake-root-generate-dictionary/56090), but it never received an answer, sadly.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [May 28, 2024, 2:12am UTC](https://root-forum.cern.ch/t/rdict-pcm-file-not-found/59287/5 "2024-05-28T02:12:33Z")

</div>

Closed on May 28, 2024, 2:12am UTC

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