You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »


 

 

1. 1. What code wrapper actually does?

The code wrapper intermediates between Kepler actor and user code:

  • Passes variables of language built-in types (int, char, etc) from actor to the code
  • Reads IDS(es) from UAL and passes data to user code
  • Passes input code parameters (XML/XSD files) to user code
  • Calls user subroutine/function
  • Saves output IDS(es)


 

2. 4. Delivery of the user code

The user code should be delivered as a static library.
Please find examples of the simple "makefiles" below:


 
Example 6. Building of Fortran code
F90 = $(ITM_INTEL_FC)
COPTS = -g -O0 -assume no2underscore -fPIC -shared-intel

INCLUDES = $(shell eval-pkg-config --cflags ual-$(ITM_INTEL_OBJECTCODE))

all: equilibrium2distsource.o libequilibrium2distsource

libequilibrium2distsource: equilibrium2distsource.o
        ar -rvs libequilibrium2distsource.a equilibrium2distsource.o

equilibrium2distsource.o: equilibrium2distsource.f90
        $(F90) $(COPTS) -c -o $@ $^ ${INCLUDES} 

clean:
        rm -f *.o *.a
Example 7. Building of C++ code
CXX=g++
CXXFLAGS= -g -fPIC
CXXINCLUDES= ${shell eval-pkg-config --cflags ual-cpp-gnu}

all: libsimplecppactor.a

libsimplecppactor.a: simplecppactor.o
        ar -rvs $@ $^

simplecppactor.o: simplecppactor.cpp
        $(CXX) $(CXXFLAGS) $(CXXINCLUDES) -c -o $@ $^

clean:
        rm *.a *.o

 

 

Recomendations

  • Please use eval-pkg-config to get UAL flags and not hard coded references.
  • The usage of environment variables for identifying compilers and versions of the pkg-config is recommended.

 

 

 

  • No labels