source: git/Singular/pyobject_setup.cc @ c728c0

spielwiese
Last change on this file since c728c0 was a015f4, checked in by Hans Schoenemann <hannes@…>, 13 years ago
error messages for python support git-svn-id: file:///usr/local/Singular/svn/trunk@13811 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.3 KB
Line 
1// -*- c++ -*-
2//*****************************************************************************
3/** @file pyobject_setup.cc
4 *
5 * @author Alexander Dreyer
6 * @date 2010-12-15
7 *
8 * This header file defines the @c blackbox setup operations for the pyobject
9 *
10 * @par Copyright:
11 *   (c) 2010 by The Singular Team, see LICENSE file
12**/
13//*****************************************************************************
14
15#include <Singular/mod2.h>
16#include <kernel/febase.h>
17#include "static.h"
18
19/* whether development version of python is linked statically or dynamically */
20#ifdef HAVE_STATIC
21  #define HAVE_STATIC_PYTHON 1
22#endif
23
24#ifdef HAVE_PYTHON  // Case: python available (prefered variant)
25
26
27# ifdef HAVE_STATIC_PYTHON // Case: link pyobject interface statically
28#include "pyobject.cc"
29void pyobject_setup() { pyobject_init(); }
30
31
32# else                     // Case: pyobject is dynamic module (prefered variant)
33
34// forward declaration for Singular/iplib.cc
35void* binary_module_function(const char* lib, const char* func); 
36void pyobject_setup()
37{
38  void* fktn = binary_module_function("pyobject", "mod_init");
39  if (fktn) (* reinterpret_cast<void (*)()>(fktn) )();
40  else Werror("python related functions are not avialable");
41}
42
43# endif
44
45#else                // Case: no python
46void pyobject_setup() { }
47
48#endif  // HAVE_PYTHON
49
Note: See TracBrowser for help on using the repository browser.