Trying to build nominatim 3.4.1 I get "fatal error: postgres.h: No such file or directory" - postgresql

I'm trying to install Nominatim 3.4.1 on Ubuntu 20.04 and PostgreSQL 12, so I'm following the official instructions from here, the issue is when I execute make, I have this error:
[ 79%] Built target osm2pgsql_lib
[ 79%] Built target osm2pgsql
[ 79%] Running external makefile /usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk
/srv/nominatim/Nominatim-3.4.0/module/Makefile:11: warning: overriding recipe for target 'install'
/usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk:241: warning: ignoring old recipe for target 'install'
/srv/nominatim/Nominatim-3.4.0/module/nominatim.c:1:10: fatal error: postgres.h: No such file or directory
1 | #include "postgres.h"
| ^~~~~~~~~~~~
compilation terminated.
make[3]: *** [<builtin>: nominatim.o] Error 1
make[2]: *** [module/CMakeFiles/nominatim_lib.dir/build.make:61: /srv/nominatim/Nominatim-3.4.0/module/dummy] Error 2
make[1]: *** [CMakeFiles/Makefile2:1908: module/CMakeFiles/nominatim_lib.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
first lines of nominatim.c file:
#include "postgres.h"
#include "fmgr.h"
I've tried find / -name "postgres.h" and find / -name "fmgr.h" and there is no such files.
I'm almost sure that the problem is that PostgreSQL 12 removed this files, changed the names or something similar, and Nominatim 3.1.4 are not aware of that change. I'd like not to downgrade PostgreSQL to solve this unless that is the only possible solution, also I don't know if a downgrade solve the issue.

on my case this got solved by reinstalling postgres sudo apt install postgresql-server-dev-12 postgresql-12-postgis-3 \ postgresql-contrib-12 postgresql-12-postgis-3-scripts

Related

Trying to install the mongodb extension (MacOS Big Sur)

When writing this command line
sudo C_INCLUDE_PATH=/usr/local/opt/openssl/include /Applications/XAMPP/xamppfiles/bin/pecl install mongodb
I get this error.
fatal error: 'unicode/usprep.h' file not found
#include <unicode/usprep.h>
^~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [src/libmongoc/src/libmongoc/src/mongoc/mongoc-scram.lo] Error 1
ERROR: `make' failed
It says something with the usprep.h, it took for me days to figure out in many different ways but unfortunately you guys may support me to solve it.

Kernel compilation fails due to PF_MAX > 44

I have a QEMU VM running an image of the Linux kernel 4.14.78.
On the host machine (a server with 96 cores), I am trying to compile a new update for the kernel with some changes I have made.
To make this process faster, I was using the host machine to compile for the target VM.
To do that I follow these steps:
copy the /boot/config-4.14.78 file from VM to host
put the copied file into the kernel source-code root directory, renaming it to .config in my
run make clean to clean it
run make menuconfig just to update the configs
run make -j$(nproc)
However, I am getting this error:
AS arch/x86/purgatory/setup-x86_64.o
CC arch/x86/purgatory/sha256.o
AS arch/x86/purgatory/entry64.o
CC arch/x86/purgatory/string.o
In file included from scripts/selinux/mdp/mdp.c:49:
./security/selinux/include/classmap.h:245:2: error: #error New address family defined, please update secclass_map.
245 | #error New address family defined, please update secclass_map.
| ^~~~~
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/mdp/mdp] Error 1
make[2]: *** [scripts/Makefile.build:587: scripts/selinux/mdp] Error 2
make[2]: *** Waiting for unfinished jobs....
In file included from scripts/selinux/genheaders/genheaders.c:19:
./security/selinux/include/classmap.h:245:2: error: #error New address family defined, please update secclass_map.
245 | #error New address family defined, please update secclass_map.
| ^~~~~
CHK scripts/mod/devicetable-offsets.h
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:587: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:587: scripts/selinux] Error 2
make[1]: *** Waiting for unfinished jobs....
I have checked what causes this, and turns out that it is because of the:
include/linux/socket.h:211:#define AF_MAX 44 /* For now.. */
include/linux/socket.h:260:#define PF_MAX AF_MAX
Then, I followed this solution to print out the definition of PF_MAX at preprocessing time, and turns out that the PF_MAX is 45:
In file included from scripts/selinux/mdp/mdp.c:49:
./security/selinux/include/classmap.h:247:9: note: #pragma message: 45
247 | #pragma message(STRING(PF_MAX))
| ^~~~~~~
./security/selinux/include/classmap.h:250:2: error: #error New address family defined, please update secclass_map.
250 | #error New address family defined, please update secclass_map.
| ^~~~~
This 45 makes no sense for me, because I just checked that it is supposed to be 44.
I wonder if the build is considering the host machine instead of the target?
P.S.: These steps works fine on my local machine, which is a 8-cores machine, look the kernel version:
uname -a
Linux campes-note 5.4.86 #1 SMP Fri Jan 1 16:26:25 -03 2021 x86_64 x86_64 x86_64 GNU/Linux
UPDATE 1:
I tried to compile the kernel without any of my changes, following th above steps mentioned, and it did not compile as well, I get the same error.
UPDATE 2:
I found out that somehow, the compilation is looking at the host /usr/src/linux-headers-x.x.x files.
Instead, it should point to the same version as the target.
For that, I tried to follow this tutorial but I did not success. I am having a problem in one of the steps stated on this tutorial.
(Gathered from the now removed comments)
I have tried myself to build myself v4.14.78 followed by the latest available v4.14.214. I have found that former fails while the latter builds. So, I have bisected down to v4.14.116 that first builds correctly. Then I simple looked into the changes and found commit 760f8522ce08 ("selinux: use kernel linux/socket.h for genheaders and mdp") in the Linux stable tree which fixes the issue.
You may try to cherry-pick it to your branch and compile again.

Having troubles installing ChezScheme-9.5.2 in Codeanywhere

Trying to install ChezScheme-9.5.2.tar.gz on Ubuntu 16.04 LTS on Codeanywhere. During sudo make command, get error message failed because uuid/uuid.h is missing. How do I get uuid/uuid.h in a location where $ sudo make can find it?
Turns out there were additional missing files, so did the following:
$ sudo apt install uuid-dev libncurses5-dev libncursesw5-dev libx11-dev
The make still fails, but not because of missing files. I believe the 512MB ram is too small.
In order to answer your question "What was your error message?" I've attempted to duplicate what happened. Think I've done so and here is the error message:
compiling cpnanopass.ss with output to cpnanopass.a6le
Mf-base:487: recipe for target 'bootall' failed
make[4]: *** [bootall] Killed
Mf-base:164: recipe for target 'allx' failed
make[3]: *** [allx] Error 2
Mf-base:181: recipe for target 'bootstrap' failed
make[2]: *** [bootstrap] Error 2
Makefile:20: recipe for target 'build' failed
make[1]: *** [build] Error 2
Makefile:19: recipe for target 'build' failed
make: *** [build] Error 2
cabox#Python_Lua:~/workspace/ChezScheme-9.5.2$
First, had to do '$ sudo apt-get install uuid-dev' because 'apt install' does something different than 'apt-get install', which got uuid.h installed.

Postgresql9.5alpha1 installation error

I tried to install postgresql 9.5(alpha) Ubuntu, but after make world I got this error:
In file included from ../../../../src/include/postgres.h:47:0,
from varlena.c:15:
levenshtein.c: In function ‘varstr_levenshtein’:
../../../../src/include/c.h:726:7: error: static assertion failed: "Levenshtein hinting mechanism restricts NAMEDATALEN"
do { _Static_assert(condition, errmessage); } while(0)
levenshtein.c:104:2: note: in expansion of macro ‘StaticAssertStmt’
StaticAssertStmt(NAMEDATALEN <= MAX_LEVENSHTEIN_STRLEN,
levenshtein.c: In function ‘varstr_levenshtein_less_equal’:
../../../../src/include/c.h:726:7: error: static assertion failed: "Levenshtein hinting mechanism restricts NAMEDATALEN"
do { _Static_assert(condition, errmessage); } while(0)
levenshtein.c:104:2: note: in expansion of macro ‘StaticAssertStmt’
StaticAssertStmt(NAMEDATALEN <= MAX_LEVENSHTEIN_STRLEN,
make[4]: *** [varlena.o] Error 1
make[3]: *** [adt-recursive] Error 2
make[2]: *** [utils-recursive] Error 2
make[1]: *** [all-backend-recurse] Error 2
make: *** [world-src-recurse] Error 2
Does anybody have a suggestion?
In ubuntu you can install latest on this moment postgresql 9.5alpha2 from my ppa by this series of command from terminal:
sudo apt-add repository ppa:kazan417/postgresql
sudo apt-get update
sudo apt-get install postgresql-9.5 postgresql-contrib-9.5 postgresql-client-9.5
This commands not just install postgresql also it setup evrything you need for running postgresql.
Also you can install additional packages. or if you want harder way compile it from source by "dpkg-buildpackage" - this is better ubuntu way of compiling. And then installing by dpkg -i .
Here link you can find more info like dsc file and orig.tar.gz for compiling.

installation of vmware workstation 10.0.1 on Centos 7

I am attempting to install VMware workstation 10.0.1 on a new installation of CEntOS version 7 (kernel version 3.10.0).
I have copied the vmnet.tar file from /lib/vmware/modules/source to my home directory for debugging. The building of the vmnet module fails with the following error message:
/bin/make -j12 auto-build HEADER_DIR=/lib/modules/3.10.0-123.el7.x86_64/build/include CC=/bin/gcc IS_GCC_3=no
Using 2.6.x kernel build system.
/bin/make -C /lib/modules/3.10.0-123.el7.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/kernels/3.10.0-123.el7.x86_64'
CC [M] /home/******/junk/vmnet-only/filter.o
/home/******/junk/vmnet-only/filter.c:206:1: error: conflicting types for ‘VNetFilterHookFn’
VNetFilterHookFn (unsigned int hooknum, // IN:
^
/home/******/junk/vmnet-only/filter.c:64:18: note: previous declaration of ‘VNetFilterHookFn’ was here
static nf_hookfn VNetFilterHookFn;
^
/home/******/junk/vmnet-only/filter.c:64:18: warning: ‘VNetFilterHookFn’ used but never defined [enabled by default]
/home/******/junk/vmnet-only/filter.c:206:1: warning: ‘VNetFilterHookFn’ defined but not used [-Wunused-function]
VNetFilterHookFn (unsigned int hooknum, // IN:
^
make[2]: *** [/home/******/junk/vmnet-only/filter.o] Error 1
make[1]: *** [_module_/home/******/junk/vmnet-only] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.0-123.el7.x86_64'
make: *** [vmnet.ko] Error 2
I've googled a bit, but I didn't find anything specific to WS 10.0.1, although I did find some patches for the installation of WS 10.0.3 but it appears that these patches would be ineffective for WS 10.0.1. I believe this because the macro that they are modifying in the patch (KERNEL_VERSION) is no in the offending file, filter.c.
Anyone have a link to a solution to this problem.
Thanks!
I had a similar problem. Found this solution and worked:
cd /usr/lib/vmware/modules/source
tar -xvf vmnet.tar
cd vmnet-only
vi filter.c
Go to lines 206 and 259 and replace the string
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
By
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
Then:
cd ..
tar -uvf vmnet.tar vmnet-only
rm -rf vmnet-only
Then run vmware workstation again and it should be able to install the kernel modules.
Good luck!
user3910091 has the right answer. This also works on 10.0.3 on RHEL7. The strange thing is that it appears they patched this in 10.0.3, but their patch uses >= and the filter options are in the opposite order, but the same minor kernel version changes appear to fix it.
cd /usr/lib/vmware/modules/source
tar -xvf vmnet.tar
cd vmnet-only
vi filter.c
Go to around lines 206 and 259 and replace the string
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
By
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)
Then:
cd ..
tar -uvf vmnet.tar vmnet-only
rm -rf vmnet-only
Then run /usr/bin/vmware again and it should be able to install the kernel modules.