How to install LXC c libraray? - lxc

I know Linux Container (LXC) has an API. We can use it via liblxc, which should be a c library. But I cannot find any? So, how people use this API currently?

If you installed lxc successfully, shared libraries & header files are copied to your environment. ex) /usr/local/include/lxc , /usr/local/lib/liblxc.so
then you can build your code within linking option '-llxc'

You need to install lxc-devel. Here's the information about this package.
# yum info lxc-devel
Loaded plugins: langpacks
Available Packages
Name : lxc-devel
Arch : x86_64
Version : 1.0.7
Release : 2.0.12.el7
Size : 20 k
Repo : ol7_latest/x86_64
Summary : Development library for lxc
URL : http://linuxcontainers.org
License : LGPLv2+
Description : The lxc-devel package contains header files and library needed for
: development of the Linux containers.

Related

Unable to install pypi package(google-cloud-bigquery) on GCP Composer

I am trying to install google-cloud-bigquery==1.5.0 PyPI packages on GCP composer for a new environment recently has been created. I get this error:
Successfully installed google-cloud-bigquery-1.5.0 google-cloud-core-0.28.1 pypd-1.1.0 strict-rfc3339-0.7
+ [[ -z fail ]]
+ python3 -m pipdeptree --warn fail
Warning!!! Possibly conflicting dependencies found:
* google-cloud-translate==2.0.1
- google-cloud-core [required: >=1.1.0,<2.0dev, installed: 0.28.1]
* google-cloud-storage==1.29.0
I tried another version (2.2.0) and it had conflicts with some other google pre-installed packages.
The new environment image version is composer-1.12.2-airflow-1.10.6.
There is another environment created few months ago and all pypi packages are installed successfully and airflow dags are running smoothly, the image version for it is composer-1.10.0-airflow-1.10.6 .
Question 1: I think the current issue is linked to the image version and probably I have to recreate the new environment with older image version, am I correct?
Question 2: To create new environment I have only three options for image version which are composer-1.12.2-airflow-1.10.6, composer-1.12.2-airflow-1.10.9, composer-1.12.2-airflow-1.10.10. How I can create environment with image version composer-1.10.0 ? We have several other projects and environment with the same location/zone but with composer-1.10.0
Please, have a look to the official documentation for the Apache Airflow and Python versions that Cloud Composer supports. You can refer to the section for the Python packages which comes with composer-1.12.2-airflow-1.10.6. A specific Cloud Composer Airflow version already comes with a set of included packages. When you upgrade/downgrade a specific installed PyPi package or try to use any other packages, you can run into conflicts.
As for now, there is no way to check conflicts ahead of time within Cloud Composer environment. I would like to suggest you to adjust your packages to be able to use in the one of the Composer environments: composer-1.12.4-airflow-1.10.10,
composer-1.12.4-airflow-1.10.9 or composer-1.12.4-airflow-1.10.6.

octave: add gdal support for mapping package

