JENKINS gradle build error with ubuntu 14.04 - jenkins

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

Related

Jenkins does not work properly on Mac M1 agent

We want to use a Mac Mini with the M1 processor as an agent in our CI pipeline to make sure that developers with new Macs can compile the project. We duplicated the setup that we have for x86, but cmake cannot find libraries such as boost:
CMake Error at /opt/homebrew/Cellar/cmake/3.19.7/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR container system
date_time)
Weirdly, this is not an issue when connecting to the machine directly via ssh. Even manually setting the environment variables does not change anything.
The Jenkins agent uses Java. If you install Java via brew (e.g., adoptopenjdk8), you might get an x64 version (as of March 2021) that is run using the Rosetta translation layer. You can verify this by executing sysctl sysctl.proc_translated. In the "normal" SSH connection, this should return 0, when executed as sh "sysctl sysctl.proc_translated" in Jenkins, you will see a 1.
Preferred Option (install native JDK)
Instead of using, e.g., adoptopenjdk8, you can install the zulu JDK, which is available natively, via
brew install --cask zulu
After this, you should be able to verify that proc_translated is 0 within Jenkins. You can verify that a native binary is built as described below.
Hotfix (without changing the JDK)
The following is a hotfix if you cannot install a native JDK.
We were able to force cmake to run natively (and thus to find the native libraries) by modifying our Jenkinsfile as follows:
old:
sh "cmake .."
sh "make hyriseTest"
new:
sh "PATH=/opt/homebrew/bin:$PATH arch -arm64 cmake .."
sh "arch -arm64 make hyriseTest"
Having to repeat the arch command over and over is not really pretty. Maybe someone has a better solution.
Verification of the result
We can verify that our generated binary is a native ARM binary:
sh "file hyriseTest"
Result:
+ file ./hyriseTest
./hyriseTest: Mach-O 64-bit executable arm64
Compiler warnings
Note: We are still seeing linker warnings about "ltmp3" and "ltmp4". I have not found any information about that online and it does not seem to affect the correctness of the result. Example:
ld: warning: direct access in function 'ltmp4' from file 'CMakeFiles/hyriseMvccDeletePlugin.dir/Unity/unity_0_cxx.cxx.o' to global weak symbol

bazel installation to version 0.5.4 or higher to build TensorFlow

I'm building a container for TensorFlow with Bazel using docker build --pull -t $USER/tensorflow-serving-devel -f Dockerfile.devel . and running it docker run -it $USER/tensorflow-serving-devel as instructed here: https://www.tensorflow.org/serving/docker
However after when running the ./configure command I get this error
root#4489fe3513fc:/serving/tensorflow# ./configure
Extracting Bazel installation...
You have bazel 0.5.1 installed.
Please upgrade your bazel installation to version 0.5.4 or higher to build TensorFlow!
Configuration finished
root#4489fe3513fc:/serving/tensorflow# cd ..
root#4489fe3513fc:/serving# bazel test tensorflow_serving/...
................
ERROR: /serving/WORKSPACE:23:1: Traceback (most recent call last):
File "/serving/WORKSPACE", line 23
tf_serving_workspace()
File "/serving/tensorflow_serving/workspace.bzl", line 16, in tf_serving_workspace
tf_workspace(path_prefix = "", tf_repo_name = "...")
File "/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/workspace.bzl", line 146, in tf_workspace
check_version("0.5.4")
File "/root/.cache/bazel/_bazel_root/f8d1071c69ea316497c31e40fe01608c/external/org_tensorflow/tensorflow/workspace.bzl", line 56, in check_version
fail("\nCurrent Bazel version is {}, ...))
Current Bazel version is 0.5.1, expected at least 0.5.4
Trying to update bazel just gives me the same version number 0.5.1. I'm not sure on how to approach this. Is there a docker supported tag that I'm missing when I try to update?
Even I wanted 0.5.4 version of bazel for tensorflow 0.8.
Tried brew install bazel#0.5.1. Didnt work..
So, I downloaded bazel 0.5.4 version from bazel git release and installed it as follows:
Download bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh from
https://github.com/bazelbuild/bazel/releases
chmod +x bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
./bazel-0.5.4-without-jdk-installer-darwin-x86_64.sh
bazel version in your terminal should give 0.5.4
Took barely couple of minutes to install it this way :) Hope that helps!!
(I shared similar answer here)

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

