User Tools

Site Tools


platform:segmentation_fault_when_using_python_api_with_3rd_party_libraries

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
platform:segmentation_fault_when_using_python_api_with_3rd_party_libraries [2019/07/24 07:55]
Clemens Westphal
platform:segmentation_fault_when_using_python_api_with_3rd_party_libraries [2019/07/24 07:55]
Clemens Westphal
Line 2: Line 2:
 ====== Segmentation fault when using Python API with 3rd party libraries ====== ====== Segmentation fault when using Python API with 3rd party libraries ======
  
-Using the GAMS Python OO API in combination with third party libraries (e.g. pandas) might fail with a segmentation fault on Linux and Mac OS X. This problem occurs if the third party library loads a version of the shared library **libstdc++** which is not compatible with the GAMS Python OO API. The solution is to force the loading of the libstdc++ version that is distributed with the GAMS system. This can be done by importing the gams module at the very beginning before all other modules. In order to make sure that the shared library is really loaded it is required to create an instance of type GamsDatabase (e.g by calling GamsWorkspace.add_database()). The following example shows hoe this can be done:+Using the GAMS Python OO API in combination with third party libraries (e.g. pandas) might fail with a segmentation fault on Linux and Mac OS X. This problem occurs if the third party library loads a version of the shared library **libstdc++** which is not compatible with the GAMS Python OO API. The solution is to force the loading of the libstdc++ version that is distributed with the GAMS system. This can be done by importing the gams module at the very beginning before all other modules. In order to make sure that the shared library is really loaded it is required to create an instance of type GamsDatabase (e.gby calling GamsWorkspace.add_database()). The following example shows hoe this can be done:
  
 <code python> <code python>
IMPRESSUM / LEGAL NOTICEPRIVACY POLICY platform/segmentation_fault_when_using_python_api_with_3rd_party_libraries.txt ยท Last modified: 2019/07/24 07:56 by Clemens Westphal