callable

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reference:callable [2016/02/11 10:41] – improve debugging infos benmuellcallable [2021/01/12 15:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== Callable Library ===== ===== Callable Library =====
  
-Starting with release 2.11, polymake offers an alternative interface for integration with other software, a C++ callable library.+polymake offers an alternative interface for integration with other software, a C++ callable library.
  
-This page describes only those parts of the interface which are specific to the callable library.  Software collaborating with polymake may (and in most cases even have to) use the Object and Function interfaces too; they are described on the [[:reference:clients|Client Development page]].+This page describes only those parts of the interface which are specific to the callable library.  Software collaborating with polymake may (and in most cases even have to) use the Object and Function interfaces too; they are described on the [[user_guide:extend:clients|Client Development page]].
  
 Benjamin Lorenz gave a [[http://polymake.org/lib/exe/fetch.php/cal_pres.pdf|presentation]] on the callable library with [[http://polymake.org/lib/exe/fetch.php/callable.tbz|examples]]. Benjamin Lorenz gave a [[http://polymake.org/lib/exe/fetch.php/cal_pres.pdf|presentation]] on the callable library with [[http://polymake.org/lib/exe/fetch.php/callable.tbz|examples]].
Line 14: Line 14:
  
 ''polymake::Main'' has one constructor: ''polymake::Main'' has one constructor:
-  * ''%%Main(user-settings = "user")%%'' \\ where //user-settings// is a string encoding whether and where the user settings like custom variables or results of rule auto-configuration are retrieved from.  The default value is ''%%"user"%%'', which causes the standard settings for the interactive mode to come into effect (usually stored under ''~/.polymake'').  Other possible values are ''%%"none"%%'' for "no configuration at all" or a [[howto:configure|configuration path]] allowing to combine several configuration sources with user's individual settings.+  * ''%%Main(user-settings = "user")%%'' \\ where //user-settings// is a string encoding whether and where the user settings like custom variables or results of rule auto-configuration are retrieved from.  The default value is ''%%"user"%%'', which causes the standard settings for the interactive mode to come into effect (usually stored under ''~/.polymake'').  Other possible values are ''%%"none"%%'' for "no configuration at all" or a [[install:configure|configuration path]] allowing to combine several configuration sources with user's individual settings.
  
 Further methods: Further methods:
Line 20: Line 20:
   * ''%%set_application_of(Object)%%''  sets the current application to that one where the type of the given object is defined   * ''%%set_application_of(Object)%%''  sets the current application to that one where the type of the given object is defined
   * ''%%add_extension("DIRECTORY")%%'' loads the extension rooted in the given directory.  Repeated calls with the same path have no effect.   * ''%%add_extension("DIRECTORY")%%'' loads the extension rooted in the given directory.  Repeated calls with the same path have no effect.
-  * ''newScope()'' create an instance of ''[[:reference:callable#scope_class|polymake::perl::Scope]]''+  * ''newScope()'' create an instance of ''[[callable#scope_class|polymake::perl::Scope]]''
-  * ''%%include("RULE_FILE")%%'' parses one additional rule file in the context of the current application. See the corresponding interactive command ''[[http://polymake.mathematik.tu-darmstadt.de/release_docs/core.html#i185|include()]]'' .+  * ''%%include("RULE_FILE")%%'' parses one additional rule file in the context of the current application. See the corresponding interactive command ''[[reldocs>latest/core.html#include|include()]]'' .
   * ''%%set_preference("label")%%'' \\ ''%%reset_preference("label")%%'' correspond to the interactive commands of the same names.   * ''%%set_preference("label")%%'' \\ ''%%reset_preference("label")%%'' correspond to the interactive commands of the same names.
-  * ''%%set_custom("name", value)%%'' \\ ''%%reset_custom("name")%%''  allow to change values of custom variables.  The variable names must be specified fully qualified (unless they reside in the current application package) and with appropriate leading symbol designating its perl type, that is, ''$'' for scalars, ''@'' for arrays, and ''%'' for hash maps.  Note that ''get_custom()'' is now a free function available for [[reference:clients#miscellaneous_functions|clients]] too.+  * ''%%set_custom("name", value)%%'' \\ ''%%reset_custom("name")%%''  allow to change values of custom variables.  The variable names must be specified fully qualified (unless they reside in the current application package) and with appropriate leading symbol designating its perl type, that is, ''$'' for scalars, ''@'' for arrays, and ''%'' for hash maps.  Note that ''get_custom()'' is now a free function available for [[user_guide:extend:clients#miscellaneous_functions|clients]] too.
   * ''%%greeting(int verbose = 2)%%'' return the polymake greeting as ''std::string'' with different verbosity levels (0-2): just name + version, with copyright added and including the GPL notice.   * ''%%greeting(int verbose = 2)%%'' return the polymake greeting as ''std::string'' with different verbosity levels (0-2): just name + version, with copyright added and including the GPL notice.
  
Line 35: Line 35:
  
 Methods: Methods:
-  * ''%%prefer_now("label")%%''  corresponds to the [[::general#preferences|interactive command]] of the same name.+  * ''%%prefer_now("label")%%''  corresponds to the [[user_guide:howto:shell_custom#preferences|interactive command]] of the same name.
   * ''%%set_custom("name", value)%%''  temporarily changes the value of the given custom variable, until the Scope object is destroyed.  Custom variables are specified in the same manner as in corresponding ''Main::set_custom'' methods.   * ''%%set_custom("name", value)%%''  temporarily changes the value of the given custom variable, until the Scope object is destroyed.  Custom variables are specified in the same manner as in corresponding ''Main::set_custom'' methods.
  
Line 42: Line 42:
 ==== Building a program ==== ==== Building a program ====
  
-You can use polymake callable library for building your programs only after having installed it at the final destination, that is, after ''make install'' .  To facilitate the build process, polymake comes with a small utility ''polymake-config'' which resides side by side with the main script ''polymake'' in the binary installation directory.  Calling this utility with various options you can obtain the compiler and linker options needed for successful build of your program.  You can even insert the calls in your Makefile directly, using the GNU make ''$(shell)'' function or `backtick` shell substitution.+You can use polymake callable library for building your programs only after having installed it at the final destination, that is, after ''ninja install'' .  To facilitate the build process, polymake comes with a small utility ''polymake-config'' which resides side by side with the main script ''polymake'' in the binary installation directory.  Calling this utility with various options you can obtain the compiler and linker options needed for successful build of your program.  You can even insert the calls in your Makefile directly, using the GNU make ''$(shell)'' function or `backtick` shell substitution.
  
 Following configuration parameters can be requested from ''polymake-config'': Following configuration parameters can be requested from ''polymake-config'':
Line 59: Line 59:
 You can add an option ''%%--debug%%'' before ''%%--cflags%%'', ''%%--ldflags%%'', or ''%%--libs%%'' if you are going to debug your program together with polymake.  Compiler options displayed without ''%%--debug%%'' provide for a build optimized for execution speed. You can add an option ''%%--debug%%'' before ''%%--cflags%%'', ''%%--ldflags%%'', or ''%%--libs%%'' if you are going to debug your program together with polymake.  Compiler options displayed without ''%%--debug%%'' provide for a build optimized for execution speed.
  
-For compilation with debugging enabled run ''%%make Debug=y%%'' (see also [[reference:clients#building_and_debugging|here]]) and make sure to install with ''%%make install Debug=y%%''. When you run the program you need to set ''POLYMAKE_CLIENT_SUFFIX=-d'' either via ''.gdbinit'' or your environment.+
  • callable.1455187300.txt.gz
  • Last modified: 2016/02/11 10:41
  • by benmuell