C++ Interface

Since v1.1.1, a simple C++ interface is provided, see the smodels/cpp directory in the source code.

Its usage is documented in run.cpp:

#include <SModelS.h>
#include <iostream>
#include <string>

/** example only */

using namespace std;

int main( int argc, char * argv[] )
  /** initialise SModelS, load database. The first argument 
   *  points to the SModelS config file, 
   *  the second argument (``smodelsdir'') must point to the 
   *  top-level directory of the SModelS installation */
  SModelS smodels ( "./parameters.ini", "../" ); 
  /** run over one single file or directory */
  int ret = smodels.run ( "test.slha" );
  /* return value, zero if successful */
  return ret;

A sample Makefile is also provided in the same directory. The python header files have to be installed; on debian-based systems the package name is libpython3-dev, on rpm-based systems it is usually called python3-devel.