# TMVA and building on a Mac

**URL:** <https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134>\
**Category:** TMVA\
**Created:** [April 12, 2012, 8:56pm UTC](https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134 "2012-04-12T20:56:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nonnormalizable](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nonnormalizable/32/11271_2.png) [@Nonnormalizable](https://root-forum.cern.ch/u/Nonnormalizable)\
**Post date:** [April 12, 2012, 8:56pm UTC](https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134/1 "2012-04-12T20:56:56Z")

</div>

Hello,

I’m trying to build TMVA in Mac OS X 10.7.3 according to the [how to](http://tmva.sourceforge.net/howto.shtml) with an installation of root 5.32/01 that I built from source. It gives the error

```auto
Building shared library lib/libTMVA.dylib ... ld: duplicate symbol TMVA::Configurable::Class_Name() in obj/TMVA_Dict1.o and obj/G__TMVA1.o for architecture x86_64
collect2: ld returned 1 exit status
make: *** [lib/libTMVA.dylib] Error 1
```

I guess this might be related to [this bug report](http://sourceforge.net/tracker/?func=detail&aid=3151825&group_id=152074&atid=783563), but adding “$(shell root-config --ldflags)” (which resolves to -m64) to that line in the Makefile has no effect for me. I’ve also tried sourcing the [setup.sh](http://setup.sh) file in tmva/test, but no luck.

Any help appreciated!

---

<div class="post-metadata">

**Author:** ![IanC89](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/22d042/32.png) [@IanC89](https://root-forum.cern.ch/u/IanC89)\
**Post date:** [April 15, 2012, 10:33am UTC](https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134/2 "2012-04-15T10:33:26Z")

</div>

I’ve used TMVA a little bit, but I’ve never gone through that setup process.

Could I suggest maybe having a look at [these statistics courses](http://www.pp.rhul.ac.uk/~cowan/stat_course.html), in particular problem sheet 7 and the accompanying datafiles as they might help set up TMVA for you, although not necessarily solve your issue.

Ian

---

<div class="post-metadata">

**Author:** ![Nonnormalizable](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nonnormalizable/32/11271_2.png) [@Nonnormalizable](https://root-forum.cern.ch/u/Nonnormalizable)\
**Post date:** [April 16, 2012, 10:56pm UTC](https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134/3 "2012-04-16T22:56:43Z")

</div>

Hi Ian, thanks for the feedback. Compiling and running those files does work for me, for whatever reason, but doesn’t seem to get me any closer to compiling and running TMVA itself for my own purposes, alas.

---

<div class="post-metadata">

**Author:** ![Nonnormalizable](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/nonnormalizable/32/11271_2.png) [@Nonnormalizable](https://root-forum.cern.ch/u/Nonnormalizable)\
**Post date:** [April 17, 2012, 9:35pm UTC](https://root-forum.cern.ch/t/tmva-and-building-on-a-mac/14134/4 "2012-04-17T21:35:40Z")

</div>

For future reference: I got this to work my downloading TMVA (4.1.2) source from the home page, then compiling that. But! I did need to change a few lines in TMVA’s source. The function TMath::Power wasn’t able to cast a UInt\_t to a Int\_t, I gather, so I needed to do this:

[code]diff -u TMVA-v4.1.2\ 2/src/MethodPDERS.cxx TMVA-v4.1.2/src/MethodPDERS.cxx  
— TMVA-v4.1.2 2/src/MethodPDERS.cxx 2011-07-20 08:37:13.000000000 -0700  
+++ TMVA-v4.1.2/src/MethodPDERS.cxx 2012-04-17 14:18:00.000000000 -0700  
@@ -988,7 +988,7 @@  
}

```
// Normalizing by the full volume

```

- ret \*= ( TMath::Power (2., GetNvar()) \* TMath::Gamma (1 + (((Double\_t) GetNvar()) / 2.)) ) /

- ret \*= ( TMath::Power (2., (Int\_t) GetNvar()) \* TMath::Gamma (1 + (((Double\_t) GetNvar()) / 2.)) ) /  
TMath::Power (TMath::Pi(), ((Double\_t) GetNvar()) / 2.);

- 

```
 ret = TMath::Power (sinc, GetNvar());

```

- 

```
ret = TMath::Power (sinc, (Int_t) GetNvar());

```

else

- 

```
 ret = TMath::Abs (sinc) * TMath::Power (sinc, GetNvar() - 1);

```

- 

```
ret = TMath::Abs (sinc) * TMath::Power (sinc, (Int_t) GetNvar() - 1);

```

return ret;  
}  
@@ -1043,8 +1043,8 @@  
Double\_t lanczos = (TMath::Sin(pix) / pix) \* (TMath::Sin(pixtimesn) / pixtimesn);  
Double\_t ret;

- if (GetNvar() % 2) ret = TMath::Power (lanczos, GetNvar());
- else ret = TMath::Abs (lanczos) \* TMath::Power (lanczos, GetNvar() - 1);

- if (GetNvar() % 2) ret = TMath::Power (lanczos, (Int\_t) GetNvar());

- else ret = TMath::Abs (lanczos) \* TMath::Power (lanczos, (Int\_t) GetNvar() - 1);
