Paul Martz wrote:
I've used Cygwin in the past for a few projects, and am now trying to use it
to build current OSG/OT/P CVS source.

OT and P build fine. When I go to build OSG, it fails to find the Producer
include files while building osgProducer. I found that I have to explicitly
export PRODUCER_INC_DIR and PRODUCER_LIB_DIR in order for the OSG build to
find the Producer header and include files. Is this to be expected? (The
Producer 'make install' puts things in /usr/local/Producer/include and
/usr/local/Producer/lib.)

Once that issue was resolved, core OSG and some of the plugins built.
However, the build failed in the ESRIShape plugin, failing to compile
ESRIShape.cpp at line 38 because ::read was not defined.

Any help would be appreciated.
   -Paul

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
Here are some sparse notes on building OSG under Cygwin. It builds, but fail at runtime and I do not understand why. Also the OT example WorkCrew has problems at runtime.

For your question, see point 5.
Hope you have more luck than me with Cygwn build.
Ciao!
               mario

1) install the following packages (the full installer ones) under d:/gnuwin32

   freetype 2.1.10
   jpeg 6b-4
   libpng 1.2.8
   libungif 4.1.4
   tiff 3.8.2-1


2) create the build file d:/buildosg.sh as below

export OSG_ROOT=/cygdrive/d/OSG_OP_OT-1.1.1-rc1
export BSD_ROOT=/cygdrive/d/gnuwin32

export OPENTHREADS_INC_DIR=$OSG_ROOT/OpenThreads/include
export OPENTHREADS_LIB_DIR=$OSG_ROOT/OpenThreads/lib/CYGWIN32
export PRODUCER_INC_DIR=$OSG_ROOT/Producer/include
export PRODUCER_LIB_DIR=$OSG_ROOT/Producer/lib/CYGWIN32
export COMPILE_EXAMPLES=yes
export COMPILE_INTROSPECTION=no

export FREETYPE_INCLUDE=$BSD_ROOT/freetype/include
export FREETYPE_LIB=$BSD_ROOT/freetype/lib
export PATH=${PATH}:$BSD_ROOT/freetype/bin

export JPEG_INCLUDE=-I$BSD_ROOT/jpeg/include
export JPEG_LIB="-L$BSD_ROOT/jpeg/lib -ljpeg"

export GIF_INCLUDE=-I$BSD_ROOT/libungif/include
export GIF_LIB=$BSD_ROOT/libungif/lib

export TIFF_INCLUDE=-I$BSD_ROOT/tiff/include
export TIFF_LIBS=$BSD_ROOT/tiff/lib

export PNG_INCLUDE=-I$BSD_ROOT/libpng/include
export PNG_LIB=$BSD_ROOT/libpng/lib

export OSG_INC_DIR=$OSG_ROOT/OpenSceneGraph/include
export OSG_LIB_DIR=$OSG_ROOT/OpenSceneGraph/lib/CYGWIN32

make $*


3) build OpenThreads

   Seems you need to copy uname.exe from cygwin into this directory to have
   $(OS) correctly initialized.

   in pthreads_src/GNUMakefile
   remove the unneeded line 31: LIBS += -lpthread

   cd OpenThreads
   make


4) build Producer

   cd ../Producer
   d:/buildosg.sh


5) Edited $OSG_ROOT\OpenSceneGraph\src\osgPlugins\ESRIShape\ESRIShape.cpp

#if defined(_MSC_VER) || defined(__MINGW32__) || defined(WIN32)
   #include <io.h>
   extern "C" int read(int, void *, unsigned int);
#endif


6) Under the installed freetype
   edit bin/freetype-config

verify that line 12 read as the following (no D:/gnuwin32.... it confound dependency tracking)
prefix=/cygdrive/d/gnuwin32/freetype

around line 144 edit the line to read
libs="-L$libdir -lfreetype -lz -Wl,-s -liberty -lintl -liconv -lwsock32 -lole32 -luuid -lmsvcp60 "


4) For the jpeg plugin
edit $OSG_ROOT\OpenSceneGraph\src\osgPlugins\jpeg\GNUMakefile and change JPEG_LIBS to JPEG_LIB
(the former for some reason is not overriden by the script definition)


5) For the gif plugin
edit GNUmakefile

ifeq ($(OS),HP-UX)
INC   += $(GIF_INCLUDE)
else
INC   += $(GIF_INCLUDE)

LINKARGS += -L$(GIF_LIB)
endif


6) For the tiff plugin
edit GNUMakefile
ifeq ($(OS),HP-UX)
INC     += $(TIFF_INCLUDE)
else
INC     += $(TIFF_INCLUDE)
#LDFLAGS += -L$(TIFF_LIBS)
LINKARGS += -L$(TIFF_LIBS) $(JPEG_LIB)

endif


7) For the png plugin
edit GNUMakefile
ifneq ($(OS),HP-UX)
INC  += $(PNG_INCLUDE)

LINKARGS += -L$(PNG_LIB)
else
INC += $(PNG_INCLUDE)
endif


8) build OpenSceneGraph
cd OpenSceneGraph
d:/buildosg.sh

I had some "modification time is in the future" warning, so I repeated the build procedure twice


x) to build the Producer examples define two new variables (OSG_INC_DIR and OSG_LIB_DIR) and modify the
GNUMakefile for Trackball

LIBS = \
-L$(OSG_LIB_DIR) -losgProducer -losgDB -losgGA -losgText -losgUtil -losg \
   -lProducer -lOpenThreads

INC      += -I$(OSG_INC_DIR)



--
Ing. Mario Valle
Visualization Group                              | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to