PostgreSQL Installation through source code. [all-src-recurse] Error 2 - postgresql

I am new to PostgreSQL. I am trying to install Postgres through source code. If I use some prebuilt binaries I am getting some dependency bugs. So I am using source code installation. While running the second step of Postgres installation i.e. make command I am getting these errors.
make[4]: *** [spgtextproc.o] Error 1
make[4]: Leaving directory `/usr/postgresql-9.5.10/src/backend/access/spgist'
make[3]: *** [spgist-recursive] Error 2
make[3]: Leaving directory `/usr/postgresql-9.5.10/src/backend/access'
make[2]: *** [access-recursive] Error 2
make[2]: Leaving directory `/usr/postgresql-9.5.10/src/backend'
make[1]: *** [all-backend-recurse] Error 2
make[1]: Leaving directory `/usr/postgresql-9.5.10/src'
make: *** [all-src-recurse] Error 2

Using sudo make install fixed the error for me

try these steps
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

While running the below command, I thought that src refers to the src directory(src) inside Postgres. And ran prefix to link it
./configure --prefix ~/postgres-12.0/src/
Here source refers to the directory where Postgres needs to be installed not the Postgres src directory.
Running the command like below solved it.
mkdir ~/any_directory
./configure --prefix ~/any_directory/

Related

Unit memcached.service not found on Ubunto 20.04 when installing memcached

I'm trying to follow these instructions on Vultr for Ubuntu 20.04 to install memcached, however when I get to the step sudo make install, the output is:
make all-recursive
make[1]: Entering directory '/root/memcached-1.6.17'
Making all in doc
make[2]: Entering directory '/root/memcached-1.6.17/doc'
make all-am
make[3]: Entering directory '/root/memcached-1.6.17/doc'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/memcached-1.6.17/doc'
make[2]: Leaving directory '/root/memcached-1.6.17/doc'
make[2]: Entering directory '/root/memcached-1.6.17'
make[2]: Leaving directory '/root/memcached-1.6.17'
make[1]: Leaving directory '/root/memcached-1.6.17'
root#plesk:~/memcached-1.6.17# ./memcached --version
memcached 1.6.17
root#plesk:~/memcached-1.6.17# sudo make install
make install-recursive
make[1]: Entering directory '/root/memcached-1.6.17'
Making install in doc
make[2]: Entering directory '/root/memcached-1.6.17/doc'
make install-am
make[3]: Entering directory '/root/memcached-1.6.17/doc'
make[4]: Entering directory '/root/memcached-1.6.17/doc'
make[4]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/local/memcached/share/man/man1'
/usr/bin/install -c -m 644 memcached.1 '/usr/local/memcached/share/man/man1'
make[4]: Leaving directory '/root/memcached-1.6.17/doc'
make[3]: Leaving directory '/root/memcached-1.6.17/doc'
make[2]: Leaving directory '/root/memcached-1.6.17/doc'
make[2]: Entering directory '/root/memcached-1.6.17'
make[3]: Entering directory '/root/memcached-1.6.17'
/usr/bin/mkdir -p '/usr/local/memcached/bin'
/usr/bin/install -c memcached '/usr/local/memcached/bin'
/usr/bin/mkdir -p '/usr/local/memcached/include/memcached'
/usr/bin/install -c -m 644 protocol_binary.h xxhash.h '/usr/local/memcached/include/memcached'
make[3]: Leaving directory '/root/memcached-1.6.17'
make[2]: Leaving directory '/root/memcached-1.6.17'
make[1]: Leaving directory '/root/memcached-1.6.17'
And then attempting to start memcached with:
sudo systemctl start memcached
results in Failed to start memcached.service: Unit memcached.service not found.
What am I missing here?
(Also Vultr instructs "Test if Memcached is active and running on TCP port 11211" by running netstat -tulpn | grep :11211--when I first tried to do this, I had to install netstat, but running this command does nothing.)
Since you installed memcached from source, you will need to run the binary directly from the command line to start the service.
/usr/local/memcached/bin/memcached -d -m 64 -l 127.0.0.1 -p 11211

Netbeans Msys2 make Cygwin1.dll issue

