[GRASS-user] error compiling GRASS "checking for pj_get_def in -lproj... no"

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.
punkish@Lucknow ~/Projects/grass-6.4.0RC5$

Here is what I have

punkish@Lucknow /usr/local/lib$ll libpro*
-rwxr-xr-x 1 root wheel 302492 Mar 10 11:04 libproj.0.5.5.dylib*
lrwxr-xr-x 1 root wheel 19 Mar 10 11:04 libproj.0.dylib@ ->
libproj.0.5.5.dylib
-rw-r--r-- 1 root wheel 1141944 Mar 10 11:04 libproj.a
lrwxr-xr-x 1 root wheel 19 Mar 10 11:04 libproj.dylib@ ->
libproj.0.5.5.dylib
-rwxr-xr-x 1 root wheel 831 Mar 10 11:04 libproj.la*

punkish@Lucknow /usr/local/lib$nm libproj.dylib | grep 'pj_get_def'
00027210 T _pj_get_def

To summarize, I have PROJ.4 4.6.1 installed correctly, and working
well with other programs such as MapServer and PostGIS. My libproj has
that specific symbol that GRASS configure seems unable to find. I have
seen a few references to this error around on lists, but no definitive
remedy.

Any suggestions anyone?

--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science

Sent from Madison, WI, United States

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Markus

On Thu, Sep 3, 2009 at 2:23 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Thanks Markus. This is what I have

punkish@Lucknow ~/Projects/grass-6.4.0RC5$tail -20 config.log
configure:7025: checking for location of External PROJ.4 library
configure:7050: checking for pj_get_def in -lproj
configure:7067: gcc -o conftest -arch x86_64 -Os -L/usr/local/lib
-arch x86_64 -arch x86_64 conftest.c -lproj 1>&5
ld warning: in /usr/local/lib/libproj.dylib, file is not of required
architecture
Undefined symbols:
  "_pj_get_def", referenced from:
      _main in ccjErGbn.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 7056 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char pj_get_def();

int main() {
pj_get_def()
; return 0; }

--
Puneet Kishor

On Thu, Sep 3, 2009 at 9:27 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 2:23 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Thanks Markus. This is what I have

punkish@Lucknow ~/Projects/grass-6.4.0RC5$tail -20 config.log
configure:7025: checking for location of External PROJ.4 library
configure:7050: checking for pj_get_def in -lproj
configure:7067: gcc -o conftest -arch x86_64 -Os -L/usr/local/lib
-arch x86_64 -arch x86_64 conftest.c -lproj 1>&5
ld warning: in /usr/local/lib/libproj.dylib, file is not of required
architecture

This will be the problem: "file is not of required architecture"

I have no clue about MacOSX, though. On Linux, it would be
a 32bit/64bit mixture...

Markus

Undefined symbols:
"_pj_get_def", referenced from:
_main in ccjErGbn.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 7056 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pj_get_def();

int main() {
pj_get_def()
; return 0; }

--
Puneet Kishor

On Thu, Sep 3, 2009 at 3:04 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 9:27 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 2:23 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Thanks Markus. This is what I have

punkish@Lucknow ~/Projects/grass-6.4.0RC5$tail -20 config.log
configure:7025: checking for location of External PROJ.4 library
configure:7050: checking for pj_get_def in -lproj
configure:7067: gcc -o conftest -arch x86_64 -Os -L/usr/local/lib
-arch x86_64 -arch x86_64 conftest.c -lproj 1>&5
ld warning: in /usr/local/lib/libproj.dylib, file is not of required
architecture

This will be the problem: "file is not of required architecture"

I compiled PROJ.4 with the standard instructions, nothing fancy at
all. It has worked fine with MapServer, PostGIS, GDAL and GEOS
installations so far. GRASS is the only one choking up with the "file
is not of required architecture" message, so I am loath to tinker with
what works with 4 other programs just so it can possibly work with one
other program, and possibly break the other four.

could it be because I first did the following

export CFLAGS="-arch x86_64 -Os"
export CXXFLAGS="-arch x86_64 -Os"

I will try again without those flags and report back.

I have no clue about MacOSX, though. On Linux, it would be
a 32bit/64bit mixture...

Markus

Undefined symbols:
"_pj_get_def", referenced from:
_main in ccjErGbn.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 7056 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pj_get_def();

