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" "${CMAKE_SOURCE_DIR}/cmake"
) )
IF (ENV{CONDA_BUILD} STREQUAL "1")
set (ANACONDA YES)
endif()
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckLibraryExists) include(CheckLibraryExists)
include(CheckSymbolExists) include(CheckSymbolExists)
@ -209,11 +213,8 @@ include(disallow)
disallow_intree_builds() disallow_intree_builds()
# set(CMAKE_BUILD_TYPE Debug) # set(CMAKE_BUILD_TYPE Debug)
set (ANACONDA $ENV{CONDA_PY})
if (ANACONDA) if (APPLE)
elseif (APPLE)
set (MACOSX_RPATH ON) set (MACOSX_RPATH ON)
set (PATH $ENV{PATH}) set (PATH $ENV{PATH})
list (FIND ${PATH} pos /usr/local) 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 # use, i.e. don't skip the full RPATH for the build tree
# SET(CMAKE_SKIP_BUILD_RPATH FALSE) # SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already # when building, don't use the install RPATH already
# (but later on when installing) # (but later on when installing)
# SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) # 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) # 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("${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}") SET(CMAKE_INSTALL_RPATH "${libdir}")
endif()
# ENDIF("${isSystemDir}" STREQUAL "-1") # ENDIF("${isSystemDir}" STREQUAL "-1")
include_directories (H include_directories (H
@ -572,6 +581,7 @@ MY_set_target_properties(libYap
SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION} SOVERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}
) )
#utf-8 is not an option #utf-8 is not an option
# we use the nice UTF-8 package # we use the nice UTF-8 package
#available at the Julia project #available at the Julia project

View File

@ -22,43 +22,68 @@ FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline)
# Sometimes readline really needs ncurses # Sometimes readline really needs ncurses
FIND_LIBRARY(READLINE_ncurses_LIBRARY NAMES 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( MARK_AS_ADVANCED(
READLINE_INCLUDE_DIR READLINE_INCLUDE_DIR
READLINE_readline_LIBRARY READLINE_readline_LIBRARY
READLINE_ncurses_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" ) SET( READLINE_FOUND "NO" )
IF(READLINE_INCLUDE_DIR) IF(READLINE_INCLUDE_DIR)
IF(READLINE_readline_LIBRARY) IF(READLINE_readline_LIBRARY)
SET( READLINE_FOUND "YES" ) SET( READLINE_FOUND "YES" )
MESSAGE(STATUS "Found readline library")
set(HAVE_LIBREADLINE CACHE YES BOOL "Readline works." )
SET( READLINE_LIBRARIES SET( READLINE_LIBRARIES
${READLINE_readline_LIBRARY} ${READLINE_readline_LIBRARY}
) )
# some readline libraries depend on ncurses # some readline libraries depend on ncurses
IF(READLINE_ncurses_LIBRARY) IF(READLINE_ncurses_LIBRARY)
SET(READLINE_LIBRARIES ${READLINE_LIBRARIES} ${READLINE_ncurses_LIBRARY}) list(APPEND READLINE_LIBRARIES ${READLINE_ncurses_LIBRARY})
ENDIF(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_readline_LIBRARY)
ENDIF(READLINE_INCLUDE_DIR) ENDIF(READLINE_INCLUDE_DIR)
set(HAVE_LIBREADLINE 0 CACHE BOOL "Readline works.")
IF(READLINE_FOUND) IF(NOT READLINE_FOUND)
MESSAGE(STATUS "Found readline library")
set(HAVE_LIBREADLINE 1)
ELSE(READLINE_FOUND)
IF(READLINE_FIND_REQUIRED) IF(READLINE_FIND_REQUIRED)
MESSAGE(SYSTEM_ERROR_FATAL "Could not find readline -- please give some paths to CMake") MESSAGE(SYSTEM_ERROR_FATAL "Could not find readline -- please give some paths to CMake")
ENDIF(READLINE_FIND_REQUIRED) 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( 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 ## after we have all functionality in
# #
# ADD_SUBDIRECTORY(console/terminal) # ADD_SUBDIRECTORY(console/terminal)
@ -17,8 +6,31 @@ option (WITH_READLINE "GNU readline console" ON)
if (WITH_READLINE) 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 find_library(READLINE_ncurses_LIBRARY
NAMES ncurses 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 HINTS ${Readline_ROOT_DIR}/lib
) )
@ -28,19 +40,19 @@ if (WITH_READLINE)
) )
find_library(READLINE_readline_LIBRARY find_library(READLINE_readline_LIBRARY
NAMES readline NAMES readline
HINTS ${READLINE_INCLUDE_DIR/../lib} ${Readline_ROOT_DIR}/lib ) HINTS ${READLINE_INCLUDE_DIR/../lib} ${Readline_ROOT_DIR}/lib
if (READLINE_readline_LIBRARY) if (READLINE_readline_LIBRARY)
set (HAVE_LIBREADLINE TRUE) set (HAVE_LIBREADLINE TRUE)
if (READLINE_INCLUDE_DIR) if (READLINE_INCLUDE_DIR)
set(READLINE_FOUND TRUE CACHE BOOL "readline is installed correctly") 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() endif()
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}") message(STATUS "headers found so far at ${READLINE_INCLUDE_DIR}")
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ") message(STATUS "libraries found so far at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ${READLINE_tinfo_LIBRARY} ${READLINE_tinfow_LIBRARY} ${READLINE_ncursesw_LIBRARY} ")
else
endif () endif ()
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} ) set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} )
set(EXTRALIBS ${EXTRALIBS} readline) set(EXTRALIBS ${EXTRALIBS} readline)
endif () endif ()

View File

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

View File

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

View File

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

View File

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

View File

@ -58,26 +58,28 @@ 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 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 ) add_custom_command (OUTPUT ${YAP_STARTUP}
# Create a startup.yss on the top directory.
add_custom_command (OUTPUT ${CMAKE_BINARY_DIR}/startup.yss
COMMAND yap-bin -B COMMAND yap-bin -B
VERBATIM VERBATIM
WORKING_DIRECTORY ${CMAKE_TOP_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS yap-bin ${PL_SOURCES} DEPENDS yap-bin ${PL_SOURCES}
) )
endif ( NOT CMAKE_CROSSCOMPILING )
install (FILES ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP} install (FILES ${CMAKE_TOP_BINARY_DIR}/${YAP_STARTUP}
DESTINATION ${dlls} DESTINATION ${dlls}
) )
endif()
install (FILES ${PL_SOURCES} install (FILES ${PL_SOURCES}
DESTINATION ${libpl}/pl DESTINATION ${libpl}/pl