Changeset: 529e39ff077d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=529e39ff077d
Added Files:
cmake/FindExtraLibraries.cmake
Modified Files:
CMakeLists.txt
clients/CMakeLists.txt
clients/mapiclient/CMakeLists.txt
clients/odbc/CMakeLists.txt
cmake/FindLiblas.cmake
geom/CMakeLists.txt
geom/monetdb5/CMakeLists.txt
monetdb5/extras/CMakeLists.txt
monetdb5/extras/rapi/CMakeLists.txt
monetdb5/modules/mal/mal_mapi.c
sql/backends/monet5/UDF/CMakeLists.txt
sql/backends/monet5/UDF/capi/CMakeLists.txt
sql/backends/monet5/UDF/pyapi3/CMakeLists.txt
sql/backends/monet5/vaults/CMakeLists.txt
sql/backends/monet5/vaults/bam/CMakeLists.txt
sql/backends/monet5/vaults/fits/CMakeLists.txt
sql/backends/monet5/vaults/lidar/CMakeLists.txt
sql/backends/monet5/vaults/netcdf/CMakeLists.txt
sql/backends/monet5/vaults/shp/CMakeLists.txt
testing/CMakeLists.txt
testing/Mtest.py.in
Branch: cmake-fun
Log Message:
Continuing cleanup:
- Moved tests to proper subdirectories.
- Reverted old liblas test.
- Removed unused CROSS_COMPILING conditional in Mtest
- In mal_mapi.c we have to set SOCKLEN to int on Windows because the winsock
API requires int instead of socklen_t.
diffs (truncated from 2207 to 300 lines):
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -80,40 +80,49 @@ if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES
message(WARNING "Compiler potentially not (correctly) recognized")
endif()
-# Set default build options
-if(NOT CMAKE_BUILD_TYPE)
+if(NOT CMAKE_BUILD_TYPE) # Set default build options
message(STATUS "Setting build type to Debug as none was selected")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "The type of build" FORCE)
endif()
-# modules to use
-set(ENABLE_MAPI "YES" CACHE STRING "Enable MAPI (default=YES)")
-if(NOT ${ENABLE_MAPI} STREQUAL "NO")
- set(HAVE_MAPI ON)
-endif()
-
-set(ENABLE_GDK "YES" CACHE STRING "Enable support for GDK (default=YES)")
-set(ENABLE_MONETDB5 "YES" CACHE STRING "Enable support for MonetDB5
(default=YES)")
-set(ENABLE_SQL "YES" CACHE STRING "Enable support for MonetDB/SQL
(default=YES)")
-
+# Extensions to use
+set(ENABLE_CINTEGRATION "AUTO" CACHE STRING "Enable support for C UDFs
(default=AUTO)")
+set(ENABLE_CONSOLE "YES" CACHE STRING "Enables direct console on the server
(involves security risks) (default=YES)")
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)
-endif()
-
-set(ENABLE_CONSOLE "YES" CACHE STRING "Enables direct console on the server
(involves security risks) (default=YES)")
-if(NOT ${ENABLE_CONSOLE} STREQUAL "NO")
- set(HAVE_CONSOLE ON)
-endif()
+set(ENABLE_FITS "AUTO" CACHE STRING "Enable support for FITS (default=AUTO)")
# Check with HAVE_FITS
+set(ENABLE_GDK "YES" CACHE STRING "Enable support for GDK (default=YES)")
+set(ENABLE_GEOM "AUTO" CACHE STRING "Enable support for geom module
(default=AUTO)") # Check with HAVE_GEOM
+set(ENABLE_INT128 "AUTO" CACHE STRING "Enable support for 128-bit integers
(default=AUTO)")
+set(ENABLE_LIDAR "AUTO" CACHE STRING "Enable support for LiDAR data
(default=AUTO)") # Check with HAVE_LIDAR
+set(ENABLE_MAPI "YES" CACHE STRING "Enable MAPI (default=YES)")
+set(ENABLE_MONETDB5 "YES" CACHE STRING "Enable support for MonetDB5
(default=YES)")
+set(ENABLE_NETCDF "AUTO" CACHE STRING "Enable support for netcdf
(default=AUTO)") # Check with HAVE_NETCDF
+set(ENABLE_ODBC "AUTO" CACHE STRING "Compile the MonetDB ODBC driver
(default=AUTO)") # Check with HAVE_ODBC
+set(ENABLE_PY3INTEGRATION "AUTO" CACHE STRING "enable support for Python 3
integration into MonetDB (default=AUTO)") # Check with HAVE_LIBPY3
+set(ENABLE_RINTEGRATION "AUTO" CACHE STRING "Enable support for R integration
into MonetDB (default=AUTO)") # Check with HAVE_LIBR
+set(ENABLE_SAMTOOLS "AUTO" CACHE STRING "Include Samtools support
(default=AUTO)") # Check with HAVE_SAMTOOLS
+set(ENABLE_SANITIZER "NO" CACHE STRING "Enable support for the GCC address
sanitizer (default=NO)")
+set(ENABLE_SHP "AUTO" CACHE STRING "Enable support for ESRI Shapefiles
(default=AUTO)") # Check with HAVE_SHP
+set(ENABLE_SQL "YES" CACHE STRING "Enable support for MonetDB/SQL
(default=YES)")
+set(ENABLE_STATIC_ANALYSIS "NO" CACHE STRING "Configure for static code
analysis (use only if you know what you are doing)")
+set(ENABLE_STRICT "${DFT_STRICT}" CACHE STRING "Enable strict compiler flags
(default=YES for development sources, NO for tarball instalation)")
+set(ENABLE_TESTING "AUTO" CACHE STRING "Enable support for testing
(default=AUTO)")
-set(ENABLE_STRICT "${DFT_STRICT}" CACHE STRING "Enable strict compiler flags
(default=YES for development sources, NO for tarball instalation)")
-set(ENABLE_SANITIZER "NO" CACHE STRING "Enable support for the GCC address
sanitizer (default=NO)")
-set(ENABLE_STATIC_ANALYSIS "NO" CACHE STRING "Configure for static code
analysis (use only if you know what you are doing)")
-if(NOT ${ENABLE_STATIC_ANALYSIS} STREQUAL "NO")
- set(STATIC_CODE_ANALYSIS ON)
-endif()
+set(WITH_BZ2 "AUTO" CACHE STRING "Include bz2 support (default=AUTO)") # Check
with BZip2_FOUND
+set(WITH_CURL "AUTO" CACHE STRING "Include cURL support (default=AUTO)") #
Check with HAVE_CURL
+set(WITH_LIBLZMA "AUTO" CACHE STRING "Include liblzma support (default=AUTO)")
# Check with HAVE_LIBLZMA
+set(WITH_LIBXML2 "AUTO" CACHE STRING "Include libxml2 support (default=AUTO)")
# Check with HAVE_LIBXML
+set(WITH_LZ4 "AUTO" CACHE STRING "Include lz4 library support (default=AUTO)")
# Check with HAVE_LIBLZ4
+set(WITH_PROJ "AUTO" CACHE STRING "Include proj support (default=AUTO)") #
Check with HAVE_PROJ
+set(WITH_READLINE "AUTO" CACHE STRING "Include readline support
(default=AUTO)") # Check with HAVE_LIBREADLINE
+set(WITH_REGEX "PCRE" CACHE STRING "Use either PCRE or POSIX regular
expressions (default=PCRE if available)") # Check with HAVE_LIBPCRE and
HAVE_POSIX_REGEX
+set(WITH_SNAPPY "AUTO" CACHE STRING "Include snappy support (default=AUTO)") #
Check with HAVE_LIBSNAPPY
+set(WITH_UUID "AUTO" CACHE STRING "Include UUID support (default=AUTO)") #
Check with HAVE_UUID
+set(WITH_VALGRIND "NO" CACHE STRING "Include valgrind support (default=NO)") #
Check with HAVE_VALGRIND
+set(WITH_ZLIB "AUTO" CACHE STRING "Include zlib support (default=AUTO)") #
Check with HAVE_LIBZ
-set(SOURCE "${CMAKE_SOURCE_DIR}")
+# Instalation directories
+set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # required for some
instalation files
if(WIN32)
string(REPLACE "/" "\\\\" TRIMMED_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}") # Fix cmake conversions
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
@@ -147,17 +156,6 @@ else()
set(PKGCONFIGDIR "${LIBDIR}/pkgconfig")
endif()
-set(PROGRAM_PERMISSIONS_DEFAULT OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # required for some
instalation files
-
-# password hash algorithm
-set(PASSWORD_BACKEND "SHA512" CACHE STRING "Password hash algorithm, one of
MD5, SHA1, RIPEMD160, SHA224, SHA256, SHA384, SHA512, defaults to SHA512")
-if(${PASSWORD_BACKEND} MATCHES
"^MD5|SHA1|RIPEMD160|SHA224|SHA256|SHA384|SHA512$")
- set(MONETDB5_PASSWDHASH ${PASSWORD_BACKEND})
- set(MONETDB5_PASSWDHASH_TOKEN ${PASSWORD_BACKEND})
-else()
- message(FATAL_ERROR "PASSWORD_BACKEND invalid, choose one of MD5, SHA1,
RIPEMD160, SHA224, SHA256, SHA384, SHA512")
-endif()
-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
add_compile_definitions(_GNU_SOURCE _XOPEN_SOURCE)
set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}
-D_GNU_SOURCE -D_XOPEN_SOURCE") # required for tests
@@ -168,17 +166,17 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Inte
file(READ "${ROOT}/usr/include/math.h" TMPTXT)
string(FIND "${TMPTXT}" "_LIB_VERSION_TYPE" FOUND_VERSION)
if(NOT FOUND_VERSION)
- set(INTEL_MATH_H_HACK ON)
+ set(INTEL_MATH_H_HACK ON CACHE INTERNAL "must use intel
math.h hack")
endif()
endif()
- set(NAN_CANNOT_BE_USED_AS_INITIALIZER ON) # This hack is only required
by the Intel compiler
+ set(NAN_CANNOT_BE_USED_AS_INITIALIZER ON CACHE INTERNAL "NaN cannot be
used as an initializer") # This hack is only required by the Intel compiler
elseif(MSVC)
set(_Noreturn "__declspec(noreturn)")
set(__attribute__(a) ON)
set(restrict "__restrict")
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
if(CMAKE_SIZEOF_VOID_P EQUAL 8) # Windows 64 bit
- set(HAVE__MUL128 ON)
+ set(HAVE__MUL128 ON CACHE INTERNAL "mul128 function is
available")
endif()
endif()
@@ -222,70 +220,6 @@ if(NOT MSVC)
endif()
endif()
-include(FindPython3)
-find_package(Python3 COMPONENTS Interpreter Development)
-set(PY3_INCLUDE_DIR "")
-set(PY3_LIBRARIES "")
-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)
- 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}")
- 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 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()
-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("${ENABLE_TESTING}" STREQUAL "YES" AND NOT HAVE_PYTHON3)
- message(FATAL_ERROR "A valid Python 3 interpreter is required for
MonetDB testing tools")
-endif()
-if(NOT "${ENABLE_TESTING}" STREQUAL "NO" AND HAVE_PYTHON3)
- set(HAVE_TESTING ON)
-endif()
-
-set(ENABLE_CINTEGRATION "AUTO" CACHE STRING "Enable support for C UDFs
(default=AUTO)")
-if("${ENABLE_CINTEGRATION}" STREQUAL "YES")
- if(NOT HAVE_PYTHON3)
- message(FATAL_ERROR "A valid Python 3 interpreter is required
to compile the C UDFs module")
- elseif(WIN32)
- message(FATAL_ERROR "The C UDFs module is not avaiable on
Windows")
- endif()
-endif()
-if(NOT "${ENABLE_CINTEGRATION}" STREQUAL "NO" AND HAVE_PYTHON3 AND NOT WIN32)
- set(HAVE_CUDF ON)
-endif()
-
if(WIN32)
set(OS_DIRSEP "\\\\")
set(OS_PATHSEP ";")
@@ -310,113 +244,43 @@ set(DIR_SEP_STR ${OS_DIRSEP})
set(PATH_SEP "'${OS_PATHSEP}'")
set(SO_EXT "${CMAKE_SHARED_LIBRARY_SUFFIX}")
+# We need python3 for the testweb, python udfs and c udfs compilation
+include(FindPython3)
+find_package(Python3 COMPONENTS Interpreter Development)
+if(Python3_FOUND)
+ set(PYTHON3_REQUIRED_VERSION "3.5")
+ 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()
+ 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(WARNING "Could not find Python 3 library
directory")
+ endif()
+ set(HAVE_PYTHON3 ON CACHE INTERNAL "python3 is available")
+ endif()
+endif()
+
# Bison
find_package(BISON)
if(NOT BISON_FOUND)
if(${ENABLE_SQL} STREQUAL "YES")
message(FATAL_ERROR "MonetDB/SQL requires bison")
- else()
- set(ENABLE_SQL "NO")
endif()
+ set(ENABLE_SQL "NO" CACHE STRING "Bison is required for MonetDB/SQL"
FORCE)
endif()
# Iconv
include(FindIconvMonetDB)
if(ICONV_FOUND)
- set(HAVE_ICONV ON)
+ set(HAVE_ICONV ON CACHE INTERNAL "iconv is available")
else()
- set(ICONV_INCLUDE_DIR "")
- set(ICONV_LIBRARIES "")
-endif()
-
-set(WITH_BZ2 "AUTO" CACHE STRING "Include bz2 support (default=AUTO)") # Check
with BZip2_FOUND
-if(NOT ${WITH_BZ2} STREQUAL "NO")
- include(FindBZip2)
-
- if(BZip2_FOUND)
- set(HAVE_LIBBZ2 ON)
- elseif(${WITH_BZ2} STREQUAL "YES")
- message(FATAL_ERROR "bz2 library not found")
- endif()
-endif()
-if(NOT BZip2_FOUND)
- set(BZIP2_INCLUDE_DIR "")
- set(BZIP2_LIBRARIES "")
-endif()
-
-set(WITH_SNAPPY "AUTO" CACHE STRING "Include snappy support (default=AUTO)") #
Check with HAVE_LIBSNAPPY
-if(NOT ${WITH_SNAPPY} STREQUAL "NO")
- include(FindSnappy)
-
- if(SNAPPY_FOUND)
- set(HAVE_LIBSNAPPY ON)
- elseif(${WITH_SNAPPY} STREQUAL "YES")
- message(FATAL_ERROR "snappy library not found")
- endif()
-endif()
-if(NOT SNAPPY_FOUND)
- set(SNAPPY_INCLUDE_DIR "")
- set(SNAPPY_LIBRARIES "")
-endif()
-
-set(WITH_LZ4 "AUTO" CACHE STRING "Include lz4 library support (default=AUTO)")
# Check with HAVE_LIBLZ4
-if(NOT ${WITH_LZ4} STREQUAL "NO")
- include(FindLZ4)
-
- if(LZ4_FOUND)
- set(LZ4_MINIMUM_VERSION "1.8.0")
- if(LZ4_VERSION VERSION_LESS "${LZ4_MINIMUM_VERSION}")
- if(${WITH_LZ4} STREQUAL "YES")
- message(FATAL_ERROR "lz4 library found, but the
version is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
- else()
- message(STATUS "lz4 library found, but the
version is too old: ${LZ4_VERSION} < ${LZ4_MINIMUM_VERSION}")
- endif()
- else()
- set(HAVE_LIBLZ4 ON)
- endif()
- elseif(${WITH_LZ4} STREQUAL "YES")
- message(FATAL_ERROR "lz4 library not found")
- endif()
-endif()
-if(NOT HAVE_LIBLZ4)
- set(LZ4_INCLUDE_DIR "")
- set(LZ4_LIBRARIES "")
-endif()
-
-# Extra libraries
-set(DL_LIBRARIES "")
-set(KVM_LIBRARIES "")
-set(MATH_LIBRARIES "")
-set(SOCKET_LIBRARIES )
-set(PSAPI_LIBRARIES "")
-if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
- set(DL_LIBRARIES "${CMAKE_DL_LIBS}")
-endif()
-if(${CMAKE_SYSTEM_NAME} MATCHES "^FreeBSD|DragonFly|NetBSD$") # Warning - I
checked the man pages and only tested on FreeBSD yet
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list