int main() {
pj_get_def()
; return 0; }

On Thu, Sep 3, 2009 at 3:09 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 3:04 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 9:27 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 2:23 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Thanks Markus. This is what I have

punkish@Lucknow ~/Projects/grass-6.4.0RC5$tail -20 config.log
configure:7025: checking for location of External PROJ.4 library
configure:7050: checking for pj_get_def in -lproj
configure:7067: gcc -o conftest -arch x86_64 -Os -L/usr/local/lib
-arch x86_64 -arch x86_64 conftest.c -lproj 1>&5
ld warning: in /usr/local/lib/libproj.dylib, file is not of required
architecture

This will be the problem: "file is not of required architecture"

I compiled PROJ.4 with the standard instructions, nothing fancy at
all. It has worked fine with MapServer, PostGIS, GDAL and GEOS
installations so far. GRASS is the only one choking up with the "file
is not of required architecture" message, so I am loath to tinker with
what works with 4 other programs just so it can possibly work with one
other program, and possibly break the other four.

could it be because I first did the following

export CFLAGS="-arch x86_64 -Os"
export CXXFLAGS="-arch x86_64 -Os"

I will try again without those flags and report back.

Ok. Results of a quick test... unsetting those CFLAGS and CXXFLAGS did
the trick. Of course, then configure got hung up on readline
(history), so I had to configure it without-readline. Now it is
make-ing.

I have no clue about MacOSX, though. On Linux, it would be
a 32bit/64bit mixture...

Markus

Undefined symbols:
"_pj_get_def", referenced from:
_main in ccjErGbn.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
configure: failed program was:
#line 7056 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char pj_get_def();

int main() {
pj_get_def()
; return 0; }

--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science

Sent from Madison, WI, United States

On Thu, Sep 3, 2009 at 10:09 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 3:04 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 9:27 PM, P Kishor<punk.kish@gmail.com> wrote:

On Thu, Sep 3, 2009 at 2:23 PM, Markus Neteler<neteler@osgeo.org> wrote:

On Thu, Sep 3, 2009 at 2:58 PM, P Kishor<punk.kish@gmail.com> wrote:

I am trying to compile GRASS on Mac OS X. For now, configure is
failing to find libproj correctly. Here is what I get

punkish@Lucknow ~/Projects/grass-6.4.0RC5$ ./configure \
--with-proj-includes=/usr/local/include \
--with-proj-libs=/usr/local/lib \
--with-proj-share=/usr/local/share/proj \
..
checking for location of External PROJ.4 includes... /usr/local/include
checking for proj_api.h... yes
checking External PROJ.4 version... 461
checking for location of External PROJ.4 library... /usr/local/lib
checking for pj_get_def in -lproj... no
configure: error: *** Unable to locate External PROJ.4 library.

In config.log (at bottom) some details should be shown why the
pj_get_def test fails.

Thanks Markus. This is what I have

punkish@Lucknow ~/Projects/grass-6.4.0RC5$tail -20 config.log
configure:7025: checking for location of External PROJ.4 library
configure:7050: checking for pj_get_def in -lproj
configure:7067: gcc -o conftest -arch x86_64 -Os -L/usr/local/lib
-arch x86_64 -arch x86_64 conftest.c -lproj 1>&5
ld warning: in /usr/local/lib/libproj.dylib, file is not of required
architecture

This will be the problem: "file is not of required architecture"

I compiled PROJ.4 with the standard instructions, nothing fancy at
all. It has worked fine with MapServer, PostGIS, GDAL and GEOS
installations so far. GRASS is the only one choking up with the "file
is not of required architecture" message, so I am loath to tinker with
what works with 4 other programs just so it can possibly work with one
other program, and possibly break the other four.

could it be because I first did the following

export CFLAGS="-arch x86_64 -Os"
export CXXFLAGS="-arch x86_64 -Os"

I will try again without those flags and report back.

They are apparently wrong: In you last mail I saw

../dist.i386-apple-darwin9.8.0/

I have no clue about MacOSX, though. On Linux, it would be
a 32bit/64bit mixture...

so this applies also here: You seem tro try to build 64bit GRASS
with (partially?) 32bit libraries.

Please don't mix...

Markus