custom compile an egg and install console scripts - buildout

I'm trying to get the following buildout working. The buildout is meant to be self contained so I don't want to install any system packages
[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
${s3ql-build:egg}
[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
http://security.ubuntu.com/ubuntu/pool/universe/s/s3ql/s3ql_1.16.orig.tar.bz2#egg=s3ql
https://github.com/wilkinson/s3ql/archive/master.zip#egg=s3ql
https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
include-dirs =
${liblzma:location}/include
${sqlite:location}/include
library-dirs =
${liblzma:location}/lib
${sqlite:location}/lib
rpath =
${liblzma:location}/lib
${sqlite:location}/lib
[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz
[pysqlite]
recipe = zc.recipe.egg:custom
egg = pysqlite
include-dirs = ${sqlite:location}/include
library-dirs = ${sqlite:location}/lib
rpath = ${sqlite:location}/lib
[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz
and I get the following
Updating liblzma.
Updating sqlite.
Updating s3ql-build.
Installing s3ql.
Getting distribution for 'pyliblzma>=0.5.3'.
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
In file included from src/liblzma.c:1:0:
src/liblzma.h:24:18: fatal error: lzma.h: No such file or directory
compilation terminated.
error: Setup script exited with error:
command 'gcc' failed with exit status 1
An error occurred when trying to install pyliblzma 0.5.3. Look above this message for any errors that were output by easy_install.
While:
Installing s3ql.
Getting distribution for 'pyliblzma>=0.5.3'.
Error: Couldn't install: pyliblzma 0.5.3
It seems like it tries to compile it again.

You need to install liblzma-dev on your OS.
gottfried#dell-xt2:~/virtualenvs/liblzma$ sudo apt-get install liblzma-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
liblzma-doc
The following NEW packages will be installed:
liblzma-dev
0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 159 kB of archives.
After this operation, 645 kB of additional disk space will be used.
Get:1 http://de.archive.ubuntu.com/ubuntu/ saucy/main liblzma-dev amd64 5.1.1alpha+20120614-2ubuntu1 [159 kB]
Fetched 159 kB in 1s (111 kB/s)
Selecting previously unselected package liblzma-dev:amd64.
(Reading database ... 272326 files and directories currently installed.)
Unpacking liblzma-dev:amd64 (from .../liblzma-dev_5.1.1alpha+20120614-2ubuntu1_amd64.deb) ...
Setting up liblzma-dev:amd64 (5.1.1alpha+20120614-2ubuntu1) ...
gottfried#dell-xt2:~/virtualenvs/liblzma$ bin/easy_install pyliblzma
Searching for pyliblzma
Reading https://pypi.python.org/simple/pyliblzma/
Best match: pyliblzma 0.5.3
Downloading https://pypi.python.org/packages/source/p/pyliblzma/pyliblzma-0.5.3.tar.bz2#md5=500f61116ee1ab4063b49c121786863a
Processing pyliblzma-0.5.3.tar.bz2
Writing /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/setup.cfg
Running pyliblzma-0.5.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-kAg4nj/pyliblzma-0.5.3/egg-dist-tmp-TmcZm_
/bin/sh: 1: pkg-config: not found
/bin/sh: 1: pkg-config: not found
zip_safe flag not set; analyzing archive contents...
Adding pyliblzma 0.5.3 to easy-install.pth file
Installed /home/gottfried/virtualenvs/liblzma/lib/python2.7/site-packages/pyliblzma-0.5.3-py2.7-linux-x86_64.egg
Processing dependencies for pyliblzma
Finished processing dependencies for pyliblzma

ok, I figured it out. Yes using a combination of zc.recipe.egg:scripts and zc.recipe.egg:custom is the right approach. But it's confusing as zc.recipe.egg:custom doesn't build the dependencies so it appears like it wasn't picking up the built s3ql.
Here is the solution that built for me.
[s3ql]
recipe = zc.recipe.egg:scripts
eggs =
${pyliblzma:egg}
${llfuse:egg}
${apsw:egg}
${s3ql-build:egg}
[s3ql-build]
recipe = zc.recipe.egg:custom
egg = s3ql
find-links =
https://bitbucket.org/nikratio/s3ql/downloads/s3ql-1.18.1.tar.bz2#egg=s3ql-1.18.1
# need this patch to build on osx
# https://bitbucket.org/nikratio/s3ql/commits/39352e8e4cb48521dd9ff589e93fc2e4ae390f9d/raw/
include-dirs =
${liblzma:location}/include
${sqlite:location}/include
library-dirs =
${liblzma:location}/lib
${sqlite:location}/lib
rpath =
${liblzma:location}/lib
${sqlite:location}/lib
[pyliblzma]
recipe = zc.recipe.egg:custom
egg = pyliblzma
include-dirs = ${liblzma:location}/include
library-dirs = ${liblzma:location}/lib
rpath = ${liblzma:location}/lib
[llfuse]
recipe = zc.recipe.egg:custom
egg = llfuse
# NOTE: requires apt-get install libfuse-dev pkg-config libattr1-dev
# fuse has to go into the kernal so we can't compile it into the buildout
[apsw]
recipe = zc.recipe.egg:custom
egg = apsw
find-links =
https://github.com/rogerbinns/apsw/releases/download/3.8.4.3-r1/apsw-3.8.4.3-r1.zip
# includes, libraries etc is ignored by apsw setup.py
environment = apsw-env
[apsw-env]
CPPFLAGS= -I${sqlite:location}/include -I${liblzma:location}/lib
LDFLAGS= -L${sqlite:location}/lib -Wl,-rpath=${sqlite:location}/lib -L${liblzma:location}/include -Wl,-rpath=${liblzma:location}/lib
PKG_CONFIG_PATH=${sqlite:location}/lib/pkgconfig:${liblzma:location}/lib/pkgconfig
[liblzma]
recipe = zc.recipe.cmmi
url = http://tukaani.org/xz/xz-5.0.5.tar.gz
[sqlite]
recipe = zc.recipe.cmmi
url = http://www.sqlite.org/2014/sqlite-autoconf-3080403.tar.gz

Related

How to use bazel to build tensorflow as external dependencies to support gpu inference?

I want to use tensorflow's c++ api to inference in my project, when I build it for cpu, it's ok. But when I build it for support gpu (bazel build --config=cuda ...), it has some error.
My WORKSPACE:
http_archive(
name = "org_tensorflow",
strip_prefix = "tensorflow-1.15.0",
sha256 = "a5d49c00a175a61da7431a9b289747d62339be9cf37600330ad63b611f7f5dc9",
urls = ["https://github.com/tensorflow/tensorflow/archive/v1.15.0.tar.gz"]
)
load("#org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace(tf_repo_name = "org_tensorflow")
# Uncomment the following two lines has the same error.
# load("#org_tensorflow//third_party/gpus:cuda_configure.bzl", "cuda_configure")
# cuda_configure(name="local_config_cuda")
My .bazelrc:
...
# config for using cuda
build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true
build:cuda --action_env TF_NEED_CUDA=1
build:cuda --crosstool_top=#local_config_cuda//crosstool:toolchain
...
My BUILD:
cc_library(
name = "tf_utils",
srcs = ["tf_utils.cpp"],
hdrs = ["tf_utils.h"],
deps = ["#org_tensorflow//tensorflow/cc/saved_model:loader"
"#org_tensorflow//tensorflow/core:tensorflow"]
)
cc_binarary(
name = "test",
srcs = ["test.cpp"],
deps = ["tf_utils"]
)
When I run bazel build --config=cuda //:test
The error message is:
ERROR: external/com_google_protobuf/BUILD:405:1: C++ compilation of rule '#com_google_protobuf//:protoc' failed (Exit 1) crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -MD -MF bazel-out/host/bin/external/com_google_protobuf/_objs/protoc/main.d ... (remaining 46 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
src/main/tools/linux-sandbox-pid1.cc:413: "execvp(external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc, 0x6dfe10)": No such file or directory
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.
The error message shows no such file or directory, but it does exist.
# ls -la external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc
-rwxrwxr-x 1 root root 9129 Dec 1 14:14 external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc*
The tensorflow version is 1.15, bazel version is 3.1.0.
Does anyone know how to configure bazel correctly so that tensorflow can support gpu as an external dependency? Thanks very much.

FASTCGI Install on Raspberry PI Error - Cannot Manually Build Package

I have searched the internet all weekend and cannot find anyone who has had a similar error. I am trying to install libapache-mod-factcgi but the package errors out and I cannot figure out why.
pi#applejacks:/tmp $ sudo apt-get source -b libapache2-mod-fastcgi
Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1.dsc'
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141.orig.tar.gz'
Skipping already downloaded file 'libapache-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1.diff.gz'
Need to get 0 B of source archives.
Skipping unpack of already unpacked source in libapache-mod-fastcgi-2.4.7~0910052141
dpkg-buildpackage: source package libapache-mod-fastcgi
dpkg-buildpackage: source version 2.4.7~0910052141-1.1+deb8u1
dpkg-buildpackage: source distribution jessie
dpkg-buildpackage: source changed by Andreas Beckmann <anbe#debian.org>
dpkg-buildpackage: host architecture armhf
dpkg-source --before-build libapache-mod-fastcgi-2.4.7~0910052141
debian/rules clean
dh_listpackages: Please specify the compatibility level in debian/compat
dh_listpackages: Compatibility levels before 5 are no longer supported (level 1 requested)
/usr/share/cdbs/1/rules/dpatch.mk:33: CDBS WARNING: dpatch.mk is deprecated since 0.4.85 - please use source format 3.0 (quilt) instead
test -x debian/rules
rmdir /tmp/libapache-mod-fastcgi-2.4.7~0910052141/build-tmp
rmdir: failed to remove ‘/tmp/libapache-mod-fastcgi-2.4.7~0910052141/build-tmp’: No such file or directory
/usr/share/cdbs/1/rules/buildcore.mk:46: recipe for target 'cleanbuilddir' failed
make: [cleanbuilddir] Error 1 (ignored)
dh_clean
dh_clean: Please specify the compatibility level in debian/compat
/usr/share/cdbs/1/rules/debhelper.mk:189: recipe for target 'clean' failed
make: *** [clean] Error 2
dpkg-buildpackage: error: debian/rules clean gave error exit status 2
Build command 'cd libapache-mod-fastcgi-2.4.7~0910052141 && dpkg-buildpackage -b -uc' failed.
E: Child process failed
I'm trying to build Apache2 on RPi also. These commands got the .deb building for me:
cd libapache-mod-fastcgi-2.4.7~0910052141;
echo 10 > debian/compat;
dpkg-buildpackage -b -uc
Then cd .. to go one level up, then install the package with dpkg -i ./libapache2-mod-fastcgi_2.4.7~0910052141-1.1+deb8u1_armhf.deb

Build chromium for raspberrypi2 on wayland with yocto project brings error related to egl.pc and wayland-egl.pc

I have completed building qt5 on raspberrypi2 by following the instruction here: http://www.embarcados.com.br/raspberry-pi-2-qt5-yocto-parte-1/
My next goal is to build chromium with wayland and egl. I have added one more layer from "https://github.com/OSSystems/meta-browser".
Actually, I could successfully build chromium with x11 but still failing with wayland. The things I did for wayland is to add "wayland" with DISTRO_FEATURES_append = " wayland" and remove x11 with DISTRO_FEATURES_remove = " x11".
However, this yields errors and the error messages mentions that missing "egl.pc" and "wayland-egl.pc". Should I add some more components in "DEPENDS" section which will be pre built and create those two package config files in addition to those components in chromium.inc? The build configurations and error messages shown are below.
Build Configuration:
BB_VERSION = "1.26.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "Ubuntu-14.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "raspberrypi2"
DISTRO = "poky"
DISTRO_VERSION = "1.8"
TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard vfpv4 cortexa7"
TARGET_FPU = "vfp-vfpv4-neon"
meta-embarcados
meta-rpi = "fido:dfb2e27bf26b109fc6ccb3bc91924fb3bb24f655"
meta-qt5 = "fido:fc026381545650e10fdd488d5b2a3b2d78f87793"
meta-raspberrypi = "fido:b896a7da70dd7a16ba7ffd664f7747cb37e1d142"
meta-oe
meta-ruby
meta-gnome = "fido:10d3c8f85280a0bf867a8e4f84bcda81c290d28e"
meta
meta-yocto = "fido:cd2c9acdbd75c83790e8144d2a834f5b5de35df0"
meta-browser = "master:ca96f4326345dcd779fc539877a04f069f431749"
NOTE: Preparing RunQueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_configure (log file is located at /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805)
ERROR: Logfile of failure stored in: /home/paul/yocto/build-browser-fido/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/chromium/40.0.2214.91-r0/temp/log.do_configure.13805
Updating projects from gyp files...
Package xcb-shm was not found in the pkg-config search path.
Perhaps you should add the directory containing xcb-shm.pc'
to the PKG_CONFIG_PATH environment variable
Package 'xcb-shm', required by 'cairo', not found
gyp: Call to 'pkg-config --cflags pangocairo pangoft2' returned exit status 1.
Requested 'egl >= 9.1.3' but version of egl is 0.0
Package wayland-egl was not found in the pkg-config search path.
Perhaps you should add the directory containingwayland-egl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'wayland-egl' found
gyp: Call to 'pkg-config --cflags "egl >= 9.1.3" "wayland-client >= 1.4.0" >>
Thank you very much for your help.
I found that I should have not done DISTRO_FEATURES_remove = " x11". However, I`m still attempting to launch chromium based on wayland compositor.

Error when installing RMySQL on Windows 7

I have followed the instructions on this website for installing RMySQL on my 64 bit Windows 7 machine: http://www.ahschulz.de/2013/07/23/installing-rmysql-under-windows/
However I get the following error message: Any ideas? I have searched for some time for an answer with no luck - I wonder if the problem is the lack of a file called x86_64-w64-mingw32-gcc but I cannot figure out where this should come from or be stored.
install.packages("RMySQL", type = "source")
Installing package(s) into ‘C:/Users/lokell/Documents/R/win-library/2.14’
(as ‘lib’ is unspecified)
Warning: dependency ‘DBI’ is not available
trying URL 'http://cran.ma.imperial.ac.uk/src/contrib/RMySQL_0.10.2.tar.gz'
Content type 'application/x-gzip' length 52150 bytes (50 Kb)
opened URL
downloaded 50 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
** libs
rm -f RMySQL-init.o connection.o db-apply.o driver.o exception.o fields.o result.o utils.o
"C:/PROGRA~1/R/R-214~1.1/bin/x64/Rscript.exe" "../tools/winlibs.R"
x86_64-w64-mingw32-gcc -I"C:/PROGRA~1/R/R-214~1.1/include" -I../windows/libmariadbclient-2.1.0/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -std=gnu99 -mtune=core2 -c RMySQL-init.c -o RMySQL-init.o
x86_64-w64-mingw32-gcc: not found
make: *** [RMySQL-init.o] Error 127
ERROR: compilation failed for package 'RMySQL'
* removing 'C:/Users/lokell/Documents/R/win-library/2.14/RMySQL'
The downloaded packages are in
‘C:\Users\lokell\AppData\Local\Temp\RtmpkPZRnB\downloaded_packages’
Warning messages:
1: running command 'C:/PROGRA~1/R/R-214~1.1/bin/x64/R CMD INSTALL -l "C:/Users/lokell/Documents/R/win-library/2.14" C:\Users\lokell\AppData\Local\Temp\RtmpkPZRnB/downloaded_packages/RMySQL_0.10.2.tar.gz' had status 1
2: In install.packages("RMySQL", type = "source") :
installation of package ‘RMySQL’ had non-zero exit status

epylint in emacs using virtualenv

Can't get epylint working. I'm using buildout to generate epylint script. But then I run it from command line it doesn't output anything.
> epylint models.py
> echo $?
0
While if pylint is installed to system (emerge pylint) everything works, except system level linter does not see eggs installed by buildout. Here is my buildout part for eplint:
[epylint]
recipe = zc.recipe.egg
eggs =
${buildout:eggs}
pylint
extra-paths = ${buildout:extra-paths}
entry-points = epylint=pylint.epylint:Run
Would like to get suggestions how I could pin point issue.
This seems to be due to missing pylint script, which epylint calls internally.
This buildout config works for me:
[epylint]
recipe = zc.recipe.egg
eggs = pylint
entry-points = epylint=pylint.epylint:Run
[pylint]
recipe = zc.recipe.egg
eggs = pylint
entry-points = pylint=pylint.lint:Run
arguments = sys.argv[1:]
I needed two parts because pylint.lint:Run and pylint.epylint:Run process command line arguments in different ways.