I am using word2vec in mllib and I want to improve the speed of linear operations in word2vec by configuring OpenBLAS.
I configured OpenBLAS on the server by manually compiling OpenBLAS with the following command.
git clone https://github.com/xianyi/OpenBlas.git
cd OpenBLAS
make USE_THREAD=0 -j16
make PREFIX=/usr/local install
sudo update-alternatives --install /usr/lib/libblas.so libblas.so /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/liblapack.so liblapack.so /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 /usr/local/lib/libopenblas.so 5
I compiled and ran the following code to make sure I had OpenBLAS configured correctly:
#include <cblas.h>
#include <stdio.h>
int main() {
double A[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double B[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double C[9] = {.5,.5,.5,.5,.5,.5,.5,.5,.5};
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,3,3,2,1,A, 3, B, 3,2,C,3);
for(int i = 0; i < 9; i++)
printf("%lf ", C[i]);
printf("\n");
return 0;
}
Use the following command to compile:
gcc test.c -lblas
The program compiles and runs well and produces the correct results.
I have included the netlib-java library in my spark project build file pom.xml as follows:
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
I then ran my spark project locally and still got the following warning:
2022-11-09 02:34:48 WARN BLAS:61 - Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
2022-11-09 02:34:48 WARN BLAS:61 - Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
2022-11-09 02:34:48 WARN APP:66 - com.github.fommil.netlib.F2jBLAS
I would like to know what might be wrong? My server configuration is as follows:
Ubuntu 18.04.1 LTS
spark-2.3.2
Intel(R) Xeon(R) W-2145 CPU # 3.70GHz
I am using word2vec in mllib and I want to improve the speed of linear operations in word2vec by configuring OpenBLAS.
I configured OpenBLAS on the server by manually compiling OpenBLAS with the following command.
git clone https://github.com/xianyi/OpenBlas.git
cd OpenBLAS
make USE_THREAD=0 -j16
make PREFIX=/usr/local install
sudo update-alternatives --install /usr/lib/libblas.so libblas.so /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/liblapack.so liblapack.so /usr/local/lib/libopenblas.so 5
sudo update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 /usr/local/lib/libopenblas.so 5
I compiled and ran the following code to make sure I had OpenBLAS configured correctly:
#include <cblas.h>
#include <stdio.h>
int main() {
double A[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double B[6] = {1.0,2.0,1.0,-3.0,4.0,-1.0};
double C[9] = {.5,.5,.5,.5,.5,.5,.5,.5,.5};
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasTrans,3,3,2,1,A, 3, B, 3,2,C,3);
for(int i = 0; i < 9; i++)
printf("%lf ", C[i]);
printf("\n");
return 0;
}
Use the following command to compile:
gcc test.c -lblas
The program compiles and runs well and produces the correct results.
I have included the netlib-java library in my spark project build file pom.xml as follows:
<dependency>
<groupId>com.github.fommil.netlib</groupId>
<artifactId>all</artifactId>
<version>1.1.2</version>
<type>pom</type>
</dependency>
I then ran my spark project locally and still got the following warning:
2022-11-09 02:34:48 WARN BLAS:61 - Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
2022-11-09 02:34:48 WARN BLAS:61 - Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
2022-11-09 02:34:48 WARN APP:66 - com.github.fommil.netlib.F2jBLAS
I would like to know what might be wrong? My server configuration is as follows:
Ubuntu 18.04.1 LTS
spark-2.3.2
Intel(R) Xeon(R) W-2145 CPU # 3.70GHz
Related
Parameters:
source = x86_x64 windows 10 or x86_x64 linux (ubuntu wsl)
target = armv5te linux
target_type = cdylib
target_glibc = 2.24
language = rust
build_tool = cargo
compiler = rustc
(The target is a Lego Mindstorm running a linux image from Ev3dev)
Cargo Configuration:
[package]
name = "ev3"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
jni = "0.19"
ev3dev-lang-rust = { version = "0.12.1", features=["screen"]}
jni_proc_macro= {path= "./jni_proc_macro"}
[lib]
crate-type= ["cdylib"]
[workspace]
members= ["jni_proc_macro"]
Build Configuration:
[build]
target = "armv5te-unknown-linux-gnueabi"
[target.armv5te-unknown-linux-gnueabi]
linker = "rust-lld"
Build Error:
error: linking with `rust-lld` failed: exit code: 1
|
= note: {...}
= note: rust-lld: error: unable to find library -lgcc_s
rust-lld: error: unable to find library -lutil
rust-lld: error: unable to find library -lrt
rust-lld: error: unable to find library -lpthread
rust-lld: error: unable to find library -lm
rust-lld: error: unable to find library -ldl
rust-lld: error: unable to find library -lc
error: could not compile `ev3` due to previous error
As the error suggests the linker is missing libraries. I found no clear solution where I can download and or provide these dependencies.
My question is, A is there a diffrent way to build this successfully or B how do I solve these dependencies.
The result needs to be a shared library (.so) for linux and armv5te
Requirements
wsl or linux installed
cargo and rustc installed
(everthing is done in wsl/linux)
Prep/Build
Install cross on cargo
cargo install cross --git https://github.com/cross-rs/cross
Install docker
Clone the cross repository
Navigate into the docker folder
Create a new file with the name "Dockerfile.armv5te-unknown-linux-gnueabi-cross"
Paste this in the new file:
FROM ubuntu:16.04
ARG DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
g++-arm-linux-gnueabi \
crossbuild-essential-armel \
libc6-dev-armel-cross
COPY deny-debian-packages.sh /
RUN TARGET_ARCH=armel /deny-debian-packages.sh \
binutils \
binutils-arm-linux-gnueabi
# Qemu is disabled since we've changed the scripts to require newer Python versions.
#COPY qemu.sh /
#RUN /qemu.sh arm
COPY qemu-runner base-runner.sh /
ENV CROSS_TOOLCHAIN_PREFIX=arm-linux-gnueabi-
ENV CROSS_SYSROOT=/usr/arm-linux-gnueabi
ENV CARGO_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
CARGO_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_RUNNER="/qemu-runner arm" \
AR_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_armv5te_unknown_linux_gnueabi="$CROSS_TOOLCHAIN_PREFIX"g++ \
BINDGEN_EXTRA_CLANG_ARGS_armv5te_unknown_linux_gnueabi="--sysroot=$CROSS_SYSROOT" \
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
RUST_TEST_THREADS=1 \
PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabi/pkgconfig/:${PKG_CONFIG_PATH}"
Make sure the project uses "LF" newlines. if not this fixes it.
Compile the custom cross/docker build using the following command in the root of the cloned repository:
cargo build-docker-image armv5te-unknown-linux-gnueabi-cross
This will create a new docker image that will be used to compile the rust code.
Then navigate to your target project folder and run:
export CROSS_TARGET_ARMV5TE_UNKNOWN_LINUX_GNUEABI_IMAGE=ghcr.io/cross-rs/armv5te-unknown-linux-gnueabi-cross:local
(Do not close this terminal)
Now add the following to the Cargo.toml file:
[package.metadata.cross.build]
default-target = "armv5te-unknown-linux-gnueabi"
now you can run:
cross build
Many cargo options like "--release" can be used (for more info have a look at cross in the credits)
Credits
MeetTitan(Stackoverflow) who recomended me to use cross
Cross project(GitHub) which powers the whole solution
Custom cross version discussion(Cross Github)
Alexhuszagh(Cross Github) who showed me how to build a custom cross version
Emilgardis(Cross Github) who explained the newline bug
I'l trying to install a package (https://github.com/SchornacklabSLCU/amfinder) that use opam to install several libraries. However, two libraries failed to install: lablgtk and cairo2-gtk.I tried to install these two directly via opam (opam install labgtk) but got the same error:
User configuration:
~/.profile is already up-to-date.
[NOTE] Make sure that ~/.profile is well sourced in your ~/.bashrc.
[ERROR] There already is an installed switch named 4.08.0
[NOTE] Package camlzip is already installed (current version is 1.11).
[NOTE] Package magic-mime is already installed (current version is 1.2.0).
[NOTE] Package cairo2 is already installed (current version is 0.6.2).
[NOTE] Package odoc is already installed (current version is 2.0.0).
[NOTE] Package dune is already installed (current version is 2.9.1).
The following actions will be performed:
∗ install lablgtk 2.18.11
∗ install cairo2-gtk 0.6.2
===== ∗ 2 =====
Do you want to continue? [Y/n] y
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
⬇ retrieved cairo2-gtk.0.6.2 (cached)
⬇ retrieved lablgtk.2.18.11 (cached)
[ERROR] The compilation of lablgtk.2.18.11 failed at "./configure --prefix /home/alr/.opam/4.08.0
LABLGLDIR=/home/alr/.opam/4.08.0/lib/lablgl".
#=== ERROR while compiling lablgtk.2.18.11 ====================================#
# context 2.1.1 | linux/x86_64 | ocaml-base-compiler.4.08.0 | https://opam.ocaml.org#03fce048
# path ~/.opam/4.08.0/.opam-switch/build/lablgtk.2.18.11
# command ~/.opam/opam-init/hooks/sandbox.sh build ./configure --prefix /home/alr/.opam/4.08.0 LABLGLDIR=/home/alr/.opam/4.08.0/lib/lablgl
# exit-code 1
# env-file ~/.opam/log/lablgtk-16902-8d49b3.env
# output-file ~/.opam/log/lablgtk-16902-8d49b3.out
### output ###
# [...]
# checking native dynlink... checking for pkg-config... /home/linuxbrew/.linuxbrew/bin/pkg-config
# checking for GTK+ - version >= 2.0.0...
# *** 'pkg-config --modversion gtk+-2.0' returned 2.24.33, but GTK+ (2.24.32)
# *** was found! If pkg-config was correct, then it is best
# *** to remove the old version of GTK+. You may also be able to fix the error
# *** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
# *** /etc/ld.so.conf. Make sure you have run ldconfig if that is
# *** required on your system.
# *** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
# *** to point to the correct configuration files
# no
# configure: error: GTK+ is required
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build lablgtk 2.18.11
└─
╶─ No changes have been performed
<><> lablgtk.2.18.11 troubleshooting ><><><><><><><><><><><><><><><><><><><><><>
=> This package requires gtk+ 2.0 development packages installed on your system
File "dune", line 4, characters 29-39:
4 | (libraries lablgtk2 cairo2 cairo2-gtk camlzip magic-mime)
^^^^^^^^^^
Error: Library "cairo2-gtk" not found.
pkg-config --modversion gtk+-2.0returns 2.24.33
echo $LD_LIBRARY_PATHreturns empty path.
echo $PKG_CONFIG_PATHreturns /home/alr/.opam/4.08.0/lib/pkgconfig:
File /etc/ld.so.conf contains the following line: include /etc/ld.so.conf.d/*.conf
I am using WSL2 on Windows10 with Ubuntu18.04. libgtk2.0-dev is already installed.
I guess there is an error in path to library but cannot figure out how to solve it.
Any help would be greatly appreciated.
Thanks
Have anyone managed to install uwsgi on cygwin (python 2.7) ?
{ uwsgi-2.0.11.2 } » python setup.py install
running install
using profile: buildconf/default.ini
detected include path: ['/usr/lib/gcc/i686-pc-cygwin/4.9.2/include', '/usr/lib/gcc/i686-pc-cygwin/4.9.2/include-fixed', '/usr/include', '/usr/lib/gcc/i686-pc-cygwin/4.9.2/../../../../include/w32api']
Patching "bin_name" to properly install_scripts dir
detected CPU cores: 1
configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_WINDOWS_MUTEX -DUWSGI_EVENT_USE_POLL -DUWSGI_EVENT_TIMER_USE_NONE -DUWSGI_EVENT_FILEMONITOR_USE_NONE -DUWSGI_UUID -DUWSGI_VERSION="\"2.0.11.2\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="11" -DUWSGI_VERSION_REVISION="2" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
*** uWSGI compiling server core ***
[gcc] core/utils.o
core/utils.c: In function ‘uwsgi_as_root’:
core/utils.c:848:4: error: implicit declaration of function ‘initgroups’ [-Werror=implicit-function-declaration]
if (initgroups(uidname, uwsgi.gid)) {
^
cc1: all warnings being treated as errors
I have got make, automake , gcc (4.9.2) . Do I need anything else ?
I ran into the exact same issue under Windows 7, gcc (GCC) 4.9.3 and GNU Make 4.1. There actually 3 issues that needed to be resolved. The first being to disable the GCC warnings by removing the -Wall flag. The second is to remove the GCC -rdynamic linker option when using Cygwin. The last issue is that you need to install libcrypt-devel using Cygwin's setup installer.
Here is is what my git diff uwsgiconfig.py looks like. Note that I cloned the master branch from GitHub.
diff --git a/uwsgiconfig.py b/uwsgiconfig.py
index 3279777..cca00cf 100644
--- a/uwsgiconfig.py
+++ b/uwsgiconfig.py
## -1,5 +1,6 ##
# uWSGI build system
+
uwsgi_version = '2.1-dev'
import os
## -621,7 +622,7 ## class uConf(object):
self.cflags = [
'-O2',
'-I.',
- '-Wall',
+ # '-Wall',
'-Werror',
'-D_LARGEFILE_SOURCE',
'-D_FILE_OFFSET_BITS=64'
## -842,6 +843,9 ## class uConf(object):
if GCC in ('clang',):
self.libs.remove('-rdynamic')
+ if uwsgi_os.startswith('CYGWIN'):
+ self.libs.remove('-rdynamic')
+
# compile extras
extras = self.get('extras', None)
if extras:
Then a simple make within the cloned uwsgi directory should build everything.
I tested it by creating a file called app.py with the following -
def application(env, start_response):
start_response('200 OK', [('content-type', 'text/html')])
return [b'asdasdasd']
Then run the server with -
./uwsgi --http :9090 --wsgi-file app.py
Everything worked fine when I accessed http://localhost:9090/.
I am successed with only using latest uwsgi and latest Cygwin. The core is step 2
step:
dowload Cygwin
install: when you install, you must choose to install pip and python (my is python2.7.16) ==> this is python for Cygwin, not the python installed on Windows and use in Cygwin shell(REF TO)
dowload uwsgi
install cd {YOUR uwsgi}; python2.7.exe setup install(python2.7.exe is that created by python for Cygwin that you choose in step2, your may diff, find at /bin/pythonX.x.exe, add it to PATH just like in linux(/etc/profile or ~/.bash_profile))
if error in step 4 occurred, like 'xxx/ld not found -lintl`, go to step2 find it(usually xxx-devel) and install
use uwsig: python and most cmd in Cygwin can only run at Cygwin console(else access denial), but you can use uwsgi, add it to your WINDOWS PATH, and install package like django in at Cygwin console.
I'm trying to cross-compile GStreamer. Version is 1.2.3. Host PC's OS is x86 linux and Target system's OS is MIPSEL linux OS.
I succeeded to compile gstreamer and plugins for target device. And gst-launch-1.0 could be executed. So I tried to use basic plugin, libgstvideotestsrc. But it didn't work. So I ran ```gst-inspect-1.0' to inspect plugins then I found the result like below.
# gst-inspect-1.0 -b
Blacklisted files:
libgstinterlace.so
libgstfbdevsink.so
libgstgeometrictransform.so
libgstmultifile.so
libgstencodebin.so
libgstfestival.so
libgstlevel.so
libgstdvdspu.so
libgstauparse.so
libgsty4menc.so
libgstvideofilter.so
libgstvideoscale.so
libgstaccurip.so
libgstvideoconvert.so
libgstaudioparsers.so
libgsttcp.so
libgstvolume.so
libgstcoreelements.so
libgstmpegtsdemux.so
libgstid3tag.so
libgstadpcmdec.so
libgstmfc.so
libgstrtpmanager.so
libgstaudiotestsrc.so
libgstdeinterlace.so
libgstdebug.so
libgstplayback.so
libgstspeed.so
libgstasfmux.so
libgsticydemux.so
libgstmpegpsdemux.so
libgstalaw.so
libgstwavparse.so
libgstpnm.so
libgstnavigationtest.so
libgstcamerabin2.so
libgstsdpelem.so
libgstisomp4.so
libgstliveadder.so
libgstmpegtsmux.so
libgstautodetect.so
libgstmultipart.so
libgstvideofiltersbad.so
libgstaudioresample.so
libgstautoconvert.so
libgstdvbsuboverlay.so
libgstid3demux.so
libgstvideobox.so
libgstgio.so
libgstdtmf.so
libgstremovesilence.so
libgstreplaygain.so
libgstaudioconvert.so
libgstcutter.so
libgstgaudieffects.so
libgstdvb.so
libgstaudiovisualizers.so
libgstudp.so
libgstimagefreeze.so
libgstadder.so
libgstpcapparse.so
libgstmxf.so
libgstshapewipe.so
libgstgdp.so
libgstwavenc.so
libgstshm.so
libgstflv.so
libgstfreeverb.so
libgstoss4audio.so
libgstsubenc.so
libgstaudiorate.so
libgstinter.so
libgsttypefindfunctions.so
libgstvideorate.so
libgstrtp.so
libgstcoloreffects.so
libgstmpegpsmux.so
libgstivtc.so
libgstjpegformat.so
libgstsmpte.so
libgstalphacolor.so
libgstsubparse.so
libgstaudiofxbad.so
libgstvideomixer.so
libgstmulaw.so
libgstdebugutilsbad.so
libgsteffectv.so
libgstfieldanalysis.so
libgstadpcmenc.so
libgstrawparse.so
libgstavi.so
libgstdataurisrc.so
libgstapetag.so
libgstinterleave.so
libgstmidi.so
libgstrtsp.so
libgstapp.so
libgstalpha.so
libgstaudiofx.so
libgstvideocrop.so
libgstvideotestsrc.so
libgstspectrum.so
libgstbayer.so
libgstaiff.so
libgstsegmentclip.so
libgstfrei0r.so
Total count: 106 blacklisted files
I wonder the meaning of 'blacklisted' and how I should approach this problem. Please let me know if you need several information to resolve this issue.
Here is my build configuration for GStreamer.
#PACKAGES: Name + version
export GST_PLUGIN_BASE="gst-plugins-base-1.2.3"
export GST_PLUGIN_GOOD="gst-plugins-good-1.2.3"
export GST_PLUGIN_BAD="gst-plugins-bad-1.2.3"
#HOST & Build configuration.
export HOST="mips-linux-gnu"
export BUILD="i686-pc-linux-gnu"
#Set path for file system.
export BUILD_PATH="~~~~~"
export ROOTFS_PATH="${BUILD_PATH}/rootfs"
export MIPS_LIB="~~~"
export INSTALL_PATH="${ROOTFS_PATH}/usr"
export INSTALL_PATH_LIB="${ROOTFS_PATH}/usr/lib"
#Compiler options
export PATH="${PATH}:${INSTALL_PATH}/bin"
export CFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"
export CPPFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0 -I${ROOTFS_PATH}/usr/lib/glib-2.0/include -I${ROOTFS_PATH}/usr/include/gstreamer-1.0 -I${ROOTFS_PATH}/usr/include/gio-unix-2.0 -mno-compact-eh -EL"
export CXXFLAGS=$CPPFLAGS
export GST_CHECK_CFLAGS="-I${ROOTFS_PATH}/usr/include -I${ROOTFS_PATH}/usr/include/glib-2.0/include"
export PKG_CONFIG="/usr/bin/pkg-config"
export PKG_CONFIG_PATH="${PATH}:${ROOTFS_PATH}/lib/pkgconfig/:${ROOTFS_PATH}/usr/lib/pkgconfig/:${ROOTFS_PATH}/usr/local/lib/pkgconfig/:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/lib/pkgconfig"
export LD_LIBRARY_PATH="/lib:/usr/local/lib"
export CC="~~~mips-linux-gnu-gcc -EL"
export CXX="~~~mips-linux-gnu-g++ -EL"
cd ${BUILD_PATH}
#GStreamer 1.2.3
#http://greenday96.egloos.com/viewer/4627046
wget http://gstreamer.freedesktop.org/src/gstreamer/$GSTREAMER.tar.xz
tar xf $GSTREAMER.tar.xz
cd $GSTREAMER
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static
sudo make
sudo make install
cd ..
#gst-plugin-base 1.2.3
wget http://gstreamer.freedesktop.org/src/gst-plugins-base/$GST_PLUGIN_BASE.tar.xz
tar xf $GST_PLUGIN_BASE.tar.xz
cd $GST_PLUGIN_BASE
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-examples --disable-pango
sudo make
sudo make install
cd ..
# gst-plugin-good-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-good/$GST_PLUGIN_GOOD.tar.xz
tar xf $GST_PLUGIN_GOOD.tar.xz
cd $GST_PLUGIN_GOOD
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-valgrind --disable-equalizer --disable-flx --disable-goom --disable-goom2k1 --disable-matroska --disable-monoscope --disable-oss --disable-cairo --disable-gdk_pixbuf --disable-soup --disable-libpng --disable-gst_v4l2
sudo make
sudo make install
cd ..
# gst-plugin-bad-1.2.3
# http://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.2.3.tar.xz
wget http://gstreamer.freedesktop.org/src/gst-plugins-bad/$GST_PLUGIN_BAD.tar.xz
tar xf $GST_PLUGIN_BAD.tar.xz
cd $GST_PLUGIN_BAD
./configure --prefix=$INSTALL_PATH --build=$BUILD --host=$HOST --disable-nls --disable-static --disable-y4m --disable-siren --disable-librfb --disable-yadif --disable-smooth --disable-videoparsers --disable-decklink --disable-valgrind --disable-directfb --disable-examples
sudo make
sudo make install
cd ..
if you want to know for sure why these plugins are blacklisted, you can remove "registry.dat" (run locate to find out its location), then rerun gst-inspect , the plugins will be examined once again and the reason for blacklisting them should be printed.
There can be several reasons why they are blacklisted, if you do this you should find them out.
Alternatively, you can also run gst-inspect location_of_the_dynamic_library.so
For gstreamer 1.8 gst-inspect-1.0 need to be launcged with additional GST_DEBUG=4 env var to view detailed reason (incompatible version in my case):
GST_DEBUG=4 gst-inspect-1.0 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so
...15-20 lines with non-interesting details...
0:00:00.035553207 4287 0x29f93c00 WARN GST_PLUGIN_LOADING gstplugin.c:485:gst_plugin_register_func: plugin "/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" has incompatible version (plugin: 1.10, gst: 1,8), not loading
Could not load plugin file: File "/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgst_some_plugin.so" appears to be a GStreamer plugin, but it failed to initialize
In my case it was blacklisted as I have built kvssink which have dependencies on other libraries. And GStreamer doesn't found them.
It was like that:
gst-inspect-1.0 kvssink
(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.097: Failed to load plugin '/root/bin/producer/libgstkvssink.so': libproducer.so: cannot open shared object file: No such file or directory
(gst-plugin-scanner:22): GStreamer-WARNING **: 13:07:28.204: Failed to load plugin '/root/bin/producer/libproducer.so': libcproducer.so: cannot open shared object file: No such file or directory
To confirm libraries issue I've used ldd
ldd libgstkvssink.so
Which will list all dependencies with paths were they may be found in system.
my libraries libcproducer.so and libcproducer.so were not found.
Based on path pritned for other visible libraries
linux-vdso.so.1 (0x00007ffc3c1a6000)
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0 (0x00007f064d24d000)
I just copied missing libraries to /usr/lib/x86_64-linux-gnu/
In my case it was:
cp libcproducer.so /usr/lib/x86_64-linux-gnu/
cp libproducer.so /usr/lib/x86_64-linux-gnu/
And than:
gst-inspect-1.0 kvssink
prints plugin details.
I've resolved that thanks to information in this thread:
Linking against external libraries in gstreamer plugin using autotools
I found the reason. It's GLIB, not GStreamer.
To build GLIB for mipsel, I should set glib_cv_uscore=no. It's up to your embedded device. So please check your target hardware's CPU specification. So I made the build script for GLIB like below.
#Glib 2.42.1
wget ftp://ftp.gnome.org/pub/gnome/sources/glib/2.42/$GLIB.tar.xz
tar xf $GLIB.tar.xz
cd $GLIB
#Build for MIPS
echo "ac_cv_func_posix_getgrgid_r=yes" > mips.cache
echo "ac_cv_func_posix_getpwuid_r=yes" >> mips.cache
echo "glib_cv_stack_grows=no" >> mips.cache
echo "glib_cv_uscore=no" >>mips.cache
./configure --prefix=$INSTALL_PATH --host=$HOST --cache-file=mips.cache --build=$BUILD
make
make install
cd ..
I got the clue from here.
I have downloaded and tried to install Gtkaml but I am having troubles.
I followed their instructions to install it, but it still fails.
I downloaded it into my downloads folder, then ran Terminal:
cd ~/Downloads
ls
cd gtkaml-0.5.94
./configure
But then it failed at ./configure, I can't remember what it was, but it was missing something so I then ran:
sudo apt-get build-dep gtkaml, then I re-ran ./configure and it succeeded. So then I proceeded to sudo make, but then it said,
jase#Jase-PC:~/Downloads/gtkaml-0.5.94$ sudo make make all-recursive
make1: Entering directory /home/jase/Downloads/gtkaml-0.5.94'
Making all in libgtkaml make[2]: Entering directory
/home/jase/Downloads/gtkaml-0.5.94/libgtkaml' /usr/bin/valac -C -H
gtkaml.h --library gtkaml --vapidir . --pkg config --pkg glib-2.0
--pkg libvala-0.16 --pkg libxml-2.0 --pkg gio-2.0 gtkamlcodecontext.vala gtkamlmarkupparser.vala gtkonparser.vala
gtkamlmarkupscanner.vala gtkamlmarkupresolver.vala
gtkamlcodeparserprovider.vala ast/gtkamlmarkupattribute.vala
ast/gtkamlmarkupcomplexattribute.vala gtkamlmarkupclass.vala
ast/gtkamlmarkuptag.vala ast/gtkamlmarkuproot.vala
ast/gtkamlmarkupchildtag.vala ast/gtkamlmarkupunresolvedtag.vala
ast/gtkamlmarkupmember.vala ast/gtkamlmarkuptemp.vala
ast/gtkamlmarkupreference.vala gtkamlmarkupnamespace.vala
gtkamlmarkuphint.vala gtkamlmarkuphintsstore.vala
gtkamlpropertyspec.vala workarounds/gtkamldatatypeparent.vala
workarounds/gtkamlcallable.vala workarounds/gtkamlvalaparser.vala
workarounds/gtkamlnamespacevisitor.vala error: Package libvala-0.16'
not found in specified Vala API directories or GObject-Introspection
GIR directories Compilation failed: 1 error(s), 0 warning(s) make[2]:
*** [libgtkaml.stamp] Error 1 make[2]: Leaving directory/home/jase/Downloads/gtkaml-0.5.94/libgtkaml' make1: *
[all-recursive] Error 1 make1: Leaving directory
`/home/jase/Downloads/gtkaml-0.5.94' make: * [all] Error 2
So then I ran sudo apt-get install libvala-0.16 to install libvala-0.16. It then said,
Reading package lists... Done Building dependency tree Reading
state information... Done Note, selecting 'libvala-0.16-dev' for regex
'libvala-0.16' Note, selecting 'libvala-0.16-0' for regex
'libvala-0.16' Note, selecting 'libvala-0.16-0-dbg' for regex
'libvala-0.16' libvala-0.16-0 is already the newest version.
libvala-0.16-0-dbg is already the newest version. libvala-0.16-dev is
already the newest version. The following packages were automatically
installed and are no longer required: libqt5declarative5 par2
python-support Use 'apt-get autoremove' to remove them. 0 to upgrade,
0 to newly install, 0 to remove and 0 not to upgrade.
So I re-ran sudo make. But same error as the original make error.
How do I make/make install this thing?
This should fix the problem
sudo apt-get install libvala-0.16-dev
What you need is a libvala development package.
I have been unable to make from source obtained from the Google code website. But I have been able to install it from the Software Center.
I have written and compiled a sample application:
<Window xmlns:g="http://gtkaml.org/0.4" xmlns="Gtk" g:name="GTKamlSample"
type="{WindowType.TOPLEVEL}" title="Window"
position="{WindowPosition.CENTER}" default-width="300" default-height="150"
destroy="Gtk.main_quit">
<Button label="Click me." clicked='{target.label="Thank you.";}' />
<![CDATA[
static int main (string[] args)
{
Gtk.init(ref args);
var window = new GTKamlSample();
window.show_all();
Gtk.main();
return 0;
}
]]>
</Window>
Which works. So your best bet is to use Software Center if you run into troubles installing it from source.