RooFFTConvPdf problem with shared library

Hello guys,

I have a problem related to the RooFFTConvPdf class when I use it through a personal shared library (in this shared library I have a class with a RooFFTConvPdf object as argument). Basically, I am able to compile and build my library without any kind of error or warning. However, when I try to load it through the root shell by using gSystem->Load(“”) I get the error

cling::DynamicLibraryManager::loadLibrary(): dir/lib/ undefined symbol: _ZTI13RooFFTConvPdf

and when I try to run a c++ code, this code is executed correctly with the following error at the end of the program:

*** glibc detected *** NAMEC++EXECUTABLE: munmap_chunk(): invalid pointer: 0x00000000038d49f0 *** ======= Backtrace: ========= /lib64/[0x7fc79e6dcf4e] /cvmfs/[0x7fc7a16f18a9] /cvmfs/[0x7fc7a18451cf] /lib64/[0x7fc79e69cebd] /cvmfs/[0x7fc7a1668946] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 00:13 1357011600 dir/lib/ 00601000-00602000 rw-p 00001000 00:13 1357011600 dir/lib/ 02240000-04575000 rw-p 00000000 00:00 0 [heap] 7fc7918a1000-7fc79195e000 r-xp 00000000 00:19 176269074 /cvmfs/ 7fc79195e000-7fc791b5e000 ---p 000bd000 00:19 176269074 /cvmfs/ 7fc791b5e000-7fc791b62000 rw-p 000bd000 00:19 176269074 /cvmfs/ 7fc791b62000-7fc791b64000 rw-p 00000000 00:00 0 7fc791b64000-7fc791b84000 r-xp 00000000 fc:01 837322 /lib64/ 7fc791b84000-7fc791d83000 ---p 00020000 fc:01 837322 /lib64/ 7fc791d83000-7fc791d84000 r--p 0001f000 fc:01 837322 /lib64/ 7fc791d84000-7fc791d85000 rw-p 00020000 fc:01 837322 /lib64/ 7fc791d85000-7fc791d86000 rw-p 00000000 00:00 0 7fc791d86000-7fc791d98000 r-xp 00000000 00:00 0 7fc791e08000-7fc791e32000 r-xp 00000000 00:00 0 7fc791e32000-7fc791e9a000 rw-p 00000000 00:00 0 7fc791f80000-7fc7927b3000 rw-p 00000000 00:00 0 7fc7927b3000-7fc7989cc000 r--p 00000000 00:19 176268068 /cvmfs/ 7fc7989cc000-7fc7989d2000 r-xp 00000000 00:19 175726341 /cvmfs/ 7fc7989d2000-7fc798bd1000 ---p 00006000 00:19 175726341 /cvmfs/ 7fc798bd1000-7fc798bd2000 rw-p 00005000 00:19 175726341 /cvmfs/ 7fc798bd2000-7fc798bd3000 rw-p 00000000 00:00 0 7fc798bd3000-7fc798bda000 r-xp 00000000 fc:01 808513 /lib64/ 7fc798bda000-7fc798dd9000 ---p 00007000 fc:01 808513 /lib64/ 7fc798dd9000-7fc798dda000 r--p 00006000 fc:01 808513 /lib64/ 7fc798dda000-7fc798ddb000 rw-p 00007000 fc:01 808513 /lib64/ 7fc798ddb000-7fc798df8000 r-xp 00000000 fc:01 826013 /lib64/ 7fc798df8000-7fc798ff7000 ---p 0001d000 fc:01 826013 /lib64/ 7fc798ff7000-7fc798ffb000 rw-p 0001c000 fc:01 826013 /lib64/ 7fc798ffb000-7fc798ffc000 rw-p 00000000 00:00 0 7fc798ffc000-7fc79acd2000 r-xp 00000000 00:19 176269098 /cvmfs/ 7fc79acd2000-7fc79aed1000 ---p 01cd6000 00:19 176269098 /cvmfs/ 7fc79aed1000-7fc79b014000 rw-p 01cd5000 00:19 176269098 /cvmfs/ 7fc79b014000-7fc79b021000 rw-p 00000000 00:00 0 7fc79b021000-7fc79b826000 r--s 00000000 fc:02 132544 /var/lib/sss/mc/passwd 7fc79b826000-7fc79b82e000 r-xp 00000000 fc:01 786486 /lib64/ 7fc79b82e000-7fc79ba2d000 ---p 00008000 fc:01 786486 /lib64/ 7fc79ba2d000-7fc79ba2e000 rw-p 00007000 fc:01 786486 /lib64/ 7fc79ba2e000-7fc79ba3a000 r-xp 00000000 fc:01 786465 /lib64/ 7fc79ba3a000-7fc79bc3a000 ---p 0000c000 fc:01 786465 /lib64/ 7fc79bc3a000-7fc79bc3b000 r--p 0000c000 fc:01 786465 /lib64/ 7fc79bc3b000-7fc79bc3c000 rw-p 0000d000 fc:01 786465 /lib64/ 7fc79bc3c000-7fc79bc59000 r-xp 00000000 fc:01 826032 /lib64/ 7fc79bc59000-7fc79be58000 ---p 0001d000 fc:01 826032 /lib64/ 7fc79be58000-7fc79be59000 r--p 0001c000 fc:01 826032 /lib64/ 7fc79be59000-7fc79be5a000 rw-p 0001d000 fc:01 826032 /lib64/ 7fc79be5a000-7fc79be5b000 rw-p 00000000 00:00 0 7fc79be5b000-7fc79be71000 r-xp 00000000 fc:01 786676 /lib64/ 7fc79be71000-7fc79c071000 ---p 00016000 fc:01 786676 /lib64/ 7fc79c071000-7fc79c072000 r--p 00016000 fc:01 786676 /lib64/ 7fc79c072000-7fc79c073000 rw-p 00017000 fc:01 786676 /lib64/ 7fc79c073000-7fc79c075000 rw-p 00000000 00:00 0 7fc79c075000-7fc79c077000 r-xp 00000000 fc:01 791878 /lib64/ (core dumped)
Does anyone know what can cause this issue? Thank you very much in advance.


