configuration

This commit is contained in:
Vitor Santos Costa 2017-11-10 23:08:35 +00:00
parent 5c199984ed
commit af233dbf36
8 changed files with 175 additions and 121 deletions

View File

@ -21,6 +21,10 @@ set(
"${CMAKE_SOURCE_DIR}/cmake"
)
IF (ENV{CONDA_BUILD} STREQUAL "1")
set (ANACONDA YES)
endif()
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckSymbolExists)
@ -63,12 +67,12 @@ endif()
if (POLICY CMP0003)
cmake_policy(SET CMP0003 NEW)
endif()
endif()
if (POLICY CMP0068)
cmake_policy(SET CMP0068 NEW)
endif()
endif()
option(BUILD_SHARED_LIBS "Build shared library" ON)
option(BUILD_SHARED_LIBS "Build shared library" ON)
set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
@ -209,11 +213,8 @@ include(disallow)
disallow_intree_builds()
# set(CMAKE_BUILD_TYPE Debug)
set (ANACONDA $ENV{CONDA_PY})
if (ANACONDA)
elseif (APPLE)
if (APPLE)
set (MACOSX_RPATH ON)
set (PATH $ENV{PATH})
list (FIND ${PATH} pos /usr/local)
@ -531,6 +532,7 @@ set_property(DIRECTORY PROPERTY CXX_STANDARD 11)
# 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 TRUE)
@ -544,7 +546,14 @@ set_property(DIRECTORY PROPERTY CXX_STANDARD 11)
# the RPATH to be used when installing, but only if it's not a system directory#LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${libdir}" isSystemDir)
# IF("${isSystemDir}" STREQUAL "-1")
if (ANACONDA)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_INSTALL_RPATH ${CMAKE_BINARY_DIR})
else()
SET(CMAKE_INSTALL_RPATH "${libdir}")
endif()
# ENDIF("${isSystemDir}" STREQUAL "-1")
include_directories (H
@ -572,6 +581,7 @@ MY_set_target_properties(libYap
SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}
)
#utf-8 is not an option
# we use the nice UTF-8 package
#available at the Julia project
@ -602,7 +612,7 @@ set_target_properties(libYap
PROPERTIES OUTPUT_NAME Yap
)
# file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages/python/swig/yap4py)
# file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/packages/python/swig/yap4py)
if (PYTHONLIBS_FOUND AND SWIG_FOUND)
add_subdirectory(packages/python/swig)

View File

