Install pg_trgm on postgres 9.4.24 - greenplum

I'm trying to use the similarity function on a Greemplum system using postgres 9.4.24 version.
The Greenplum System is running on a CentOS 7 cluster (CentOS Linux release 7.9.2009 (Core))
I've managed to install the postgresql-contrib package by running this:
sudo yum install postgresql-contrib.x86_64
However, when I run this command on a DB:
create extension pg_trgm();
I get the following:;
SQL Error [58P01]: ERROR: could not open extension control file "/usr/local/greenplum-db-6.13.0/share/postgresql/extension/pg_trgm.control": No such file or directory
I looked in the directory and the pg_trgm.control wasn't there but I was expecting it since I installed the contrib package.
Is there anything I missed?
I found the contrib repository for Greenplum and downloaded the code here:
https://github.com/greenplum-db/gpdb/tree/master
which includes the contrib directory with all the extensions..
however, when I try to make && make install, I get an error:
[gpadmin#mdw pg_trgm]$ sudo make
Makefile:22: ../../src/Makefile.global: No such file or directory
Makefile:23: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.
Looking at the directory structure and files, Makefile.global doesn't exists and contrib-global.mk does but not sure if the path is correct, I can try changing the path in the Makefile but not sure.
These are the contents of the Makefile file:
# contrib/pg_trgm/Makefile
MODULE_big = pg_trgm
OBJS = trgm_op.o trgm_gist.o trgm_gin.o trgm_regexp.o $(WIN32RES)
EXTENSION = pg_trgm
DATA = pg_trgm--1.3--1.4.sql \
pg_trgm--1.3.sql pg_trgm--1.2--1.3.sql pg_trgm--1.1--1.2.sql \
pg_trgm--1.0--1.1.sql pg_trgm--unpackaged--1.0.sql
PGFILEDESC = "pg_trgm - trigram matching"
REGRESS = pg_trgm pg_word_trgm pg_strict_word_trgm
REGRESS_OPTS += --init-file=$(top_srcdir)/src/test/regress/init_file
ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
else
subdir = contrib/pg_trgm
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
include $(top_srcdir)/contrib/contrib-global.mk
endif
I have checked out the code in my /tmp folder and it created the structure under /tmp/gpdb
UPDATE:
I did follow Bradford suggestions and was able to compile and install, however, I'm getting this when I run:
create extension pg_trgm;
ERROR: could not open extension control file "/usr/local/greenplum-db-6.13.0/share/postgresql/extension/pg_trgm.control": No such file or directory (seg57 172.28.8.8:6001 pid=146663)
I did run manually once I ran the make and make install:
/usr/bin/install -c -m 755 pg_trgm.so '/usr/local/greenplum-db-6.13.0/lib/postgresql/pg_trgm.so'
/usr/bin/install -c -m 644 pg_trgm.control '/usr/local/greenplum-db-6.13.0/share/postgresql/extension/'
/usr/bin/install -c -m 644 pg_trgm--1.1.sql pg_trgm--1.0--1.1.sql pg_trgm--unpackaged--1.0.sql '/usr/local/greenplum-db-6.13.0/share/postgresql/extension/'
I can see the .control file in there so not sure what's going on, it seems it was copied only to the master but not the segment hosts, would that be an issue? Do I need to compile this on every segment host?
UPDATE:
I did install on each segment and now I'm getting this:
SQL Error [0A000]: ERROR: query plan with multiple segworker groups is not supported
Hint: likely caused by a function that reads or modifies data in a distributed table
would this extension not be supported by greenplum?

At a high level, you will want to download the source for the release of GPDB that you are running. You can do this either by downloading the tarball from the GitHub release page or cloning the repository and checking-out the release tag.
Once you have done that, source greenplum_path.sh from your installation of GPDB, change into the the contrib/pg_trgm directory and run
USE_PGXS=true make
USE_PGXS=true make install
Setting USE_PGXS will pull in the missing Makefiles from the installation of GPDB.
If the install location of GPDB is not owned by gpadmin user, then the make install will fail for permission issues; using sudo make install will most likely fail because pg_config won't be found on the path. In that case, I just run make -n install and then manually run the commands prefixed with sudo.
Here are all the steps in a psuedo-shell session:
git clone https://github.com/greenplum-db/gpdb.git
cd gpdb
# use git checkout 6.13.0 for older versions of git
git switch --detach 6.13.0
git submodule update --init --recursive
source /usr/local/greenplum-db-6.13.0/greenplum_path.sh
cd contrib/pg_trgm
USE_PGXS=true make
USE_PGXS=true make -n install
Edit: I should clarify that I haven't tested if pg_trgm works with GPDB, only that it builds and compiles.

Related

Building Linux perf from source: how to modify the install directory?

I am following this wiki page to build perf from source as below:
PYTHON=python3 make -C tools/perf install
where ~/bin will be the default build directory.
How can I change the build directory to let's say ~/bin/test? I already have another perf build in ~/bin, and I want to have the new build in a different directory.
I have tried to modify the Makefile (if that is how to do it), but I could not figure it out.
One last silly question: Can I just move my current perf build to another directory or it will screw up its links?
You should be able to easily install into a different directory by specifying prefix=... or DESTDIR=... when running make. You will see this and other info if you run make -C tools/perf help:
$ make -C tools/perf help
...
Perf install targets:
NOTE: documentation build requires asciidoc, xmlto packages to be installed
HINT: use "prefix" or "DESTDIR" to install to a particular
path like "make prefix=/usr/local install install-doc"
install - install compiled binaries
...
Make sure to pass an absolute path to avoid problems (you can use realpath for that):
PYTHON=python3 make -C tools/perf prefix=$(realpath ~/bin/test) install

config.status: error: cannot find input file: `po/Makefile.in.in'

I hit this error message while trying to build gnote using GNU Autotools.
I had first run:
$ git clean -xf # to clean the tree of untracked files, then
$ autoreconf # to create the script named `configure`, and finally
$ ./configure # to check my system, and create Makefiles from their templates
Neither po/Makefile.in.in nor po/Makefile.in exist in the source tree that I downloaded.
Yet configure needs to make this po/Makefile, as called for in the root Makefile.am in this line:
SUBDIRS = data src po help
Where do I get, or how do I make, po/Makefile.in.in?
Like all Gnome related packages, gnote uses many steps of buildsystem setup beyond just running autoreconf.
The autogen.sh script gnote comes with should run all the required steps to set up the buildsystem.
As usual, run the autogen.sh script with the --help parameter if you want to call configure separately.
po/Makefile.in.in is created by running intltoolize from the intltool package. It needs to be run from the project tree's root directory.
There isn't much documentation on intltoolize that I could find except for the brief man page, but it's source code says that that it's a fork of an older utility called libtoolize, and it's a relatively short script.
(BTW, if you don't already have intltoolize installed, you can figure out which package installs it, with this: sudo apt-file find intltoolize.)
*.in files are templates used by AutoMake to create a Makefile.
.in.in is a soft link to /usr/share/intltool/Makefile.in.in.

cp: cannot stat ‘build/docker/gotools/bin/protoc-gen-go’: No such file or directory

I try to build hyperledger fabric, and have installed the project as the guide in http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup/#option-1-vagrant-development-environment.
When I try to 'make peer', command is shown as:
vagrant#ubuntu-1404:/opt/gopath/src/github.com/hyperledger/fabric/devenv$
cp: cannot stat 'build/docker/gotools/bin/protoc-gen-go': No such file
or directory
I looked into the folder and didn't find the file protoc-gen-go. Does it indicate that I missed few steps when I was setting up the envrionment?
Step 1: Run
$go get -u github.com/golang/protobuf/protoc-gen-go
Download protoc-gen-go
Step 2: cp
$ cp $GOPATH/bin/protoc-gen-go build/docker/gotools/bin/
Then continue your make.
You can find the file protoc-gen-go in path: $GOPATH/bin, then copy this file to $GOPATH/src/github.com/hyperledger/fabric/build/docker/gotools/bin/.
If all things has done, you can run: make peer and it will work.
I had a same problem. Maybe your GOPATH and GOROOT variables are conflicted with your customized paths.
I solved the problem like this:
Delete /usr/lib/go
Delete /usr/local/go
Download protoc-gen-go ($go get -u github.com/golang/protobuf/protoc-gen-go)
protoc-gen-go binary is created at your go workspace
copy the protoc-gen-go binary to fabric/build/docker/gotools/bin/
BUILD AS make peer
I hope this would helpful to you
Can you try to:
cd /opt/gopath/src/github.com/hyperledger/fabric/
make peer
and see if it works? Looks like you are in the devenv subdir.
I had the same issue when Docker was returning permissions issues causing the build to fail.
Once that happens, the build process won't work successfully even after you fix the Docker issues.
Instead, once Docker is repaired, delete the gotools folder and run make again:
Makefile:245: recipe for target 'build/docker/gotools' failed
make: *** [build/docker/gotools] Error 126
user#:~/go/src/github.com/hyperledger/fabric$ rm -rf build/docker/gotools/
user#:~/go/src/github.com/hyperledger/fabric$ make all

GNU Octave: Build a package from a directory instead of a tarball

I currently developing an interface for a library as a GNU Octave package. Normally packages in GNU Octave are installed via
pkg install tarball_of_the_package.tar.gz
But compressing the package for each test is more or less time consuming. Now my question is if it is possible to call somehow the pkg install mechanism from a directory which has a valid package structure like in the tarball? Running
pkg install .
from inside this directory yields an error:
unpack: FILETYPE must be "gunzip" for a directory
Even specifying the whole path as
pkg install /path/to/the/package/source
results in the same problem.
At the moment I am using GNU Octave 4.0.0 for my developments.
What most packages have is a Makefile at the root of the package with targets such as install that will handle that for you. See for example the Makefile for the statistics package which allow you to do:
$ hg clone http://hg.code.sf.net/p/octave/statistics
destination directory: statistics
requesting all changes
adding changesets
adding manifests
adding file changes
added 401 changesets with 996 changes to 172 files
updating to branch default
133 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ cd statistics/
$ make install
Creating package version 1.2.4 release ...
rm -rf "statistics-1.2.4"
hg archive --exclude ".hg*" --exclude "Makefile" --type files "statistics-1.2.4"
chmod -R a+rX,u+w,go-w "statistics-1.2.4"
tar cf - --posix "statistics-1.2.4" | gzip -9n > "statistics-1.2.4.tar.gz"
Installing package locally ...
octave --silent --eval 'pkg ("install", "statistics-1.2.4.tar.gz")'
For information about changes from previous versions of the statistics package, run 'news statistics'.
And of course, there's nothing stopping you from calling make install from the Octave session itself. The statistics package example is nicer because it only has m files. If your package also has code to be compiled, the image package has a more complex, but not by much, Makefile for that.

make *** no targets specified and no makefile found. stop

I have a problem installing package dionaea.
After I type this:
./configure --with-lcfg-include=/opt/dionaea/include/ \
--with-lcfg-lib=/opt/dionaea/lib/ \
--with-python=/opt/dionaea/bin/python3.1 \
--with-cython-dir=/usr/bin \
--with-udns-include=/opt/dionaea/include/ \
--with-udns-lib=/opt/dionaea/lib/ \
--with-emu-include=/opt/dionaea/include/ \
--with-emu-lib=/opt/dionaea/lib/ \
--with-gc-include=/usr/include/gc \
--with-ev-include=/opt/dionaea/include \
--with-ev-lib=/opt/dionaea/lib \
--with-nl-include=/opt/dionaea/include \
--with-nl-lib=/opt/dionaea/lib/ \
--with-curl-config=/opt/dionaea/bin/ \
--with-pcap-include=/opt/dionaea/include \
--with-pcap-lib=/opt/dionaea/lib/ \
--with-glib=/opt/dionaea
and the next step is:
#make
An error message appears:
make: *** No targets specified and no makefile found. Stop.
My directory is /usr/local/src
make takes a makefile as input. Makefile usually is named makefile or Makefile. The configure command should generate a makefile, so that make could be in turn executed. Check if a makefile has been generated under your working directory.
running ./configure should solve your problem.
I got the same error and i fixed it by looking at the solution from this site:
http://trac.macports.org/ticket/40476.
SO did you got any error after running './configure' ? Maybe something about lacking tclConfig.sh.
If so, instead of running './configure', you have to search for the tclConfigure.sh first and then put it in the command, in my case, its located in /usr/lib/. And then run:
'./configure ----with-tcl=/usr/lib --with-tclinclude=/usr/include'
./configure command should generate a makefile, named makefile or Makefile. if in the directory there is no this file, you should check whether the configure command execute success.
in my case, I configure the apr-util:
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
because the --with-apr=/usr/local/apr/bin/apr-1-config, the apr did not install yet, so there configure fail, there did not generate the apr's /usr/local/apr/bin/apr-1-config.
So I install the apr, then configure the apr-util, it works.
You had to have something like this:
"configure: error: "Error: libcrypto required."
after your ./configure runs. So you need to resolve noticed dependencies first and then try ./configure once more time and then run make !
I recently ran into this problem while trying to do a manual install of texane's open-source STLink utility on Ubuntu. The solution was, oddly enough,
make clean
make
If after ./configure Makefile.in and Makefile.am are generated and make fail (by showing this following make: *** No targets specified and no makefile found. Stop.) so there is something not configured well, to solve it, first run "autoconf" commande to solve wrong configuration then re-run "./configure" commande and finally "make"
Delete your source tree that was gunzipped or gzipped and extracted to folder and reextract again. Supply your options again
./configure --with-option=/path/etc ...
Then if all libs are present, your make should succeed.
This may happen if there is any read and write permission denial to the user. Like C:\Windows\System32\ have restricted access and you are cloned and trying to make from such restricted directory.
If you create Makefile in the VSCode, your makefile doesnt run. I don't know the cause of this issue. Maybe the configuration of the file is not added to system. But I solved this way. delete created makefile, then go to project directory and right click mouse later create a file and named Makefile. After fill the Makefile and run it. It will work.
Try
make clean
./configure --with-option=/path/etc
make && make install
In my case there was a file Makefile.PL in a database library:
http://www.cpan.org/modules/by-module/DBI/DBI-1.630.tar.gz
The following command created the makefile
perl Makefile.PL
After that, make command worked
I think that it can mean that ./configure command failed for some reason, in my case it was due to a missing package. So i have used my OS package manager to install required package (autoconf and autoconf-archive in my case), then it worked.
first time try
make clean
make
if these didn't solve your issue you have to install build packages.
debian base
apt-get install build-essential libgtk-3-dev
For RHEL/CentOS
sudo yum install gcc glibc glibc-common gd gd-devel -y
Step 1: Install the Required Dependencies
First, launch the Terminal and run the commands below to install the required dependencies and libraries.
sudo apt install autoconf automake libpcre3-dev libnl-3-dev libsqlite3-dev libssl-dev ethtool build-essential g++ libnl-genl-3-dev libgcrypt20-dev libtool python3-distutils
sudo apt install -y pkg-config
Step 2: Compile and Install
Now, run the commands below (one by one in order) to compile the source code and install Your Repo on your system.
[Before this enter you directory ex: cd folder_name]
sudo autoreconf -i
sudo ./configure --with-experimental --with-ext-scripts
sudo make
sudo make install
I hope this time problem will be solved.
You need to check the output of the configure command.
Mine contained this error:
configure: error: in `/home/ubuntu/build/php-8.0.19':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Then I googled the error and solved it.
Before running "make" you need to configure your build using "CMake"
Try:
cmake .
Creating Makefile in the VScode did not worked for me. So, delete the make file created in the VS code, go to the project directory and create file add all the commands in it and name it as Makefile and save. Then try to execute it in VS code. It will work. Don't know why it doesn't work with VS code.
Unpack the source from a working directory and cd into the file directory as root. Use the commands ./configure then make and make install

Resources