# Generating rootmap files with root 6.04.18

**URL:** <https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493>\
**Category:** ROOT\
**Created:** [July 7, 2016, 11:24am UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493 "2016-07-07T11:24:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otto\_Schaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/90ced4/32.png) [@Otto\_Schaile](https://root-forum.cern.ch/u/Otto_Schaile)\
**Post date:** [July 7, 2016, 11:24am UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493/1 "2016-07-07T11:24:14Z")

</div>

Dear Rooters,

we are trying to adapt our Marabou project to Root 6.  
Compiling, linking and running of the execs with gcc 4.8,  
all is fine.  
Our issue at the moment is with loading our shared libs in a root session.  
Under Root 5 we generated rootmap files with $ROOTSYS/bin/rlibmap  
getting files like:

```auto
Library.TMbsWindow2d: libTMrbUtils.so libGraf.so
Library.TMbsWindowF: libTMrbUtils.so libGraf.so
...
```

With this the following works:

```auto
gSystem->Load("libTMrbUtils.so");
```

Btw. This file generated under Root 5 still does its job under Root 6,  
though rlibmap is no longer there.

Under Root 6 I tried to generate dictionary, pcm and rootmap  
as done in $ROOTSYS/hist/hist/Module.mk  
The resulting command line looks like this:

```auto
rootcling -rootbuild -f utils/src/G__TMrbUtilsDict.cxx
-s lib/libTMrbUtils.so -rml libTMrbUtils.so 
-rmf lib/libTMrbUtils.rootmap 
-m /software/opt/trusty/x86_64/root/6.04.18/lib/libGraf_rdict.pcm
-c -writeEmptyRootPCM
utils/inc/GlobDef.h utils/inc/SetColor.h utils/inc/ utils/inc/TMrbEnv.h 
...
utils/inc/TMrbWdw.h utils/inc/LinkDef.h
```

The resulting lib/libTMrbUtils.rootmap is:

```auto
[libTMrbUtils.so]
# List of selected classes
class TMbsWindow2d
class TMbsWindowF
...
header TMrbWdw.h
header TMrbEnv.h
...
```

So no reference to [libGraf.so](http://libGraf.so) at all  
and of course

```auto
gSystem->Load("libTMrbUtils.so");
```

results in:  
cling::DynamicLibraryManager::loadLibrary():…undefined: \_ZTI5TLine

So I am something important missing!

Any help appreciated

Otto

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 7, 2016, 4:46pm UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493/2 "2016-07-07T16:46:42Z")

</div>

Hi Otto,

For each dependent library you want to specify add the option:` -rml	Rootmap library name                                                 
  Specify the name of the library which contains the autoload keys. This    
  switch can be specified multiple times to autoload several libraries in   
  presence of a particular key.                                             
`

Note that we actually strongly recommend to no longer use this feature but instead rely on explicitly linking the dependent library to the library itself. I.e.`
g++ --shared -o libTMrbUtils.so .... ${OBJECT_FILES} ..... -lGraf`This allows to then add to that link line the flag`-Wl,--no-undefined `which will warn you of missing symbols (if any) at compile time rather than delaying the check until run-time.

Cheers,  
Philippe.

---

<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:** [July 7, 2016, 5:52pm UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493/3 "2016-07-07T17:52:35Z")

</div>

Hi Otto,

I very much support the comments of Philippe.  
In case you want to have more information about the switches supported by rootcling, you can always refer to the help prompted by the command “rootcling -h”.  
Let me comment about the dictionary generation command you used, just for completeness:

```auto
rootcling -rootbuild -f utils/src/G__TMrbUtilsDict.cxx
-s lib/libTMrbUtils.so -rml libTMrbUtils.so
-rmf lib/libTMrbUtils.rootmap
-m /software/opt/trusty/x86_64/root/6.04.18/lib/libGraf_rdict.pcm
-c -writeEmptyRootPCM
utils/inc/GlobDef.h utils/inc/SetColor.h utils/inc/ utils/inc/TMrbEnv.h
...
utils/inc/TMrbWdw.h utils/inc/LinkDef.h
```

- The “-rootbuild” and “-writeEmptyRootPCM” are for internal use only, at least for the moment. They should not be used for generating dictionaries of user classes.
- The switch “-c” is not necessary anymore.
- In your invocation, the -s switch can be dropped.
- The “-m” switch is presently not used by ROOT but will be as soon as clang C++ modules are supported: this is a very nice way to write a forward compatible infrastructure.

So, in short, if you want to generate a dictionary for your classes taking advantage of the linking feature mentioned by Philippe in the previous post, the command could look like:

```auto
rootcling -f utils/src/G__TMrbUtilsDict.cxx 
-rml libTMrbUtils.so 
-rmf lib/libTMrbUtils.rootmap 
-m /software/opt/trusty/x86_64/root/6.04.18/lib/libGraf_rdict.pcm
utils/inc/GlobDef.h utils/inc/SetColor.h utils/inc/ utils/inc/TMrbEnv.h
...
utils/inc/TMrbWdw.h utils/inc/LinkDef.h
```

Cheers,  
Danilo

---

<div class="post-metadata">

**Author:** ![Otto\_Schaile](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/o/90ced4/32.png) [@Otto\_Schaile](https://root-forum.cern.ch/u/Otto_Schaile)\
**Post date:** [July 11, 2016, 8:03am UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493/4 "2016-07-11T08:03:05Z")

</div>

HI Philippe, Danilo,  
thank you for the clarifying answers.  
One question to Danilo still:  
I modified the rootcling line as you suggested.  
However if I drop

```auto

```

the name of the pcm file becomes:

```auto

```

instead of

```auto

```

Is this expected?

Cheers  
Otto

---

<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:** [July 11, 2016, 9:06am UTC](https://root-forum.cern.ch/t/generating-rootmap-files-with-root-6-04-18/21493/5 "2016-07-11T09:06:33Z")

</div>

Hi Otto,

yes. The input is taken from the output cxx file. To simplify your command, if this is possible in your setup and you want to do it, you can rename the autogenerated cxx dictionary file.

Cheers,  
Danilo