@ -22,43 +22,68 @@ FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline)
# Sometimes readline really needs ncurses
FIND_LIBRARY(READLINE_ncurses_LIBRARY NAMES ncurses)
FIND_LIBRARY(READLINE_ncursesw_LIBRARY NAMES ncursesw)
# Sometimes ncurses really needs terminfo
FIND_LIBRARY(READLINE_tinfo_LIBRARY NAMES tinfo)
FIND_LIBRARY(READLINE_tinfow_LIBRARY NAMES tinfow)
MARK_AS_ADVANCED(
READLINE_INCLUDE_DIR
READLINE_readline_LIBRARY
READLINE_ncurses_LIBRARY
READLINE_tinfo_LIBRARY
READLINE_ncursesw_LIBRARY
READLINE_tinfow_LIBRARY
)
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}")
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ")
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}")
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ${READLINE_tinfo_LIBRARY} ${READLINE_ncursesw_LIBRARY} ${READLINE_tinfow_LIBRARY} ")
set(HAVE_LIBREADLINE FALSE CACHE BOOL "Readline works.")
SET( READLINE_FOUND "NO" )
IF(READLINE_INCLUDE_DIR)
IF(READLINE_readline_LIBRARY)
SET( READLINE_FOUND "YES" )
SET( READLINE_LIBRARIES
MESSAGE(STATUS "Found readline library")
set(HAVE_LIBREADLINE CACHE YES BOOL "Readline works." )
SET( READLINE_LIBRARIES
${READLINE_readline_LIBRARY}
)
# some readline libraries depend on ncurses
IF(READLINE_ncurses_LIBRARY)
SET(READLINE_LIBRARIES ${READLINE_LIBRARIES} ${READLINE_ncurses_LIBRARY})
ENDIF(READLINE_ncurses_LIBRARY)
list(APPEND READLINE_LIBRARIES ${READLINE_ncurses_LIBRARY})
endif ()
# some readline libraries depend on ncurses
IF(READLINE_ncursesw_LIBRARY)
list(APPEND READLINE_LIBRARIES ${READLINE_ncursesw_LIBRARY})
endif ()
# some readline libraries depend on tinfo
IF(READLINE_tinfo_LIBRARY)
list(APPEND READLINE_LIBRARIES ${READLINE_tinfo_LIBRARY})
endif ()
# some readline libraries depend on tinfo
IF(READLINE_tinfow_LIBRARY)
list(APPEND READLINE_LIBRARIES ${READLINE_tinfow_LIBRARY})
endif ()
ENDIF(READLINE_readline_LIBRARY)
ENDIF(READLINE_INCLUDE_DIR)
set(HAVE_LIBREADLINE 0 CACHE BOOL "Readline works.")
IF(READLINE_FOUND)
MESSAGE(STATUS "Found readline library")
set(HAVE_LIBREADLINE 1)
ELSE(READLINE_FOUND)
IF(READLINE_FIND_REQUIRED)
IF(NOT READLINE_FOUND)
IF(READLINE_FIND_REQUIRED)
MESSAGE(SYSTEM_ERROR_FATAL "Could not find readline -- please give some paths to CMake")
ENDIF(READLINE_FIND_REQUIRED)
ENDIF(READLINE_FOUND)
ENDIF(NOT READLINE_FOUND)
find_package_handle_standard_args(Readline READLINE_INCLUDE_DIR READLINE_LIBRARIES READLINE_readline_LIBRARY READLINE_ncurses_LIBRARY)
find_package_handle_standard_args(Readline READLINE_INCLUDE_DIR READLINE_LIBRARIES READLINE_readline_LIBRARY READLINE_ncurses_LIBRARY READLINE_tinfo_LIBRARY)
MARK_AS_ADVANCED(

View File

@ -1,14 +1,3 @@
# - Find the readline library
# This module defines
# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
# READLINE_LIBRARIES, the libraries required to use READLINE.
# READLINE_FOUND, If false, do not try to use READLINE.
# also defined, but not for general use are
# READLINE_readline_LIBRARY, where to find the READLINE library.
# , where to find the ncurses library [might not be defined]
# include subdirectories configuration
## after we have all functionality in
#
# ADD_SUBDIRECTORY(console/terminal)
@ -17,10 +6,33 @@ option (WITH_READLINE "GNU readline console" ON)
if (WITH_READLINE)
find_library(READLINE_tinfo_LIBRARY
NAMES tinfo
message(STATUS "tinfo DLL found at ${READLINE_tinfo_LIBRARY}")
HINTS ${Readline_ROOT_DIR}/lib
)
find_library(READLINE_tinfow_LIBRARY
NAMES tinfow
HINTS ${Readline_ROOT_DIR}/lib
)
find_library(READLINE_ncurses_LIBRARY
essage(STATUS "tinfo DLL found at ${READLINE_tinfo_LIBRARY}")
HINTS ${Readline_ROOT_DIR}/lib
)
find_library(READLINE_tinfow_LIBRARY
NAMES tinfow
HINTS ${Readline_ROOT_DIR}/lib
)
find_library(READLINE_ncurses_LIBRARY
NAMES ncurses
HINTS ${Readline_ROOT_DIR}/lib
message(STATUS "readline ncurses DLL found at ${READLINE_ncurses_LIBRARY}")
)
find_library(READLINE_ncursesw_LIBRARY
NAMES ncursesw
message(STATUS "readline ncursesw DLL found at ${READLINE_ncursesw_LIBRARY}")
HINTS ${Readline_ROOT_DIR}/lib
)
find_path(READLINE_INCLUDE_DIR
NAMES readline/readline.h
@ -28,19 +40,19 @@ if (WITH_READLINE)
)
find_library(READLINE_readline_LIBRARY
NAMES readline
HINTS ${READLINE_INCLUDE_DIR/../lib} ${Readline_ROOT_DIR}/lib )
HINTS ${READLINE_INCLUDE_DIR/../lib} ${Readline_ROOT_DIR}/lib
if (READLINE_readline_LIBRARY)
set (HAVE_LIBREADLINE TRUE)
if (READLINE_INCLUDE_DIR)
set(READLINE_FOUND TRUE CACHE BOOL "readline is installed correctly")
set (READLINE_LIBRARIES ${READLINE_ncurses_LIBRARY} ${READLINE_readline_LIBRARY} )
set (READLINE_LIBRARIES ${READLINE_ncursesw_LIBRARY} ${READLINE_tinfow_LIBRARY}$ ${READLINE_tinfo_LIBRARY}$ ${READLINE_ncurses_LIBRARY} ${READLINE_readline_LIBRARY} )
endif()
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}")
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ")
message(STATUS "headers found so far at ${READLINE_INCLUDE_DIR}")
message(STATUS "libraries found so far at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ${READLINE_tinfo_LIBRARY} ${READLINE_tinfow_LIBRARY} ${READLINE_ncursesw_LIBRARY} ")
else
endif ()
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} )
set(EXTRALIBS ${EXTRALIBS} readline)
endif ()

View File

