Discussion:
[omniORB] omniORB Environment
Arthur B Olsen
2007-09-28 01:10:30 UTC
Permalink
Im new to omniORB.

Im am a bit confused with the setup and build system.

I followed the directions. I created a directory called build under /usr/local/src/omniORB-4.1.0

I have built the source and installed omniorb in /usr/local/omniorb

I was expecting that i now could use the stuff under /usr/local/omniorb to buil my own applications.

So first thing is to compile the examples. But trying to build the examples under /usr/local/src/omniORB-4.1.0/src/examples/ is a no go.

Trying to compile it somwhere else, like under /home/badknees/development is a no go

I have to compile the examples in /usr/local/src/omniORB-4.1.0/build/src/examples. But theres only a makefile an the compiled stuff.

In the documentation is a paragraph call "setting up the environment" or something like that, but it says nothing about setting up the environment.

So what i would like to know, is how do you guys set up your omniORB environment. Whats beforeauto.mk and afterauto.mk. What is dir.mk.

Do i have to keep and use /usr/local/src/omniORB-4.1.0 and /usr/local/src/omniORB-4.1.0/build - like the examples do

Could someone give me a rough outline, on how to set up my development environment, and what magic tool to use to make those simple but confusing makefiles.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070927/43182175/attachment.htm
Duncan Grisby
2007-09-30 20:52:18 UTC
Permalink
Post by Arthur B Olsen
Im am a bit confused with the setup and build system.
I followed the directions. I created a directory called build under
/usr/local/src/omniORB-4.1.0
I have built the source and installed omniorb in /usr/local/omniorb
I was expecting that i now could use the stuff under
/usr/local/omniorb to buil my own applications.
You can.
Post by Arthur B Olsen
So first thing is to compile the examples. But trying to build the
examples under /usr/local/src/omniORB-4.1.0/src/examples/ is a no go.
The build system that omniORB itself uses is an over-complex pile of
evolved make files and magic with virtual paths. It's not really a good
idea to try to extend it to compile your own code unless you understand
a lot about autoconf and GNU make.

As you have found, you can build the omniORB examples under the build
tree that's used for building omniORB itself, but that's not really a
good starting point for building your own code. The best thing to do is
to write some really simple makefiles that just compile the things you
need. All you need to do is set the include path to find the omniORB
headers, and to link with the right omniORB libraries.

Perhaps some kind soul would post a simple makefile they're using...

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
BadKnees
2007-10-01 19:39:43 UTC
Permalink
Post by Duncan Grisby
Perhaps some kind soul would post a simple makefile they're using...
Just in case someone else is wondering about how to get a quick start:

Copy the bd_client.cc bd_server and the echo_callback.idl to your workspace.
Lay it out like this:

./IDL/echo_callback.idl
./bd_server.cc
./bd_client.cc

And here's a simple Makefile:

PWD = $(shell pwd)
IDL = $(PWD)/IDL
STUB = $(PWD)/.stub
OBJ = $(PWD)/.obj
OMNIROOT = /usr/local/omniorb
IDLC = $(OMNIROOT)/bin/omniidl -bcxx
C++ = g++
CARGS = -c -O2 -Wall -Wno-unused -fexceptions -D__OMNIORB4__ -D_REENTRANT -D__OSVERSION__=2 -D__linux__ -D__x86__
LARGS = -O2 -Wall -Wno-unused -fexceptions
INC = -I$(OMNIROOT)/include/ -I. -I$(STUB)
LIB = -L$(OMNIROOT)/lib -L.
LDF = -lomniORB4 -lomniDynamic4 -lomnithread -lpthread
RM = rm -rf

all: bd_client bd_server

$(OBJ):
mkdir $(OBJ)

$(STUB):
mkdir $(STUB)

$(STUB)/echo_callbackSK.cc $(STUB)/echo_callback.hh: $(STUB) $(IDL)/echo_callback.idl
cd $(STUB) && $(IDLC) $(IDL)/echo_callback.idl

$(OBJ)/echo_callbackSK.o: $(OBJ) $(STUB)/echo_callbackSK.cc $(STUB)/echo_callback.hh
cd $(OBJ) && $(C++) $(CARGS) $(INC) -o $(OBJ)/echo_callbackSK.o $(STUB)/echo_callbackSK.cc

$(OBJ)/bd_server.o: $(OBJ) $(STUB)/echo_callback.hh bd_server.cc
$(C++) $(CARGS) $(INC) -o $(OBJ)/bd_server.o bd_server.cc

