# Building root from source

**URL:** <https://root-forum.cern.ch/t/building-root-from-source/30256>\
**Category:** ROOT\
**Created:** [August 15, 2018, 1:58am UTC](https://root-forum.cern.ch/t/building-root-from-source/30256 "2018-08-15T01:58:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ce\_hyde](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ce_hyde/32/22389_2.png) [@ce\_hyde](https://root-forum.cern.ch/u/ce_hyde)\
**Post date:** [August 15, 2018, 1:58am UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/1 "2018-08-15T01:58:50Z")

</div>

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

* * *

---

<div class="post-metadata">

**Author:** ![oshadura](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/oshadura/32/14460_2.png) [@oshadura](https://root-forum.cern.ch/u/oshadura)\
**Post date:** [August 15, 2018, 7:36am UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/2 "2018-08-15T07:36:46Z")

</div>

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

Cheers,  
Oksana.

---

<div class="post-metadata">

**Author:** ![ce\_hyde](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ce_hyde/32/22389_2.png) [@ce\_hyde](https://root-forum.cern.ch/u/ce_hyde)\
**Post date:** [August 15, 2018, 5:04pm UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/3 "2018-08-15T17:04:53Z")

</div>

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](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

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

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 15, 2018, 5:24pm UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/4 "2018-08-15T17:24:59Z")

</div>

Rename “main” into “HW”.

---

<div class="post-metadata">

**Author:** ![ce\_hyde](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ce_hyde/32/22389_2.png) [@ce\_hyde](https://root-forum.cern.ch/u/ce_hyde)\
**Post date:** [August 15, 2018, 7:14pm UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/5 "2018-08-15T19:14:22Z")

</div>

This works, either interpreted or compiled.

```auto
#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.
```

---

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [August 15, 2018, 8:09pm UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/6 "2018-08-15T20:09:48Z")

</div>

> [@ROOT 6 / CLING / rootcling replacements for (\_\_CINT\_\_), (\_\_MAKECINT\_\_) and (\_\_ACLIC\_\_) macros](https://root-forum.cern.ch/t/root-6-cling-rootcling-replacements-for-cint-makecint-and-aclic-macros/27698):
>
> I am looking for ROOT 6 / CLING / rootcling replacements for ROOT 5 / CINT / rootcint macros \_\_CINT\_\_, \_\_MAKECINT\_\_ and \_\_ACLIC\_\_ (I would like to get rid of any ROOT 5 / CINT / rootcint dependencies in new ROOT 6 / CLING / rootcling source code): #if defined(\_\_CINT\_\_) && !defined(\_\_MAKECINT\_\_) // source code being actually interpreted by cint #elif defined(\_\_MAKECINT\_\_) // source code seen by rootcint only #elif defined(\_\_ACLIC\_\_) // source code being actually compiled by ACLiC #else // source…

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 29, 2018, 8:09pm UTC](https://root-forum.cern.ch/t/building-root-from-source/30256/7 "2018-08-29T20:09:48Z")

</div>

Closed on August 29, 2018, 8:09pm UTC

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