eulerto / pg_similarity

set of functions and operators for executing similarity queries

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install the extension in rhel7 and postgres version is Postgres13.3

crbsram opened this issue · comments

Hi Team

I downloaded the file from the git and tried to execute the following command.
the PATH env looks like below:
$ echo $PATH
/usr/pgsql-13/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:
When I try to run make install I get the below error
Make Version is this
$ make --version
GNU Make 3.82
Built for x86_64-redhat-linux-gnu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
When I try ti install by giving the command
$ make install
Makefile:21: ../../src/Makefile.global: No such file or directory
Makefile:22: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.
I am getting the above error.
Please let me know am I missing anything.

HI All

Following are the steps that were followed to resolve the problem.
Note: These steps are only applicable to rhel 7.0 to rhel 7.5 and postgres version 13.3

By default the gcc compiler would have been installed. So there is no need to install gcc.
start running the below command
yum install llvm-toolset-7

After running this command you should see the below set of lines
Resolving Dependencies
--> Running transaction check
---> Package llvm-toolset-7.x86_64 0:5.0.1-4.el7 will be installed
--> Processing Dependency: llvm-toolset-7-clang = 5.0.1 for package: llvm-toolset-7-5.0.1-4.el7.x86_64
--> Processing Dependency: llvm-toolset-7-lldb = 5.0.1 for package: llvm-toolset-7-5.0.1-4.el7.x86_64
--> Processing Dependency: llvm-toolset-7-llvm = 5.0.1 for package: llvm-toolset-7-5.0.1-4.el7.x86_64
--> Processing Dependency: llvm-toolset-7-python-lit for package: llvm-toolset-7-5.0.1-4.el7.x86_64
--> Processing Dependency: llvm-toolset-7-runtime for package: llvm-toolset-7-5.0.1-4.el7.x86_64
--> Running transaction check
---> Package llvm-toolset-7-clang.x86_64 0:5.0.1-4.el7 will be installed
--> Processing Dependency: llvm-toolset-7-clang-libs(x86-64) = 5.0.1-4.el7 for package: llvm-toolset-7-clang-5.0.1-4.el7.x86_64
--> Processing Dependency: libLLVM-5.0.so(LLVM_5.0)(64bit) for package: llvm-toolset-7-clang-5.0.1-4.el7.x86_64
--> Processing Dependency: libLLVM-5.0.so()(64bit) for package: llvm-toolset-7-clang-5.0.1-4.el7.x86_64
---> Package llvm-toolset-7-lldb.x86_64 0:5.0.1-4.el7 will be installed
---> Package llvm-toolset-7-llvm.x86_64 0:5.0.1-8.el7 will be installed
---> Package llvm-toolset-7-python2-lit.noarch 0:0.5.1-1.el7 will be installed
---> Package llvm-toolset-7-runtime.x86_64 0:5.0.1-4.el7 will be installed
--> Running transaction check
---> Package llvm-toolset-7-clang-libs.x86_64 0:5.0.1-4.el7 will be installed
--> Processing Dependency: llvm-toolset-7-compiler-rt(x86-64) >= 5.0.1 for package: llvm-toolset-7-clang-libs-5.0.1-4.el7.x86_64
--> Processing Dependency: llvm-toolset-7-libomp(x86-64) >= 5.0.1 for package: llvm-toolset-7-clang-libs-5.0.1-4.el7.x86_64
--> Processing Dependency: devtoolset-7-gcc-c++ for package: llvm-toolset-7-clang-libs-5.0.1-4.el7.x86_64
--> Processing Dependency: devtoolset-7-libstdc++-devel for package: llvm-toolset-7-clang-libs-5.0.1-4.el7.x86_64
---> Package llvm-toolset-7-llvm-libs.x86_64 0:5.0.1-8.el7 will be installed
--> Running transaction check
---> Package devtoolset-7-gcc-c++.x86_64 0:7.3.1-5.16.el7 will be installed
--> Processing Dependency: devtoolset-7-gcc = 7.3.1-5.16.el7 for package: devtoolset-7-gcc-c++-7.3.1-5.16.el7.x86_64
--> Processing Dependency: devtoolset-7-runtime for package: devtoolset-7-gcc-c++-7.3.1-5.16.el7.x86_64
---> Package devtoolset-7-libstdc++-devel.x86_64 0:7.3.1-5.16.el7 will be installed
---> Package llvm-toolset-7-compiler-rt.x86_64 0:5.0.1-2.el7 will be installed
---> Package llvm-toolset-7-libomp.x86_64 0:5.0.1-2.el7 will be installed
--> Running transaction check
---> Package devtoolset-7-gcc.x86_64 0:7.3.1-5.16.el7 will be installed
--> Processing Dependency: devtoolset-7-binutils >= 2.22.52.0.1 for package: devtoolset-7-gcc-7.3.1-5.16.el7.x86_64
---> Package devtoolset-7-runtime.x86_64 0:7.1-4.el7 will be installed
--> Running transaction check
---> Package devtoolset-7-binutils.x86_64 0:2.28-11.el7 will be installed
--> Finished Dependency Resolution

In case in your corporate environment yum install doesn't work please download the respective dependencies from the rpm repository and try running command with yum localinstall.

Once these are installed you should install the other libraries like shown below:

Execute the below command:
yum localinstall libedit-devel-3.0-12.20121213cvs.el7.x86_64.rpm llvm5.0-devel-5.0.1-7.el7.x86_64.rpm llvm5.0-5.0.1-7.el7.x86_64.rpm llvm5.0-libs-5.0.1-7.el7.x86_64.rpm

(download these .rpm files from the rpm repositories. even though my computer was connected to internet somehow it was not available in the yum repository of redhat, hence i had to download these rpm and use the yum localinstall to install)

Once it is installed execute the below command
yum localinstall postgresql13-13.3-1PGDG.rhel7.x86_64.rpm postgresql13-contrib-13.3-1PGDG.rhel7.x86_64.rpm postgresql13-devel-13.3-1PGDG.rhel7.x86_64.rpm postgresql13-libs-13.3-1PGDG.rhel7.x86_64.rpm postgresql13-llvmjit-13.3-1PGDG.rhel7.x86_64.rpm

This should install without any problem.

In case if any dependency error comes up please download the relevant libraries. In my case I had to download the few rpm files like
libicu-devel-50.2-4.el7_7.x86_64.rpm
libicu-50.2-4.el7_7.x86_64.rpm
ncurses-devel.x86_64 0:5.9-14.20130511.el7_4

Once these dependencies resolved postgres installed successfully.

after that i went to the directory by issuing below command
cd /usr/pgsql-13/share/contrib/
after that below command executed
git clone https://github.com/eulerto/pg_similarity.git
this created the directory pg_similarity.
In case this command doesn't work in corporate environment try setting up the HTTP_PROXY or try downloading the file in your local and move the same to the above mentioned path.
execute below command
cd pg_similarity
now run the below commands

make
make install
this should install the relevant libraries
now login to psql.
and connect to your database and create extension pg_similarity.

Before running make command please set your PATH environment variable as shown below:

export PATH=/usr/pgsql-13/bin:$PATH
export PATH=/usr/pgsql-13/lib:$PATH

Note: Team please keep this in the read me section. This will help the other engineers and research students who wants to use the extension.
Thanks
C.R.Bala