Compilation on macOs
Liam Gaffney liam.gaffney@cern.ch:
- Makefile definitions are too strict on the compiler choice
In all the Makefiles under rootext, you fix the compiler choice to be g++. However, if g++ was not used to build ROOT, this will clash with flags and libraries. The compiler should be the same as that used for ROOT, i.e.: CPP := $(shell root-config --cxx)
- The location of libmfile is inflexible
libmfile is not found on my system in a default directory. I get around this currently by hacking the Makefiles and adding -I</path/to/mfile/include> to the CXXFLAGS and -L</path/to/mfile/lib> to the LFLAGS. However, this then doesn't get passed to the rootling invocations, so I have added new variables EXTRAINC and EXTRALIB and passed them to the appropriate places.
- Similarly, the location of ALL headers and libraries is inflexible
Specifically, when using Macports on my system, additional libraries are installed to /opt/local/, so I have to add this by hand to the Makefile as above. For example, X11/Xlib.h is not found in my default directories, but is instead at /opt/local/include.
- libmfile clashes with the raw source code if the compiler is case-insensitive
I avoid this by changing all the raw source header files to be .hh instead of .h. i.e: MFile.hh, MFileHist.hh, etc. Of course, this means changing all instances of #include too and adding 'mfile-root/*.hh', to the list of source files in the setup.py file. In your current version of things, the header file definition in the Makefile also needs to be changed to HDR_FILES := $(SRC_FILES:.cxx=.hh), which in turn means that all MatOp.h, VMatrix.h etc files must become .hh too. Maybe you'll find a better way to do this...
- libX11 needs to be explicitly passed at compilation
I always get an error for an undefined symbol "_XDrawLines", which is part of libX11. On mac, this library is apparently not automatically passed at compilation time, so I have to explicitly add it to the "display" Makefile with -lX11 on the end of LFLAGS.
Undefined symbols for architecture x86_64:
"_XDrawLines", referenced from:
HDTV::Display::View2D::RenderCut(HDTV::Display::DisplayCut const&, int, int, unsigned long) in View2D.o
HDTV::Display::View2D::DrawPolyLine(unsigned long, unsigned long, int, short*) in View2D.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libdisplay.so] Error 1
- The doc files fail to compile because of rst2man
On my mac at least, python-utils from Macports gives rst2man.py as an executable, not rst2man. The Makefile should probably look for either of them.