the problem you have is that the library containing the RooFFTConvPdf, i.e., must be loaded already when you load your library.
There are at least two ways of achieving this:

  1. When you build your library, you link it against
  2. You make sure that libRooFitCore is already loaded when your library is loaded at runtime explicitly, e.g. by loading it before by hand.
    I would recommend to go for 1).
    As for the second error you paste, hard to say, especially before fixing the first one.


Hi Danilo,

Thank you very much for your fast reply!! In principle, I was convinced to already link and since I am using the following flag in my Makefile:

Anyway, when I try to load manually and (I need to load manually this library since I am using also a RooGaussModel in my code) before this latter is perfectly loaded! It is obvious now that the libraries linking in my Makefile is not properly done. What it’s wrong in my Makefile? Here my code:

[code]EXE1 =

#OS Version
ROOTCONFIG := $(ROOTSYS)/bin/root-config
ROOTCINT := $(ROOTSYS)/bin/rootcint
ARCH := $(shell $(ROOTCONFIG) --arch)
PLATFORM := $(shell $(ROOTCONFIG) --platform)

Compiler version

CC = g++

Primary directory



OBJ = obj
DICT = dict
LIB = lib
BIN = bin
SRC = src
MAIN = main
IMG = img
RES = res
FILES = files

Directory commands

RMDIRS = @rm -rf $(OBJ); rm -rf $(DICT); rm -rf $(LIB); rm -rf $(BIN)
MKOBJ = @mkdir -p $(OBJ)
MKDICT = @mkdir -p $(DICT)
MKLIB = @mkdir -p $(LIB)
MKBIN = @mkdir -p $(BIN)
MKUSR = @mkdir -p $(IMG); mkdir -p $(RES); mkdir -p $(FILES)

Include directories

ROOTHH = $(ROOTSYS)/include

ROOT library directory


#RooFit library

File lists

CCLIST = $(wildcard $(FHH)/.cpp)
HHLIST = $(wildcard $(FHH)/
OBJLIST = $(notdir $(patsubst %.cpp,%.o,$(CCLIST)))
DICTLIST = $(notdir $(patsubst %.h,%Dict.o,$(HHLIST)))

Output name files


Compiler options

CCOPT = -std=c++11 -O2
CCWARN = -Wall -Wno-deprecated -Wno-write-strings -Wformat -Wsign-compare
CCINCL = -I. -I$(FHH) $(ROOTCONFIG) --cflags -fPIC
CCLIBSO = -L$(RFSO) $(ROOTCONFIG) --libs -lFFTW -lRooFitCore -lRooFit -lRooStats -lHtml -lMinuit -lThread -lTreePlayer -lFoam
-lProof -lProofBench -lProofDraw -lProofPlayer

default: $(BIN)/$(EXE1)


@echo “Making $@”
@$(ROOTCINT) -f $@ -c $(patsubst $(DICT)/%Dict.cpp,$(FHH)/%.h,$@)

$(DICT)/%Dict.o: $(DICT)/%Dict.cpp
@echo “Compiling $@”
@$(CC) $(CCOPT) $(CCWARN) $(CCINCL) -c $(patsubst %.o,%.cpp,$@) -o $@

$(OBJ)/%.o: $(FHH)/%.cpp $(FHH)/%.h
@echo “Compiling $(notdir $(patsubst %.o,%.cpp,$@))”
@$(CC) $(CCOPT) $(CCWARN) $(CCINCL) -c $(FHH)/$(notdir $(patsubst %.o,%.cpp,$@)) -o $@

$(LIBF): $(addprefix $(OBJ)/, $(OBJLIST)) $(addprefix $(DICT)/, $(DICTLIST)) $(OBJ)/$(LIBNAME)_dict.o
@echo “Make libraries”
$(CC) $(CCOPT) $(CCWARN) $(addprefix $(OBJ)/, $(OBJLIST)) $(addprefix $(DICT)/, $(DICTLIST)) $(SOFLAGS) -o $(LIBF)

$(OBJ)/$(LIBNAME)_dict.o: $(OBJ)/$(LIBNAME)_dict.cxx

$(OBJ)/$(LIBNAME)_dict.cxx: $(wildcard $(FHH)/*.h) $(DICT)/$(LIBNAME)_dict.h $(DICT)/$(LIBNAME)_LinkDef.h
$(ROOTCINT) -f $@ -c -I$(SRC) -I$(DICT) $(DICT)/$(LIBNAME)_dict.h $(DICT)/$(LIBNAME)_LinkDef.h

$(BIN)/$(EXE1): $(MAIN)/$(EXE1).cc $(LIBF)
@echo “Make exe1”
$(CC) $(CCOPT) $(CCWARN) $(CCINCL) -L$(PWD)/$(LIB) $(CCLIBSO) -l$(LIBNAME) $(MAIN)/$(EXE1).cc -o $(BIN)/$(EXE1)
Thank you very much.

Hi Marco,

before diving in the makefile, did you verify that the roofit library is not actually linked to your library with the ldd command?


Hi Danilo,

I didn’t know the ldd command (very useful! thank you very much!) and indeed the and were not correctly linked in This because I didn’t add the $(CCLIBSO) variable in the Makefile line associated to the compilation of $(LIBF). Now, both c++ executable and library are executed and loaded correctly!

Thank you very much for your help!