EnterpriseDB / mongo_fdw

PostgreSQL foreign data wrapper for MongoDB
GNU Lesser General Public License v3.0
326 stars 70 forks source link

Building on Ubuntu 16 in Virtualbox #102

Closed russormes closed 5 years ago

russormes commented 6 years ago

I struggled to get this to build and install on a vagrant provisioned Virtualbox instance running Ubuntu 16 (bento/ubuntu-16.04).

I got it working on postgres 10 on that box with the following actions: (for some reason I needed sudo to get permissions on directories, this should probably be fixed!):

$ git clone https://github.com/EnterpriseDB/mongo_fdw.git --recursive
$ sudo apt install pkg-config
$ cd mongo_fdw/
$ sudo ./autogen.sh --with-master
$ cd json-c/
$ sudo vim Makefile # EDIT:: CPPFLAGS = -fPIC
$ sudo make clean
$ sudo make install
$ cd .. # CWD mongo-fdw
$ sudo make install
$ sudo cp /usr/local/lib/lib* /usr/lib/

After following the install instructions in this repo's README I was getting an error when running make as in this issue #78. As I have to run as sudo I found it easier to just enter the json-c directory, set the CPPFLAGS value in the Makefile and then run make clean and make install again.

After that I found there was an issue with the extensions not finding files installed into /usr/local/lib and so I copied them across to get it working.

I do realise this is not a solution, just a work around, but maybe this can point others to the solution they require for Ubuntu 16.

andreasscherbaum commented 5 years ago

Closing this, as #78 is already fixed.