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

Compare with Current View Page History

« Previous Version 5 Next »

3 Development of C++ codes

 

CHEAT SHEET
ITMIMAS
#include "UALClasses.h"#include "UALClasses.h"
ItmNs::Itm::<cpo> cpo;
IdsNs::IDS::<ids> ids;
ItmNs::Itm::<cpo>Array     cpoArray;  <= Array!
IdsNs::IDS::<ids>    ids;   <= Single obj !
ItmNs::codeparam_t & codeparamIdsNs::codeparam_t & codeparam
eval-pkg-config
pkg-config
eval-pkg-config --cflags --libs ual-cpp-gnu
pkg-config --cflags --libs imas-cpp
  

 


Examples

Examples of interface between wrapper and user code
ITM
/**** Simple types ***/
void simple(double &x, double &y)

/**** Single slice ***/
void slice( ItmNs::Itm::equilibrium &eq)

/**** Array of slices ***/
void slice_array( ItmNs::Itm::equilibriumArray &eq)

/**** Code XML parameters ***/
void code_params(...., ItmNs::codeparam_t& codeparam)

/**** Arbitrary diagnostic info ***/
void diag_info(...., int* output_flag, char** diagnostic_info)
IMAS
/**** Simple types ***/
void simple(double &x, double &y)

/**** Single slice ***/
void slice(IdsNs::IDS::equilibrium &eq)

/**** Array of slices ***/void slice_array
( IdsNs::IDS:equilibrium &eq)

/**** Code XML parameters ***/
void code_params(...., IdsNs::codeparam_t& codeparam)
 
/**** Arbitrary diagnostic info ***/
void diag_info(...., int* output_flag, char** diagnostic_info)

 

1. 4. Delivery of the user code

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

 

Example 7. Building of C++ code
CXX=g++
CXXFLAGS= -g -fPIC
CXXINCLUDES= ${shell pkg-config --cflags imas-cpp}

all: libsimplecppactor.a

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

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

clean:
        rm *.a *.o
  • No labels