I have read calling a compiled-dll-from-outside-Mathica function and the CodeGeneration tutorial and scanned other related questions too numerous to mention, but I am still not sure how to generate a DLL that contains one or more compiled functions that I can call Python

The functions in question take as parameters 1, 2 or matrices valued in 3D and several int / real scalars, and can also return matrices, multiple values (for assignment to multiple variables in Python).

(I also looked at pjlink @ b3m2a1, but I was worried about overhead costs since the compiled functions will be used to a large extent, and then I noticed that WolframClientForPython replaced it; I installed it anyway with pip but then I noticed that it says it requires Wolfram Language 11.3 or higher, unfortunately I only have MMA 11.0.1, is that an absolute prerequisite or a recommendation? **To update** It seems absolute: the evaluation generated an error

WolframKernelException: could not communicate with the kernel: C: Program Files Wolfram Research Mathematica 11.0 WolframKernel.exe

)

Since my compilation and C skills are insignificant, and my ignorance of executables, shells, etc. Windows is huge, can anyone provide me or direct me to a minimum working example of: compiling> 2 of such functions in a DLL for the environment below?

The functions in question are compiled in C, do not call MainEvaluate and have been used successfully within MMA, I just need to reuse them in a Python environment.

Environment: MMA 11.0.1.0; Win 10 64 bits, VS Studio 2017, Python 3.6 / 7, Jupyterlab front-end.

Although useless by themselves, here are examples of the definitions of compiled functions

```
pearsonRtoRefVector = Compile({{dataVec, _Real,1}, {corrVecLen, _Integer},{corrVecMean, _Real}, {corrVecMeanDiffs, _Real, 1}, {corrVecMeanDiffsSquaredSummed, _Real}},
Module(
{dataVecLen,dataVecMean, dataVecMeanDiffs,dataVecMeanDiffsSquaredSummed},
dataVecLen = Length(dataVec);
If(dataVecLen !=corrVecLen,
-11, (* just a number that is not in the range(-1,1) *)
dataVecMean = Last(Accumulate(dataVec))/dataVecLen;
dataVecMeanDiffs= dataVec - dataVecMean;
dataVecMeanDiffsSquaredSummed = dataVecMeanDiffs.dataVecMeanDiffs;
If(dataVecMeanDiffsSquaredSummed <= 2.2250738585072014`*^-308 (*$MinMachineNumber*), (* 2019-06-04 Why not just Chop, which is compilable *)
0, (* clamp value to zero for effectively zero floats - can increase the size of "effectively zero" as required *)
dataVecMeanDiffs.corrVecMeanDiffs/(Sqrt(dataVecMeanDiffsSquaredSummed)*Sqrt(corrVecMeanDiffsSquaredSummed))
)
)
), CompilationTarget -> "C", "RuntimeOptions" -> "Speed");
(* COMPILATION TESTED OK 2017-02-12 Needed "InlineExternalDefinitions"(Rule)True *)
(* It is assumed the following have been precomputed: the common correlation vector, vOscTable...
To see the effect of the Vosc table (which is assumed to have the right dimensions) pass a table filled with zeroes
Recall that vOscTable has n columns and nc rows, i.e. indexes as ((nc, n))*)
buildTAMSDTable =
Compile({{aPQTable, _Real, 3},{gCorrVecLen, _Real}, {gCorrVecMean, _Real}, {gCorrVecMeanDiffs, _Real, 1}, {gCorrVecMeanDiffsSquaredSummed, _Real},{aVoscTable, _Real, 2}},
Module({pTable, qTable, ps, qs, pDiffs, qDiffs, bigN, intNcut,n,nc,cs,commonPQDims},
pTable = aPQTable((1));
qTable = aPQTable((2));
commonPQDims = Dimensions(pTable);
nc = commonPQDims((1)); (* #random c values = ((1)) because I am working on one of the translation variable sub-tables extracted *)
bigN = Last(commonPQDims); (* Number of points in data series *)
intNcut = IntegerPart(bigN/10);
Table( (* Outer Table makes a vector of the correlations, but built-in Correlation is not compilable :( *)
pearsonRtoRefVector(
Table( (* This makes the mean squared deviations for correlation *)
ps = pTable((cs)); (* Take one set of p values for the series *)
qs = qTable((cs)); (* Take one set of q values for the series *)
pDiffs = Take(ps, n - bigN) - Take(ps, bigN - n); (* Calc the p diffs *)
qDiffs = Take(qs, n - bigN) - Take(qs, bigN - n); (* Calc the q diffs *)
(1/(bigN - n) (pDiffs.pDiffs + qDiffs.qDiffs)) - aVoscTable((cs, n)), (* The Mean of squared diffs summed - Vosc Continue to be wary of Vosc index order - ok but you never know! *)
{n, 1, intNcut}),
gCorrVecLen,gCorrVecMean,gCorrVecMeanDiffs,gCorrVecMeanDiffsSquaredSummed),
{cs,1,nc})
),
CompilationTarget -> "C", "RuntimeOptions" -> "Speed", CompilationOptions->{"InlineCompiledFunctions"->True, "InlineExternalDefinitions"->True});
```