On a Jenkins Docker : CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles" - docker

I really need some help to build a simple project with Cmake with Jenkins on a Docker container.
I use jenkins/jenkins:lts-jdk11 and the Cmake plugin : https://plugins.jenkins.io/cmakebuilder/
But I get these error logs :
First time build. Skipping changelog.
Install from cmake.org [InSearchPath]: Unpacking https://cmake.org/files/v3.24/cmake-3.24.2-linux-aarch64.tar.gz to /var/jenkins_home/tools/hudson.plugins.cmake.CmakeTool/3.24.2 on Jenkins...
Install from cmake.org [InSearchPath]: Inspecting unpacked files at /var/jenkins_home/tools/hudson.plugins.cmake.CmakeTool/3.24.2...
[build] $ /var/jenkins_home/tools/hudson.plugins.cmake.CmakeTool/3.24.2/bin/cmake /var/jenkins_home/workspace/Patate
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/var/jenkins_home/workspace/Patate/build/CMakeFiles/CMakeOutput.log".
Build step 'CMake Build' marked build as failure
Finished: FAILURE
It says Cmake is unable to find the build generator "Unix Makefiles" but I don't know how to install it on a Docker container. I checked in the Plugin Manager but it seems there is nothing. I searched for Ninja as well but it's not there either.
I don't understand why there is no proper step-by-step tutorial to create something that common as a Cmake build with Jenkins.

Related

Bazel doesn't build ios mediapipe examples

I tried to build HandTrackingExample and get this error
ERROR:
/Users/air/Documents/mediapipe/mediapipe/examples/ios/handtrackinggpu/BUILD:34:16:
ProcessEntitlementsFiles
mediapipe/examples/ios/handtrackinggpu/HandTrackingGpuApp_entitlements.entitlements
failed (Exit 1): plisttool failed: error executing command
bazel-out/host/bin/external/build_bazel_rules_apple/tools/plisttool/plisttool
... (remaining 1 argument(s) skipped)
Note: The failure of target
#build_bazel_rules_apple//tools/plisttool:plisttool (with exit code 1)
may have been caused by the fact that it is running under Python 2
instead of Python 3. Examine the error to determine if that appears to
be the problem. Since this target is built in the host configuration,
the only way to change its version is to set --host_force_python=PY3,
which affects the entire build.
If this error started occurring in Bazel 0.27 and later, it may be
because the Python toolchain now enforces that targets analyzed as PY2
and PY3 run under a Python 2 and Python 3 interpreter, respectively.
See https://github.com/bazelbuild/bazel/issues/7899 for more
information.
I tried build with --host_force_python=PY3 and PY2 but error the same
The link that is given in the error did not find a solution to your problem. How do I build a project correctly?
Try it
$ brew install python
$ sudo ln -s -f /usr/local/bin/python3.7 /usr/local/bin/python
$ python --version
Python 3.7.4
$ pip3 install --user six

OpenCV build error: does not appear to contain CMakeLists.txt

