Changeset: 80a103907e3e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=80a103907e3e
Added Files:
geom/monetdb5/libgeom.c
geom/monetdb5/libgeom.h
Removed Files:
geom/lib/libgeom.c
geom/lib/libgeom.h
Modified Files:
CMakeLists.txt
CMakeReadme.txt
geom/lib/Makefile.ag
geom/monetdb5/CMakeLists.txt
testing/CMakeLists.txt
testing/Mtest.py.in
Branch: cmake-fun
Log Message:
Removed python 2 references as it support will end soon (Mtest.py runs).
Cleaned dependency checks for data vaults libraries.
diffs (truncated from 515 to 300 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,7 +102,7 @@ set(ENABLE_GDK "YES" CACHE STRING "Enabl
set(ENABLE_MONETDB5 "YES" CACHE STRING "Enable support for MonetDB5
(default=YES)")
if(${ENABLE_GDK} STREQUAL "NO")
if(${ENABLE_MONETDB5} STREQUAL "YES")
- message(FATAL_ERROR "MonetDB5 requires GDK.")
+ message(FATAL_ERROR "MonetDB5 requires GDK")
elseif(${ENABLE_MONETDB5} STREQUAL "AUTO")
set(ENABLE_MONETDB5 "NO")
endif()
@@ -113,33 +113,12 @@ endif()
set(ENABLE_SQL "YES" CACHE STRING "Enable support for MonetDB/SQL
(default=YES)")
if(${ENABLE_MONETDB5} STREQUAL "NO")
if(${ENABLE_SQL} STREQUAL "YES")
- message(FATAL_ERROR "MonetDB/SQL requires MonetDB5.")
+ message(FATAL_ERROR "MonetDB/SQL requires MonetDB5")
elseif(${ENABLE_SQL} STREQUAL "AUTO")
set(ENABLE_SQL "NO")
endif()
endif()
-set(ENABLE_GEOM "AUTO" CACHE STRING "Enable support for geom module
(default=AUTO)")
-if(${ENABLE_MONETDB5} STREQUAL "NO")
- if(${ENABLE_GEOM} STREQUAL "YES")
- message(FATAL_ERROR "Geom module requires MonetDB5.")
- elseif(${ENABLE_GEOM} STREQUAL "AUTO")
- set(ENABLE_GEOM "NO")
- endif()
-endif()
-
-set(ENABLE_LIDAR "AUTO" CACHE STRING "Enable support for LiDAR data
(default=AUTO)")
-set(ENABLE_SHP "AUTO" CACHE STRING "Enable support for ESRI Shapefiles
(default=AUTO)")
-if(${ENABLE_GEOM} STREQUAL "NO")
- if(${ENABLE_SHP} STREQUAL "YES")
- message(FATAL_ERROR "ESRI Shapefile vault requires the geom
module.")
- elseif(${ENABLE_SHP} STREQUAL "AUTO")
- set(ENABLE_SHP "NO")
- endif()
-else()
- set(HAVE_GEOM ON)
-endif()
-
set(ENABLE_EMBEDDED "NO" CACHE STRING "Enable support for running MonetDB as a
library (default=NO)") # TODO check this
if(NOT ${ENABLE_EMBEDDED} STREQUAL "NO")
set(HAVE_EMBEDDED ON)
@@ -287,87 +266,52 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Inte
endif()
endif()
-set(PY2_INCLUDE_DIR "")
-set(PY2_LIBRARIES "")
+include(FindPython3)
+find_package(Python3 COMPONENTS Interpreter Development)
set(PY3_INCLUDE_DIR "")
set(PY3_LIBRARIES "")
-set(ENABLE_PY2INTEGRATION "AUTO" CACHE STRING "Enable support for Python 2
integration into MonetDB (default=AUTO)") # Check with HAVE_LIBPY
-set(ENABLE_PY3INTEGRATION "AUTO" CACHE STRING "enable support for Python 3
integration into MonetDB (default=AUTO)") # Check with HAVE_LIBPY3
-
-include(FindPython2)
-include(FindPython3)
-find_package(Python2 COMPONENTS Interpreter Development)
-find_package(Python3 COMPONENTS Interpreter Development)
-if(Python2_FOUND)
- if(${Python2_VERSION_MINOR} VERSION_LESS 6)
- message(WARNING "Python 2 executable is too old (<2.6)")
- else()
- set(HAVE_PYTHON2 YES)
- set(PY2_INCLUDE_DIR "${Python2_INCLUDE_DIRS}")
- set(PY2_LIBRARIES "${Python2_LIBRARIES}")
- set(PYTHON2 "${Python2_EXECUTABLE}")
- endif()
-endif()
+set(ENABLE_PY3INTEGRATION "AUTO" CACHE STRING "enable support for Python 3
integration into MonetDB (default=AUTO)") # Check with HAVE_PYTHON3 and
HAVE_LIBPY3 for integration
if(Python3_FOUND)
- if(${Python3_VERSION_MINOR} VERSION_LESS 5)
- message(WARNING "Python 3 executable is too old (<3.5)")
+ set(PYTHON3_REQUIRED_VERSION "3.5")
+ if("${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}" VERSION_LESS
${PYTHON3_REQUIRED_VERSION})
+ if("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
+ message(FATAL_ERROR "The Python 3 executable is too old
${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} <
${PYTHON3_REQUIRED_VERSION}")
+ else()
+ message(WARNING "The Python 3 executable is too old
${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} <
${PYTHON3_REQUIRED_VERSION})")
+ endif()
else()
set(HAVE_PYTHON3 YES)
set(PY3_INCLUDE_DIR "${Python3_INCLUDE_DIRS}")
set(PY3_LIBRARIES "${Python3_LIBRARIES}")
- set(PYTHON3 "${Python3_EXECUTABLE}")
- endif()
-endif()
-if(HAVE_PYTHON2 OR HAVE_PYTHON3)
- set(HAVE_PYTHON YES)
- if(HAVE_PYTHON2) # Prioritize python 2 over python 3
- exec_program("${PYTHON2}" ARGS "-c \"import
distutils.sysconfig;
print(distutils.sysconfig.get_python_lib(1,0,'${LIBDIR}'))\"" OUTPUT_VARIABLE
PYTHON2_LIBDIR RETURN_VALUE PYTHON2_LIBDIR_CODE)
- if(PYTHON2_LIBDIR AND PYTHON2_LIBDIR_CODE EQUAL 0)
- string(LENGTH "${LIBDIR}" LIBDIR_LENGTH)
- string(LENGTH "${PYTHON2_LIBDIR}"
PYTHON2_LIBDIR_PREFIX_LENGTH)
- math(EXPR LEN1 "${LIBDIR_LENGTH}+1") # add the /
separator
- string(SUBSTRING "${PYTHON2_LIBDIR}" ${LEN1} -1
PYTHON_LIBDIR) # remove the prefix
- else()
- message(FATAL_ERROR "Could not find PYTHON2_LIBDIR")
- endif()
- else()
- exec_program("${PYTHON3}" ARGS "-c \"import
distutils.sysconfig;
print(distutils.sysconfig.get_python_lib(1,0,'${LIBDIR}'))\"" OUTPUT_VARIABLE
PYTHON3_LIBDIR RETURN_VALUE PYTHON3_LIBDIR_CODE)
+ exec_program("${Python3_EXECUTABLE}" ARGS "-c \"import
distutils.sysconfig;
print(distutils.sysconfig.get_python_lib(1,0,'${LIBDIR}'))\"" OUTPUT_VARIABLE
PYTHON3_LIBDIR RETURN_VALUE PYTHON3_LIBDIR_CODE)
if(PYTHON3_LIBDIR AND PYTHON3_LIBDIR_CODE EQUAL 0)
string(LENGTH "${LIBDIR}" LIBDIR_LENGTH)
string(LENGTH "${PYTHON3_LIBDIR}"
PYTHON3_LIBDIR_PREFIX_LENGTH)
math(EXPR LEN1 "${LIBDIR_LENGTH}+1") # add the /
separator
string(SUBSTRING "${PYTHON3_LIBDIR}" ${LEN1} -1
PYTHON_LIBDIR) # remove the prefix
else()
- message(FATAL_ERROR "Could not find PYTHON3_LIBDIR")
+ message(FATAL_ERROR "Could not find Python 3 library
directory")
+ endif()
+
+ 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 YES)
+ 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()
-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 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)
- 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")
- else()
- message(STATUS "numpy version >= 1.7.0 required for Python
${PY_MAJOR_VERSION} integration support")
- endif()
-endfunction()
-if(HAVE_PYTHON2 AND NOT ${ENABLE_PY2INTEGRATION} STREQUAL "NO")
- 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} NUMPY3_INCLUDE_DIR)
+elseif("${ENABLE_PY3INTEGRATION}" STREQUAL "YES")
+ message(FATAL_ERROR "A valid Python 3 interpreter is required for
Python 3 integration support")
endif()
set(ENABLE_TESTING "AUTO" CACHE STRING "Enable support for testing
(default=AUTO)")
-if(NOT "${ENABLE_TESTING}" STREQUAL "NO" AND NOT HAVE_PYTHON2 AND NOT
HAVE_PYTHON3)
+if(NOT "${ENABLE_TESTING}" STREQUAL "NO" AND NOT HAVE_PYTHON3)
set(ENABLE_TESTING "NO")
endif()
if(NOT "${ENABLE_TESTING}" STREQUAL "NO")
@@ -834,8 +778,8 @@ endif()
set(ODBCINST_LIBRARIES "")
set(ODBC_LIBRARIES "")
set(ODBC_INCLUDE_DIR "")
-set(WITH_ODBC "AUTO" CACHE STRING "Compile the MonetDB ODBC driver
(default=AUTO)") # Check with HAVE_ODBC
-if(NOT ${WITH_ODBC} STREQUAL "NO")
+set(ENABLE_ODBC "AUTO" CACHE STRING "Compile the MonetDB ODBC driver
(default=AUTO)") # Check with HAVE_ODBC
+if(NOT ${ENABLE_ODBC} STREQUAL "NO")
find_path(ODBCINST_INCLUDE odbcinst.h)
if(ODBCINST_INCLUDE)
set(HAVE_ODBCINST_H ON)
@@ -885,7 +829,7 @@ if(NOT ${WITH_ODBC} STREQUAL "NO")
if(HAVE_SQLGETPRIVATEPROFILESTRING)
set(ODBCINST_LIBRARIES
"${ODBCINST_LIBRARY}")
set(HAVE_SQLGETPRIVATEPROFILESTRING ON)
- elseif(${WITH_ODBC} STREQUAL "YES")
+ elseif(${ENABLE_ODBC} STREQUAL "YES")
message(FATAL_ERROR "odbcinst library
not found")
else()
message(STATUS "odbcinst library not
found")
@@ -900,7 +844,7 @@ if(NOT ${WITH_ODBC} STREQUAL "NO")
cmake_pop_check_state()
if(HAVE_SQLGETDIAGREC)
set(ODBC_LIBRARIES "${ODBC_LIBRARY}")
- elseif(${WITH_ODBC} STREQUAL "YES")
+ elseif(${ENABLE_ODBC} STREQUAL "YES")
message(FATAL_ERROR "odbc library not
found")
else()
message(STATUS "odbc library not found")
@@ -935,13 +879,13 @@ if(NOT ${WITH_ODBC} STREQUAL "NO")
if(ODBCINST_LIBRARY AND ODBC_LIBRARY)
set(HAVE_ODBC YES)
- elseif(${WITH_ODBC} STREQUAL "YES")
+ elseif(${ENABLE_ODBC} STREQUAL "YES")
message(FATAL_ERROR "There are unixODBC
libraries missing")
else()
message(STATUS "There are unixODBC libraries
missing")
endif()
endif()
- elseif(${WITH_ODBC} STREQUAL "YES")
+ elseif(${ENABLE_ODBC} STREQUAL "YES")
message(FATAL_ERROR "odbcinst.h not found")
else()
message(STATUS "odbcinst.h not found")
@@ -964,8 +908,8 @@ if(NOT PROJ_FOUND)
endif()
set(SAMTOOLS_LIBRARIES "")
-set(WITH_SAMTOOLS "AUTO" CACHE PATH "Include Samtools support (default=AUTO)")
# Check with HAVE_SAMTOOLS
-if(NOT ${WITH_SAMTOOLS} STREQUAL "NO")
+set(ENABLE_SAMTOOLS "AUTO" CACHE PATH "Include Samtools support
(default=AUTO)") # Check with HAVE_SAMTOOLS
+if(NOT ${ENABLE_SAMTOOLS} STREQUAL "NO")
cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES
"${CMAKE_REQUIRED_LIBRARIES};${MATH_LIBRARIES};${THREAD_LIBRARIES};${ZLIB_LIBRARIES};bam")
check_include_file("samtools/bam.h" HAVE_SAMTOOLS_BAM_H)
@@ -979,7 +923,7 @@ if(NOT ${WITH_SAMTOOLS} STREQUAL "NO")
check_symbol_exists("bam_header_read" "samtools/bam.h" HAVE_SAMTOOLS)
if(HAVE_SAMTOOLS)
set(SAMTOOLS_LIBRARIES "bam")
- elseif(${WITH_SAMTOOLS} STREQUAL "YES")
+ elseif(${ENABLE_SAMTOOLS} STREQUAL "YES")
message(FATAL_ERROR "bam_header_read symbol not found")
else()
message(STATUS "bam_header_read symbol not found")
@@ -987,56 +931,49 @@ if(NOT ${WITH_SAMTOOLS} STREQUAL "NO")
cmake_pop_check_state()
endif()
-set(WITH_GEOS "AUTO" CACHE STRING "Include geos library support
(default=AUTO)") # Check with HAVE_GEOS_LIB
-if(NOT ${WITH_GEOS} STREQUAL "NO")
- include(FindGeos)
+set(ENABLE_GEOM "AUTO" CACHE STRING "Enable support for geom module
(default=AUTO)") # Check with HAVE_GEOM
+if(NOT ${ENABLE_GEOM} STREQUAL "NO")
+ if(${ENABLE_MONETDB5} STREQUAL "NO" AND ${ENABLE_GEOM} STREQUAL "YES")
+ message(FATAL_ERROR "Geom module requires MonetDB5")
+ else()
+ include(FindGeos)
- if(GEOS_FOUND)
- set(GEOS_MINIMUM_VERSION "3.4.0")
- if(GEOS_VERSION VERSION_LESS "${GEOS_MINIMUM_VERSION}")
- if(${WITH_GEOS} STREQUAL "YES")
- message(FATAL_ERROR "geos library found but
version is too old: ${GEOS_VERSION} < ${GEOS_MINIMUM_VERSION}")
+ if(GEOS_FOUND)
+ set(GEOS_MINIMUM_VERSION "3.4.0")
+ if(GEOS_VERSION VERSION_LESS "${GEOS_MINIMUM_VERSION}")
+ if(${ENABLE_GEOM} STREQUAL "YES")
+ message(FATAL_ERROR "geos library found
but version is too old: ${GEOS_VERSION} < ${GEOS_MINIMUM_VERSION}")
+ else()
+ message(STATUS "geos library found but
version is too old: ${GEOS_VERSION} < ${GEOS_MINIMUM_VERSION}")
+ endif()
else()
- message(STATUS "geos library found but version
is too old: ${GEOS_VERSION} < ${GEOS_MINIMUM_VERSION}")
+ set(HAVE_GEOM ON)
endif()
- else()
- set(HAVE_GEOS_LIB ON)
+ elseif(${ENABLE_GEOM} STREQUAL "YES")
+ message(FATAL_ERROR "geos library required for geom
module")
endif()
- elseif(${WITH_GEOS} STREQUAL "YES")
- message(FATAL_ERROR "geos library not found")
endif()
endif()
-if(NOT HAVE_GEOS_LIB)
+if(NOT HAVE_GEOM)
set(GEOS_INCLUDE_DIR "")
set(GEOS_LIBRARIES "")
- if(${ENABLE_GEOM} STREQUAL "YES")
- message(FATAL_ERROR "geos library required for geom module")
- else()
- set(HAVE_GEOM OFF)
- endif()
endif()
-set(WITH_GDAL "AUTO" CACHE STRING "Include gdal support (default=AUTO)") #
Check with GDAL_FOUND
-if(${WITH_GDAL} STREQUAL "NO")
- if(HAVE_GEOM)
- message(FATAL_ERROR "geom module required for gdal")
+set(ENABLE_SHP "AUTO" CACHE STRING "Enable support for ESRI Shapefiles
(default=AUTO)") # Check with HAVE_SHP
+if(NOT ${ENABLE_SHP} STREQUAL "NO")
+ if(NOT HAVE_GEOM AND ${ENABLE_SHP} STREQUAL "YES")
+ message(FATAL_ERROR "geom module required for ESRI Shapefile
vault")
else()
- set(HAVE_GEOM OFF)
- endif()
- if(${ENABLE_SHP} STREQUAL "YES")
- message(FATAL_ERROR "geom module required for shp")
- else()
- set(ENABLE_SHP "NO")
+ include(FindGDAL)
+
+ if(GDAL_FOUND)
+ set(HAVE_SHP YES)
+ elseif(${ENABLE_SHP} STREQUAL "YES")
+ message(FATAL_ERROR "gdal library required for ESRI
Shapefile vault")
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list