More on taking another crack at putting it all together..

Ok… I think I’m so close to putting it all together. Whether or not it works, well that’s another matter.
Just a note to myself here but for I start.
I added these notes to src/Makefile.am:

AM_CXXFLAGS =-DHAVE_IOSTREAM -DHAVE_LIMITS
AM_CPPFLAGS = -I/usr/include/opencascade/

It seemed to work, but I wonder if they where meant to go in the configure.ac Quick check to my favorite tutorial.. I seem to be using AM_CPPFLAGS correctly, but there is no reference to AM_CXXFLAGS in this tutorial…
Ok… there are references appearing to AM_CXXFLAGS on the net so….. I think I need to did deeper….
This is not what I intended to do this morning but….
I found some interesting info here:http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.htm

27.6.1 Compile Flag Variables

This section attempts to answer all the above questions. We will mostly discuss CPPFLAGS in our examples, but actually the answer holds for all the compile flags used in Automake: CCASFLAGS, CFLAGS, CPPFLAGS, CXXFLAGS, FCFLAGS, FFLAGS, GCJFLAGS, LDFLAGS, LFLAGS, LIBTOOLFLAGS, OBJCFLAGS, RFLAGS, UPCFLAGS, and YFLAGS.

CPPFLAGS, AM_CPPFLAGS, and mumble_CPPFLAGS are three variables that can be used to pass flags to the C preprocessor (actually these variables are also used for other languages like C++ or preprocessed Fortran). CPPFLAGS is the user variable (see User Variables), AM_CPPFLAGS is the Automake variable, and mumble_CPPFLAGS is the variable specific to the mumble target (we call this a per-target variable, see Program and Library Variables).

Ok… I think i found my answer here: 8.4 Program and Library Variables

maude_CCASFLAGS
maude_CFLAGS
maude_CPPFLAGS
maude_CXXFLAGS
maude_FFLAGS
maude_GCJFLAGS
maude_LFLAGS
maude_OBJCFLAGS
maude_RFLAGS
maude_UPCFLAGS
maude_YFLAGS
Automake allows you to set compilation flags on a per-program (or per-library) basis. A single source file can be included in several programs, and it will potentially be compiled with different flags for each program. This works for any language directly supported by Automake. These per-target compilation flags are ‘_CCASFLAGS’, ‘_CFLAGS’, ‘_CPPFLAGS’, ‘_CXXFLAGS’, ‘_FFLAGS’, ‘_GCJFLAGS’, ‘_LFLAGS’, ‘_OBJCFLAGS’, ‘_RFLAGS’, ‘_UPCFLAGS’, and ‘_YFLAGS’.

When using a per-target compilation flag, Automake will choose a different name for the intermediate object files. Ordinarily a file like sample.c will be compiled to produce sample.o. However, if the program’s _CFLAGS variable is set, then the object file will be named, for instance, maude-sample.o. (See also renamed objects.) The use of per-target compilation flags with C sources requires that the macro AM_PROG_CC_C_O be called from configure.ac.

In compilations with per-target flags, the ordinary ‘AM_’ form of the flags variable is not automatically included in the compilation (however, the user form of the variable is included). So for instance, if you want the hypothetical maude compilations to also use the value of AM_CFLAGS, you would need to write:

Oh… I wish I hadn’t run out of coffee yesterday…. tea is just not enough…
This is what my directory looks like.

jonas@Ubuntu4:~/gtkmmocascade/src$ ls
gtkmmocascade.cpp gtkmmocascade-main.o MakeBottle.cpp Makefile.am Makefile.old
gtkmmocascade.h main.cpp Makefile Makefile.in