ffmpeg fails to build by MacPorts

I've seen a many problems about this, but I didn't get a solution.
My OS is Yosemite and current OpenCV is 2.4.9
I'm trying to install OpenCV with TBB, but when I do it by sudo port install opencv +debug +python27 +qt4 +tbb (through this SO question):
Rafaels-iMac:y3PQFyQhUG rafaelruizmunoz$ sudo port install opencv
+debug +python27 +qt4 +tbb
Warning: The Xcode Command Line Tools don't appear to be installed; most ports will likely fail to build.
Warning: Install them by running 'xcode-select --install'.
Warning: The Xcode Command Line Tools don't appear to be installed; most ports will likely fail to build.
Warning: Install them by running xcode-select --install'.
---> Computing dependencies for ffmpeg
---> Configuring ffmpeg Error: Failed to configure ffmpeg, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/work/ffmpeg-2.6/config.log
Error: org.macports.configure for port ffmpeg returned: configure failure: command execution failed Please see the log file for port ffmpeg for details:
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_ffmpeg/ffmpeg/main.log
Error: Unable to upgrade port: 1
Error: Unable to execute port: upgrade ffmpeg failed
And there are not any logs on those paths.
I've tried (support from SO and MacPorts).
port selfupdate
port upgrade ffmpeg
port clean x264
port upgrade outdated
port -f selfupdate
but nothing happened.
Does anyone have a clue?
Thank you in advance.
EDIT: Doing xcode-select --install doesn't resolve anything.
The code that produces this warning is at http://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl?marks=3279-3289#L3266. On 10.10, it checks whether /Library/Developer/CommandLineTools/usr/include exists and /Library/Developer/CommandLineTools/usr/bin/make is executable. Since that's not the case on your system, the Command Line Tools have not been successfully installed.
After running xcode-select --install, a dialog box should pop up that allows you to click "Install" to install the Command Line Tools. See http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/ for screenshots.
Once you installed those, your build should work. If it doesn't, you'll have to upload the contents of the main.log for further diagnosis.

ERROR: cannot start RubyMine. No JDK found. JDK Version? + desktop link

ERROR: cannot start RubyMine.
No JDK found. Please validate either RUBYMINE_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.
I'm not sure what JDK version number to use to download it?
Also how to create a desktop link in 11.10?
I think using apt-get is easier, see for example this article:
sudo apt-get install openjdk-7-jdk
Turned out that in the end I had to do several things to get java running and thus resolve the issue:
Get Java
Download oracle7 jdk at:
http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
e.g. http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.tar.gz
Follow instructions at:
http://www.webupd8.org/2011/09/how-to-install-oracle-java-7-jdk-in.html
e.g.
After downloading java (above):
Extract the downloaded Oracle Java JDK archive into your home folder and rename the newly created folder to "java-7-oracle".
sudo mv its_name java-7-oracle
Install Java
cd
sudo mkdir -p /usr/lib/jvm/ #just in case
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java # choose version 1.7 if necessary.
Check the Java install
java -version
javac -version
I was then able to start up rubyMine successfully.
Create rubyMine shortcut
To create the desktop launcher in Ubuntu 11.10:
Once you've installed rubymine and you have the executable somewhere:
If it's called mine, then create a desktop launcher that runs it
http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html
You'll run (in a terminal window):
gnome-desktop-item-edit ~/Desktop/ --create-new
Indicate where the rubyMine executable is, e.g. use /usr/local/bin/mine as the command to run.
You can then also drag that to the left side toolbar icons area for a icon quick-launcher there.
Note:
If following these instructions and making a quick-launch icon at the end - make sure NOT to delete the desktop icon you created earlier when cleaning up your desktop as this will also remove that quick-launch item (it's a link to it).

Resources