maven and jdk8 on Alpine Linux image - linux

This is my first time working with an Alpine linux image. Its part of a Jenkins build pipeline.
When I try to compile my maven build (which requires Java 1.8) ... it gives an error suggested there is no compiler installed.
However, I confirmed its installed ... multiple ways;
Echo the JAVA_HOME variable which returns
/usr/lib/jvm/java-1.8-openjdk
Tested to confirm the compiler is there;
by running "${JAVA_HOME}/javac -version" ... which returns;
/usr/lib/jvm/java-1.8-openjdk/bin/javac -version
javac 1.8.0_222
However, maven still points to the JRE ...
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T07:58:13Z)
Maven home: /usr/share/java/maven-3
Java version: 1.8.0_222, vendor: IcedTea
Java home: /usr/lib/jvm/java-1.8-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.19.84-coreos", arch: "amd64", family: "unix"
I tried manually installed the JDK ... but doesn't seem to help;
apk update
apk add openjdk8
apk add maven
Any suggestions? I need Java 8 to compile this app ... and currently every attempt to do a "mvn clean install" results in a failure, as below;
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

Tried many different ideas and then eventually thought about setting the path to the compiler and amazingly, now it works!
export PATH=${PATH}:${JAVA_HOME}/bin
mvn clean install

Related

Meson version in Yocto

Earlier I compiled project i.MX Linux Yocto Project BSP 4.14.78_1.0.0 Release version and it was OK. I didn't update the project and all enviroment is installed on linux build computer. But now I have error like below.
Log data follows:
| DEBUG: Executing shell function do_configure
| The Meson build system
| Version: 0.44.1
| Source dir: /home/local/user/imx-yocto-bsp1/build-wayland-imx8qmmek/tmp/work/aarch64-poky-linux/vkmark/1.0-r0/git
| Build dir: /home/local/user/imx-yocto-bsp1/build-wayland-imx8qmmek/tmp/work/aarch64-poky-linux/vkmark/1.0-r0/build
| Build type: cross build
|
| Meson encountered an error in file meson.build, line 1, column 0:
| Meson version is 0.44.1 but project requires >=0.45.
|
Is it meson from toolchain or from build OS?
According to https://layers.openembedded.org/layerindex/recipe/72132/ you're most likely using the Sumo release of Yocto. Thud onwards have 0.45. Considering Sumo isn't supported anymore I'd considering upgrading your Yocto/BSP.
It's the toolchain meson: You don't mention the Yocto/oe-core version but based on the meson version it seems a couple of years old. If you managed to build a version of 'vkmark' before then it almost certainly means that the version you built did not require this meson version but the version you are building now does.

How to properly setup native ARPACK for Spark 2.2.0

