Обсуждение: Problem installing extensions on Lion

Поиск
Список
Период
Сортировка

Problem installing extensions on Lion

От
Stefan Schwarzer
Дата:
Hi there,

I upgraded my machine from Snow Leopard to Lion, and ran, as usual, into some Postgres update problems.

I used Kyngchaos libraries for all frameworks and Postgres. Now, I'd like to install the tablefunc/crosstab function.

But the "make" process gives me this:

cd contrib/tablefunc
tablefunc $ make
gcc -Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv  -I. -I. -I/usr/local/pgsql-9.1/include/server -I/usr/local/pgsql-9.1/include/internal -I/usr/include/libxml2  -c -o tablefunc.o tablefunc.c
In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
                 from tablefunc.c:33:
/usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
/usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
/usr/local/pgsql-9.1/include/server/c.h:69:20: error: string.h: No such file or directory


I have a similar issue with the compilation of the Postgis lib.

Thanks a lot for any tip!

Stefan

Re: Problem installing extensions on Lion

От
Craig Ringer
Дата:
On 06/12/2012 08:21 PM, Stefan Schwarzer wrote:
Hi there,

I upgraded my machine from Snow Leopard to Lion, and ran, as usual, into some Postgres update problems.

I used Kyngchaos libraries for all frameworks and Postgres. Now, I'd like to install the tablefunc/crosstab function.

But the "make" process gives me this:

Looks like your dev env is broken or incomplete.

--
Craig Ringer

Re: Problem installing extensions on Lion

От
Stefan Schwarzer
Дата:
>> I upgraded my machine from Snow Leopard to Lion, and ran, as usual, into some Postgres update problems.
>>
>> I used Kyngchaos libraries for all frameworks and Postgres. Now, I'd like to install the tablefunc/crosstab
function.
>>
>> But the "make" process gives me this:
>
> Looks like your dev env is broken or incomplete.

Thanks for that. But what does that mean more exactly? What can I do about it?

Thanks for any hints!

Re: Problem installing extensions on Lion

От
Stefan Schwarzer
Дата:
> In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
>                  from tablefunc.c:33:
> /usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
> /usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
> /usr/local/pgsql-9.1/include/server/c.h:69:20: error: string.h: No such file or directory


Still trying to figure it out. I did a complete fresh install of Lion. Added Xcode too.

After looking around, it seems that the problem is arising from Xcode 4.3+ not being installed anymore under
"/Developer/..."but " /Applications/Xcode.app". 

I found a website [1] stating that the solution would be to use something like this:

       "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/"

But I have still the same problem… Can anyone give me a hint what I should do? Uninstall Xcode and install just a
stand-alonecompiler?  

Thanks for any help. I am really stuck!

Stef

[1] http://blog.bitemyapp.com/2012/03/20/fix-fs-events-stdio.h-not-found.html

Re: Problem installing extensions on Lion

От
Adrian Klaver
Дата:
On 06/14/2012 04:47 AM, Stefan Schwarzer wrote:
>> In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
>>                   from tablefunc.c:33:
>> /usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
>> /usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
>> /usr/local/pgsql-9.1/include/server/c.h:69:20: error: string.h: No such file or directory

1) Do the above files actually exist in the above location?

2)  If they do not exist there, do they exist anywhere on the machine?

3) How was Postgres installed?

>
>
> Still trying to figure it out. I did a complete fresh install of Lion. Added Xcode too.
>
> After looking around, it seems that the problem is arising from Xcode 4.3+ not being installed anymore under
"/Developer/..."but " /Applications/Xcode.app". 
>
> I found a website [1] stating that the solution would be to use something like this:
>
>         "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/"
>
> But I have still the same problem… Can anyone give me a hint what I should do? Uninstall Xcode and install just a
stand-alonecompiler? 
>
> Thanks for any help. I am really stuck!
>
> Stef
>
> [1] http://blog.bitemyapp.com/2012/03/20/fix-fs-events-stdio.h-not-found.html


--
Adrian Klaver
adrian.klaver@gmail.com

