Mike, the example to look at is in DXROOT/samples/program_guide.   There's
a makefile in there that builds all three types.  I've condensed it for you
in ~gabram/rtl.  Copy those files,  make, and then include " -mdf
hello.mdf" when you start OpenDX.

Greg


                                                                                
                                                          
                      "Mike H. Miller"                                          
                                                          
                      <[EMAIL PROTECTED]>                   To:       
[email protected]                                   
                      Sent by:                             cc:                  
                                                          
                      [EMAIL PROTECTED]        Subject:  [opendx-users] 
Question about Modules on Linux                       
                      son.ibm.com                                               
                                                          
                                                                                
                                                          
                                                                                
                                                          
                      06/24/2002 08:28 AM                                       
                                                          
                      Please respond to                                         
                                                          
                      opendx-users                                              
                                                          
                                                                                
                                                          
                                                                                
                                                          




Hi,
I'm learning how to write modules for OpenDX now, and was trying to
create samples of all three (inboard, outboard, and loadable) modules.
My problem is that there are no valid makefiles for an x86 linux system
in the sample directory. I found this (slightly modified) on the
internet for an outboard:

BASE = /s/gordo/paredsoft/local/dx
FILES = outboard.o hello.o
LITELIBS = -L$(BASE)/lib_linux -lDXlite -lm
CC = gcc
CFLAGS = -O -Dlinux -I$(BASE)/include
LIBS   = -L$(BASE)/lib_linux -L/usr/X11R6/lib -L/usr/local/lib /usr/lib
-lDX -lMagick -lpng -ltiff -lGL -lm -lX11 -ldl -lnsl
# make the outboard
hello:  hello.c
        $(CC) $(CFLAGS) -DUSERMODULE=m_Hello -c $(BASE)/lib/outboard.c
        $(CC) $(CFLAGS) -c hello.c
        $(CC)  $(FILES) $(LITELIBS) -o hello

And for an inboard, I succeeded in using this:
SHELL = /bin/sh
BASE = /s/gordo/paredsoft/local/dx
include $(BASE)/lib_$(DXARCH)/arch.mak
FILES_firstmodule = userfirstmodule.$(OBJEXT) firstmodule.$(OBJEXT)
BIN = $(BASE)/bin
CFLAGS = -I./ -I$(BASE)/include $(DX_CFLAGS)
LDFLAGS = -L$(BASE)/lib_$(DXARCH)
LIBS = -lDX $(DX_GL_LINK_LIBS) $(DXEXECLINKLIBS)
OLIBS = -lDXlite -lm
BIN = $(BASE)/bin
# create the necessary executable
dxexec: $(FILES_firstmodule)
        $(CC) $(LDFLAGS) $(FILES_firstmodule) $(LIBS) -o dxexec
.c.o: ; cc -c $(DXABI) $(DX_RTL_CFLAGS) $(CFLAGS) $*.c
.C.o: ; cc -c $(DXABI) $(DX_RTL_CFLAGS) $(CFLAGS) $*.C
# a command to run the user module
run: dxexec
        dx -edit -exec ./dxexec -mdf firstmodule.mdf &
# make the user files
userfirstmodule.c: firstmodule.mdf
        $(BIN)/mdf2c firstmodule.mdf > userfirstmodule.c
# kluge for when DXARCH isn't set
$(BASE)/lib_/arch.mak:
        (export DXARCH=`dx -whicharch` ; $(MAKE) -f firstmodule.make )
       echo YOU NEED TO SET DXARCH via dx -whicharch

Both compile just fine. The inboard actually works great, but since that
only allows one module, that's not my ideal solution. The outboard seems
to work, but gives an "error connecting to localhost" when I try and run
it. My real problem is that I want to be able to create loadable
modules-- does anyone have a Makefile to do that? Thanks.

--
Mike Miller
[EMAIL PROTECTED] ->
[EMAIL PROTECTED]


#### signature.asc has been removed from this note on June 24 2002 by
Gregory D Abram



Reply via email to