# No more Makefile for building?

**URL:** <https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949>\
**Category:** O²\
**Tags:** build, cmake, ninja\
**Created:** [May 17, 2021, 9:01am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949 "2021-05-17T09:01:01Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvalle](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/n/db5fbb/32.png) [@nvalle](https://alice-talk.web.cern.ch/u/nvalle)\
**Post date:** [May 17, 2021, 9:01am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/1 "2021-05-17T09:01:02Z")

</div>

Dear experts,

so far I always used “make install” to compile changes in my code, going into sw/BUILD/O2-latest/O2 or in the subdirectory where I actually made the change (the same for QualityControl).  
Recently I made a pull from git and in the BUILD directory there is no more the Makefile, so that using “make” seems impossible. I know that ninja is an alternative (and a “build.ninja” file is actually present) but…

1. The build.ninja file is only in the parent directory and not in (for example) O2/Detectrors/\*… etc… (not a big issue, but strange to me)

2. Building with ninja fails probably because of the gcc library GLIBCXX\_3.4.26 (line 5 of the linked file) (I’m on Ubuntu 18.04)

Do I really need to use ninja to build?

If this is the case, do you have any hint on how to solve the problem at point 2? On [this file](https://cernbox.cern.ch/index.php/s/nymnso3PiiFb8Fi) I pasted the output of the command “sudo ninja install -v” executed in “sw/BUILD/O2-latest/latest” without having modified the code with respect to that cloned (yesterday) from the git dev branch and built with aliBuild.

Thanks a lot in advance.  
Nicolò

---

<div class="post-metadata">

**Author:** ![eulisse](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/eulisse/32/19_2.png) [@eulisse](https://alice-talk.web.cern.ch/u/eulisse)\
**Post date:** [May 17, 2021, 9:24am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/2 "2021-05-17T09:24:57Z")

</div>

Can you check if:

```auto
cmake --build . --target install  

```

solves your issues? In principle you should not need to know what is being used by CMake to do the actual build.

---

<div class="post-metadata">

**Author:** ![nvalle](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/n/db5fbb/32.png) [@nvalle](https://alice-talk.web.cern.ch/u/nvalle)\
**Post date:** [May 17, 2021, 9:36am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/3 "2021-05-17T09:36:59Z")

</div>

Hi Giulio,

thanks. It launches the building but it doesn’t solve the library problem. This is the output:

nvalle2@fedora:~/alice/sw/BUILD/O2-latest/O2$ sudo cmake --build . --target install  
[1/3090] Linking CXX shared library stage/lib/libO2GPUCommon.so  
FAILED: version/libversion.a  
: && /home/nvalle2/alice/sw/ubuntu1804\_x86-64/CMake/v3.19.2-local1/bin/cmake -E rm -f version/libversion.a && /home/nvalle2/alice/sw/ubuntu1804\_x86-64/GCC-Toolchain/v10.2.0-alice2-local1/bin/ar qc version/libversion.a version/CMakeFiles/version.dir/O2Version.cxx.o && /home/nvalle2/alice/sw/ubuntu1804\_x86-64/GCC-Toolchain/v10.2.0-alice2-local1/bin/ranlib version/libversion.a && :  
/home/nvalle2/alice/sw/ubuntu1804\_x86-64/CMake/v3.19.2-local1/bin/cmake: /usr/lib/x86\_64-linux-gnu/libstdc++.so.6: version `GLIBCXX\_3.4.26’ not found (required by /home/nvalle2/alice/sw/ubuntu1804\_x86-64/CMake/v3.19.2-local1/bin/cmake)  
[10/3090] Building CXX object DataFormats/Headers/CMakeFiles/O2test-headers-DataHeader.dir/test/testDataHeader.cxx.o  
ninja: build stopped: subcommand failed.

Nicolò

---

<div class="post-metadata">

**Author:** ![eulisse](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/eulisse/32/19_2.png) [@eulisse](https://alice-talk.web.cern.ch/u/eulisse)\
**Post date:** [May 17, 2021, 9:49am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/4 "2021-05-17T09:49:33Z")

</div>

Do you use direnv to setup your build environment?

---

<div class="post-metadata">

**Author:** ![eulisse](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/eulisse/32/19_2.png) [@eulisse](https://alice-talk.web.cern.ch/u/eulisse)\
**Post date:** [May 17, 2021, 9:50am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/5 "2021-05-17T09:50:58Z")

</div>

What happens here is that CMake was compiled with a different C++ than the one you are using to compile, and the environment seems to be picking up the system version of libstdc++.

---

<div class="post-metadata">

**Author:** ![nvalle](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/n/db5fbb/32.png) [@nvalle](https://alice-talk.web.cern.ch/u/nvalle)\
**Post date:** [May 17, 2021, 10:00am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/6 "2021-05-17T10:00:47Z")

</div>

Well… I would say no. At least, I don’t do anything more than loading the environment with  
“alienv enter O2/latest” before truing to build.

---

<div class="post-metadata">

**Author:** ![eulisse](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/eulisse/32/19_2.png) [@eulisse](https://alice-talk.web.cern.ch/u/eulisse)\
**Post date:** [May 17, 2021, 10:58am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/7 "2021-05-17T10:58:07Z")

</div>

Could you try with:

```auto
WORK_DIR=$PWD/sw . $WORK_DIR/osx_x86-64/O2/latest/etc/profile.d/init.sh

```

where `$PWD/sw` is your alibuild work directory?

---

<div class="post-metadata">

**Author:** ![nvalle](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/n/db5fbb/32.png) [@nvalle](https://alice-talk.web.cern.ch/u/nvalle)\
**Post date:** [May 17, 2021, 12:01pm UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/8 "2021-05-17T12:01:32Z")

</div>

The init.sh is executed without problem, But then when trying to build I get the same the same as before…

---

<div class="post-metadata">

**Author:** ![gvolpe](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@gvolpe](https://alice-talk.web.cern.ch/u/gvolpe)\
**Post date:** [June 9, 2021, 8:41am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/9 "2021-06-09T08:41:42Z")

</div>

Hi Giulio,

basically, I have the same problem! Before I could compile typing “make -j install”! What should I do now?! If I compile using aliBuild it takes a lot of time.

Thanks,

Giacomo.

---

<div class="post-metadata">

**Author:** ![jgcn](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@jgcn](https://alice-talk.web.cern.ch/u/jgcn)\
**Post date:** [August 24, 2021, 8:43am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/10 "2021-08-24T08:43:58Z")

</div>

Hi Giulio,

in [QualityControl/ModulesDevelopment.md at master · AliceO2Group/QualityControl · GitHub](https://github.com/AliceO2Group/QualityControl/blob/master/doc/ModulesDevelopment.md#developing-with-alibuildalienv)  
it is recommended to use make -j8 install for development, but it does not work.  
I am not an expert and using alibiuld is quite slow. Is there a solition that gives the functionallity of the previous make -j8 install?  
thanks

---

<div class="post-metadata">

**Author:** ![bvonhall](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/bvonhall/32/8_2.png) [@bvonhall](https://alice-talk.web.cern.ch/u/bvonhall)\
**Post date:** [August 24, 2021, 9:30am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/11 "2021-08-24T09:30:25Z")

</div>

Hi,

You should use `ninja`. I will update the doc.

Cheers,  
Barth

---

<div class="post-metadata">

**Author:** ![jgcn](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/j/48db29/32.png) [@jgcn](https://alice-talk.web.cern.ch/u/jgcn)\
**Post date:** [August 24, 2021, 9:39am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/12 "2021-08-24T09:39:00Z")

</div>

Dear Barth

thanks for the prompt response. When I try to use ninja I get  
zsh: command not found: ninja  
how do I install ninja?

have a nice day  
guillermo

---

<div class="post-metadata">

**Author:** ![bvonhall](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/bvonhall/32/8_2.png) [@bvonhall](https://alice-talk.web.cern.ch/u/bvonhall)\
**Post date:** [August 24, 2021, 10:24am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/13 "2021-08-24T10:24:52Z")

</div>

Dear Guillermo,

It is probably safer to try

```auto
cmake --build . --target install  

```

as it would simply reuse `ninja` as it was used when running `aliBuild`.

---

<div class="post-metadata">

**Author:** ![bvonhall](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/bvonhall/32/8_2.png) [@bvonhall](https://alice-talk.web.cern.ch/u/bvonhall)\
**Post date:** [August 24, 2021, 10:27am UTC](https://alice-talk.web.cern.ch/t/no-more-makefile-for-building/949/14 "2021-08-24T10:27:07Z")

</div>

Actually you should follow these instructions: [🛠 Build the packages · ALICE Analysis Tutorial](https://alice-doc.github.io/alice-analysis-tutorial/building/build.html#rebuild-existing-installations)
