Error installing postgis with brew - postgresql

I'm having problems installing postgis using brew. I'm getting the following error(s):
==> Checking out http://svn.osgeo.org/postgis/trunk/
==> ./autogen.sh
==> ./configure --with-projdir=/usr/local --with-jsondir=/usr/local/opt/json-c --with-pgconfig=/usr/local/Cella
==> make
/bin/sh ../../libtool --mode=link clang -g -O2 -fno-common -DPIC -Wall -Wmissing-prototypes -I../rt_core -I../../liblwgeom -I/usr/local/include -I/usr/local/Cellar/gdal/1.11.1_3/include -I/usr/local/Cellar/geos/3.4.2/include ../rt_core/librtcore.a raster2pgsql.o ../../liblwgeom/liblwgeom.la -L/usr/local/Cellar/gdal/1.11.1_3/lib -lgdal -L/usr/local/Cellar/geos/3.4.2/lib -lgeos_c -liconv -lm -o raster2pgsql
libtool: link: cannot find the library `/usr/local/lib/libgeos_c.la' or unhandled argument `/usr/local/lib/libgeos_c.la'
make[2]: *** [raster2pgsql] Error 1
make[1]: *** [rtloader] Error 2
make: *** [all] Error 1
READ THIS: http://git.io/brew-troubleshooting
These open issues may also help:
Postgis sql files not found (https://github.com/Homebrew/homebrew/issues/26604)
I have looked at the suggested issues with no luck. I have also tried to remove and reinstall postgres. Has anyone experienced similar issue and found a solution?
The /usr/local/lib/libgeos_c.la is not ins this location. I have also tried reinstalling gdal and geos using brew.

Postgres.app comes with Postgis baked in. The Postgis folks even recommend it as the best way to get postgis on your mac. http://postgis.net/install/

Related

fatal error: 'google/protobuf/compiler/plugin.h' file not found

I'm compiling a Google protobuf plugin from these sources.
I've installed protobuf#2.5 with the homebrew command:
brew install protobuf#2.5
After installation I get the following error when trying to compile by calling make:
Richards-Mac-mini:protobuf-objc-arc richard$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src/compiler
g++ -DHAVE_CONFIG_H -I. -I../.. -g -O2 -DNDEBUG -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
main.cc:17:10: fatal error: 'google/protobuf/compiler/plugin.h' file not found
#include <google/protobuf/compiler/plugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [main.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
In particular, this line is interesting:
fatal error: 'google/protobuf/compiler/plugin.h' file not found
While I definitely able to go to this path and find the plugin.h file:
/usr/local/Cellar/protobuf#2.5/2.5.0/include/google/protobuf/compiler/plugin.h
Looks, like the library is not linked correctly with the binary and the issue is somehow related to the correct path.
When I try to issue a command which protoc, I get:
/usr/local/opt/protobuf#2.5/bin/protoc
protoc --version leads to the following output, which is expected.
libprotoc 2.5.0
Fixed by issuing the following commands:
brew link --force --overwrite protobuf250
Output:
Linking /usr/local/Cellar/protobuf#2.5/2.5.0... 14 symlinks created
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/protobuf#2.5/bin:$PATH"' >> ~/.bash_profile
And then:
echo 'export PATH="/usr/local/opt/protobuf#2.5/bin:$PATH"' >>
~/.bash_profile
After successful linking I was able to compile the Objective-C plugin without errors.

sslscan.c:94:25: fatal error: openssl/err.h: No such file or directory compilation terminated. #163

I am need to install sslscan tool for ssl scanning (from here) in ubuntu virtual machine (virtualbox).
Following their installation instructions provided here, I installed openssl-chacha from here. Note that I am aware that this fork of openssl contains weak cipehrs (I use the tool and openssl for testing-scanning purposes not real application).
Then, after installing the above openssl, the first thing I did is executing: make. Note that it is unclear to me when to use these commands that he sslscan mentioned here (I did not execute them). But I want to use the chacha version of openssl:
apt-get install build-essential git zlib1g-dev
apt-get build-dep openssl
make static
When I try to run the command: make I get this error:
make: git: Command not found
cc -o sslscan -Wall -Wformat=2 -Wformat-security -pie -z relro -z now -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl -DVERSION=\"1.11.11\" sslscan.c -lssl -lcrypto -ldl
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:91: recipe for target 'sslscan' failed
make: *** [sslscan] Error 1
I am in this directory: /home/myuser/Downloads/sslscan-master
I made sure that openssl in:
/usr/local/ssl
Can you please point to me what is missing? I am not familiar with Linux system (Windows user) but I prefer to use the tool in Linux. So I will appreciate your help and patience.
make: git: Command not found
So start by installing the git command:
apt-get install git
(or maybe git-core)

End of file/pseudo-op errors compiling MongoDB with SSL

I'm currently using MongoDB on Ubuntu 13.10 x64 with the replica set functionality across 3 sites and have gotten to the stage where I need to enable SSL. This requires compiling it myself and sadly I have no prior experience of this which is causing me some headaches.
I'm trying to compile r2.4.9 following the procedure outlined here: http://www.mongodb.org/about/tutorial/build-mongodb-on-linux/
I have installed a ton of packages based on what I found scouring the web for related articles:
git-core build-essential scons devscripts lintian dh-make libpcre3 libpcre3-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libpcap-dev libreadline-dev libssl-dev rng-tools
I also changed the SConstruct file to remove the CCFLAG -Werror to stop it failing immediately with so many [-Werror=unused-local-typedefs] as mentioned in this question.
The compilation process seems to get quite far but always fails at the same file dbclient_rs.cpp:
g++ -o build/linux2/ssl/mongo/client/dbclient_rs.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -fno-builtin-memcmp -O3 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_SSL -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/linux2/ssl/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/ssl/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/ssl/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/ssl -Isrc -Ibuild/linux2/ssl/mongo -Isrc/mongo -Ibuild/linux2/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/ssl/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/ssl/third_party/v8/include -Isrc/third_party/v8/include src/mongo/client/dbclient_rs.cpp
(warning spam removed)
{standard input}: Assembler messages:
{standard input}:73382: Warning: end of file not at end of a line; newline inserted
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
scons: *** [build/linux2/ssl/mongo/client/dbclient_rs.o] Error 4
scons: building terminated because of errors.
Note: I've also seen pseudo-op errors in the same place, but they were replaced by the above error when I removed the CCFLAG -w in favour of removing Werror instead.
Also just noticed when it starts up and does its checks the line Checking for C library rt... no - could this be a problem?
g++ version is 4.8.1, scons version is 2.3.0
Am I doing something unbelievably stupid here?
Many thanks.
Ok after more searching I found the an explanation of the problem here.
Seems to be related to not having enough RAM for the compilation process. I was running on a 512MB VPS. Worked fine after upgrading to 4GB (also removed the -pipe CCFLAG as suggested).

Scons in Mongodb

When i run scons --ssl all, it throws an error:
g++ -o build/linux2/release/ssl/mongo/util/net/ssl_manager.o -c
-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wno-unknown-pragmas -Winvalid-pch -pipe -fno-builtin-memcmp -O3 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_SSL -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -DNETSNMP_NO_INLINE -Ibuild/linux2/release/ssl/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/release/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/release/ssl/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/release/ssl/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/release/ssl -Isrc -Ibuild/linux2/release/ssl/mongo -Isrc/mongo -Ibuild/linux2/release/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/release/ssl/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/release/ssl/third_party/v8/include -Isrc/third_party/v8/include src/mongo/util/net/ssl_manager.cpp
src/mongo/util/net/ssl_manager.cpp: In member function 'void
mongo::SSLManager::_setupFIPS()':
src/mongo/util/net/ssl_manager.cpp:187: error: 'FIPS_mode_set' was not
declared in this scope scons: *
[build/linux2/release/ssl/mongo/util/net/ssl_manager.o] Error 1 scons:
building terminated because of errors.
How to fix this issue. Using Ubuntu 12.04
To address this error make sure that you have a version of OpenSSL installed that defines FIPS_mode_set. Some versions of 0.9.8 for example don't. Upgrading to 1.0.1 should address.
If you are already on 1.0.1 make sure that correct OpenSSL headers and libraries are being used by scons. You can set explicitly by adding the include and lib paths as a command line arguments, as follows:
scons --ssl --cpppath /usr/local/openssl/1.0.1e/include --libpath /usr/local/openssl/1.0.1e/lib all
Where the paths provided are the actual paths of your OpenSSL include and libraries.
For those who have the same issue with OSX on Mac. Here is what you need to include:
scons --ssl --cpppath=/usr/local/opt/openssl/include --libpath=/usr/local/opt/openssl/lib all
assuming you've downloaded openssl with brew
brew install openssl

XML::Parser refusing to install

I've been trying to install XML::Simple on Ubuntu 12.10 for the past two hours or so and have officially run out of ideas. It's failing at the XML::Parser.
I've done an
sudo apt-get install expat
and it still did not work. Here's the error I've been getting:
make[1]: Entering directory `/home/<user>/.cpan/build/XML-Parser-2.41-MCLo7T/Expat'
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
/usr/bin/perl /usr/share/perl/5.14.2/ExtUtils/xsubpp -noprototypes -typemap /usr/share /perl/5.14/ExtUtils/typemap -typemap typemap Expat.xs > Expat.xsc && mv Expat.xsc Expat.c
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"2.41\" -DXS_VERSION=\"2.41\" -fPIC "-I/usr/lib/perl/5.14/CORE" Expat.c
Expat.xs:12:19: fatal error: expat.h: No such file or directory
compilation terminated.
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/home/sclarawu/.cpan/build/XML-Parser-2.41-MCLo7T/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Seems to be telling me that it's unable to find expat.h, but I'm not sure why or how, considering expat is installed? I tried to apt expat-devel, but it appears not to be a package in apt. Any ideas would be greatly appreciated. :)
EDIT: I seemed to have been simply trying to install the wrong package. -.- It's always the little things. Much thanks to those who answered!
Another way to get to the same information which #Moritz Bunkus has pointed out above.
ubuntu:~$ apt-cache search expat
expat - XML parsing C library - example application
libexpat1 - XML parsing C library - runtime library
libexpat1-dev - XML parsing C library - development kit
The third one in the result set is what you are looking for.
Adding to the other answers, here's how to install the expat dependency on CentOS/RHEL:
yum install expat-devel
You need to install the Expat library and its development headers. For DebUbuntu this means libexpat1-dev as well as those distros often split their libraries into two packages: one for the runtime components (shared libraries, data files, general documentation), one for the development components (static libraries, header files, development documentation).
Just in case, using Debian Jessie I had to install libexpat1-dev by executing apt-get install libexpat1-dev
I only managed to install it by downloading it from cpan and manually editing the Makefile.pl inside to correctly pointing to the EXPATLIBPATH and EXPATINCPATH.
See this post for more detailed instructions.