I am trying to run some old matlab code with octave. Unfortunately this code contains a geotiffread function and I think I should change this function with rasterread (package mapping).
However, when I try to install the mapping package I get this warning:
octave:7> pkg install mapping-1.4.0.tar.gz
configure: WARNING: GDAL library not found. Reading of raster files will be disabled.
For information about changes from previous versions of the mapping package, run 'news mapping'.
I tried to run octave (5.2.0 version) within:
a Debian Buster distribution (snap and flatpak package)
a docker container (MacOS 10.15 host, installed from the mtmiller/octave image).
online with the octave-online service, running this code:
pkg load mapping;
[bands, info] = rasterread ('mexutm250.tiff');
With this output:
octave:3> source("my_script.m")
error: gdalread: reading of raster file with GDAL was disabled during installation
error: called from
rasterread at line 56 column 26
my_script at line 2 column 15
No attempt was successful.
EDIT 2: I know that my octave installations are without GDAL support. I would like to use octave with full mapping package, and GDAL support, without recompile it. There is a way to do it (e.g. update a library path within the docker installation to add the libgdal library)?
If there is no way to add GDAL support without recompile octave, there is a guide to do it with minimal effort?
EDIT 3: I already installed the gdal dependencies:
$ sudo aptitude search gdal |grep ^i
[sudo] password for virtuser:
i gdal-bin - Geospatial Data Abstraction Library - programmi di utilità
i A gdal-data - libreria Geospatial Data Abstraction Library - file di dati
i libgdal-dev - libreria Geospatial Data Abstraction Library - file di sviluppo
i libgdal20 - libreria Geospatial Data Abstraction Library
Thank you.
I got octave with GDAL integration when I installed the octave package from the debian repository. I needed octave 5.2, so I switched to Ubuntu 20.04.
as suggested in one of the comments, checking
>> news mapping
(also at https://octave.sourceforge.io/mapping/NEWS.html)
looking at mapping 1.2.1 where rasterread was introduced, it states:
** New features
Reading GIS raster data: A first go is provided using
functions rasterread.m and rasterinfo.m. Both invoke binary
function gdalread() of which an initial version was provided
by Shashank Khare. rasterread.m and rasterinfo.m can read
and return info on any raster data type that the underlying
GDAL library can read. As such, separate functions for e.g.,
GeoTIFF and ArcGrid etc. are not required.
To make use of these functions the GDAL library must be
present on your system => GDAL is a suggested dependency.
You should be able to install the GDAL library in Debian using your preferred installation method.
Unsure whether or not you'll need to uninstall/reinstall the mapping package afterward, but if an unload/reload doesn't get rid of the message, try that and see if mapping is able to see the library.

How to install luarocks packages without internet?

I used torch distro repository on github and installed LuaJIT and luarocks.
I want to install luarocks packages , from source, that is downloading the packages(.zip files) and building them from source .
I tried doing it by downloading the packages from github and then running luarocks install modulename.rockspec . But here it again starts cloning from github.
Can anyone tell me the exact procedure to do this ?
You can use either source rocks or binary rocks.
Using source rocks
A source rock is a package with .src.rock extension containing the sources. You create it packing a rockspec:
luarocks pack bla-1.0-1.rockspec # uses the network
This produces bla-1.0-1.src.rock. Running luarocks build bla-1.0-1.src.rock does not use the network to build bla, but it will hit the network to fetch dependencies if needed. So you need to pack and install all dependencies beforehand.
Using binary rocks
A binary rock is a compiled package with .PLATFORM.rock extension containing the .lua or .so/.dll modules. You create it building a module and then packing the code you built:
luarocks build bla-1.0-1.rockspec # uses the network
luarocks pack bla # doesn't use the network
This produces a binary rock, say bla-1.0-1.linux-x86.rock. Note however that to install this in another machine, the target machine needs to be fully ABI-compatible, that is, all installed libraries in the source and destination machine need to be compatible (e.g. same OS/distro version). For this reason, this is useful for deploying rocks to multiple machines in a farm, but not for distributing binary packages for end-users in general.
Grouping packed rocks into a local server
Once you pack all rocks you need (and their dependencies) using one of the methods above, you can put them all in a directory, then turn it into a "local server":
mkdir my_rocks
mv *.rock my_rocks # suppose we have some packed .rock files here
cd my_rocks
luarocks-admin make-manifest my_rocks
This works with both source and binary rocks. You'll then be able to build rocks from there without fetching the network.
luarocks install bla --only-server=/home/YOURNAME/my_rocks

RHEL 7 collectd dbi freetds issues

I can't seem to get the dbi plugin working for collectd on RHEL 7. I am trying to connect to Microsoft SQL Server using the FreeTDS driver, but collectd/dbi can't find it.
I've installed the latest collectd:
Name : collectd
Arch : x86_64
Version : 5.5.2
Release : 1.el7
Size : 1.8 M
Repo : installed
From repo : epel
Summary : Statistics collection daemon for filling RRD files
License : GPLv2
I've installed collectd-dbi:
Name : collectd-dbi
Arch : x86_64
Version : 5.5.2
Release : 1.el7
Size : 32 k
Repo : installed
From repo : /collectd-dbi-5.5.2-1.el7.x86_64
Summary : DBI plugin for collectd
License : GPLv2
I've installed FreeTDS:
Name : freetds
Arch : x86_64
Version : 0.95.81
Release : 1.el7
Size : 2.7 M
Repo : installed
From repo : epel
Summary : Implementation of the TDS (Tabular DataStream) protocol
License : LGPLv2+ and GPLv2+
collectd shows an error when trying to load FreeTDS:
dbi plugin: cdbi_connect_database: dbi_driver_open_r (FreeTDS) failed.
What am I missing? Any help would be greatly appreciated.
I'm fighting the same problem myself, and while I haven't yet got it working I'm pretty sure you need DBD::Sybase in addition to collectd, collectd-dbi and freetds. I grabbed it from http://search.cpan.org/CPAN/authors/id/M/ME/MEWP/DBD-Sybase-1.15.tar.gz.
With luck you'll get past where I'm at, which is that Perl says the driver is available, but the collectd plugin can't reference it.
Seeming success on the perl side:
cat ./test.pl
#!/usr/bin/perl
use DBI;
#Prints a list of the available DBD drivers.
#available_drivers = DBI->available_drivers;
print ("The available DBD drivers are: #available_drivers.\n");
$ ./test.pl
The available DBD drivers are: DBM ExampleP File Gofer Oracle Proxy Sponge Sybase mysql.
But I get this error in the collectd log:
[2016-09-27 14:18:09] dbi plugin: cdbi_connect_database: dbi_driver_open_r (Sybase) failed.
[2016-09-27 14:18:09] dbi plugin: Maybe the driver isn't installed? Known drivers are:
[2016-09-27 14:18:09] dbi plugin: * mysql
That mysql driver became available after I installed the libdbi-dbd-mysql rpm, but no love yet getting it to recognize the Sybase driver.

what is the standard ada include path

Im using gnat4.6 on Ubuntu installed using apt-get. I need to know where to install downloaded libraries like APQ. What should I set my ADA_INCLUDE_PATH and ADA_OBJECTS_PATH to?
The beauty of Ada support in Debian (on which Ubuntu is based) is that you don't need to mess with ADA_INCLUDE_PATH and friends; supported libraries are installed where the GNAT Project Manager expects to find them. Say gnatls -v to see the default values.
To use the system as intended, you will find it much simpler to use the GNAT Project Manager; you'd say, in your my_project.gpr file,
with "apq";
project My_Project is
...
and build with
$ gnatmake -P my_project
There's online documentation for GPR, but I wouldn't call it particularly user-friendly. There's a set of Youtube videos (I haven't looked at them in any detail; their stated interest is large systems, but hang in there).
I use gnatmake to build; how do I cite my build paths in a correct way?
The relevant options are shown in 6.2 Switches for gnatmake: Source and library search path switches.
Addendum: The development package is libapq3.2.0-dev.
The manual is in /usr/share/doc/libapq3.2.0-dev/manual.pdf.gz
An example and corresponding .gpr file are in /usr/share/doc/libapq3.2.0-dev/examples. As #Simon suggested, the .gpr file begins:
with "apq.gpr";
project APQ.Samples is
The Ada include files are in /usr/share/ada/adainclude/apq.
The libraries are in /usr/lib.
$ dpkg -L libapq3.2.0-dev
/.
/usr
/usr/share
/usr/share/ada
/usr/share/ada/adainclude
/usr/share/ada/adainclude/apq
/usr/share/ada/adainclude/apq/apq_helper.ads
/usr/share/ada/adainclude/apq/apq_helper.adb
/usr/share/ada/adainclude/apq/apq.adb
/usr/share/ada/adainclude/apq/apq.ads
/usr/share/ada/adainclude/apq.gpr
/usr/share/doc
/usr/share/doc/libapq3.2.0-dev
/usr/share/doc/libapq3.2.0-dev/copyright
/usr/share/doc/libapq3.2.0-dev/manual.pdf.gz
/usr/share/doc/libapq3.2.0-dev/examples
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.adb
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.ads
/usr/share/doc/libapq3.2.0-dev/examples/apq-samples.gpr
/usr/lib
/usr/lib/libapq.a
/usr/lib/ada
/usr/lib/ada/adalib
/usr/lib/ada/adalib/apq
/usr/lib/ada/adalib/apq/apq_helper.ali
/usr/lib/ada/adalib/apq/apq.ali
/usr/share/doc/libapq3.2.0-dev/changelog.Debian.gz
/usr/lib/libapq.so

Resources