It make no sense to me, why I put a AM_CXXFLAGS there… (I think I may have gotten it from the OCC_forum…
Ok… I fixed a few things up…
and here’s what happens when I run make:

jonas@Ubuntu4:~/gtkmmocascade$ make
make all-recursive
make[1]: Entering directory /home/jonas/gtkmmocascade'
Making all in src
make[2]: Entering directory
/home/jonas/gtkmmocascade/src’
make[2]: *** No rule to make target gtmmocascade.cpp', needed by gtkmmocascade-gtmmocascade.o’. Stop.
make[2]: Leaving directory /home/jonas/gtkmmocascade/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
/home/jonas/gtkmmocascade’
make: *** [all] Error 2
jonas@Ubuntu4:~/gtkmmocascade$

Ok… This is pretty much what happened before my corrections…
So… googling 668000 hits.. on “*** No rule to make target” that’s comforting at least to I’m not a alone with this issue.  One of the first hits has a good line. “Wo ist der Hund begraben? Where is the dog buried… 😉
(I’m going to use that one)
If found another reference on :http://www.opencascade.org/org/forum/thread_4018/
Hmm… running out of time here… Going to need to look at this at lunch….
So… here is what my src/Makefile.am currently looks like…

LIB_OCC= -Luser/lib -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \

-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \

-lTKService -lTKV2d -lTKV3d -lTKMesh -lTKPCAF -lTKLCAF -lTKPLCAF -lTKCDF -lTKCAF \

-lPTKernel -lTKIGES -lTKSTEP -lTKSTEPBase -lTKSTEPAttr -lTKSTEP209 -lTKSTL -lTKVRML -lTKShHealing \

-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl

AM_CPPFLAGS = -I/usr/include/opencascade/ -DHAVE_IOSTREAM -DHAVE_LIMITS
bin_PROGRAMS = gtkmmocascade
gtkmmocascade_SOURCES = gtmmocascade.h main.cpp gtmmocascade.cpp MakeBottle.cpp
gtkmmocascade_CPPFLAGS = $(GTKMM_CFLAGS) $(GTKGLEXTMM_CFLAGS)
gtkmmocascade_LDADD = $(GTKMM_LIBS) $(GTKGLEXTMM_LIBS) $(LIB_OCC)

I ran across a couple interesting links at lunch…
http://www.gamedev.net/community/forums/topic.asp?topic_id=510468
This link also points to a make tutorial that code my eye.. I need to check  this out also…

http://www.hsrl.rutgers.edu/ug/make_help.html

A side note… I ran across a interesting link on cross platform IDE’s
http://www.gamedev.net/community/forums/topic.asp?topic_id=296922

I added these two line to my configure.ac
AC_PROG_LIBTOOL        # add libtool to autotools suite
AC_SUBST(LIBTOOL_DEPS) # force regeneration of libtool  if necessary

I got rid of that error but that gave me some more…

jonas@Ubuntu4:~/gtkmmocascade$
jonas@Ubuntu4:~/gtkmmocascade$ make
make all-recursive
make[1]: Entering directory /home/jonas/gtkmmocascade'
Making all in src
make[2]: Entering directory
/home/jonas/gtkmmocascade/src’
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/atkmm-1.6 -I/usr/include/gtk-2.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include -I/usr/include/cairomm-1.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/atk-1.0 -I/usr/include/gtkglextmm-1.2 -I/usr/lib/gtkglextmm-1.2/include -I/usr/include/gtkglext-1.0 -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/lib/gtkglext-1.0/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1 -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/cairomm-1.0 -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/atk-1.0 -I/usr/include/atkmm-1.6 -g -O2 -MT gtkmmocascade-main.o -MD -MP -MF “.deps/gtkmmocascade-main.Tpo” -c -o gtkmmocascade-main.o test -f 'main.cpp' || echo './'main.cpp; \
then mv -f “.deps/gtkmmocascade-main.Tpo” “.deps/gtkmmocascade-main.Po”; else rm -f “.deps/gtkmmocascade-main.Tpo”; exit 1; fi
In file included from main.cpp:2:
./gtkmmocascade.h:12:38: error: AIS_InteractiveContext.hxx: No such file or directory
./gtkmmocascade.h:14:24: error: V3d_View.hxx: No such file or directory
./gtkmmocascade.h:15:26: error: V3d_Viewer.hxx: No such file or directory
./gtkmmocascade.h:17:35: error: Geom_BSplineSurface.hxx: No such file or directory
./gtkmmocascade.h:19:37: error: AIS_InteractiveObject.hxx: No such file or directory
./gtkmmocascade.h:20:40: error: Graphic3d_NameOfMaterial.hxx: No such file or directory

Opp’s I seem to have regressed…

jonas@Ubuntu4:~/gtkmmocascade$ locate AIS_InteractiveContext.hxx
/usr/include/opencascade/AIS_InteractiveContext.hxx

The issue would be with the src/Makefile.am. I make a couple of tweeks. I seems to be back to my orginal issue.
Now…. I’m back this this message

jonas@Ubuntu4:~/gtkmmocascade$ cd src
jonas@Ubuntu4:~/gtkmmocascade/src$ ls
gtkmmocascade.cpp  gtkmmocascade-main.o  MakeBottle.cpp  Makefile.am   Makefile.in
gtkmmocascade.h    main.cpp              Makefile        Makefile.am~  Makefile.old
jonas@Ubuntu4:~/gtkmmocascade/src$ cd ..
jonas@Ubuntu4:~/gtkmmocascade$ make
make  all-recursive
make[1]: Entering directory /home/jonas/gtkmmocascade'
Making all in src
make[2]: Entering directory
/home/jonas/gtkmmocascade/src’
make[2]: *** No rule to make target gtmmocascade.cpp', needed by gtkmmocascade-gtmmocascade.o’.  Stop.
make[2]: Leaving directory /home/jonas/gtkmmocascade/src'
make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory /home/jonas/gtkmmocascade’
make: *** [all] Error 2
jonas@Ubuntu4:~/gtkmmocascade$
Man this is frustrating….
Ok… I’m going retrace my steps and think about this…
I download some source from here…http://edwin.iband.net/opencascade/gtkmmocascade.tar.bz2
Some thing was screwed up with the tar ball. I believe I manually extracted each file via google source..
Now the problem the package is with the makefiles. I’m using opencascade from a .deb files where everythings is in a standard location….
I tried doing two things at once, fix the locations and use automake…. I think I’m missing something very very obvious…
Perhaps… I could just try to fix the makefiles with out using automake and see where that gets me…
Ok… Since, my version of opencascade was made from a .deb I needed change the some of the specified locations.
The makefile as downloaded looked like this:
CC=g++

TARGET=makebottle

OBJS= main.o \
MakeBottle.o \
gtkmmocascade.o

GTK_INCLUDES=pkg-config gtkmm-2.4  gtkglextmm-1.2 --cflags
GTK_LDFLAGS=pkg-config  gtkmm-2.4  gtkglextmm-1.2 --libs

OCC_INCLUDES_OLD=-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception  \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/opt/OpenCASCADE5.2/ros/inc  \
-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_INCLUDES=-DCSFDB \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/opt/OpenCASCADE5.2/ros/inc  \
-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_LDFLAGS=-L/opt/OpenCASCADE5.2/ros/Linux/lib

LIB_OCC= -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \
-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \
-lTKService -lTKV2d -lTKV3d -lTKPCAF -lTKCDF -lTKCAF \
-lPTKernel -lTKIGES -lTKSTEP -lTKSTL -lTKVRML -lTKShHealing \
-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl  -lTKBO  \
-lTKBool -lTKTopAlgo -lTKPrim -lTKOffset -lTKFillet -lTKBO

CPPFLAGS= -Wno-deprecated -I./ $(GTK_INCLUDES) $(OCC_INCLUDES)
CFLAGS=$(CPPFLAGS)

LDFLAGS=$(GTK_LDFLAGS) $(OCC_LDFLAGS) $(LIB_OCC)

$(TARGET):$(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)

.PHONY: clean distclean

clean:
-rm -f $(OBJS)

distclean:
-rm -f $(TARGET)

.SUFFIXES: .cpp .o

.cpp.o:
$(CC) $(CPPFLAGS) -c $< -o $@

main.o          : main.cpp gtkmmocascade.h
MakeBottle.o    : MakeBottle.cpp
gtkmmocascade.o : gtkmmocascade.cpp gtkmmocascade.h

I had to tweek it to look like this:

CC=g++

TARGET=makebottle

OBJS= main.o \
MakeBottle.o \
gtkmmocascade.o

GTK_INCLUDES=pkg-config gtkmm-2.4  gtkglextmm-1.2 --cflags
GTK_LDFLAGS=pkg-config  gtkmm-2.4  gtkglextmm-1.2 --libs

OCC_INCLUDES_OLD=-DCSFDB -DNO_CXX_EXCEPTION -DNo_Exception  \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/usr/include/opencascade
#-I/opt/OpenCASCADE5.2/ros/src/WOKTclLib this directory doesn’t exist

OCC_INCLUDES=-DCSFDB \
-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DLIN -DLININTEL \
-I/usr/include/opencascade
#  \
#             -I/opt/OpenCASCADE5.2/ros/src/WOKTclLib

OCC_LDFLAGS=-L/usr/lib

LIB_OCC= -lTKernel -lTKMath -lTKG2d -lTKG3d -lTKGeomBase -lTKBRep -lTKGeomAlgo -lTKTopAlgo \
-lTKPrim -lTKBool -lTKFeat -lTKFillet -lTKOffset -lTKHLR \
-lTKService -lTKV2d -lTKV3d -lTKPCAF -lTKCDF -lTKCAF \
-lPTKernel -lTKIGES -lTKSTEP -lTKSTL -lTKVRML -lTKShHealing \
-lTKXSBase -lTKPShape -lTKShapeSchema -lTKOpenGl  -lTKBO  \
-lTKBool -lTKTopAlgo -lTKPrim -lTKOffset -lTKFillet -lTKBO

CPPFLAGS= -Wno-deprecated -I./ $(GTK_INCLUDES) $(OCC_INCLUDES)
CFLAGS=$(CPPFLAGS)

LDFLAGS=$(GTK_LDFLAGS) $(OCC_LDFLAGS) $(LIB_OCC)

$(TARGET):$(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)

.PHONY: clean distclean

clean:
-rm -f $(OBJS)

distclean:
-rm -f $(TARGET)

.SUFFIXES: .cpp .o

.cpp.o:
$(CC) $(CPPFLAGS) -c $< -o $@

main.o          : main.cpp gtkmmocascade.h
MakeBottle.o    : MakeBottle.cpp
gtkmmocascade.o : gtkmmocascade.cpp gtkmmocascade.h

This actually worked 🙂
I actually have an image that I’d like to post here. But for some reason I can’t get it to upload at the moment 🙁
Hmmm… It seems to be a problem related to Adobe Flash (which I did download a while back…)

http://wordpress.org/support/topic/177127 I’m not in the mood to explore this one for now, so I guess they’ll be no pictures till wordpress 2.7 which is still in beta, comes out.

This entry was posted in Ubuntu, Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *