new make configuration
This commit is contained in:
parent
b6f1079503
commit
591d5a8653
207
Packages.cmake
Normal file
207
Packages.cmake
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
|
||||||
|
message(STATUS "Building YAP packages version ${YAP_VERSION}")
|
||||||
|
|
||||||
|
|
||||||
|
include (cudd NO-POLICY-SCOPE)
|
||||||
|
include (python NO-POLICY-SCOPE)
|
||||||
|
include (java NO-POLICY-SCOPE)
|
||||||
|
|
||||||
|
|
||||||
|
if (POLICY CMP0042
|
||||||
|
)
|
||||||
|
cmake_policy( SET CMP0042 NEW)
|
||||||
|
#cmake_policy( NO_POLICY_SCOPE )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT WIN32)
|
||||||
|
set (BUILD_SHARED_LIBS ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
option (WITH_JIT
|
||||||
|
"just in Time Clause Compilation" OFF)
|
||||||
|
if (WITH_JIT)
|
||||||
|
add_subDIRECTORY(JIT)
|
||||||
|
endif (WITH_JIT)
|
||||||
|
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/raptor)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/xml)
|
||||||
|
|
||||||
|
|
||||||
|
OPTION (WITH_CLPBN " Enable the CLPBN and PFL probabilistic languages" ON)
|
||||||
|
|
||||||
|
OPTION (WITH_CPLINT " Enable the cplint probabilistic language" ON)
|
||||||
|
|
||||||
|
OPTION (WITH_HORUS " Enable the CLPBN and PFL probabilistic languages" ON)
|
||||||
|
|
||||||
|
IF (WITH_CLPBN)
|
||||||
|
add_subDIRECTORY (packages/CLPBN)
|
||||||
|
ENDIF(WITH_CLPBN)
|
||||||
|
|
||||||
|
IF (WITH_CPLINT)
|
||||||
|
add_subDIRECTORY (packages/cplint)
|
||||||
|
ENDIF(WITH_CPLINT)
|
||||||
|
|
||||||
|
|
||||||
|
#must be last
|
||||||
|
add_subDIRECTORY (packages/swig)
|
||||||
|
|
||||||
|
|
||||||
|
# please install doxygen for prolog first
|
||||||
|
# git clone http://www.github.com/vscosta/doxygen-yap
|
||||||
|
# cd doxygen-yap
|
||||||
|
# mkdir -p build
|
||||||
|
# cd build
|
||||||
|
# make; sudo make install
|
||||||
|
option (WITH_DOCS
|
||||||
|
"generate YAP docs" OFF)
|
||||||
|
|
||||||
|
# add_subDIRECTORY (docs)
|
||||||
|
|
||||||
|
# add_subDIRECTORY (packages/cuda)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/gecode)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/real)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/python)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/jpl)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/bdd)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/ProbLog)
|
||||||
|
|
||||||
|
add_subDIRECTORY (packages/swi-minisat2)
|
||||||
|
|
||||||
|
|
||||||
|
#todo: use cmake target builds
|
||||||
|
# option (USE_MAXPERFORMANCE
|
||||||
|
# "try using the best flags for specific architecture" OFF)
|
||||||
|
|
||||||
|
# option (USE_MAXMEMORY
|
||||||
|
# "try using the best flags for using the memory to the most" ON)
|
||||||
|
#TODO: check MAXMEMORY
|
||||||
|
|
||||||
|
#TODO: use cmake target builds
|
||||||
|
# option (USE_DEBUGYAP
|
||||||
|
# "enable C-debugging for YAP" OFF)
|
||||||
|
|
||||||
|
#TODO: use cmake arch/compiler
|
||||||
|
# option (USE_CYGWIN
|
||||||
|
# "use cygwin library in WIN32" OFF)
|
||||||
|
|
||||||
|
option (WITH_PRISM
|
||||||
|
"use PRISM system in YAP" ON)
|
||||||
|
#TODO:
|
||||||
|
|
||||||
|
|
||||||
|
option (WITH_YAP_DLL
|
||||||
|
"compile YAP as a DLL" ON)
|
||||||
|
#TODO:
|
||||||
|
|
||||||
|
option (WITH_YAP_STATIC
|
||||||
|
"compile YAP statically" OFF)
|
||||||
|
#TODO:
|
||||||
|
|
||||||
|
option(WITH_YAP_CONDOR
|
||||||
|
"allow YAP to be used from condor" OFF)
|
||||||
|
|
||||||
|
if (WITH_YAP_CONDOR)
|
||||||
|
# use default allocator
|
||||||
|
set ( YAP_STATIC ON )
|
||||||
|
set ( YAP_DLL OFF )
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#TODO: detect arch before allow this option
|
||||||
|
# OPTION(WIN64
|
||||||
|
# "compile YAP for win64" OFF)
|
||||||
|
|
||||||
|
# option (APRIL
|
||||||
|
# "compile Yap to support April ILP system" OFF)
|
||||||
|
# option (DLCOMPAT
|
||||||
|
# "use dlcompat library for dynamic loading on Mac OS X" OFF)
|
||||||
|
|
||||||
|
# SHARED PACKAGES with SWI
|
||||||
|
|
||||||
|
# swi packages have both Makefile.in which we will use and
|
||||||
|
# Makefile.mak, we will use the later to identify this packages
|
||||||
|
# while we keep both autotools amd cmake working side by side
|
||||||
|
# Search for available packages which all have a Makefile.mak
|
||||||
|
#file (GLOB PACKAGES packages/*/Makefile.mak)
|
||||||
|
|
||||||
|
# needed by this packages
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
set(MSVC_RUNTIME "dynamic")
|
||||||
|
ENDIF(MSVC)
|
||||||
|
|
||||||
|
target_link_libraries(libYap wsock32 ws2_32 Shlwapi)
|
||||||
|
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
add_executable (yap-bin ${CONSOLE_SOURCES})
|
||||||
|
|
||||||
|
set_target_properties (yap-bin PROPERTIES OUTPUT_NAME yap)
|
||||||
|
|
||||||
|
|
||||||
|
target_link_libraries(yap-bin libYap )
|
||||||
|
|
||||||
|
install(TARGETS libYap yap-bin
|
||||||
|
RUNTIME DESTINATION ${bindir}
|
||||||
|
LIBRARY DESTINATION ${libdir}
|
||||||
|
ARCHIVE DESTINATION ${libdir}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CMAKE_DEPENDENT_OPTION (WITH_SYSTEM_MMAP "Use MMAP for shared memory allocation" ON
|
||||||
|
"NOT WITH_YAPOR_THOR" OFF)
|
||||||
|
|
||||||
|
CMAKE_DEPENDENT_OPTION (WITH_SYSTEM_SHM "Use SHM for shared memory allocation" ON
|
||||||
|
"NOT WITH_YAPOR_THOR; NOT WITH_SYSTEM_MMAP" OFF )
|
||||||
|
|
||||||
|
add_subDIRECTORY(library/lammpi)
|
||||||
|
|
||||||
|
if (MPI_C_FOUND)
|
||||||
|
|
||||||
|
CMAKE_DEPENDENT_OPTION( WITH_MPI ON "Interface to OpenMPI/MPICH"
|
||||||
|
"MPI_C_FOUND" OFF)
|
||||||
|
macro_optional_add_subDIRECTORY(library/mpi)
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MPI_C_COMPILE_FLAGS} ")
|
||||||
|
include_directories(${MPI_C_INCLUDE_PATH})
|
||||||
|
target_link_libraries(yap-bin ${MPI_C_LIBRARIES} )
|
||||||
|
if(MPI_C_COMPILE_FLAGS)
|
||||||
|
set_target_properties(yap-bin PROPERTIES
|
||||||
|
COMPILE_FLAGS "${MPI_C_COMPILE_FLAGS}")
|
||||||
|
endif(MPI_C_COMPILE_FLAGS)
|
||||||
|
|
||||||
|
if(MPI_C_LINK_FLAGS)
|
||||||
|
set_target_properties(yap-bin PROPERTIES
|
||||||
|
LINK_FLAGS "${MPI_C_LINK_FLAGS}")
|
||||||
|
endif()
|
||||||
|
endif (MPI_C_FOUND)
|
||||||
|
|
||||||
|
## add_subDIRECTORY(utils)
|
||||||
|
|
||||||
|
#
|
||||||
|
# include subdirectories configuration
|
||||||
|
## after we have all functionality in
|
||||||
|
#
|
||||||
|
# ADD_SUBDIRECTORY(console/terminal)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
macro_display_feature_log()
|
||||||
|
if(POLICY CMP0058)
|
||||||
|
cmake_policy(SET CMP0058 NEW)
|
||||||
|
endif(POLICY CMP0058)
|
111
libYap.cmake
Normal file
111
libYap.cmake
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
|
||||||
|
include (Sources)
|
||||||
|
|
||||||
|
set(YAP_STARTUP startup.yss)
|
||||||
|
## define system
|
||||||
|
|
||||||
|
# Optional libraries that affect compilation
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_TOP_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||||
|
set(YAP_PL_SRCDIR ${CMAKE_SOURCE_DIR}/pl)
|
||||||
|
|
||||||
|
set(YAP_YAPLIB libYap${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
|
|
||||||
|
string(TIMESTAMP YAP_TIMESTAMP)
|
||||||
|
|
||||||
|
string( SUBSTRING ${CMAKE_SHARED_LIBRARY_SUFFIX} 1 -1 SO_EXT )
|
||||||
|
|
||||||
|
|
||||||
|
set_property(DIRECTORY PROPERTY CXX_STANDARD 11)
|
||||||
|
|
||||||
|
# rpath stuff, hopefully it works
|
||||||
|
|
||||||
|
# use, i.e. don't skip the full RPATH for the build tree
|
||||||
|
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
|
|
||||||
|
# when building, don't use the install RPATH already
|
||||||
|
# (but later on when installing)
|
||||||
|
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
|
|
||||||
|
SET(CMAKE_INSTALL_RPATH "${libdir};${dlls}:")
|
||||||
|
|
||||||
|
# add the automatically determined parts of the RPATH
|
||||||
|
# which point to directories outside the build tree to the install RPATH
|
||||||
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
|
set_target_properties(libYap
|
||||||
|
PROPERTIES OUTPUT_NAME Yap
|
||||||
|
)
|
||||||
|
MY_set_target_properties(libYap
|
||||||
|
PROPERTIES VERSION ${YAP_FULL_VERSION}
|
||||||
|
SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (READLINE_LIBRARIES)
|
||||||
|
MY_target_link_libraries(libYap READLINE_LIBRARIES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# the RPATH to be used when installing, but only if it's not a system directory
|
||||||
|
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${libdir};${dlls}" isSystemDir)
|
||||||
|
IF("${isSystemDir}" STREQUAL "-1")
|
||||||
|
SET(CMAKE_INSTALL_RPATH "${libdir};${dlls}")
|
||||||
|
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||||
|
|
||||||
|
|
||||||
|
include_directories (H
|
||||||
|
H/generated
|
||||||
|
include os OPTYap utf8proc JIT/HPP)
|
||||||
|
include_directories (BEFORE ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
if (ANDROID)
|
||||||
|
include_directories (CXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package (GMP)
|
||||||
|
macro_log_feature (GMP_FOUND
|
||||||
|
"GNU libgmp (in some cases MPIR"
|
||||||
|
"GNU big integers and rationals"
|
||||||
|
"http://gmplib.org")
|
||||||
|
list(APPEND YAP_SYSTEM_OPTIONS big_numbers)
|
||||||
|
|
||||||
|
if (GMP_FOUND)
|
||||||
|
# GMP_FOUND - true if GMP/MPIR was found
|
||||||
|
# GMP_INCLUDE_DIRS - include search path
|
||||||
|
# GMP_LIBRARIES - libraries to link with
|
||||||
|
# GMP_LIBRARY_ #add_executable(test ${SOURCES})
|
||||||
|
add_library(libGMP SHARED IMPORTED GLOBAL)
|
||||||
|
set_target_properties(libGMP PROPERTIES IMPORTED_LOCATION ${GMP_LIBRARIES})
|
||||||
|
#config.h needs this (TODO: change in code latter)
|
||||||
|
include_directories( ${GMP_INCLUDE_DIRS} )
|
||||||
|
target_link_libraries(libYap libGMP)
|
||||||
|
endif (GMP_FOUND)
|
||||||
|
|
||||||
|
include( Threads )
|
||||||
|
#
|
||||||
|
# include OS and I/o stuff
|
||||||
|
#
|
||||||
|
# convenience libraries
|
||||||
|
# OPTYap exports important flags
|
||||||
|
#
|
||||||
|
list(APPEND YAP_SYSTEM_OPTIONS "thread support")
|
||||||
|
|
||||||
|
#utf-8 is not an option
|
||||||
|
# we use the nice UTF-8 package
|
||||||
|
#available at the Julia project
|
||||||
|
include_directories ( utf8proc )
|
||||||
|
MY_ADD_SUBDIRECTORY ( utf8proc )
|
||||||
|
|
||||||
|
MY_ADD_SUBDIRECTORY ( os )
|
||||||
|
MY_ADD_SUBDIRECTORY ( OPTYap )
|
||||||
|
MY_ADD_SUBDIRECTORY ( packages/myddas )
|
||||||
|
MY_ADD_SUBDIRECTORY ( library/dialect/swi/fli )
|
||||||
|
MY_ADD_SUBDIRECTORY ( CXX )
|
||||||
|
|
||||||
|
#bootstrap and saved state
|
||||||
|
add_subDIRECTORY ( pl )
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY( library)
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY( swi/library "swiLibrary" )
|
Reference in New Issue
Block a user