I'm using Netbeans 11 and MSYS2 MINGW64 G++.
Here's a screenshot of my toolchains:
When I try to run a simple Hello World c++ I get the following errors:
0 [main] cppapplication_2_cygwin_try (19728) D:\Program-Workspaces\netbean
s11\CppApplication_2_Cygwin_Try\dist\Debug\MinGW_2-Windows\cppapplication_2_cygw
in_try.exe: *** fatal error - cygheap base mismatch detected - 0x180343408/0x180
347408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
In other cases like when using the CLANG++ compiler, everything compiles well with the make.exe.
Could someone help on this please?
Thanks.
EDIT: Adding the NB11 messages:
cd 'D:\Program-Workspaces\netbeans11\CppApplication_2_Cygwin_Try'
D:\Programs\msys64\usr\bin\make.exe -f Makefile CONF=Debug
"/D/Programs/msys64/usr/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
"/D/Programs/msys64/usr/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_2-Windows/cppapplication_2_cygwin_try.exe
make[2]: Entering directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
mkdir -p build/Debug/MinGW_2-Windows
rm -f "build/Debug/MinGW_2-Windows/main.o.d"
g++ -std=c++2a -c -g -MMD -MP -MF "build/Debug/MinGW_2-Windows/main.o.d" -o build/Debug/MinGW_2-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW_2-Windows
g++ -std=c++2a -o dist/Debug/MinGW_2-Windows/cppapplication_2_cygwin_try build/Debug/MinGW_2-Windows/main.o
make[2]: Leaving directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
make[1]: Leaving directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
BUILD SUCCESSFUL (total time: 17s)
cd 'D:\Program-Workspaces\netbeans11\CppApplication_2_Cygwin_Try'
D:\Programs\msys64\usr\bin\make.exe -f Makefile CONF=Debug
"/D/Programs/msys64/usr/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
"/D/Programs/msys64/usr/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW_2-Windows/cppapplication_2_cygwin_try.exe
make[2]: Entering directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
make[2]: 'dist/Debug/MinGW_2-Windows/cppapplication_2_cygwin_try.exe' is up to date.
make[2]: Leaving directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
make[1]: Leaving directory '/d/Program-Workspaces/netbeans11/CppApplication_2_Cygwin_Try'
BUILD SUCCESSFUL (total time: 3s)
0 [main] cppapplication_2_cygwin_try (17884) D:\Program-Workspaces\netbean
s11\CppApplication_2_Cygwin_Try\dist\Debug\MinGW_2-Windows\cppapplication_2_cygw
in_try.exe: *** fatal error - cygheap base mismatch detected - 0x180343408/0x180
347408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
RUN FAILED (exit value 127, total time: 1s)

Problems with LTTng-modules-2.8 on RaspberryPi

I'm using a RaspberryPi Zero W with Raspbian 4.9.80+ and I'm trying to install LTTng-modules-2.8 but when I type these commands
wget http://lttng.org/files/lttng-modules/lttng-modules-latest-
2.8.tar.bz2 &&
tar -xf lttng-modules-latest-2.8.tar.bz2 &&
cd lttng-modules-2.8.* &&
make &&
sudo make modules_install &&
sudo depmod -a
I receive this (after typing the command "make"):
make -C /lib/modules/4.9.80+/build M=/home/pi/lttng-modules-2.8.7
CONFIG_LTTNG=m
CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules
make[1]: *** /lib/modules/4.9.80+/build: No such file or directory. Stop.
Makefile:110: receipe for target 'modules' failed
make: *** [modules] Error 2
I downloaded the modules correctly but it seems that they are not there; how can I solve this problem?
Thanks, Ivan.
You need the kernel headers to build modules, according to raspbian's documentation they are provided by the raspberrypi-kernel-headers, you can install it with this command :
sudo apt-get install raspberrypi-kernel-headers
And then run the make commands.

Installing older versions of Emacs (19.34)

