Can't install pvl8 v.2.3.15: Regenerating ninja files - FAILED: build.ninja - linux-mint

Linux Mint 20.2 , kernel 5.11.0-25-generic
I want to install plv8-2.3.15
Help here:
https://github.com/plv8/plv8/blob/v2.3.15/docs/BUILDING.md
Installed the next packages:
sudo apt-get update
sudo apt install git
sudo apt install python2
sudo apt install g++
sudo apt install pkg-config
sudo apt install libc-dev-bin
sudo apt install libc++abi-dev
sudo apt-get install libc++abi-dev
sudo apt install libc++-dev
sudo apt install libglib2.0-dev-bin
sudo apt install libtinfo5
sudo apt install ninja-build
Steps:
After make I get the next result:
./generate_upgrade.sh 2.3.15
sed -e 's/#PLV8_VERSION#/2.3.15/g' plv8.control.common | g++ -E -P -DLANG_plv8 - > plv8.control
sed -e 's/#LANG_NAME#/plv8/g' plv8.sql.common | sed -e 's/#PLV8_VERSION#/2.3.15/g' | g++ -E -P -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -DLANG_plv8 - > plv8--2.3.15.sql
sed -e 's/#PLV8_VERSION#/2.3.15/g' plv8.control.common | g++ -E -P -DLANG_plcoffee - > plcoffee.control
sed -e 's/#LANG_NAME#/plcoffee/g' plv8.sql.common | sed -e 's/#PLV8_VERSION#/2.3.15/g' | g++ -E -P -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -DLANG_plcoffee - > plcoffee--2.3.15.sql
sed -e 's/#PLV8_VERSION#/2.3.15/g' plv8.control.common | g++ -E -P -DLANG_plls - > plls.control
sed -e 's/#LANG_NAME#/plls/g' plv8.sql.common | sed -e 's/#PLV8_VERSION#/2.3.15/g' | g++ -E -P -I. -I./ -I/usr/include/postgresql/9.6/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5 -DLANG_plls - > plls--2.3.15.sql
Nice.
Now I want to install.
Try this
sudo make install
But I get error:
sudo make install
cd build/v8 ; env CXXFLAGS=-fPIC CFLAGS=-fPIC ninja -C out.gn/x64.release d8
ninja: Entering directory `out.gn/x64.release'
[1/1] Regenerating ninja files
FAILED: build.ninja
/home/Downloads/plv8-2.3.15/build/v8/buildtools/linux64/gn --root=/home/alexei/Downloads/plv8-2.3.15/build/v8 -q --check gen .
/bin/sh: 1: /home/alexei/Downloads/plv8-2.3.15/build/v8/buildtools/linux64/gn: not found
ninja: error: rebuilding 'build.ninja': subcommand failed
make: *** [Makefile:42: v8] Error 1

Related

How to install perl Kafka::Connection on alpine image

I have a working UBUNTU image with this Dockerfile:
FROM perl:5.14
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y libgd-dev
RUN perl -MCPAN -e 'install (Try::Tiny)'
RUN perl -MCPAN -e 'install (Kafka::Connection)'
RUN perl -MCPAN -e 'install (YAML)'
RUN perl -MCPAN -e 'install (GD::Simple)'
RUN perl -MCPAN -e 'install (GD::Graph)'
RUN perl -MCPAN -e 'install (JSON)'
RUN perl -MCPAN -e 'install (JSON::MaybeXS)'
RUN perl -MCPAN -e 'install (HTTP::Request)'
RUN perl -MCPAN -e 'install (HTTP::Response)'
RUN perl -MCPAN -e 'install (HTTP::Daemon)'
COPY run.sh /run.sh
RUN chmod +x "/run.sh"
RUN mkdir -p /code_path
WORKDIR /code_path
CMD ["/run.sh"]
I'n trying to get a slimmer alpine version like this:
FROM alpine:3.10.3
## alpine curl and wget aren't fully compatible, so we install them
## here. gnupg is needed for Module::Signature.
RUN apk update && apk upgrade
RUN apk add curl tar make gcc build-base wget gnupg
RUN mkdir -p /usr/src/perl
WORKDIR /usr/src/perl
## from perl; `true make test_harness` because 3 tests fail
## some flags from http://git.alpinelinux.org/cgit/aports/tree/main/perl/APKBUILD?id=19b23f225d6e4f25330e13144c7bf6c01e624656
RUN curl -SLO https://www.cpan.org/src/5.0/perl-5.30.0.tar.gz \
&& echo 'aa5620fb5a4ca125257ae3f8a7e5d05269388856 *perl-5.30.0.tar.gz' | sha1sum -c - \
&& tar --strip-components=1 -xzf perl-5.30.0.tar.gz -C /usr/src/perl \
&& rm perl-5.30.0.tar.gz \
&& ./Configure -des \
-Duse64bitall \
-Dcccdlflags='-fPIC' \
-Dcccdlflags='-fPIC' \
-Dccdlflags='-rdynamic' \
-Dlocincpth=' ' \
-Duselargefiles \
-Dusethreads \
-Duseshrplib \
-Dd_semctl_semun \
-Dusenm \
&& make libperl.so \
&& make -j$(nproc) \
&& true TEST_JOBS=$(nproc) make test_harness \
&& make install \
&& curl -LO https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm \
&& chmod +x cpanm \
&& ./cpanm App::cpanminus \
&& rm -fr ./cpanm /root/.cpanm /usr/src/perl
## from tianon/perl
ENV PERL_CPANM_OPT --verbose --mirror https://cpan.metacpan.org --mirror-only
RUN cpanm Digest::SHA Module::Signature && rm -rf ~/.cpanm
ENV PERL_CPANM_OPT $PERL_CPANM_OPT --verify
RUN perl -MCPAN -e 'install (Try::Tiny)'
RUN perl -MCPAN -e 'install (Kafka::Connection)'
RUN perl -MCPAN -e 'install (YAML)'
RUN perl -MCPAN -e 'install (GD::Simple)'
RUN perl -MCPAN -e 'install (GD::Graph)'
RUN perl -MCPAN -e 'install (JSON)'
RUN perl -MCPAN -e 'install (JSON::MaybeXS)'
RUN perl -MCPAN -e 'install (HTTP::Request)'
RUN perl -MCPAN -e 'install (HTTP::Response)'
RUN perl -MCPAN -e 'install (HTTP::Daemon)'
COPY run.sh /run.sh
RUN chmod +x "/run.sh"
RUN mkdir -p /code_path
WORKDIR /code_path
CMD ["/run.sh"]
I keep getting this error
OS.c:18:10: fatal error: obstack.h: No such file or directory
#include <obstack.h> /* glibc's handy obstacks */
how do I get all the dependencies for Kafka on the image?
Alpine does not ship glibc, and obstack.h is not part of musl-dev.
Try alpine-pkg-glibc.
You could try grabbing obstack.h on Alpine by installing the newly available musl-obstack-dev package of the edge/testing repository:
apk add musl-obstack-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
Note that edge/testing packages are cutting edge and are considered experimental (as opposed to main stable package).
While Alpine (musl libc) is generally not glibc compatible, it does provide lightweight glibc compatibility in terms of convenience headers and libraries, particularly via the libc6-compat package, and packages as the aforementioned.
Tip: use Alpine's excellent package search for locating missing files. Alpine is vivid and active and sees new packages regularly. Most of the time you'll find that missing files are available in apk packages. Results for obstack.h package contents search:
https://pkgs.alpinelinux.org/contents?file=obstack.h&path=&name=&branch=edge
I eventually searched Github to find a newer alpine perl image and was greatly helped by valino's answer in arriving at this Dockerfile:
FROM alpine:3.10.3
## alpine curl and wget aren't fully compatible, so we install them
## here. gnupg is needed for Module::Signature.
RUN apk update && apk upgrade
RUN apk add --no-cache curl tar make gcc build-base wget gnupg ca-certificates g++ git gd-dev
RUN apk add --no-cache zlib zlib-dev
RUN apk add --no-cache perl perl-dev
RUN curl -L <check the link above "newer alpine perl image" for this line it was rejected> > /bin/cpanm && chmod +x /bin/cpanm
RUN cpanm App::cpm
WORKDIR /usr
RUN cpm install Try::Tiny
RUN cpm install YAML
RUN cpm install JSON
RUN cpm install JSON::MaybeXS
RUN cpm install HTTP::Request
RUN cpm install HTTP::Response
RUN cpm install HTTP::Daemon
RUN cpm install GD::Simple
RUN cpm install GD::Graph
RUN cpm install Data::HexDump::Range
RUN cpm install Proc::Daemon
RUN cpm install Test::Block
RUN cpm install Text::Colorizer
RUN cpm install Gzip::Faster
ENV PERL5LIB=/usr/local/lib/perl5
ENV PATH=/usr/local/bin:$PATH
RUN apk add --no-cache musl-obstack-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
RUN cpm install Proc::ProcessTable
RUN cpm install Kafka::Connection
COPY run.sh /run.sh
RUN chmod +x "/run.sh"
RUN mkdir -p /code_path
WORKDIR /code_path
CMD ["/run.sh"]

Running Mkbootstrap for DBI () => DBIXS.h:22:20: fatal error: EXTERN.h: No such file or directory

I try to install MHA node on a docker container based on Alpine. The container has perl, make and gcc via apk. :
RUN apk add --update perl make gcc
A prerequisite for MHA node is DBD::mysql. The command
perl -MCPAN -e 'install DBD::mysql'
results in the above given error. Google does know nothing about it.
The following commands, needed for MHA manager, do run fine, however:
perl -MCPAN -e "install Config::Tiny"
perl -MCPAN -e "install Log::Dispatch"
perl -MCPAN -e "install Parallel::ForkManager"
The problem obviously is related to DBI:
Running Mkbootstrap for DBI ()
chmod 644 "DBI.bs"
"/usr/bin/perl" -p -e "s/~DRIVER~/Perl/g" ./Driver.xst > Perl.xsi
"/usr/bin/perl" "/usr/share/perl5/core_perl/ExtUtils/xsubpp" -typemap "/usr/share/perl5/core_perl/ExtUtils/typemap" -typemap "typemap" Perl.xs > Perl.xsc && mv Perl.xsc Perl.c
cc -c -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fomit-frame-pointer -DVERSION=\"1.636\" -DXS_VERSION=\"1.636\" -fPIC "-I/usr/lib/perl5/core_perl/CORE" -W -Wall -Wpointer-arith -Wbad-function-cast -Wno-comment -Wno-sign-compare -Wno-cast-qual -Wmissing-noreturn -Wno-unused-parameter Perl.c
In file included from Perl.xs:7:0:
DBIXS.h:22:20: fatal error: EXTERN.h: No such file or directory
compilation terminated.
Makefile:625: recipe for target 'Perl.o' failed
make: *** [Perl.o] Error 1
TIMB/DBI-1.636.tar.gz
/usr/bin/make -- NOT OK
What can I do to resolve it?
Works with Ubuntu 14.04 after install make gcc
You need the libperl headers to be able to build certain modules, including DBI. On Alpine it looks like they are provided by the package perl-dev.
From http://www.perlmonks.org/bare/?node_id=486526
EXTERN.h is part of the perl C API which is needed for embedding the interpreter and building XS modules. The official perl distribution contains all these files, but many linux distributions don't bundle it as part of the base perl package (some even leave out a lot of core modules). There should be one or more additional packages for your distribution that supply the C API files. They're usually called "perl-dev" or something like it. (From googling, it looks like the mandrage package is "perl-devel-5.*.rpm")
So the solution looked like to add perl-dev to the apk add command, but this was not enough:
In file included from DBIXS.h:23:0,
from Perl.xs:7:
/usr/lib/perl5/core_perl/CORE/perl.h:699:23: fatal error: sys/types.h: No such file or directory
compilation terminated.
Makefile:628: recipe for target 'Perl.o' failed
Ok, some more googling resulted in addin musl-dev as well. Now that works:
FROM alpine
ENV MHA_NODE_VERSION=0.54 \
MHA_MANAGER_VERSION=0.55
COPY ./mha/* /tmp/
# mha4mysql-manager-0.55.tar.gz
# mha4mysql-node-0.54.tar.gz
RUN apk add --update perl perl-dev musl-dev make gcc \
&& perl -MCPAN -e 'install DBD::mysql' \
&& perl -MCPAN -e "install Config::Tiny" \
&& perl -MCPAN -e "install Log::Dispatch" \
&& perl -MCPAN -e "install Parallel::ForkManager" \
&& cd /tmp \
&& tar -zxf mha4mysql-node-${MHA_NODE_VERSION}.tar.gz \
&& cd mha4mysql-node-${MHA_NODE_VERSION}/ \
&& perl Makefile.PL \
&& make \
&& make install \
&& cd /tmp \
&& tar -zxf mha4mysql-manager-${MHA_MANAGER_VERSION}.tar.gz \
&& cd mha4mysql-manager-${MHA_MANAGER_VERSION}/ \
&& perl Makefile.PL \
&& make \
&& make install \
&& apk del make gcc musl-dev perl-dev \
&& rm -rf /var/cache/apk/*
ENTRYPOINT ["/usr/bin/perl", "-de0"]

how to build pipeline_kafka extension

i'm currently trying to compile the pipeline_kafka extension from Github to add it to my pipelinedb instance but i'm running in a problem neither i nor google seems to be able to solve.
when i execute make command i get the following error
stc#vm:~/pipeline_kafka$ make gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.6 -c -o pipeline_kafka.o pipeline_kafka.c pipeline_kafka.c:23:40: fatal error: catalog/pipeline_stream_fn.h: No such file or directory #include "catalog/pipeline_stream_fn.h" ^ compilation terminated. : recipe for target 'pipeline_kafka.o' failed make: *** [pipeline_kafka.o] Error 1
does anyone has an idea what to do? I'm running on debian 8.
Does anyone know why this extension is not part of pipelinedb anymore?
cheers and thanks in advance
the reason for the error is my entire approach towards using/installing pipelinedb and pipeline_kafka.
the following script worked for me on a standard Debian 8 installation. Maybe it helps.
Download and install PipelineDB
wget -O pipelinedb_install_package "https://www.pipelinedb.com/download/0.9.1/debian8"
sudo dpkg -i pipelinedb_install_package
mkdir ~/logs
pipeline-init -D ~/data/pipelinedb
pipeline-ctl -D ~/data/pipelinedb -l ~/logs/pipelinedb.log start
sleep 5.0
pipeline pipeline
Download and install pipeline_kafka extension
sudo apt-get install git gcc g++ zlib1g-dev
mkdir ~/git
git clone https://github.com/edenhill/librdkafka.git ~/git/librdkafka
git clone https://github.com/pipelinedb/pipeline_kafka.git >~/git/pipeline_kafka
cd ~/git/librdkafka
./configure --prefix=/usr
make
sudo make install
cd ~/git/pipeline_kafka
./configure
make
sudo make install
pipeline pipeline -c "CREATE EXTENSION pipeline_kafka;"
sed -i 's/#shared_preload_libraries/shared_preload_libraries/' ~/data/pipelinedb/pipelinedb.conf
sed -i "s/shared_preload_libraries = ''/shared_preload_libraries=pipeline_kafka/" ~/data/pipelinedb/pipelinedb.conf

How can I get pkg-config to work within eclipse juno (Mac OS X)?

I try to get gtkmm running within eclipse. This is my makefile (without the cleaning):
all : main.cpp
#export PATH+=/opt/local/bin;
#echo PATH=$(PATH);
g++ -v `pkg-config gtkmm-2.4 --cflags` \
-O0 -g3 -Wall -S \
-o main.o main.cpp;
g++ -v -o main.exe main.o \
`pkg-config gtkmm-2.4 \
--libs` ;
In the Console I get (amongst other output):
PATH=/usr/bin:/bin:/usr/sbin:/sbin
g++ -v `pkg-config gtkmm-2.4 --cflags` \
-O0 -g3 -Wall -S \
-o main.o main.cpp;
/bin/sh: pkg-config: command not found
I did:
ln -s /usr/bin/pkg-config /opt/local/bin/pkg-config
And when I type
/usr/bin/pkg-config
in Terminal, I get:
Must specify package names on the command line
So I assume pkg-config works in the "Terminal" ... But not in eclipse.
What can I do?
Thanks!
Nils
I don't know exactly what solved my Problem, since now, it works.
I guess it was one of the following:
makefile now looks like this:
all: main.cpp
g++ -v `pkg-config gtkmm-2.4 --cflags`-O0 -g3 -Wall -c -o main.o main.cpp;
g++ -v -o main.exe main.o `pkg-config gtkmm-2.4 --libs`
clean:
rm -f main.exe main.o
I have smybolic link towards pkg-config within /bin:
sudo ln -s /opt/local/bin/pkg-config /bin/pkg-config
I installed XQuartz
I updated MacPorts and all outdated ports:
sudo port -v selfupdate
sudo port upgrade outdated

"rpmbuild -bb package.spec" produces error: Package already exists: %package debuginfo

When i run the command rpmbuild -bb mypackage.spec, on centos, i get an error
error: Package already exists: %package debuginfo
following is part of the spec file:
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: gcc = 4.1.2
BuildRequires: make >= 3.81
BuildRequires: postgresql84-devel = 8.4.9
%description
ElementalCORE
%prep
%setup -qn pcore
%build
%{__make}
%install
mkdir -p %{_tmppath}/%{name}-%{version}-%{release}
mkdir -p %{name}
mkdir -p %{_bindir}
install -d %{name}
#This is to ensure that the BuildRoot will be created fresh during the %install section.
#mkdir -p %{buildroot}
#install -p -m 0755 $RPM_BUILD_ROOT/%{name}/obj/ggsnc/ggsnc %{_bindir}
%clean
%files
%defattr(-,root,root)
%doc NEWS
The problem is the %install in the comment. Replace it with %_install.