@ -6,13 +6,13 @@ export MACOSX_DEPLOYMENT_TARGET=10.9
export R_COMMAND=$R
export CMAKE_BUILD_TYPE=Debug
export CMAKE=$PREFIX/bin/cmake
export CMAKE_INCLUDE_PATH=$SYS_PREFIX/include
export CMAKE_LIBRARY_PATH=$SYS_PREFIX/lib
export CMAKE_INCLUDE_PATH=$PREFIX/include
export CMAKE_LIBRARY_PATH=$PREFIX/lib
export CMAKE_INSTALL_PREFIX=$PREFIX
export GENERATOR="-GNinja"
export PYTHON_EXECUTABLE="$PYTHON"
export PYTHON_LIBRARY="$STDLIB_DIR/../libPython${PY_VER}m$SHLIB_EXT"
export PYTHON_INCLUDE_DIR="$STDLIB_DIR/../../include/python$PY_VER"m
export PYTHON_LIBRARY="$PREFIX/lib/libpython${PY_VER}m$SHLIB_EXT"
export PYTHON_INCLUDE_DIR="$PREFIX/include/python$PY_VER"m
mkdir $PREFIX/conda
cd $PREFIX/conda
@ -28,7 +28,8 @@ cd $PREFIX/conda
$RECIPE_DIR/..
make -j install CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX"
#./yap -B
# mv startup.yss $PREFIX/lib/Yap
# Remove the created lib64 directory
# rm -rf $PREFIX/conda
rm -rf $PREFIX/conda

View File

@ -6,13 +6,11 @@ requirements:
build:
- cmake
- swig
- readline
- gmp
- python
- r
- notebook
run:
- readline
- gmp
- r
- notebook

View File

@ -43,7 +43,9 @@ INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR}/yap4py/i
# LIBRARY DESTINATION ${PYTHON_MODULE_PATH}
# )
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/yap4py)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/yap4py)
endif()
if (CONDA)
set(bdist bdist_conda)

View File

@ -63,8 +63,12 @@ if platform.system() == 'Windows':
local_libs = []
win_libs = ['wsock32','ws2_32']
my_extra_link_args = ['-Wl,-export-all-symbols']
else:
my_extra_link_args = ['-Wl,-rpath','-Wl,${libdir}']
elif platform.system() == 'Darwin':
my_extra_link_args = ['-L','..']
win_libs = []
local_libs = ['Py4YAP']
elif platform.system() == 'Linux':
my_extra_link_args = ['-L','..']
win_libs = []
local_libs = ['Py4YAP']

View File

@ -1,83 +1,85 @@
set(PL_BOOT_SOURCES
absf.yap
arith.yap
arithpreds.yap
arrays.yap
atoms.yap
attributes.yap
boot.yap
bootlists.yap
callcount.yap
checker.yap
consult.yap
control.yap
corout.yap
dbload.yap
debug.yap
depth_bound.yap
dialect.yap
directives.yap
eam.yap
error.yap
errors.yap
eval.yap
flags.yap
grammar.yap
ground.yap
hacks.yap
init.yap
listing.yap
load_foreign.yap
messages.yap
meta.yap
modules.yap
newmod.yap
os.yap
pathconf.yap
preddecls.yap
preddyns.yap
preds.yap
profile.yap
protect.yap
qly.yap
save.yap
setof.yap
signals.yap
sort.yap
spy.yap
statistics.yap
strict_iso.yap
swi.yap
tabling.yap
threads.yap
udi.yap
undefined.yap
utils.yap
yapor.yap
set(PL_BOOT_SOURCES
absf.yap
arith.yap
arithpreds.yap
arrays.yap
atoms.yap
attributes.yap
boot.yap
bootlists.yap
callcount.yap
checker.yap
consult.yap
control.yap
corout.yap
dbload.yap
debug.yap
depth_bound.yap
dialect.yap
directives.yap
eam.yap
error.yap
errors.yap
eval.yap
flags.yap
grammar.yap
ground.yap
hacks.yap
init.yap
listing.yap
load_foreign.yap
messages.yap
meta.yap
modules.yap
newmod.yap
os.yap
pathconf.yap
preddecls.yap
preddyns.yap
preds.yap
profile.yap
protect.yap
qly.yap
save.yap
setof.yap
signals.yap
sort.yap
spy.yap
statistics.yap
strict_iso.yap
swi.yap
tabling.yap
threads.yap
udi.yap
undefined.yap
utils.yap
yapor.yap
)
add_to_group( PL_BOOT_SOURCES pl_boot_library )
add_to_group( PL_BOOT_SOURCES pl_boot_library )
if (CMAKE_CROSSCOMPILING)
add_custom_target (STARTUP ALL SOURCES
DEPENDS ${CMAKE_BINARY_DIR}/startup.yss
DEPENDS ${PL_BOOT_SOURCES}
)
else()
add_custom_target (STARTUP ALL
DEPENDS ${YAP_STARTUP}
WORKING_DIRECTORY ${CMAKE_TOP_BINARY_DIR}
)
if ( NOT CMAKE_CROSSCOMPILING )
# Create a startup.yss on the top directory.
add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/startup.yss
COMMAND yap-bin -B
VERBATIM
WORKING_DIRECTORY ${CMAKE_TOP_BINARY_DIR}
DEPENDS yap-bin ${PL_SOURCES}
)
endif ( NOT CMAKE_CROSSCOMPILING )
install (FILES ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP}
DESTINATION ${dlls}
)
add_custom_command (OUTPUT ${YAP_STARTUP}
COMMAND yap-bin -B
VERBATIM
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS yap-bin ${PL_SOURCES}
)
install (FILES ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP}
DESTINATION ${dlls}
)
endif()
install (FILES ${PL_SOURCES}
DESTINATION ${libpl}/pl