Permissions problem when loading shared library

I have built a shared library / dictionary for my classes to be able to load them from the root interpreter. I have used the CMake macro:

ROOT_GENERATE_DICTIONARY(SimulationDataRootDict ${HEADERS} MODULE SimulationData)

I generate the libSimulationData.so library and the other dictionary related files such as libSimulationData.rootmap and libSimulationData_rdict.pcm. The library seems to work in some systems, however in one system I get the following error:

root [0] gSystem->Load("libSimulationData.so")
(int) 0
root [1] DataEvent ev;
libSimulationData dictionary payload:8:10: remark: could not acquire lock file for module 'SimulationData': failed to create unique file /programas/root/6.25.01/lib/SimulationData.pcm.lock-d4f4f1c2: Permission denied [-Rmodule-build]
#include "/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataEvent.h"
         ^
libSimulationData dictionary payload:8:10: remark: building module 'SimulationData' as '/programas/root/6.25.01/lib/SimulationData.pcm' [-Rmodule-build]
error: unable to open output file '/programas/root/6.25.01/lib/SimulationData.pcm': 'Permission denied'
libSimulationData dictionary payload:8:10: remark: finished building module 'SimulationData' [-Rmodule-build]
libSimulationData dictionary payload:8:10: fatal error: could not build module 'SimulationData'
#include "/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataEvent.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error in <TInterpreter::AutoParse>: Error parsing payload code for class DataEvent with content:

#line 1 "libSimulationData dictionary payload"

#ifndef SPDLOG_COMPILED_LIB
  #define SPDLOG_COMPILED_LIB 1
#endif

#define _BACKWARD_BACKWARD_WARNING_H
// Inline headers
#include "/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataEvent.h"
#include "/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataSteps.h"
#include "/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataTrack.h"

#undef  _BACKWARD_BACKWARD_WARNING_H

ROOT_prompt_1:1:11: error: variable has incomplete type 'DataEvent'
DataEvent ev;
          ^
libSimulationData dictionary forward declarations' payload:7:117: note: forward declaration of 'DataEvent'
class __attribute__((annotate("$clingAutoload$/tmp/tmp.KVC21ZJ1Eb/libraries/SimulationData/include/DataEvent.h")))  DataEvent;

It looks like the problem is that I don’t have permissions to write in $ROOTSYS/lib, which I don’t. Is there a way to solve this problem?

On a side note, is there a way to automatically load the library? perhaps placing it in some directory (other than $ROOTSYS).

Thanks.

I guess @vvassilev can help.

Can you list the contents of the folder that contains libSimulationData.so?