Building root from source

I am on OSX 10.13.6
I had problems with root binaries, so I am trying to install
root from source.

I unzipped the source tar-ball into directory
/usr/local/root
Then from directory

/usr/local/root_v16.14_02
I entered commands
sudo cmake …/root
sudo cmake --build .

After compiling a long list of files, I got the following error message

[ 91%] Built target G__PyROOT
[ 91%] Generating G__RMySQL.cxx, …/…/lib/libRMySQL_rdict.pcm, …/…/lib/libRMySQL.rootmap
In file included from input_line_12:9:
/usr/local/root_v6.14_02/include/TMySQLStatement.h:35:7: error: unknown type name 'my_bool’
my_bool fResNull; //! indicates if argument is null
^
Error: /usr/local/root_v6.14_02/bin/rootcling: compilation failure (/usr/local/root_v6.14_02/lib/libRMySQL9ed90ba58e_dictUmbrella.h)
make[2]: *** [sql/mysql/G__RMySQL.cxx] Error 1
make[1]: *** [sql/mysql/CMakeFiles/G__RMySQL.dir/all] Error 2
make: *** [all] Error 2

Any suggestions?

other system info:

bash-3.2$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

bash-3.2$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


ROOT Version: 6.14/02
Platform: OSX 10.13.6
Compiler: Not Provided


@ce_hyde, can you try to disable mysql adding flag -Dmysql=OFF to your CMake command, perhaps it will help?

Cheers,
Oksana.

I am actually building root v6.15/01
after

cmake -Dmysql=OFF
cmake --build .
compilation was successful, and created
/bin/root

.demo ran, but
clicking on the geometry button froze the root session.
Here is a root session
bash-3.2$ root

| Welcome to ROOT 6.15/01 http://root.cern.ch |
| (c) 1995-2018, The ROOT Team |
| Built for macosx64 |
| From heads/master@v6-13-04-935-g269e690fe8, Aug 15 2018, 08:24:02 |

Try ‘.help’, ‘.demo’, ‘.license’, ‘.credits’, ‘.quit’/‘.q’

root [0] .L HW.cpp
root [1] main()
bash-3.2$

Here is the code

#include <stdio.h>
int main(){
   int i = 0;
   printf("Hello root World \n");
   i++;
   return i;
}
'''

Rename “main” into “HW”.

1 Like

This works, either interpreted or compiled.

#include <stdio.h>
int HW(){
   int i = 0;
   printf("Hello root World \n");
   i++;
   return i;
}
'''
So if I want to compile outside root with a Makefile the global name is main()
but if I compile inside root the global name cannot be main()?


Thanks for the help.  I will try more complicated examples.

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