I am having some trouble installing an older version of emacs (19.34) to run an old script. Currently, I have downloaded the source code and tried to compile but I am getting some error which I don't seem to understand (there are some previous errors with line endings too, but they can be fixed).
I am first running the ./configure script, then running
gmake && gmake install
I am getting this error
Producing `src/paths.h' from `src/paths.in'.
src/paths.h is unchanged
Producing `src/paths.h' from `src/paths.in'.
src/paths.h is unchanged
cd lib-src; gmake all \
CC='gcc' CFLAGS='-g -O' CPPFLAGS='' \
LDFLAGS='' MAKE='gmake'
gmake[1]: Entering directory `/user/b/user1/emacs-19.34/lib-src'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/user/b/user1/emacs-19.34/lib-src'
cd src; gmake all \
CC='gcc' CFLAGS='-g -O' CPPFLAGS='' \
LDFLAGS='' MAKE='gmake'
gmake[1]: Entering directory `/user/b/user1/emacs-19.34/src'
cd ../lwlib/; gmake -w
gmake[2]: Entering directory `/user/b/user1/emacs-19.34/lwlib'
gmake[2]: Nothing to be done for `all'.
gmake[2]: Leaving directory `/user/b/user1/emacs-19.34/lwlib'
CC='gcc' CFLAGS='-g -O' MAKE='gmake'
"C_SWITCH_X_SITE=-I/usr/openwin/include"
/bin/sh: C_SWITCH_X_SITE=-I/usr/openwin/include: not found
gmake[1]: *** [really-lwlib] Error 1
gmake[1]: Leaving directory `/user/b/user1/emacs-19.34/src'
gmake: *** [src] Error 2
I have checked that /usr/openwin/include is present in the server, and have manually added /usr/openwin/include to PATH and LD_LIBRARY_PATH. Somehow, the Makefile is not picking it up.
The server config is SunOS 5.10, Generic January 2005. I do not have sudo access, but I have manually set the install path to my local home directory.
Any suggestions?
Thanks in advance!
Edit: Any suggestions that I could install Emacs 19.34 on the server without installing from source would be helpful too.
Where are the double quotes around this line coming from?
"C_SWITCH_X_SITE=-I/usr/openwin/include"
It looks like /bin/sh is complaining about this entire line "not found", rather than setting an environment variable as that line seems to be intended to do.
If this line is not something you set yourself, then trying a different shell (SHELL=/usr/local/bin/bash gmake for example) might work.

Netbeans fortran build fails on Mac OS 10.8, cannot see gfortran file

I'm trying to get Netbeans up and running so I can start a Fortran project. I've downloaded the binaries and installed the plugins to the best of my knowledge. When I try to compile my hello world I get this error:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/convection
mkdir -p build/Debug/GNU-MacOSX
gfortran -c -g -o build/Debug/GNU-MacOSX/main.o main.f
gfortran: error trying to exec 'f951': execvp: No such file or directory
make[2]: *** [build/Debug/GNU-MacOSX/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 111ms)
Any thoughts?
EDIT: I'm using Mac OSX 10.8.5
EDIT 2: I've been messing around for awhile now and now the error is slightly different:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/convection
mkdir -p build/Debug/GNU-MacOSX
gfortran -c -g -o build/Debug/GNU-MacOSX/main.o main.f
make[2]: gfortran: No such file or directory
make[2]: *** [build/Debug/GNU-MacOSX/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 127ms)
EDIT 3: And just for fun, here is the output from a successful build that I was able to do in Ubuntu:
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/hannah/NetBeansProjects/test'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/test
make[2]: Entering directory `/home/hannah/NetBeansProjects/test'
make[2]: `dist/Debug/GNU-Linux-x86/test' is up to date.
make[2]: Leaving directory `/home/hannah/NetBeansProjects/test'
make[1]: Leaving directory `/home/hannah/NetBeansProjects/test'
BUILD SUCCESSFUL (total time: 92ms)
I had the same problem on 10.9. I needed to make a new gfortran link in my /usr/bin (Base directory). After that it worked fine. If I had it in usr/local/bin,..or any other path it didn't work.
Here is a link to someone else's solution to this problem. gfortran is unable to find f951.
http://ubuntuforums.org/showthread.php?t=1164394
I think I found the solution here: http://eftrunk.blogspot.com/2011/11/how-to-fix-error-trying-to-exec-f951.html
Will report back if it works or not.