
Kernel *k = Kernel::CreateKernelInNewThread() Ĭout ExecuteCommandLine("echo Hello World") > dummy For the rest of this section, we will assume the reader is using the pre-built release package.įor convenience, here's a Hello World program that you can use to test your compilation process:

See the BuildSconsScript for more information.

Also note that when building from source, you need to build the "kernel" target (built by default) to get the shared library, and the "headers" target (not built by default) to produce the include directory. If you are building Soar from source, by default the build script will put the shared library in SoarSuite/out, and the headers in SoarSuite/out/include. The header will be in SoarSuite/bin/include. If you are using the pre-built release package, the Soar shared library will be in SoarSuite/bin, named libSoar.so (Linux), libSoar.dylib (OSX), or Soar.dll(Windows). To use the SML API in a C++ program, you must include the header file "sml_Client.h" and link to the Soar shared library. The error messages compilers produce for mismatched instruction sets tend to be cryptic, and you probably won't realize what the problem is from reading them. This will be SoarSuite/bin if you are using a pre-built release distribution of Soar, or (by default) SoarSuite/out if you built Soar yourself.įor all languages, compilers and operating systems, please make sure that you link 32-bit programs to the 32-bit version of Soar, and likewise for the 64-bit version. All dependencies are located in a single directory or one of its subdirectories. In practice, this can still be painful because the operating system must be told where to look for the dependencies. Usually, only one or two dependencies must be specified.

Previous releases required a slightly more complex compilation process.īuilding a program to call the SML API is conceptually straightforward in any language. These instructions are for the 9.3.2 and later releases. This page lays out the steps required to compile C++, Java, and Python SML client programs successfully on Linux/OSX/Windows. The API was written natively in C++, but has Java, Python, and Tcl bindings generated via SWIG. The SML API is the standard method to get Soar agents to communicate with external environments, such as simulations or games.
