[GRASS-dev] compiling vdigit in wxPython

I got farther trying to compile vdigit today. Unfortunately, it still isn’t quite there.

First, here is the configure script I used. It configured without error.

./configure --with-freetype --with-freetype-includes=“/Library/Frameworks/FreeType.framework/unix/include/freetype2 /Library/Frameworks/FreeType.framework/unix/include” --with-freetype-libs=/Library/Frameworks/FreeType.framework/unix/lib --with-gdal=/Library/Frameworks/GDAL.framework/Programs/gdal-config --with-proj --with-proj-includes=/Library/Frameworks/PROJ.framework/unix/include --with-proj-libs=/Library/Frameworks/PROJ.framework/unix/lib --with-proj-share=/Library/Frameworks/PROJ.framework/Resources/proj --with-jpeg-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-jpeg-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-png-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-png-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --with-tiff-includes=/Library/Frameworks/UnixImageIO.framework/unix/include --with-tiff-libs=/Library/Frameworks/UnixImageIO.framework/unix/lib --without-postgres --without-mysql --with-odbc --with-sqlite --with-sqlite-libs=/Library/Frameworks/SQLite3.framework/unix/lib --with-sqlite-includes=/Library/Frameworks/SQLite3.framework/unix/include --with-fftw-includes=/Library/Frameworks/FFTW3.framework/unix/include --with-fftw-libs=/Library/Frameworks/FFTW3.framework/unix/lib --with-cxx --with-tcltk-includes=/usr/local/tcltk/include --with-tcltk-libs=/usr/local/tcltk/lib --with-x --without-motif --without-glw --with-opengl=x11 --with-opengl-libs=/usr/X11R6/lib --without-readline --prefix=/Applications/Grass --enable-macosx-app --with-python --with-wxwidgets=/usr/local/lib/wxPython-unicode-2.8.7.1/bin/wx-config

Second, I DIDN’T make the link to libgdi.so because…

  1. my wx folder already has a gdi.so file AND
  2. I don’t seem to have a libgdi.so file

So here is the error.

cmb-MBP-2:~/grass_dev/grass_src cmbarton$ cd ./gui/wxpython/vdigit
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target clean' ../../../include/Make/Rules.make:72: warning: ignoring old commands for target clean’
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumeddriver.cpp:1: warning: -fpic is not supported; -fPIC assumed

lipo: can’t create output file: OBJ.i686-apple-darwin8.11.1/driver.o (No such file or directory)
make: *** [OBJ.i686-apple-darwin8.11.1/driver.o] Error 1
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$

So what is my next step?

Michael

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Feb 24, 2008, at 11:29 AM, Michael Barton wrote:

Second, I DIDN'T make the link to libgdi.so because...
1) my wx folder already has a _gdi_.so file AND
2) I don't seem to have a libgdi.so file

It's the other way around - libgdi.so is the symlink you're creating to the existing _gdi_.so.

cmb-MBP-2:~/grass_dev/grass_src cmbarton$ cd ./gui/wxpython/vdigit
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:72: warning: ignoring old commands for target `clean'
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumeddriver.cpp:1: warning: -fpic is not supported; -fPIC assumed

lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o (No such file or directory)
make: *** [OBJ.i686-apple-darwin8.11.1/driver.o] Error 1
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$

That's strange - I wonder where that "-dynamic" came from? That's a linker option, and this is just a compile step. That may be what is causing the unhelpful error.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro

On Feb 24, 2008, at 11:31 AM, William Kyngesburye wrote:

On Feb 24, 2008, at 11:29 AM, Michael Barton wrote:

Second, I DIDN'T make the link to libgdi.so because...
1) my wx folder already has a _gdi_.so file AND
2) I don't seem to have a libgdi.so file

It's the other way around - libgdi.so is the symlink you're creating to the existing _gdi_.so.

cmb-MBP-2:~/grass_dev/grass_src cmbarton$ cd ./gui/wxpython/vdigit
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:72: warning: ignoring old commands for target `clean'
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumeddriver.cpp:1: warning: -fpic is not supported; -fPIC assumed

lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o (No such file or directory)
make: *** [OBJ.i686-apple-darwin8.11.1/driver.o] Error 1
cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$

That's strange - I wonder where that "-dynamic" came from? That's a linker option, and this is just a compile step. That may be what is causing the unhelpful error.

OK. I made the link and still got a similar, but a bit different error

Michael

cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:72: warning: ignoring old commands for target `clean'
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o (No such file or directory)
make: *** [OBJ.i686-apple-darwin8.11.1/driver.o] Error 1

On Feb 24, 2008, at 3:48 PM, Michael Barton wrote:

OK. I made the link and still got a similar, but a bit different error

Michael

cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:72: warning: ignoring old commands for target `clean'
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o (No such file or directory)
make: *** [OBJ.i686-apple-darwin8.11.1/driver.o] Error 1

Same error, just not strung out on one line. It's not getting to the link step yet, so the libgdi symlink hasn't come into play yet.

I tried it on Leopard and it's compiling the .o's, but I get errors in the linking. It's strange, but I have all the same compile options, just in a different order, like it's ignoring the makefile's object target (yours looks like it is according to the makefile).

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

Michael Barton wrote:

> That's strange - I wonder where that "-dynamic" came from? That's
> a linker option, and this is just a compile step. That may be what
> is causing the unhelpful error.
>

OK. I made the link and still got a similar, but a bit different error

Michael

cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
Makefile:23: warning: overriding commands for target `clean'
../../../include/Make/Rules.make:72: warning: ignoring old commands
for target `clean'
c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple-
darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/
1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/
include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/
include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/
MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/
wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/
local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 -
D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__
driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o
(No such file or directory)

The OBJ.<arch> directory isn't being created.

Normally, this is done by the following in Rules.make

  $(OBJDIR):
    -test -d $(OBJDIR) || $(MKDIR) $(OBJDIR)
  
  ifeq ($(BROKEN_MAKE),)
  ...
  $(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS) | $(OBJDIR)
    $(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(EXTRA_INC) $(INC) -o $@ -c $<
  else
  ...
  $(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS)
    $(MAKE) $(OBJDIR)
    $(CC) $(CXXFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(EXTRA_INC) $(INC) -o $@ -c $<
  endif

[NOTE: the latter rule incorrectly uses $(CC) instead of $(CXX), which
I'll fix shortly.]

vdigit/Makefile has a conflicting rule:

  $(OBJARCH)/%.o: %.cpp $(LOCAL_HEADERS)
    $(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $< -o $@

When multiple single-colon rules exist for a target, the dependencies
are merged while the commands from the second override those from the
first.

In the case where $(BROKEN_MAKE) isn't set, the order-only dependency
upon $(OBJDIR) is retained, which causes $(OBJDIR) to be created
first. But in the case where $(BROKEN_MAKE) is set, there is no
dependency, and the command to create the directory isn't executed
because the commands in vdigit/Makefile override it.

The best solution is to discard the rule from vdigit/Makefile, and
just use the one from Rules.make, setting EXTRA_INC to $(INCLUDE_DIRS).

--
Glynn Clements <glynn@gclements.plus.com>