Changeset: b138d9c38ec7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b138d9c38ec7
Modified Files:
        CMakeLists.txt
        clients/odbc/CMakeLists.txt
        monetdb5/extras/rapi/CMakeLists.txt
        sql/backends/monet5/UDF/capi/CMakeLists.txt
        sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
Branch: cmake-fun
Log Message:

We require python 3.4 for testing and 3.5 for python UDFs.

Set RHOME only if HAVE_LIBR is enabled, and HAVE_SIZEOF_SQLWCHAR check is not 
required for the ODBC driver.


diffs (101 lines):

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -287,7 +287,7 @@ else()
        endif()
 endif()
 if(Python3_Interpreter_FOUND)
-       set(PYTHON3_REQUIRED_VERSION "3.5")
+       set(PYTHON3_REQUIRED_VERSION "3.4")
        if("${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" VERSION_LESS 
${PYTHON3_REQUIRED_VERSION})
                message(WARNING "The Python 3 executable is too old 
${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} < 
${PYTHON3_REQUIRED_VERSION}")
        else()
diff --git a/clients/odbc/CMakeLists.txt b/clients/odbc/CMakeLists.txt
--- a/clients/odbc/CMakeLists.txt
+++ b/clients/odbc/CMakeLists.txt
@@ -62,7 +62,7 @@ if(NOT ${ENABLE_ODBC} STREQUAL "NO")
                                set(ODBC_LIBRARIES "${ODBC_LIBRARY}")
                        endif()
 
-                       if(ODBCINST_LIBRARY AND ODBC_LIBRARY AND 
HAVE_SIZEOF_SQLWCHAR)
+                       if(ODBCINST_LIBRARY AND ODBC_LIBRARY)
                                set(HAVE_ODBC ON CACHE INTERNAL "odbc extension 
is available")
                        elseif(${ENABLE_ODBC} STREQUAL "YES")
                                message(FATAL_ERROR "There are unixODBC 
libraries missing")
diff --git a/monetdb5/extras/rapi/CMakeLists.txt 
b/monetdb5/extras/rapi/CMakeLists.txt
--- a/monetdb5/extras/rapi/CMakeLists.txt
+++ b/monetdb5/extras/rapi/CMakeLists.txt
@@ -39,9 +39,10 @@ if(NOT ${ENABLE_RINTEGRATION} STREQUAL "
                set(HAVE_LIBR ON CACHE INTERNAL "rapi extension is available")
        endif()
 endif()
-set(RHOME "${R_HOME_OUTPUT}" CACHE INTERNAL "R home directory") # No R_HOME on 
Windows
 
 if(HAVE_LIBR)
+       set(RHOME "${R_HOME_OUTPUT}" CACHE INTERNAL "R home directory") # No 
R_HOME on Windows
+
        include_directories(../../../common/stream ../../../common/utils 
../../../gdk ../../mal ../../modules/kernel
                                                ../../modules/atoms 
../../modules/mal ../../../sql/common ../../../sql/include
                                                ../../../sql/server 
../../../sql/storage ../../../sql/backends/monet5 ${R_INCLUDE_DIR})
diff --git a/sql/backends/monet5/UDF/capi/CMakeLists.txt 
b/sql/backends/monet5/UDF/capi/CMakeLists.txt
--- a/sql/backends/monet5/UDF/capi/CMakeLists.txt
+++ b/sql/backends/monet5/UDF/capi/CMakeLists.txt
@@ -14,7 +14,7 @@ if("${ENABLE_CINTEGRATION}" STREQUAL "YE
        endif()
 endif()
 if(NOT "${ENABLE_CINTEGRATION}" STREQUAL "NO" AND HAVE_PYTHON3 AND NOT WIN32)
-       set(HAVE_CUDF ON CACHE INTERNAL "pyapi3 extension is available")
+       set(HAVE_CUDF ON CACHE INTERNAL "C udfs extension is available")
 
        include_directories(../../../../../clients/mapilib 
../../../../../common/utils ../../../../../common/stream
                                                
../../../../../monetdb5/modules/atoms ../../../../../monetdb5/modules/mal 
../../../../../gdk
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
@@ -6,21 +6,34 @@
 # Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
 #]]
 
-if(HAVE_PYTHON3 AND Python3_Development_FOUND)
-       message(STATUS "Checking for numpy version")
-       exec_program("${Python3_EXECUTABLE}" ARGS "-c \"import numpy; 
print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)\"" OUTPUT_VARIABLE 
NUMPY_OUTPUT RETURN_VALUE NUMPY_RETURN_CODE)
-       exec_program("${Python3_EXECUTABLE}" 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_LIBPY3 ON CACHE INTERNAL "pyapi3 extension is 
available")
-               set(NUMPY3_INCLUDE_DIR ${NUMPY_CPP_FLAGS})
-               message(STATUS "numpy version >= 1.7.0 for Python 3 found")
+if(NOT "${ENABLE_PY3INTEGRATION}" STREQUAL "NO")
+       if(HAVE_PYTHON3 AND Python3_Development_FOUND)
+               set(PYTHON3_DEV_REQUIRED_VERSION "3.5")
+               if("${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" 
VERSION_LESS ${PYTHON3_DEV_REQUIRED_VERSION})
+                       if("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
+                               message(FATAL_ERROR "Python 
${PYTHON3_DEV_REQUIRED_VERSION} is required for Python 3 integration support")
+                       else()
+                               message(STATUS "Python 
${PYTHON3_DEV_REQUIRED_VERSION} is required for Python 3 integration support")
+                       endif()
+               else()
+                       message(STATUS "Checking for numpy version")
+                       exec_program("${Python3_EXECUTABLE}" ARGS "-c \"import 
numpy; print(int(numpy.__version__.split('.').__getitem__(1)) >= 7)\"" 
OUTPUT_VARIABLE NUMPY_OUTPUT RETURN_VALUE NUMPY_RETURN_CODE)
+                       exec_program("${Python3_EXECUTABLE}" 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_LIBPY3 ON CACHE INTERNAL "pyapi3 
extension is available")
+                               set(NUMPY3_INCLUDE_DIR ${NUMPY_CPP_FLAGS})
+                               message(STATUS "numpy version >= 1.7.0 for 
Python 3 found")
+                       elseif("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
+                               message(FATAL_ERROR "numpy version >= 1.7.0 
required for Python 3 integration support")
+                       else()
+                               message(STATUS "numpy version >= 1.7.0 required 
for Python 3 integration support")
+                       endif()
+               endif()
        elseif("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
-               message(FATAL_ERROR "numpy version >= 1.7.0 required for Python 
3 integration support")
+               message(FATAL_ERROR "A Python 3 interpreter and development 
libraries are required for Python 3 integration support")
        else()
-               message(STATUS "numpy version >= 1.7.0 required for Python 3 
integration support")
+               message(STATUS "A Python 3 interpreter and development 
libraries are required for Python 3 integration support")
        endif()
-elseif("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
-       message(FATAL_ERROR "A valid Python 3 interpreter is required for 
Python 3 integration support")
 endif()
 
 if(HAVE_LIBPY3)
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to