# Problem with building ROOT: MathMore error

**URL:** <https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822>\
**Category:** Newbie\
**Created:** [August 30, 2019, 11:02am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822 "2019-08-30T11:02:10Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [August 30, 2019, 11:02am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/1 "2019-08-30T11:02:10Z")

</div>

Hi,  
I was trying to install ROOT from the git repository.  
First, I cloned the package: git clone [https://github.com/root-project/root.git](https://github.com/root-project/root.git)  
Then, in the build directory, I run:  
cmake . .  
cmake --build . -j8

and I got this error:

CMakeFiles/MathMore.dir/src/GSLNLSMinimizer.cxx.o: In function `ROOT::Math::GSLMultiFit::CovarMatrix() const': /home/ramij/root/math/mathmore/src/GSLMultiFit.h:185: undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
CMakeFiles/MathMore.dir/src/GSLNLSMinimizer.cxx.o: In function `ROOT::Math::GSLNLSMinimizer::Minimize()': GSLNLSMinimizer.cxx:(.text+0x139c): undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
GSLNLSMinimizer.cxx:(.text+0x142b): undefined reference to `gsl_multifit_fdfsolver_jac' GSLNLSMinimizer.cxx:(.text+0x1906): undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
GSLNLSMinimizer.cxx:(.text+0x1f88): undefined reference to `gsl\_multifit\_fdfsolver\_jac’  
collect2: error: ld returned 1 exit status  
gmake[2]: \*\*\* [lib/libMathMore.so] Error 1  
gmake[1]: \*\*\* [math/mathmore/CMakeFiles/MathMore.dir/all] Error 2  
gmake[1]: \*\*\* Waiting for unfinished jobs…

A screenshot is attached below.  
Please help me with this.

 ![MathMore_error](https://root-forum.cern.ch/uploads/default/original/3X/6/8/68a474dd7eca6ef7e2acfd7908fbd0a72b347b5e.png)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [August 30, 2019, 11:45am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/2 "2019-08-30T11:45:45Z")

</div>

May be @amadio has some idea about it.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [September 3, 2019, 1:11pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/3 "2019-09-03T13:11:15Z")

</div>

Hi, do you use builtin\_gsl? Or do you have GSL installed in your system? If the latter, what version do you have installed? Please provide more information about the operating system and compiler you are using. Thanks.

---

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [September 3, 2019, 2:19pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/4 "2019-09-03T14:19:42Z")

</div>

GSL version: gsl-1.15-13.el7.x86\_64.rpm  
Operating System: CentOS Linux 7 (Core)  
Kernel: Linux 3.10.0-693.el7.x86\_64  
Compiler:  
gcc.x86\_64 4.8.5-28.el7\_5.1  
gcc-c++.x86\_64 4.8.5-28.el7\_5.1  
gcc-gfortran.x86\_64 4.8.5-28.el7\_5.1

---

<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:** [September 3, 2019, 6:23pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/5 "2019-09-03T18:23:48Z")

</div>

Do you have “gsl- **devel** -1.15-13.el7.x86\_64” installed, too?

---

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [September 3, 2019, 7:05pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/6 "2019-09-03T19:05:50Z")

</div>

Yes.

/install/centos7.4/x86\_64/Packages/gsl-1.15-13.el7.i686.rpm  
/install/centos7.4/x86\_64/Packages/gsl-1.15-13.el7.x86\_64.rpm  
/install/centos7.4/x86\_64/Packages/gsl-devel-1.15-13.el7.i686.rpm  
/install/centos7.4/x86\_64/Packages/gsl-devel-1.15-13.el7.x86\_64.rpm

---

<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:** [September 3, 2019, 7:34pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/7 "2019-09-03T19:34:20Z")

</div>

What do you get from:

```bash
which gsl-config
rpm -qf `which gsl-config`
gsl-config --version
gsl-config --prefix
grep GSL_MAJOR_VERSION `gsl-config --prefix`/include/gsl/gsl_version.h

```

---

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [September 3, 2019, 7:54pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/8 "2019-09-03T19:54:54Z")

</div>

which gsl-config  
/usr/local/bin/gsl-config

rpm -qf `which gsl-config`  
file /usr/local/bin/gsl-config is not owned by any package

gsl-config --version  
2.5

gsl-config --prefix  
/usr/local

grep GSL\_MAJOR\_VERSION `gsl-config --prefix`/include/gsl/gsl\_version.h  
#define GSL\_MAJOR\_VERSION 2

---

<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:** [September 3, 2019, 8:00pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/9 "2019-09-03T20:00:35Z")

</div>

As you can see, you have another GSL version in “/usr/local”. You need to use something like:

```bash
cmake -DGSL_DIR=/usr/local ..

```

---

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [September 3, 2019, 8:53pm UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/10 "2019-09-03T20:53:11Z")

</div>

In the build directory  
cmake -DGSL\_DIR=/usr/local …  
cmake --build . -j8

Output:  
[80%] Building CXX object math/genvector/CMakeFiles/GenVector.dir/src/BoostZ.cxx.o  
[80%] Building CXX object math/matrix/CMakeFiles/Matrix.dir/src/TMatrixTSym.cxx.o  
[80%] Linking CXX shared library …/…/lib/libMathMore.so  
[80%] Building CXX object geom/geom/CMakeFiles/Geom.dir/src/TGeoBuilder.cxx.o  
CMakeFiles/MathMore.dir/src/GSLNLSMinimizer.cxx.o: In function `ROOT::Math::GSLMultiFit::CovarMatrix() const': /home/ramij/root/math/mathmore/src/GSLMultiFit.h:185: undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
CMakeFiles/MathMore.dir/src/GSLNLSMinimizer.cxx.o: In function `ROOT::Math::GSLNLSMinimizer::Minimize()': GSLNLSMinimizer.cxx:(.text+0x139c): undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
GSLNLSMinimizer.cxx:(.text+0x142b): undefined reference to `gsl_multifit_fdfsolver_jac' GSLNLSMinimizer.cxx:(.text+0x1906): undefined reference to`gsl\_multifit\_fdfsolver\_jac’  
GSLNLSMinimizer.cxx:(.text+0x1f88): undefined reference to `gsl\_multifit\_fdfsolver\_jac’  
collect2: error: ld returned 1 exit status  
gmake[2]: \*\*\* [lib/libMathMore.so] Error 1  
gmake[1]: \*\*\* [math/mathmore/CMakeFiles/MathMore.dir/all] Error 2  
gmake[1]: \*\*\* Waiting for unfinished jobs…

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [September 4, 2019, 6:33am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/11 "2019-09-04T06:33:38Z")

</div>

Try `cmake -DCMAKE_PREFIX_PATH=/usr/local ...` instead. When you use `-D<PKG_DIR>=...` you need to pass the directory where its CMake config file resides, not the prefix. You may also have better luck passing `-DGSL_ROOT_DIR=...`, as that’s what `cmake --help-module FindGSL` tells me to do. Cheers,

---

<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:** [September 4, 2019, 7:15am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/12 "2019-09-04T07:15:04Z")

</div>

@axel So, it seems there is a bug on the “[Building ROOT](https://root.cern.ch/building-root)” web page which mentiones “GSL\_DIR” while it should be “GSL\_ROOT\_DIR”.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 4, 2019, 8:17am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/13 "2019-09-04T08:17:56Z")

</div>

Thanks, updated! @amadio anything else that’s obviously wrong on [that page](https://root.cern.ch/building-root)?

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [September 4, 2019, 8:23am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/14 "2019-09-04T08:23:34Z")

</div>

Yes, that page is overdue for an update…

---

<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:** [September 4, 2019, 8:33am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/15 "2019-09-04T08:33:38Z")

</div>

@ramijiiti Can you try (and report the result):

```auto
cmake -DGSL_ROOT_DIR=/usr/local ..

```

Note also that your `cmake --version` should return “3.13.5” (which is the current default “cmake3” on CentOS 7) or any newer version.

---

<div class="post-metadata">

**Author:** ![ramijiiti](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/r/b2d939/32.png) [@ramijiiti](https://root-forum.cern.ch/u/ramijiiti)\
**Post date:** [September 4, 2019, 10:01am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/16 "2019-09-04T10:01:02Z")

</div>

It worked.  
Thanks everyone for your help.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [September 4, 2019, 10:56am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/17 "2019-09-04T10:56:01Z")

</div>

I’d actually prefer that we simply state where to find the info, instead of having yet another place that we need to keep updated. `cmake --something`?

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [September 6, 2019, 9:10am UTC](https://root-forum.cern.ch/t/problem-with-building-root-mathmore-error/35822/18 "2019-09-06T09:10:29Z")

</div>

In this particular case, it’s `cmake --help-module FindGSL`.
