Changeset: 71588c85d3ae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=71588c85d3ae
Modified Files:
CMakeLists.txt
sql/backends/monet5/UDF/pyapi/CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
Branch: cmake-fun
Log Message:
We still have to look for numpy include directory.
diffs (66 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -347,11 +347,13 @@ else()
message(FATAL_ERROR "A valid python 2 or python 3 interpreter is
required to compile MonetDB")
endif()
-function(MT_testPythonIntegration HAVE_LIBPY PY_MAJOR_VERSION
INTEGRATION_ENABLED INTERPRETER_PATH)
+function(MT_testPythonIntegration HAVE_LIBPY PY_MAJOR_VERSION
INTEGRATION_ENABLED INTERPRETER_PATH NUMPY_INCLUDE_DIR)
message(STATUS "Checking for numpy version")
exec_program("${INTERPRETER_PATH}" ARGS "-c \"import numpy;
print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)\"" OUTPUT_VARIABLE
NUMPY_OUTPUT RETURN_VALUE NUMPY_RETURN_CODE)
- if(NUMPY_RETURN_CODE EQUAL 0 AND "${NUMPY_OUTPUT}" STREQUAL "True")
+ exec_program("${INTERPRETER_PATH}" ARGS "-c \"import numpy;
print(numpy.get_include())\"" OUTPUT_VARIABLE NUMPY_CPP_FLAGS RETURN_VALUE
NUMPY_CPP_RC)
+ if(NUMPY_RETURN_CODE EQUAL 0 AND NUMPY_CPP_RC EQUAL 0 AND
"${NUMPY_OUTPUT}" STREQUAL "True")
set(${HAVE_LIBPY} YES PARENT_SCOPE)
+ set(${NUMPY_INCLUDE_DIR} "${NUMPY_CPP_FLAGS}" PARENT_SCOPE)
message(STATUS "numpy version >= 1.7.0 for Python
${PY_MAJOR_VERSION} found")
elseif("${INTEGRATION_ENABLED}" STREQUAL "YES")
message(FATAL_ERROR "numpy version >= 1.7.0 required for Python
${PY_MAJOR_VERSION} integration support")
@@ -360,10 +362,10 @@ function(MT_testPythonIntegration HAVE_L
endif()
endfunction()
if(HAVE_PYTHON2 AND NOT ${ENABLE_PY2INTEGRATION} STREQUAL "NO")
- MT_testPythonIntegration(HAVE_LIBPY 2 ${ENABLE_PY2INTEGRATION}
${Python2_EXECUTABLE})
+ MT_testPythonIntegration(HAVE_LIBPY 2 ${ENABLE_PY2INTEGRATION}
${Python2_EXECUTABLE} NUMPY2_INCLUDE_DIR)
endif()
if(HAVE_PYTHON3 AND NOT ${ENABLE_PY3INTEGRATION} STREQUAL "NO")
- MT_testPythonIntegration(HAVE_LIBPY3 3 ${ENABLE_PY3INTEGRATION}
${Python3_EXECUTABLE})
+ MT_testPythonIntegration(HAVE_LIBPY3 3 ${ENABLE_PY3INTEGRATION}
${Python3_EXECUTABLE} NUMPY3_INCLUDE_DIR)
endif()
set(ENABLE_TESTING "AUTO" CACHE STRING "Enable support for testing
(default=AUTO)")
@@ -1141,7 +1143,7 @@ else()
set(CMAKE_EXTRA_INCLUDE_FILES
"${CMAKE_EXTRA_INCLUDE_FILES};sys/types.h;sys/socket.h")
endif()
check_type_size(SOCKET _SOCKET LANGUAGE C)
-if(NOT HAVE_SOCKET)
+if(NOT HAVE__SOCKET)
set(SOCKET int)
endif()
check_type_size(socklen_t SOCKLEN_T LANGUAGE C)
diff --git a/sql/backends/monet5/UDF/pyapi/CMakeLists.txt
b/sql/backends/monet5/UDF/pyapi/CMakeLists.txt
--- a/sql/backends/monet5/UDF/pyapi/CMakeLists.txt
+++ b/sql/backends/monet5/UDF/pyapi/CMakeLists.txt
@@ -9,7 +9,8 @@
include_directories(../../../../../clients/mapilib ../../../../../common/utils
../../../../../common/stream
../../../../../monetdb5/modules/atoms
../../../../../monetdb5/modules/mal ../../../../../gdk
../../../../../monetdb5/mal
../../../../../sql/backends/monet5 ../../../../../sql/common
- ../../../../../sql/include
../../../../../sql/server ../../../../../sql/storage ${PY2_INCLUDE_DIR})
+ ../../../../../sql/include
../../../../../sql/server ../../../../../sql/storage ${PY2_INCLUDE_DIR}
+ ${NUMPY2_INCLUDE_DIR})
set(PYAPI_LINK_LIBRARIES ${PY2_LIBRARIES})
if(WIN32)
diff --git a/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
b/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
--- a/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
+++ b/sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
@@ -10,7 +10,7 @@ include_directories(../../../../../clien
../../../../../monetdb5/modules/atoms
../../../../../monetdb5/modules/mal ../../../../../gdk
../../../../../monetdb5/mal
../../../../../sql/backends/monet5 ../../../../../sql/common
../../../../../sql/include
../../../../../sql/server ../../../../../sql/storage ../pyapi
- ${PY3_INCLUDE_DIR})
+ ${PY3_INCLUDE_DIR}
${NUMPY3_INCLUDE_DIR})
set(PYAPI3_LINK_LIBRARIES ${PY3_LIBRARIES})
if(WIN32)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list