$(OBJ)/bd_client.o: $(OBJ) $(STUB)/echo_callback.hh bd_client.cc
$(C++) $(CARGS) $(INC) -o $(OBJ)/bd_client.o bd_client.cc

bd_server: $(OBJ)/echo_callbackSK.o $(OBJ)/bd_server.o
$(C++) $(LARGS) $(LIB) $(LDF) -o bd_server $(OBJ)/bd_server.o $(OBJ)/echo_callbackSK.o

bd_client: $(OBJ)/echo_callbackSK.o $(OBJ)/bd_client.o
$(C++) $(LARGS) $(LIB) $(LDF) -o bd_client $(OBJ)/bd_client.o $(OBJ)/echo_callbackSK.o

clean:
$(RM) $(OBJ) $(STUB) bd_server bd_client
renny.koshy at rubixinfotech.com ()
2007-10-01 21:46:49 UTC
Permalink
One comment is the defines... such as -D_REENTRANT -D__OSVERSION__=2
-D__linux__ -D__x86__ are compiler/platform specific....

A good general rule (because we use omniORB on several diff OS/hardware)
is to comple the example and capture the output... that will show you
which defines you need....

Renny Koshy
President & CEO

--------------------------------------------
RUBIX Information Technologies, Inc.
www.rubixinfotech.com



BadKnees <***@flatrate.fo>
Sent by: omniorb-list-***@omniorb-support.com
10/01/2007 09:39 AM

To
omniorb-***@omniorb-support.com
cc

Subject
[omniORB] omniORB Environment
Post by Duncan Grisby
Perhaps some kind soul would post a simple makefile they're using...
Just in case someone else is wondering about how to get a quick start:

Copy the bd_client.cc bd_server and the echo_callback.idl to your
workspace.
Lay it out like this:

./IDL/echo_callback.idl
./bd_server.cc
./bd_client.cc

And here's a simple Makefile:

PWD = $(shell pwd)
IDL = $(PWD)/IDL
STUB = $(PWD)/.stub
OBJ = $(PWD)/.obj
OMNIROOT = /usr/local/omniorb
IDLC = $(OMNIROOT)/bin/omniidl -bcxx
C++ = g++
CARGS = -c -O2 -Wall -Wno-unused -fexceptions -D__OMNIORB4__
-D_REENTRANT -D__OSVERSION__=2 -D__linux__ -D__x86__
LARGS = -O2 -Wall -Wno-unused -fexceptions
INC = -I$(OMNIROOT)/include/ -I. -I$(STUB)
LIB = -L$(OMNIROOT)/lib -L.
LDF = -lomniORB4 -lomniDynamic4 -lomnithread -lpthread
RM = rm -rf

all: bd_client bd_server

$(OBJ):
mkdir $(OBJ)

$(STUB):
mkdir $(STUB)

$(STUB)/echo_callbackSK.cc $(STUB)/echo_callback.hh: $(STUB)
$(IDL)/echo_callback.idl
cd $(STUB) && $(IDLC) $(IDL)/echo_callback.idl

$(OBJ)/echo_callbackSK.o: $(OBJ) $(STUB)/echo_callbackSK.cc
$(STUB)/echo_callback.hh
cd $(OBJ) && $(C++) $(CARGS) $(INC) -o $(OBJ)/echo_callbackSK.o
$(STUB)/echo_callbackSK.cc

$(OBJ)/bd_server.o: $(OBJ) $(STUB)/echo_callback.hh bd_server.cc
$(C++) $(CARGS) $(INC) -o $(OBJ)/bd_server.o bd_server.cc

$(OBJ)/bd_client.o: $(OBJ) $(STUB)/echo_callback.hh bd_client.cc
$(C++) $(CARGS) $(INC) -o $(OBJ)/bd_client.o bd_client.cc

bd_server: $(OBJ)/echo_callbackSK.o $(OBJ)/bd_server.o
$(C++) $(LARGS) $(LIB) $(LDF) -o bd_server $(OBJ)/bd_server.o
$(OBJ)/echo_callbackSK.o

bd_client: $(OBJ)/echo_callbackSK.o $(OBJ)/bd_client.o
$(C++) $(LARGS) $(LIB) $(LDF) -o bd_client $(OBJ)/bd_client.o
$(OBJ)/echo_callbackSK.o

clean:
$(RM) $(OBJ) $(STUB) bd_server bd_client

_______________________________________________
omniORB-list mailing list
omniORB-***@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20071001/61038fa1/attachment.htm
Loading...