ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 13 Nov 2017 07:04:01 -0600using sage library in C or C++?http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/ Is there a way to run sage library in C/C++ or include the sage in C/C++? For example, I want to calculate minkowski sum, difference or decomposition in C or C++? Tue, 17 Oct 2017 10:57:44 -0500http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/Comment by vdelecroix for <p>Is there a way to run sage library in C/C++ or include the sage in C/C++? For example, I want to calculate minkowski sum, difference or decomposition in C or C++? </p>
http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/?comment=39246#post-id-39246The only possibility is to call the Sage python interpreter from your C/C++ program.Sun, 22 Oct 2017 10:31:20 -0500http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/?comment=39246#post-id-39246Answer by Jeroen Demeyer for <p>Is there a way to run sage library in C/C++ or include the sage in C/C++? For example, I want to calculate minkowski sum, difference or decomposition in C or C++? </p>
http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/?answer=39513#post-id-39513I obviously don't know your exact use case. First of all, this has nothing to do with Sage, it is really a Python question.
Embedding Python in C is explained here: https://docs.python.org/2/extending/embedding.html
Alternatively: instead of using Sage in your C/C++ program, you could reverse this and use your C/C++ program inside Sage. That is relatively easy using Cython.Mon, 13 Nov 2017 07:04:01 -0600http://ask.sagemath.org/question/39196/using-sage-library-in-c-or-c/?answer=39513#post-id-39513