Re: Problem installing extensions on Lion

От
Stefan Schwarzer
Дата:
On Jun 14, 2012, at 3:32 PM, Adrian Klaver wrote:

> On 06/14/2012 04:47 AM, Stefan Schwarzer wrote:
>>> In file included from /usr/local/pgsql-9.1/include/server/postgres.h:47,
>>>                  from tablefunc.c:33:
>>> /usr/local/pgsql-9.1/include/server/c.h:67:19: error: stdio.h: No such file or directory
>>> /usr/local/pgsql-9.1/include/server/c.h:68:20: error: stdlib.h: No such file or directory
>>> /usr/local/pgsql-9.1/include/server/c.h:69:20: error: string.h: No such file or directory
>
> 1) Do the above files actually exist in the above location?

Yes, the c.h exist in the mentioned location. However, as it does not indicate where it looks for the stdio.h, perhaps
theproblem lies there. I can see that file in several places in 

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/...

and in

/usr/include/c++/4.2.1/tr1/stdio.h
/usr/include/stdio.h


> 2)  If they do not exist there, do they exist anywhere on the machine?
>
> 3) How was Postgres installed?

Postgres was installed using the Kyngchaos libraries.

Re: Problem installing extensions on Lion

От
Alban Hertroys
Дата:
On 12 June 2012 14:21, Stefan Schwarzer <stefan.schwarzer@unep.org> wrote:
> But the "make" process gives me this:
>
> cd contrib/tablefunc
> tablefunc $ make
> gcc -Os -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk

I think that's where it looks for the standard C headers?
In that case that's what you need to change. Or you can create a
symlink that points gcc to the new location.

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.

Re: Problem installing extensions on Lion

От
Tom Lane
Дата:
Stefan Schwarzer <stefan.schwarzer@unep.org> writes:
> On Jun 14, 2012, at 3:32 PM, Adrian Klaver wrote:
>> 1) Do the above files actually exist in the above location?

> Yes, the c.h exist in the mentioned location. However, as it does not indicate where it looks for the stdio.h,
perhapsthe problem lies there. 

Indeed.  Where did you get the advice to use "-isysroot
/Developer/SDKs/MacOSX10.6.sdk"?  According to the gcc manual,
that means

     Use DIR as the logical root directory for headers and libraries.
     For example, if the compiler would normally search for headers in
     `/usr/include' and libraries in `/usr/lib', it will instead search
     `DIR/usr/include' and `DIR/usr/lib'.

So basically, that breaks every attempt to use a standard header from
/usr/include, unless the SDK has provided a substitute, which evidently
it mostly doesn't.

[ pokes around on own Mac... ]  Hmm, for me the file
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdio.h
does exist with reasonably sane-looking contents.  So maybe your problem
is a broken SDK installation.

            regards, tom lane

Re: Problem installing extensions on Lion

От
Stefan Schwarzer
Дата:
>>> 1) Do the above files actually exist in the above location?
>
>> Yes, the c.h exist in the mentioned location. However, as it does not indicate where it looks for the stdio.h,
perhapsthe problem lies there. 
>
> Indeed.  Where did you get the advice to use "-isysroot
> /Developer/SDKs/MacOSX10.6.sdk"?  According to the gcc manual,
> that means
>
>     Use DIR as the logical root directory for headers and libraries.
>     For example, if the compiler would normally search for headers in
>     `/usr/include' and libraries in `/usr/lib', it will instead search
>     `DIR/usr/include' and `DIR/usr/lib'.
>
> So basically, that breaks every attempt to use a standard header from
> /usr/include, unless the SDK has provided a substitute, which evidently
> it mostly doesn't.
>
> [ pokes around on own Mac... ]  Hmm, for me the file
> /Developer/SDKs/MacOSX10.6.sdk/usr/include/stdio.h
> does exist with reasonably sane-looking contents.  So maybe your problem
> is a broken SDK installation.

Just as an information: It's really the Xcode which is placed now in /Applications, instead of /Developer. I copied
overmy older version of Xcode to the /Developer directory, and the compilation worked fine...