I am following this guide to build an optimized version of OpenCV for android:
https://medium.com/#tomdeore/opencv-on-android-tiny-with-optimization-enabled-932460acfe38
Step 4:
I downloaded OpenCV from Github (https://github.com/opencv/opencv)
I run:
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9$ mkdir build
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9$ cd build/
fabio#fabio-XPS-15-9560:~/Software/opencv-3.4.9/build$ cmake -DCMAKE_TOOLCHAIN_FILE=../platforms/android/android.toolchain.cmake -DANDROID_STL=gnustl_shared -DANDROID_NATIVE_API_LEVEL=23
But I got this error:
CMake Error: The source directory "/home/fabio/Software/opencv-3.4.9/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
What am I doing wrong?
Note, in your linked build guide, the cmake command ends with a .. telling CMake to run on the parent directory:
cmake \
-DCMAKE_TOOLCHAIN_FILE=../platforms/android/android.toolchain.cmake\
-DANDROID_STL=gnustl_shared \
-DANDROID_NATIVE_API_LEVEL=23 ..
You are running CMake from the build directory, which is incorrect. You want to run on the parent directory, which does contain a CMakeLIsts.txt file.

install MongoDB C++ Driver problem in ubuntu 16.04

I want to install MongoDB C++ Driver, so first is mongocxx
I follow this installation:
http://mongocxx.org/mongocxx-v3/installation/
but I can not pass step 4
when I run this in mongo-cxx-driver/build
sudo cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
it shows
-- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
CMake Error at src/mongocxx/CMakeLists.txt:37 (find_package):
By not providing "Findlibmongoc-1.0.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"libmongoc-1.0", but CMake did not find one.
Could not find a package configuration file provided by "libmongoc-1.0"
(requested version 1.13.0) with any of the following names:
[![enter image description here][1]][1]
libmongoc-1.0Config.cmake
libmongoc-1.0-config.cmake
Add the installation prefix of "libmongoc-1.0" to CMAKE_PREFIX_PATH or set
"libmongoc-1.0_DIR" to a directory containing one of the above files. If
"libmongoc-1.0" provides a separate development package or SDK, be sure it
has been installed.
second question,
Step 2: Choose a C++17 polyfill how can I set MNMLSTC/core?
does anyone can help me,I already trap here for a long time ?
my env:
mongo-c-driver 1.15.1
libmongoc-1.0
mongocxx-3.4.x
Cmake is complaining about not finding a package configuration file (xxx.cmake), probably because you didn't build libmongoc/libbson.
I've tried to reproduce your issue and hit the same problem when I only installed them (apt-get install), so my suggestion is that you get the sources and build them as described at: http://mongoc.org/libmongoc/current/installing.html
Here's the list of commands (with the latest version of mongo-c-driver=1.15.1) which I just tried and worked fine:
wget https://github.com/mongodb/mongo-c-driver/releases/download/1.15.1/mongo-c-driver-1.15.1.tar.gz
tar xzf mongo-c-driver-1.15.1.tar.gz
cd mongo-c-driver-1.15.1
mkdir cmake-build
cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..
make
sudo make install
At this point you can go back into mongocxx/build and run again the command you were stuck at:
cd ../../mongo-cxx-driver/build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..

JENKINS gradle build error with ubuntu 14.04

I am using below configuration and trying to make Jenkins build but I am getting errors.
Note, I am able to make build successfully with command line.
My PC environments:
OS: ubuntu 14.04
Gradle version: 2.14.1.
Jenkins version: 2.25
Java version: java-8-openjdk-amd64
JENKINS BUILD ERRORS:
[workspace] $ /bin/sh -xe /tmp/hudson2322559356105735311.sh
+ cd /home/ekambaramv/Jenkins/workspace/CARMODE_STAR_O-OS/MAIN/
+ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
+ GRADLE_USER_HOME=/home/ekambaramv/Jenkins/gradle-2.14.1/
+ /home/ekambaramv/Jenkins/gradle-2.14.1/bin/gradle clean build
**FAILURE:** Build failed with an exception.
* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Build step 'Execute shell' marked build as failure
Finished: FAILUR
E
I've had similar problems with the JNI libary when using Gradle. It's possible you might be using a version of the JNI library that is incompatible with Gradle.
Try going to the site: https://debian.pkgs.org/9/debian-main-amd64/libnative-platform-jni_0.11-5_amd64.deb.html and downloading the libnative-platform-jni_0.11-5_amd64.deb package onto your machine.
You can either open Nautilus and right click the .deb package and select 'Open with Software Install', or you can navigate the command line to the download directory and run the following:
sudo apt-get install ./libnative-platform-jni_0.11-5_amd64.deb
Next, check to see if Gradle still gives you the same "Failed to load native library..." error message as before by running:
gradle --version
If the problem persists, and you still get the error message, you might want to consider upgrading to a later version of Gradle. I was able to get this working on Gradle 3.2.1, but I know this method isn't always possible.
If you need to back out the changes, just run another sudo apt-get update, and the JNI libraries will be overwritten with the latest version once more.
One More Thing
I mentioned the libraries get overwritten the next time you update your system (apt-get, Software Updater). To prevent this, run the following command:
sudo apt-mark hold libnative-platform-jni
This will force the update software to overlook any later versions of the library. To turn this off, run the opposite command:
sudo apt-mark unhold libnative-platform-jni

CMAKE_MAKE_PROGRAM value cannot be retrieved from CMakeCache.txt

I have a project that I'm running through the Jenkins CI server and is being built using the Cmake plugin, and I am consistently getting the same error:
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/580152/Celero/build/64
ERROR:Failed to get CMAKE_MAKE_PROGRAM value from C:\Users\580152\Celero\build\64\CMakeCache.txt
I am using Visual Studio 2012, and I can build and run the .sln file in Visual Studio using the files generated by the Cmake plugin. However, it never builds or finishes whenever I use the Cmake plugin. I've worked with Jenkins a bit in the previous weeks, but I'm still a noob when it comes to some of the plugins and settings, and the same goes to Cmake.
Is this a Jenkins plugin problem, a Cmake error, or am I just not setting something up right/missing the problem entirely?
Any and all help is much appreciated.
Update:
I have found that this error is caused by Cmakebuilder plugin, and was updated to fix this issue in version 2.1, and though I'm currently using that version of the plugin the error is still occurring. Could something have happened that my version was not updated properly (though it says that no updates are available) or is this an issue with the plugin that must be resolved?
Thanks again for any help.
Perhaps my experience is old, but I have had trouble with the Jenkins cmake plugin. So I prefer to do my Jenkins cmake builds with a command shell batch script. This also makes the Jenkins build job more closely match my development build. I try to have my Jenkins build jobs be little more than
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=../exports ..
cmake --build . --config Release --target test
cmake --build . --config Release --target install

Resources