11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

310 • Chapter 7: <strong>Advanced</strong> ConnectivityTo view the executed commands, set the infolevel for define_externalto 3 or higher. Repeating the previous example you might see the following.> p := define_external(‘COMPILE_OPTIONS‘):> p:-COMPILER := "gcc";> p:-COBJ_FLAG := "-o ":> infolevel[define_external] := 3:> define_external(‘mat_mult‘,‘WRAPPER‘,‘LIB‘="libcexttest.so"):"COMPILE_COMMAND""gcc -g -c -I/user/local/maple/extern/include -o \mwrap_mat_mult.o mwrap_mat_mult.c""LINK_COMMAND""ld -znodefs -G -dy -Bdynamic-L/user/local/maple/bin/bin.SUN_SPARC_SOLARIS \-omwrap_mat_mult.so mwrap_mat_mult.o -lc -lmaplec"Another way to view the compile and link commands is to call thecommand-builder procedures directly. Ensure to set or unassign the variablesthat will be assigned, otherwise they are blank.> p := define_external(‘COMPILE_OPTIONS‘):> p:-COMPILER := "gcc";> p:-COBJ_FLAG := "-o ":> p:-COMPILE_COMMAND();"gcc-g -c -I/u/maple/extern/include -o .o .c"> unassign(’p:-FILE’);> p:-COMPILE_COMMAND();"gcc-g -c -I/u/maple/extern/include -o FILE.o FILE.c"Example The following example shows two calls to define_externalseparated by the restart command. The first call does not use theWRAPLIB option and thus generates quad.c and compiles the wrapperlibrary quad.dll. The second call uses the WRAPLIB option in order toreuse the existing quad.dll. No compilation or wrapper generation isdone in the second call.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!