Giter VIP home page Giter VIP logo

Comments (9)

pykello avatar pykello commented on August 16, 2024 1

I have some questions:

  1. How did you install PostgreSQL?
  2. Can you try to see if PostgreSQL compiles & installs from source code? You can get 9.3.4 from http://www.postgresql.org/ftp/source/v9.3.4/
  3. If compiling & installing PostgreSQL was successful, does cstore_fdw compile with it?

One of my guesses is that if you used a package manager to install PostgreSQL, then it may have set some environmental variables and flags before compiling PostgreSQL, and so pg_config may contain configurations that don't work as it is.

If installing & compiling everything from source works, then this may give us some clues about how to solve the original problem.

from cstore_fdw.

pykello avatar pykello commented on August 16, 2024

Thanks for reporting this. We will look into this and follow up.

from cstore_fdw.

jasonmp85 avatar jasonmp85 commented on August 16, 2024

What version of OS X are you using? Can you give us more specifics about your installation?

from cstore_fdw.

Nasadows avatar Nasadows commented on August 16, 2024

I'm using OS X 10.9.2 (Mavericks)

I did everything as described at the bottom of the initial page (https://github.com/citusdata/cstore_fdw).

  1. install protobuf-c with macports via: sudo port install protobuf-c
  2. I added the path to my pg_config file to my PATH variable by changing the /etc/paths file using vi. But my pg_config file is NOT located at /usr/local/pgsql/bin/, it is located at /Library/PostgreSQL/9.3/bin/
  3. I changed into the directory were I saved the source code for the cstore (for me it's at documents) and I executed make.

Then I get the above error.

I guess it is, because all the libraries it is looking for is located in /usr/local/bin AND /opt/local/bin AND also /opt/local/include.

Do I have to place the source code into a special directory in my mac? Because I guess copying all the needed files from the just mentioned 3 folders should not be a satisfying solution.

Is this enough information for a start?

from cstore_fdw.

jasonmp85 avatar jasonmp85 commented on August 16, 2024

If you're new to the Mac and have no other reason to use MacPorts, I'd suggest trying Homebrew. It doesn't require sudo for normal operation and installs packages to /usr/local, which is already in the default paths used for compilation and linking.

Since MacPorts installs stuff to /opt/local, I'm going to guess that your problem is twofold: the compiler can't find the protobuf-c headers and the linker won't be able to find the protobuf libraries. I don't know what that sysroot jargon is about, so hopefully it's just a warning.

pg_config is actually an executable. You can run it yourself to see what it produces. The Makefile invokes it using pg_config --pgxs, which prints out a bunch of configuration information about your PostgreSQL install. So as long as your path includes the right pg_config (i.e. the one in the install of PostgreSQL you care about) then it should work.

For the MacPorts issue, it might be easiest in your case to just modify the Makefile. You'll want to modify these two lines to look like the following:

PG_CPPFLAGS = --std=c99 -I/opt/local/include
SHLIB_LINK = -L/opt/local/lib -lprotobuf-c

If that doesn't work, please paste the entire output from running make.

from cstore_fdw.

Nasadows avatar Nasadows commented on August 16, 2024

With only changing the two lines in the makefile. I still got the same error.

So I completely uninstalled MacPorts and Installed Homebrew. I also cleaned up all directories as suggested by brew doctor.

Then I ran:

brew install protobuf-c

with this result:

==> Installing protobuf-c dependency: protobuf
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/protobuf-2.
######################################################################## 100,0%
==> Pouring protobuf-2.5.0.mavericks.bottle.tar.gz
==> Caveats
Editor support and examples have been installed to:
/usr/local/Cellar/protobuf/2.5.0/share/doc/protobuf
==> Summary
🍺 /usr/local/Cellar/protobuf/2.5.0: 75 files, 6,2M
==> Installing protobuf-c
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/protobuf-c-
######################################################################## 100,0%
==> Pouring protobuf-c-0.15.mavericks.bottle.tar.gz
🍺 /usr/local/Cellar/protobuf-c/0.15: 12 files, 360K

Then I ran:

PATH=/Library/PostgreSQL/9.3/bin/:$PATH make

With this result:

protoc-c --c_out=. cstore.proto
gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -headerpad_max_install_names -arch i386 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv --std=c99 -I. -I. -I/Library/PostgreSQL/9.3/include/postgresql/server -I/Library/PostgreSQL/9.3/include/postgresql/internal -I/opt/local/20140109/include/libxml2 -I/usr/local/include/libxml2 -I/usr/local/include -c -o cstore.pb-c.o cstore.pb-c.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk'
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk'
clang: warning: argument unused during compilation: '-headerpad_max_install_names'
In file included from cstore.pb-c.c:8:
In file included from ./cstore.pb-c.h:6:
/usr/local/include/google/protobuf-c/protobuf-c.h:22:10: fatal error:
'assert.h' file not found
#include <assert.h>
^
1 error generated.
make: *** [cstore.pb-c.o] Error 1

So I still get the same error. Am I getting something wrong?

from cstore_fdw.

Nasadows avatar Nasadows commented on August 16, 2024

Yes, this solved all the problems. I uninstalled PostgreSQL, because I truly installed it before using a package manager. Now I compiled and installed PostgreSQL from source code and both, PostgreSQL and cstore_fdw, compiled successfully.

I will start trying them out to give some feedback, if now everything works fine.

Thanks for the great support.

from cstore_fdw.

Nasadows avatar Nasadows commented on August 16, 2024

Just for the sake of completeness: The example on the main page is running as described.

from cstore_fdw.

jasonmp85 avatar jasonmp85 commented on August 16, 2024

Great to hear!

from cstore_fdw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.