I am getting the following Warning when I run the PySpark job:
17/10/06 18:27:16 WARN ARPACK: Failed to load implementation
from: com.github.fommil.netlib.NativeSystemARPACK
17/10/06 18:27:16
WARN ARPACK: Failed to load implementation from:
com.github.fommil.netlib.NativeRefARPACK
My Code is
mat = RowMatrix(tf_rdd_vec.cache())
svd = mat.computeSVD(num_topics, computeU=False)
I am using Ubuntu 16.04 EC2 instance. And I have installed all following libraries into my system.
sudo apt install libarpack2 Arpack++ libatlas-base-dev liblapacke-dev libblas-dev gfortran libblas-dev liblapack-dev libnetlib-java libgfortran3 libatlas3-base libopenblas-base
I have adjusted LD_LIBRARY_PATH to point to shared lib path as following.
export LD_LIBRARY_PATH=/usr/lib/
Now when I list $LD_LIBRARY_PATH directory it shown me the following .so files
ubuntu:~$ ls $LD_LIBRARY_PATH/*.so | grep "pack\|blas"
/usr/lib/libarpack.so
/usr/lib/libblas.so
/usr/lib/libcblas.so
/usr/lib/libf77blas.so
/usr/lib/liblapack_atlas.so
/usr/lib/liblapacke.so
/usr/lib/liblapack.so
/usr/lib/libopenblasp-r0.2.18.so
/usr/lib/libopenblas.so
/usr/lib/libparpack.so
But Still I am not able to use the Native ARPACK implementation. Also I am Caching the RDD passing to matrix But it still throws Cache WARNING Any suggestion how to solve these 3 Warnings ?
I have downloaded compiled version of spark-2.2.0 from the spark download page.
After exploring I am able to remove these warnings and using native ARPACK by the following way.
The solution was to rebuild spark with -Pnetlib-lgpl argument.
Build Spark for Native Support
So following are my steps on Ubuntu 16.04
# Make sure you use the correct download link, from spark download section
wget https://d3kbcqa49mib13.cloudfront.net/spark-2.2.0.tgz
tar -xpf spark-2.2.0.tgz
cd spark-2.2.0/
./dev/make-distribution.sh --name custom-spark --pip --tgz -Psparkr -Phadoop-2.7 -Pnetlib-lgpl
When i started the first time it failed by throwing the following error
Cannot find 'R_HOME'. Please specify 'R_HOME' or make sure R is
properly installed. [ERROR] Command execution failed.
[TRUNCATED]
[INFO] BUILD FAILURE [INFO]
[INFO] Total time: 02:38 min (Wall Clock) [INFO] Finished at:
2017-10-13T21:04:11+00:00 [INFO] Final Memory: 59M/843M
[ERROR] Failed to execute goal
org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (sparkr-pkg) on project
spark-core_2.11: Command execution failed. Process exited with an
error: 1 (Exit value: 1) -> [Help 1] [ERROR]
So i installed the R language
sudo apt install r-base-core
Then i re-ran the above build command and it successfully installed.
Following are related versions when i build this release
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
$ python --version
Python 2.7.12
$ R --version
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
$ make --version
GNU Make 4.1
Built for x86_64-pc-linux-gnu

problems building CodeLite

Having a heck of a time trying to build CodeLite for an ARM-based Ubuntu Linux target. (Build instructions here: http://codelite.org/Developers/Linux). I get an error from CMAKE that says Could not locate GTK2. Looking in the CmakeLists.txt file I can see that this is a result of find_package(GTK2) failing to find GTK2. I think I have installed gtk according to what the CodeLite build instructions say to do using the command sudo apt-get install libgtk2.0-dev.
In terms of cmake, I don't understand what a "package" is. How would I [manually] locate this package on my filesystem and how do I get cmake to find it?
For my aarch64 ubuntu 17.04, the libraries and headers were under /usr/lib/aarch64-linux-gnu, so invoking cmake with them produced the correct build files:
cmake -DCMAKE_INCLUDE_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/ -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1

Installation of haskell-chart fails due to gtk-0.14.2 build error

I'm trying to install haskell-chart from here (github), I clone it, install stack, ran stack setup (it installs GHC successfully), but then I ran make that fails with the messages:
...
Chart-cairo-1.8: copy/register
Chart-diagrams-1.8: copy/register
Progress: 4/6
-- While building package gtk-0.14.2 using:
/tmp/stack4807/gtk-0.14.2/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
...
[ 22 of 209] Compiling Graphics.UI.Gtk.Embedding.Plug ( .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Graphics/UI/Gtk/Embedding/Plug.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Graphics/UI/Gtk/Embedding/Plug.o )
/tmp/stack4807/gtk-0.14.2/Graphics/UI/Gtk/Embedding/Plug.chs:120:6:
Couldn't match expected type ‘CUInt’
with actual type ‘Maybe DrawWindow’
In the first argument of ‘gtk_plug_new’, namely...
Stack version is 1.1.2 x86_64 hpack-0.14.1, LTS Haskell 5.18 (ghc-7.10.3). What can I do with this errors?
In order to build haskell-chart from github sources on linux one should replace in stack.yaml
flags:
gtk:
have-quartz-gtk: true
with
flags: {}
because Linux don't use Quartz flag have-quartz-gtk, and Quartz is not needed to build gtk (Windows also do not use Quartz).
Using brew I upgraded gtk+ from version 2.24.25 to 2.24.30 and installed the latest version of XQuartz (version 2.7.9 - I couldn't determine which version I had originally installed.)
With these changes I was able to successfully build the project with stack build.
Specific commands:
$ brew cask install xquartz --force
$ brew upgrade gtk
Note that you don't actually have to use gtk. There are two rendering backend for the chart library - one based upon cairo from gtk2hs the other on the diagrams library. The cairo backend is significantly faster, whereas the diagrams backend is pure haskell, and hence is easier to build.
By default, both backends are built, but you can build just the core library and the diagrams backend with:
stack build ./chart ./chart-diagrams

Invalid configuration i686-redhat-linux-gnu on CentOS

I launch this command to build rpm package:
#>rpmbuild --rebuild -vv vqadmin-toaster-2.3.7-1.4.1.src.rpm
I'm on CentOs 6.4 and i want to build and install qmailtoaster packets.
Only this packet get an error:
checking build system type... Invalid configuration 'i686-redhat-linux-gnu': machine 'i686-redhat-linux' not recognized
What can i do? this is first time that i'm compiling RPM packages, any ideas?
i also run into the same problem, according to qmailtoaster installation script the command suppose to be
rpmbuild --rebuild --with cnt5064 vqadmin-toaster-2.3.7-1.4.1.src.rpm
built it has the same error msg as above
and I Google around and found out
vqadmin build error
many of our programs are running automake versions that PREDATE 64-bit linux... and while most apps will build just fine (albeit less optimized), vqadmin 2.3.7 does NOT build successfully in this "unknown-linux" environment.
He offers a x86_64 rpm at the bottom

Resources