I am very new to Jenkins, but given I see the following error:

CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name

when trying to run a unittest with cmake on jenkins and

which g++ 

gives the error Build step 'Execute shell' marked build as failure, I suppose g++ is not installed on jenkins. How can I install it, or solve my problems in an other way?

I seem to have admin right on jenkins (I do not know how to find this out), but it was installed by someone else on a Linux server I cannot access.


There are two answers here that suggest you install a single package. While this may work to provide for this specific error, I would suggest installing by group to ensure that you also have make, automake, autoconf, and etc.

On RHEL5 (and derivatives);

sudo yum groupinstall development-tools

On RHEL6 (and derivatives);

sudo yum groupinstall development

This said, cmake is an optional component of both of these groups and would still be installed separately if you need it. (sudo yum install cmake) Or, you can modify /etc/yum.conf to install optional packages with the groupinstall.

Add or change in /etc/yum.conf:


If the Jenkins server is the build server, simply have your system admin (if that's not you) install the g++ compiler. On Red Hat / CentOS / Fedora, this is the gcc-g++ package. If the Jenkins server is not the build server, this package needs to be installed on the build server.


You are missing compiler on the server where you want to compile Jenkins

 yum install gcc g++ -y

With the help of above commands you can install compiler and then you can try to compile jenkins.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.