ldd
This commit is contained in:
parent
9a5681b2cb
commit
d348e8c563
@ -384,6 +384,36 @@ if (${C_COMPILER} MATCHES "Intel")
|
||||
set(HAVE_GCC 1)
|
||||
endif ()
|
||||
|
||||
# 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 TRUE)
|
||||
|
||||
# SET(CMAKE_INSTALL_FULL_RPATH ${CMAKE_TOP_BINARY_DIR})
|
||||
|
||||
# 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)
|
||||
|
||||
|
||||
# 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")
|
||||
SET(CMAKE_INSTALL_RPATH ${libdir})
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
IF(NOT WIN32 AND NOT APPLE)
|
||||
LIST(APPEND CMAKE_INSTALL_RPATH \\$ORIGIN/../lib/Yap)
|
||||
LIST(APPEND CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
LIST(APPEND CMAKE_INSTALL_RPATH \\$ORIGIN/../lib)
|
||||
LIST(APPEND CMAKE_INSTALL_RPATH \\$ORIGIN/../../../lib)
|
||||
|
||||
ENDIF()
|
||||
|
||||
# Model Specific
|
||||
if (HAVE_GCC)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -Wall)
|
||||
@ -534,27 +564,6 @@ 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 TRUE)
|
||||
|
||||
# SET(CMAKE_INSTALL_FULL_RPATH ${CMAKE_TOP_BINARY_DIR})
|
||||
|
||||
# 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)
|
||||
|
||||
|
||||
# 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")
|
||||
SET(CMAKE_INSTALL_RPATH ${libdir})
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
include_directories(H
|
||||
H/generated
|
||||
|
@ -6,7 +6,7 @@ INCLUDE(UseSWIG)
|
||||
include(FindPythonModule)
|
||||
|
||||
list (APPEND pl_library ${CMAKE_CURRENT_SOURCE_DIR}/prolog/yapi.yap )
|
||||
set (PYTHON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/yap4py/yapi.py ${CMAKE_CURRENT_SOURCE_DIR}/yap4py/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/yap4py/__main__.py)
|
||||
set (PYTHON_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/yap4py/yapi.py ${CMAKE_CURRENT_SOURCE_DIR}/yap4py/__main__.py)
|
||||
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(../../swig/yap.i PROPERTIES CPLUSPLUS ON)
|
||||
@ -22,6 +22,7 @@ set(YAP4PY_PY yap4py/__init__.py yap4py/__main__.py yap4py/yapi.py)
|
||||
configure_file("setup.py.in" setup.py)
|
||||
configure_file("MANIFEST.in" ${CMAKE_CURRENT_BINARY_DIR}/MANIFEST.in)
|
||||
configure_file("YAP4PY.md" README.md)
|
||||
configure_file(yap4py/__init__.py.in yap4py/__init__.py)
|
||||
|
||||
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH} ${CMAKE_CURRENT_BINARY_DIR}/yap4py/include
|
||||
)
|
||||
|
@ -9,6 +9,8 @@ import platform
|
||||
global yap_lib_path
|
||||
yap_lib_path = os.path.dirname(__file__)
|
||||
|
||||
if @CONDA_BUILD@ == "1":
|
||||
# do not do nothing
|
||||
if platform.system() == 'Windows':
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
@ -23,3 +25,7 @@ else:
|
||||
if platform.system() == 'Apple':
|
||||
load('libYap.dylib')
|
||||
load('libPy4YAP.dylib' )
|
||||
else:
|
||||
load('libYap.os')
|
||||
load('libPy4YAP.os' )
|
||||
|
@ -6,20 +6,26 @@ import os.path
|
||||
import platform
|
||||
import sys
|
||||
|
||||
# global yap_lib_path
|
||||
#yap_lib_path = os.path.dirname(__file__)
|
||||
global yap_lib_path
|
||||
yap_lib_path = os.path.dirname(__file__)
|
||||
|
||||
# if platform.system() == 'Windows':
|
||||
# def load( dll ):
|
||||
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
# dll = os.path.abspath(dll)
|
||||
# ctypes.WinDLL(dll)
|
||||
# else:
|
||||
# def load( l0 ):
|
||||
# for i in ["@libdir@",""]:
|
||||
# dll = os.path.concat(i,l0)
|
||||
# dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
# dll = os.path.abspath(dll)
|
||||
# ctypes.CDLL(dll)
|
||||
# # load('libYap*')
|
||||
# # load('libPy4YAP*')
|
||||
if platform.system() == 'Windows':
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.WinDLL(dll)
|
||||
elseif
platform.system() == 'Apple':
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.CDLL(dll)
|
||||
load('libYap.dylib')
|
||||
load('libPy4YAP.dylib')
|
||||
else:
|
||||
def load( dll ):
|
||||
dll = glob.glob(os.path.join(yap_lib_path,dll))[0]
|
||||
dll = os.path.abspath(dll)
|
||||
ctypes.CDLL(dll)
|
||||
load('libYap.so')
|
||||
load('libPy4YAP.so')
|
||||
|
@ -2,7 +2,11 @@
|
||||
|
||||
|
||||
/* example.i */
|
||||
#if PYTHONSWIG
|
||||
%module(directors = "1", package="yap4py") yap
|
||||
#else
|
||||
%module(directors = "1") yap
|
||||
#endif
|
||||
|
||||
// Language independent exception handler
|
||||
%include exception.i
|
||||
|
Reference in New Issue
Block a user