|
1 | 1 | ARG_ENABLE("tensor", "enable tensor", "no");
|
2 | 2 |
|
3 | 3 | if (PHP_TENSOR != "no") {
|
4 |
| - EXTENSION("tensor", "tensor.c", null, "-I"+configure_module_dirname); |
5 |
| - ADD_SOURCES(configure_module_dirname + "/kernel", "main.c memory.c exception.c debug.c backtrace.c object.c array.c string.c fcall.c require.c file.c operators.c math.c concat.c variables.c filter.c iterator.c exit.c time.c", "tensor"); |
6 |
| - /* PCRE is always included on WIN32 */ |
7 |
| - AC_DEFINE("ZEPHIR_USE_PHP_PCRE", 1, "Whether PHP pcre extension is present at compile time"); |
8 |
| - if (PHP_JSON != "no") { |
9 |
| - ADD_EXTENSION_DEP("tensor", "json"); |
10 |
| - AC_DEFINE("ZEPHIR_USE_PHP_JSON", 1, "Whether PHP json extension is present at compile time"); |
| 4 | + if (CHECK_LIB("libopenblas.lib", "tensor", PHP_TENSOR) && |
| 5 | + CHECK_HEADER_ADD_INCLUDE("cblas.h", "CFLAGS_TENSOR") |
| 6 | + ) { |
| 7 | + EXTENSION("tensor", "tensor.c", null, "-I"+configure_module_dirname); |
| 8 | + ADD_SOURCES(configure_module_dirname + "/kernel", "main.c memory.c exception.c debug.c backtrace.c object.c array.c string.c fcall.c require.c file.c operators.c math.c concat.c variables.c filter.c iterator.c exit.c time.c", "tensor"); |
| 9 | + /* PCRE is always included on WIN32 */ |
| 10 | + AC_DEFINE("ZEPHIR_USE_PHP_PCRE", 1, "Whether PHP pcre extension is present at compile time"); |
| 11 | + if (PHP_JSON != "no") { |
| 12 | + ADD_EXTENSION_DEP("tensor", "json"); |
| 13 | + AC_DEFINE("ZEPHIR_USE_PHP_JSON", 1, "Whether PHP json extension is present at compile time"); |
| 14 | + } |
| 15 | + ADD_SOURCES(configure_module_dirname + "/include", "arithmetic.c comparison.c linear_algebra.c signal_processing.c settings.c", "tensor"); |
| 16 | + ADD_SOURCES(configure_module_dirname + "/tensor", "algebraic.zep.c arithmetic.zep.c arraylike.zep.c comparable.zep.c special.zep.c statistical.zep.c trigonometric.zep.c tensor.zep.c vector.zep.c columnvector.zep.c matrix.zep.c settings.zep.c", "tensor"); |
| 17 | + ADD_SOURCES(configure_module_dirname + "/tensor/exceptions", "tensorexception.zep.c invalidargumentexception.zep.c dimensionalitymismatch.zep.c runtimeexception.zep.c", "tensor"); |
| 18 | + ADD_SOURCES(configure_module_dirname + "/tensor/decompositions", "cholesky.zep.c eigen.zep.c lu.zep.c svd.zep.c", "tensor"); |
| 19 | + ADD_SOURCES(configure_module_dirname + "/tensor/reductions", "ref.zep.c rref.zep.c", "tensor"); |
| 20 | + ADD_FLAG("CFLAGS_TENSOR", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); |
| 21 | + ADD_FLAG("CFLAGS", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); |
| 22 | + ADD_FLAG("LDFLAGS", "/LTCG"); |
| 23 | + } else { |
| 24 | + WARNING("tensor not enabled; libraries and headers not found"); |
11 | 25 | }
|
12 |
| - ADD_SOURCES(configure_module_dirname + "/include", "arithmetic.c comparison.c linear_algebra.c signal_processing.c settings.c", "tensor"); |
13 |
| - ADD_SOURCES(configure_module_dirname + "/tensor", "algebraic.zep.c arithmetic.zep.c arraylike.zep.c comparable.zep.c special.zep.c statistical.zep.c trigonometric.zep.c tensor.zep.c vector.zep.c columnvector.zep.c matrix.zep.c settings.zep.c", "tensor"); |
14 |
| - ADD_SOURCES(configure_module_dirname + "/tensor/exceptions", "tensorexception.zep.c invalidargumentexception.zep.c dimensionalitymismatch.zep.c runtimeexception.zep.c", "tensor"); |
15 |
| - ADD_SOURCES(configure_module_dirname + "/tensor/decompositions", "cholesky.zep.c eigen.zep.c lu.zep.c svd.zep.c", "tensor"); |
16 |
| - ADD_SOURCES(configure_module_dirname + "/tensor/reductions", "ref.zep.c rref.zep.c", "tensor"); |
17 |
| - ADD_FLAG("CFLAGS_TENSOR", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); |
18 |
| - ADD_FLAG("CFLAGS", "/D ZEPHIR_RELEASE /Oi /Ot /Oy /Ob2 /Gs /GF /Gy /GL"); |
19 |
| - ADD_FLAG("LDFLAGS", "/LTCG"); |
20 | 26 | }
|
0 commit comments