Makefiles
This commit is contained in:
parent
7a7a9f56ed
commit
d93134dcf6
|
@ -16,12 +16,11 @@
|
|||
static char SccsId[] = "%W% %G%.2";
|
||||
#endif
|
||||
|
||||
|
||||
#include "Yap.h"
|
||||
#include "Yatom.h"
|
||||
#include "YapHeap.h"
|
||||
#include "yapio.h"
|
||||
#include "YapText.h"
|
||||
#include "Yatom.h"
|
||||
#include "yapio.h"
|
||||
#include <stdlib.h>
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
|
@ -37,9 +36,7 @@ static char SccsId[] = "%W% %G%.2";
|
|||
|
||||
Int p_load_foreign(USES_REGS1);
|
||||
|
||||
Int
|
||||
p_load_foreign( USES_REGS1 )
|
||||
{
|
||||
Int p_load_foreign(USES_REGS1) {
|
||||
StringList ofiles = NULL;
|
||||
StringList libs = NULL;
|
||||
char *InitProcName;
|
||||
|
@ -56,7 +53,8 @@ p_load_foreign( USES_REGS1 )
|
|||
/* collect the list of object files */
|
||||
t = Deref(ARG1);
|
||||
while (1) {
|
||||
if (t == TermNil) break;
|
||||
if (t == TermNil)
|
||||
break;
|
||||
t1 = HeadOfTerm(t);
|
||||
t = TailOfTerm(t);
|
||||
new = (StringList)Yap_AllocCodeSpace(sizeof(StringListItem));
|
||||
|
@ -68,7 +66,8 @@ p_load_foreign( USES_REGS1 )
|
|||
/* collect the list of library files */
|
||||
t = Deref(ARG2);
|
||||
while (1) {
|
||||
if (t == TermNil) break;
|
||||
if (t == TermNil)
|
||||
break;
|
||||
t1 = HeadOfTerm(t);
|
||||
t = TailOfTerm(t);
|
||||
new = (StringList)Yap_AllocCodeSpace(sizeof(StringListItem));
|
||||
|
@ -86,7 +85,20 @@ p_load_foreign( USES_REGS1 )
|
|||
returncode = true;
|
||||
} else
|
||||
/* call the OS specific function for dynamic loading */
|
||||
if(Yap_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) {
|
||||
if (Yap_LoadForeign(ofiles, libs, InitProcName, &InitProc) ==
|
||||
LOAD_SUCCEEDED) {
|
||||
if (InitProc == NULL) {
|
||||
char *f;
|
||||
if (ofiles) {
|
||||
f = RepAtom(ofiles->name)->StrOfAE;
|
||||
} else {
|
||||
f = RepAtom(libs->name)->StrOfAE;
|
||||
}
|
||||
Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, ARG3,
|
||||
"Foreign module %s does not have initialization function %s", f,
|
||||
InitProcName);
|
||||
return false;
|
||||
}
|
||||
Yap_StartSlots();
|
||||
(*InitProc)();
|
||||
Yap_CloseSlots(CurSlot);
|
||||
|
@ -117,8 +129,7 @@ p_load_foreign( USES_REGS1 )
|
|||
return returncode;
|
||||
}
|
||||
|
||||
static Int
|
||||
p_open_shared_object( USES_REGS1 ) {
|
||||
static Int p_open_shared_object(USES_REGS1) {
|
||||
Term t = Deref(ARG1);
|
||||
Term tflags = Deref(ARG2);
|
||||
char *s;
|
||||
|
@ -144,16 +155,17 @@ p_open_shared_object( USES_REGS1 ) {
|
|||
|
||||
s = (char *)RepAtom(AtomOfTerm(t))->StrOfAE;
|
||||
if ((handle = Yap_LoadForeignFile(s, IntegerOfTerm(tflags))) == NULL) {
|
||||
Yap_Error(EXISTENCE_ERROR_SOURCE_SINK,t,"open_shared_object_failed for %s"
|
||||
" with %s\n", s, LOCAL_ErrorMessage);
|
||||
Yap_Error(EXISTENCE_ERROR_SOURCE_SINK, t,
|
||||
"open_shared_object_failed for %s"
|
||||
" with %s\n",
|
||||
s, LOCAL_ErrorMessage);
|
||||
return FALSE;
|
||||
} else {
|
||||
return Yap_unify(MkIntegerTerm((Int)handle), ARG3);
|
||||
}
|
||||
}
|
||||
|
||||
static Int
|
||||
p_close_shared_object( USES_REGS1 ) {
|
||||
static Int p_close_shared_object(USES_REGS1) {
|
||||
Term t = Deref(ARG1);
|
||||
void *handle;
|
||||
|
||||
|
@ -170,8 +182,7 @@ p_close_shared_object( USES_REGS1 ) {
|
|||
return Yap_CloseForeignFile(handle);
|
||||
}
|
||||
|
||||
static Int
|
||||
p_call_shared_object_function( USES_REGS1 ) {
|
||||
static Int p_call_shared_object_function(USES_REGS1) {
|
||||
Term t = Deref(ARG1);
|
||||
Term tfunc = Deref(ARG2);
|
||||
Term tmod;
|
||||
|
@ -213,18 +224,18 @@ p_call_shared_object_function( USES_REGS1 ) {
|
|||
return FALSE;
|
||||
}
|
||||
CurrentModule = tmod;
|
||||
res = Yap_CallForeignFile(handle, (char *)RepAtom(AtomOfTerm(tfunc))->StrOfAE);
|
||||
res =
|
||||
Yap_CallForeignFile(handle, (char *)RepAtom(AtomOfTerm(tfunc))->StrOfAE);
|
||||
CurrentModule = OldCurrentModule;
|
||||
return res;
|
||||
}
|
||||
|
||||
static Int
|
||||
p_obj_suffix( USES_REGS1 ) {
|
||||
return Yap_unify(Yap_CharsToListOfCodes(SO_EXT, ENC_ISO_LATIN1 PASS_REGS),ARG1);
|
||||
static Int p_obj_suffix(USES_REGS1) {
|
||||
return Yap_unify(Yap_CharsToListOfCodes(SO_EXT, ENC_ISO_LATIN1 PASS_REGS),
|
||||
ARG1);
|
||||
}
|
||||
|
||||
static Int
|
||||
p_open_shared_objects( USES_REGS1 ) {
|
||||
static Int p_open_shared_objects(USES_REGS1) {
|
||||
#ifdef SO_EXT
|
||||
return TRUE;
|
||||
#else
|
||||
|
@ -232,26 +243,25 @@ p_open_shared_objects( USES_REGS1 ) {
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Yap_InitLoadForeign( void )
|
||||
{
|
||||
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag);
|
||||
void Yap_InitLoadForeign(void) {
|
||||
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign,
|
||||
SafePredFlag | SyncPredFlag);
|
||||
Yap_InitCPred("$open_shared_objects", 0, p_open_shared_objects, SafePredFlag);
|
||||
Yap_InitCPred("$open_shared_object", 3, p_open_shared_object, SyncPredFlag);
|
||||
Yap_InitCPred("close_shared_object", 1, p_close_shared_object, SyncPredFlag|SafePredFlag);
|
||||
Yap_InitCPred("close_shared_object", 1, p_close_shared_object,
|
||||
SyncPredFlag | SafePredFlag);
|
||||
/** @pred close_shared_object(+ _Handle_)
|
||||
|
||||
Detach the shared object identified by _Handle_.
|
||||
|
||||
|
||||
*/
|
||||
Yap_InitCPred("$call_shared_object_function", 2, p_call_shared_object_function, SyncPredFlag);
|
||||
Yap_InitCPred("$call_shared_object_function", 2,
|
||||
p_call_shared_object_function, SyncPredFlag);
|
||||
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
|
||||
}
|
||||
|
||||
void
|
||||
Yap_ReOpenLoadForeign(void)
|
||||
{
|
||||
void Yap_ReOpenLoadForeign(void) {
|
||||
CACHE_REGS
|
||||
ForeignObj *f_code = ForeignCodeLoaded;
|
||||
Term OldModule = CurrentModule;
|
||||
|
@ -260,7 +270,9 @@ Yap_ReOpenLoadForeign(void)
|
|||
YapInitProc InitProc = NULL;
|
||||
|
||||
CurrentModule = f_code->module;
|
||||
if(Yap_ReLoadForeign(f_code->objs,f_code->libs,(char *)RepAtom(f_code->f)->StrOfAE,&InitProc)==LOAD_SUCCEEDED) {
|
||||
if (Yap_ReLoadForeign(f_code->objs, f_code->libs,
|
||||
(char *)RepAtom(f_code->f)->StrOfAE,
|
||||
&InitProc) == LOAD_SUCCEEDED) {
|
||||
if (InitProc)
|
||||
(*InitProc)();
|
||||
}
|
||||
|
@ -268,11 +280,3 @@ Yap_ReOpenLoadForeign(void)
|
|||
}
|
||||
CurrentModule = OldModule;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
408
CMakeLists.txt
408
CMakeLists.txt
|
@ -1,3 +1,4 @@
|
|||
|
||||
# value of 3.4.0 or lower.
|
||||
cmake_minimum_required(VERSION 3.4)
|
||||
|
||||
|
@ -13,6 +14,7 @@ include(CMakeToolsHelpers OPTIONAL)
|
|||
project( YAP )
|
||||
|
||||
include(FeatureSummary)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(YAP_APP_DIR "${CMAKE_SOURCE_DIR}/../..")
|
||||
cmake_policy(VERSION 3.4)
|
||||
|
@ -32,7 +34,17 @@ include(MacroOptionalAddSubdirectory)
|
|||
include(MacroOptionalFindPackage)
|
||||
include(FeatureSummary)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
include (GNUInstallDirs)
|
||||
|
||||
# Optional Components
|
||||
#
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckPrototypeExists)
|
||||
include(CheckVariableExists)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(TestBigEndian)
|
||||
include(GetGitRevisionDescription)
|
||||
|
||||
# Creates and names a library, sets it as either STATIC
|
||||
# or SHARED, and provides the relative paths to its source code.z
|
||||
|
@ -196,42 +208,47 @@ disallow_intree_builds()
|
|||
|
||||
if (APPLE)
|
||||
set (MACOSX_RPATH ON)
|
||||
endif (APPLE )
|
||||
if(POLICY CMP0042)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
endif(POLICY CMP0042)
|
||||
if(POLICY CMP0043)
|
||||
cmake_policy(SET CMP0043 NEW)
|
||||
endif(POLICY CMP0043)
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
set ( prefix ${YAP_APP_DIR}/build )
|
||||
set ( datarootdir ${prefix}/assets )
|
||||
else()
|
||||
set ( prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set ( datarootdir ${prefix}/share )
|
||||
set (PATH $ENV{PATH})
|
||||
list (FIND ${PATH} pos /usr/local)
|
||||
if (pos EQUAL -1)
|
||||
set (pos 0)
|
||||
endif()
|
||||
list (INSERT CMAKE_PREFIX_PATH pos
|
||||
/usr/local/opt/gmp
|
||||
/usr/local/opt/libxml2
|
||||
/usr/local/opt/openmpi
|
||||
/usr/local/opt/openssl
|
||||
/usr/local/opt/postgresql
|
||||
/usr/local/opt/python3
|
||||
/usr/local/opt/readline
|
||||
/usr/local/opt/swig
|
||||
)
|
||||
endif (APPLE )
|
||||
if(ANDROID)
|
||||
set ( datarootdir /assets )
|
||||
endif()
|
||||
set ( prefix ${CMAKE_INSTALL_PREFIX}) #BINDIR})
|
||||
set ( bindir ${CMAKE_INSTALL_PREFIX}/bin) #BINDIR})
|
||||
set ( includedir ${CMAKE_INSTALL_PREFIX}/include) #INCLUDEDIR})
|
||||
set ( libdir ${CMAKE_INSTALL_PREFIX}/lib) #LIBDIR})
|
||||
set ( exec_prefix ${CMAKE_INSTALL_PREFIX}/libexec) #LIBEXECDIR})
|
||||
set( datarootdir ${CMAKE_INSTALL_PREFIX}/share) #DATAROOTDIR})
|
||||
set ( datadir ${CMAKE_INSTALL_PREFIX}/share) #DATADIR})
|
||||
set ( mandir ${CMAKE_INSTALL_PREFIX}/share/man) #MANDIR})
|
||||
|
||||
set ( libpl ${datarootdir}/Yap)
|
||||
set ( includedir "${prefix}/include")
|
||||
set ( exec_prefix "${prefix}")
|
||||
set ( libdir "${exec_prefix}/lib")
|
||||
set ( datadir "${datarootdir}")
|
||||
set ( mandir "${datarootdir}/man")
|
||||
set ( bindir "${exec_prefix}/bin")
|
||||
set ( docdir "${datarootdir}/doc/Yap")
|
||||
set ( dlls "${exec_prefix}/lib/Yap")
|
||||
|
||||
set ( dlls ${libdir}/Yap)
|
||||
|
||||
set(YAP_ROOTDIR ${prefix})
|
||||
|
||||
# erootdir -> rootdir
|
||||
# bindir defined above
|
||||
# libdir defined above
|
||||
set(YAP_LIBDIR "${dlls}")
|
||||
set(YAP_SHAREDIR "${datarootdir}")
|
||||
set(YAP_BINDIR "${bindir}")
|
||||
set(YAP_INCLUDEDIR "${includedir}")
|
||||
set(YAP_ROOTDIR "${prefix}")
|
||||
set(YAP_SHAREDIR ${datarootdir})
|
||||
set(YAP_BINDIR ${bindir})
|
||||
set(YAP_INCLUDEDIR ${includedir})
|
||||
set(YAP_ROOTDIR ${prefix})
|
||||
set(YAP_LIBDIR ${dlls})
|
||||
|
||||
#
|
||||
#
|
||||
|
@ -246,111 +263,6 @@ set (pl_library "" CACHE INTERNAL "prolog library files" )
|
|||
set (pl_os_library "" CACHE INTERNAL "prolog os files" )
|
||||
set (pl_boot_library "" CACHE INTERNAL "prolog boot files" )
|
||||
|
||||
#
|
||||
# Sources Section
|
||||
#
|
||||
|
||||
|
||||
set (ABSMI_SOURCES
|
||||
C/absmi.c
|
||||
C/absmi_insts.h
|
||||
C/fli_absmi_insts.h
|
||||
C/or_absmi_insts.h
|
||||
C/control_absmi_insts.h
|
||||
C/index_absmi_insts.h
|
||||
C/prim_absmi_insts.h
|
||||
C/cp_absmi_insts.h
|
||||
C/lu_absmi_insts.h
|
||||
C/unify_absmi_insts.h
|
||||
C/fail_absmi_insts.h
|
||||
C/meta_absmi_insts.h
|
||||
)
|
||||
|
||||
set (ENGINE_SOURCES
|
||||
${ABSMI_SOURCES}
|
||||
C/agc.c
|
||||
C/adtdefs.c
|
||||
C/alloc.c
|
||||
C/amasm.c
|
||||
C/analyst.c
|
||||
C/args.c
|
||||
C/arrays.c
|
||||
C/arith0.c
|
||||
C/arith1.c
|
||||
C/arith2.c
|
||||
C/atomic.c
|
||||
C/attvar.c
|
||||
C/bignum.c
|
||||
C/bb.c
|
||||
C/blobs.c
|
||||
C/cdmgr.c
|
||||
C/cmppreds.c
|
||||
C/compiler.c
|
||||
C/computils.c
|
||||
C/corout.c
|
||||
C/cut_c.c
|
||||
C/dbase.c
|
||||
C/dlmalloc.c
|
||||
C/errors.c
|
||||
C/eval.c
|
||||
C/exec.c
|
||||
C/exo.c
|
||||
C/exo_udi.c
|
||||
C/flags.c
|
||||
C/globals.c
|
||||
C/gmp_support.c
|
||||
C/gprof.c
|
||||
C/grow.c
|
||||
C/heapgc.c
|
||||
C/index.c
|
||||
C/init.c
|
||||
C/inlines.c
|
||||
C/depth_bound.c
|
||||
C/mavar.c
|
||||
C/modules.c
|
||||
C/other.c
|
||||
C/parser.c
|
||||
C/qlyr.c
|
||||
C/qlyw.c
|
||||
C/range.c
|
||||
C/save.c
|
||||
C/scanner.c
|
||||
C/signals.c
|
||||
C/sort.c
|
||||
C/stdpreds.c
|
||||
C/stack.c
|
||||
C/text.c
|
||||
C/threads.c
|
||||
C/tracer.c
|
||||
C/unify.c
|
||||
C/userpreds.c
|
||||
C/utilpreds.c
|
||||
C/yap-args.c
|
||||
C/write.c
|
||||
C/udi.c
|
||||
#packages/udi/rtree.c
|
||||
#packages/udi/rtree_udi.c
|
||||
|
||||
# ${IOLIB_SOURCES}
|
||||
# MPI_SOURCES
|
||||
)
|
||||
|
||||
set(C_INTERFACE_SOURCES
|
||||
${PROJECT_BINARY_DIR}/GitSHA1.c
|
||||
C/load_foreign.c
|
||||
C/load_dl.c
|
||||
C/load_dld.c
|
||||
C/load_dyld.c
|
||||
C/load_none.c
|
||||
C/load_aout.c
|
||||
C/load_aix.c
|
||||
C/load_dll.c
|
||||
C/load_shl.c
|
||||
C/c_interface.c
|
||||
C/clause_list.c
|
||||
)
|
||||
|
||||
|
||||
find_package (GMP)
|
||||
# GMP_FOUND - true if GMP/MPIR was found
|
||||
# GMP_INCLUDE_DIRS - include search path
|
||||
|
@ -359,195 +271,14 @@ set(C_INTERFACE_SOURCES
|
|||
|
||||
list(APPEND YAP_SYSTEM_OPTIONS big_numbers)
|
||||
|
||||
find_package( Readline)
|
||||
|
||||
List(APPEND YAP_SYSTEM_OPTIONS readline)
|
||||
# include subdirectories configuration
|
||||
## after we have all functionality in
|
||||
#
|
||||
# ADD_SUBDIRECTORY(console/terminal)
|
||||
|
||||
include(readline)
|
||||
if (READLINE_FOUND )
|
||||
list( APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES} )
|
||||
|
||||
list(APPEND YAP_SYSTEM_OPTIONS readline)
|
||||
endif()
|
||||
|
||||
list(APPEND LIBYAP_SOURCES ${C_INTERFACE_SOURCES} ${ENGINE_SOURCES})
|
||||
|
||||
set( BEAM_HEADERS
|
||||
BEAM/beam.h
|
||||
)
|
||||
set (CORE_HEADERS
|
||||
${CMAKE_SOURCE_DIR}/H/Atoms.h
|
||||
${CMAKE_SOURCE_DIR}/H/Foreign.h
|
||||
${CMAKE_SOURCE_DIR}/H/Regs.h
|
||||
${CMAKE_SOURCE_DIR}/H/ScannerTypes.h
|
||||
${CMAKE_SOURCE_DIR}/H/Tags_24bits.h
|
||||
${CMAKE_SOURCE_DIR}/H/Tags_32LowTag.h
|
||||
${CMAKE_SOURCE_DIR}/H/Tags_32Ops.h
|
||||
${CMAKE_SOURCE_DIR}/H/Tags_32bits.h
|
||||
${CMAKE_SOURCE_DIR}/H/Tags_64bits.h
|
||||
${CMAKE_SOURCE_DIR}/H/TermExt.h
|
||||
${CMAKE_SOURCE_DIR}/H/Yap.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapAppliedOpcodes.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapCompile.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapCompoundTerm.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapEval.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapFlags.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapGFlagInfo.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapHandles.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapHeap.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapLFlagInfo.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapOpcodes.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapSignals.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapTags.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapTerm.h
|
||||
${CMAKE_SOURCE_DIR}/H/YapText.h
|
||||
${CMAKE_SOURCE_DIR}/H/Yapproto.h
|
||||
${CMAKE_SOURCE_DIR}/H/Yatom.h
|
||||
${CMAKE_SOURCE_DIR}/H/absmi-interpretrer.h
|
||||
${CMAKE_SOURCE_DIR}/H/absmi-switch.h
|
||||
${CMAKE_SOURCE_DIR}/H/absmi-threaded.h
|
||||
${CMAKE_SOURCE_DIR}/H/absmi-traced.h
|
||||
${CMAKE_SOURCE_DIR}/H/absmi.h
|
||||
${CMAKE_SOURCE_DIR}/H/alloc.h
|
||||
${CMAKE_SOURCE_DIR}/H/amidefs.h
|
||||
${CMAKE_SOURCE_DIR}/H/amijit.h
|
||||
${CMAKE_SOURCE_DIR}/H/amiops.h
|
||||
${CMAKE_SOURCE_DIR}/H/arith2.h
|
||||
${CMAKE_SOURCE_DIR}/H/arrays.h
|
||||
${CMAKE_SOURCE_DIR}/H/attvar.h
|
||||
${CMAKE_SOURCE_DIR}/H/clause.h
|
||||
${CMAKE_SOURCE_DIR}/H/corout.h
|
||||
${CMAKE_SOURCE_DIR}/H/cut_c.h
|
||||
${CMAKE_SOURCE_DIR}/H/dlmalloc.h
|
||||
${CMAKE_SOURCE_DIR}/H/fields.h
|
||||
${CMAKE_SOURCE_DIR}/H/findclause.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/dglobals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/dhstruct.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/h0globals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/h0struct.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/hglobals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/hlocals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/hstruct.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/i0globals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/iatoms.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/iglobals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/ihstruct.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/ilocals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/ratoms.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/rglobals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/rhstruct.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/rlocals.h
|
||||
${CMAKE_SOURCE_DIR}/H/generated/tatoms.h
|
||||
${CMAKE_SOURCE_DIR}/H/globals.h
|
||||
${CMAKE_SOURCE_DIR}/H/headclause.h
|
||||
${CMAKE_SOURCE_DIR}/H/heap.h
|
||||
${CMAKE_SOURCE_DIR}/H/heapgc.h
|
||||
${CMAKE_SOURCE_DIR}/H/index.h
|
||||
${CMAKE_SOURCE_DIR}/H/inline-only.h
|
||||
${CMAKE_SOURCE_DIR}/H/iswiatoms.h
|
||||
${CMAKE_SOURCE_DIR}/H/locals.h
|
||||
${CMAKE_SOURCE_DIR}/H/nolocks.h
|
||||
${CMAKE_SOURCE_DIR}/H/qly.h
|
||||
${CMAKE_SOURCE_DIR}/H/rclause.h
|
||||
${CMAKE_SOURCE_DIR}/H/rheap.h
|
||||
${CMAKE_SOURCE_DIR}/H/saveclause.h
|
||||
${CMAKE_SOURCE_DIR}/H/sig.h
|
||||
${CMAKE_SOURCE_DIR}/H/sshift.h
|
||||
${CMAKE_SOURCE_DIR}/H/threads.h
|
||||
${CMAKE_SOURCE_DIR}/H/tracer.h
|
||||
${CMAKE_SOURCE_DIR}/H/trim_trail.h
|
||||
${CMAKE_SOURCE_DIR}/H/udi_private.h
|
||||
${CMAKE_SOURCE_DIR}/H/utarray.h
|
||||
${CMAKE_SOURCE_DIR}/H/uthash.h
|
||||
${CMAKE_SOURCE_DIR}/H/walkclause.h
|
||||
${CMAKE_SOURCE_DIR}/H/yerror.h
|
||||
)
|
||||
|
||||
set (INCLUDE_HEADERS
|
||||
${CMAKE_SOURCE_DIR}/include/GitSHA1.h
|
||||
${CMAKE_SOURCE_DIR}/include/SWI-Prolog.h
|
||||
${CMAKE_SOURCE_DIR}/include/VFS.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapDefs.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapError.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapErrors.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapFormat.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapInterface.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapRegs.h
|
||||
${CMAKE_SOURCE_DIR}/include/YapStreams.h
|
||||
${CMAKE_SOURCE_DIR}/include/blobs.h
|
||||
${CMAKE_SOURCE_DIR}/include/c_interface.h
|
||||
${CMAKE_SOURCE_DIR}/include/clause_list.h
|
||||
${CMAKE_SOURCE_DIR}/include/pl-types.h
|
||||
${CMAKE_SOURCE_DIR}/include/udi.h
|
||||
)
|
||||
|
||||
set (CONFIGURATION_HEADERS
|
||||
${CMAKE_BINARY_DIR}/YapConfig.h
|
||||
${CMAKE_BINARY_DIR}/YapTermConfig.h
|
||||
${CMAKE_BINARY_DIR}/config.h
|
||||
${CMAKE_BINARY_DIR}/cudd_config.h
|
||||
${CMAKE_BINARY_DIR}/dlocals.h
|
||||
${CMAKE_BINARY_DIR}/YapIOConfig.h
|
||||
)
|
||||
|
||||
|
||||
set (CXX_HEADERS
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapa.hh
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapdb.hh
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapi.hh
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapie.hh
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapq.hh
|
||||
${CMAKE_SOURCE_DIR}/CXX/yapt.hh
|
||||
|
||||
)
|
||||
set (PYTHON_HEADERS ${CMAKE_SOURCE_DIR}/packages/python/py4yap.h)
|
||||
|
||||
set (OPTYap_HEADERS
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/opt.config.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/opt.proto.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/opt.structs.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/opt.macros.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/or.macros.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/or.sba_amiops.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/or.sba_unify.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/tab.structs.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_x86.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_sparc.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_mips.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_mips_funcs.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_alpha.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_alpha_funcs.h
|
||||
${CMAKE_SOURCE_DIR}/OPTYap/locks_pthread.h
|
||||
|
||||
)
|
||||
|
||||
set (YAPOS_HEADERS
|
||||
${CMAKE_SOURCE_DIR}/os/encoding.h
|
||||
${CMAKE_SOURCE_DIR}/os/fmemopen.h
|
||||
${CMAKE_SOURCE_DIR}/os/format.h
|
||||
${CMAKE_SOURCE_DIR}/os/getw.h
|
||||
${CMAKE_SOURCE_DIR}/os/iopreds.h
|
||||
${CMAKE_SOURCE_DIR}/os/sysbits.h
|
||||
${CMAKE_SOURCE_DIR}/os/yapio.h
|
||||
)
|
||||
|
||||
list( APPEND c_headers ${CMAKE_SOURCE_DIR}/utf8proc/utf8proc.h )
|
||||
list( APPEND c_headers ${YAPOS_HEADERS} )
|
||||
list( APPEND c_headers ${OPTYap_HEADERS} )
|
||||
list( APPEND c_headers ${INCLUDE_HEADERS} )
|
||||
list( APPEND c_headers ${CORE_HEADERS} )
|
||||
list (APPEND c_headers ${PYTHON_HEADERS})
|
||||
#list( APPEND c_headers ${CONFIGURATION_HEADERS} )
|
||||
list( APPEND cxx_headers ${CXX_HEADERS} )
|
||||
|
||||
|
||||
set(STATIC_SOURCES
|
||||
#NOT INCLUDED FOR NOW
|
||||
)
|
||||
|
||||
set(CONSOLE_SOURCES
|
||||
console/yap.c)
|
||||
|
||||
#MPI STUFF
|
||||
# library/mpi/mpi.c library/mpi/mpe.c
|
||||
|
@ -642,7 +373,7 @@ endif()
|
|||
if (HAVE_GCC)
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -Wall )
|
||||
if ( ${C_COMPILER} MATCHES "GNU")
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:-O3;-fomit-frame-pointer;-fstrict-aliasing;-freorder-blocks;-fsched-interblock> )
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:-O3;-fomit-frame-poinkter;-fstrict-aliasing;-freorder-blocks;-fsched-interblock> )
|
||||
else()
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_OPTIONS $<$<CONFIG:Release>:-O3;-fstrict-aliasing;-freorder-blocks;-fsched-interblock> )
|
||||
endif()
|
||||
|
@ -673,6 +404,7 @@ set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS UTF8PROC=1)
|
|||
|
||||
include_directories ( utf8proc packages/myddas packages/myddas/sqlite3/src)
|
||||
|
||||
|
||||
if (ANDROID)
|
||||
include_directories (
|
||||
packages/myddas/sqlite3/src/Android/jni/sqlite
|
||||
|
@ -706,6 +438,7 @@ IF (WITH_SWIG OR ANDROID)
|
|||
# "http://www.swig.org" ON)
|
||||
ENDIF (WITH_SWIG OR ANDROID)
|
||||
|
||||
|
||||
option (WITH_PYTHON
|
||||
"Allow Python->YAP and YAP->Python" ON)
|
||||
|
||||
|
@ -728,7 +461,7 @@ ENDIF (WITH_PYTHON)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
include (Sources)
|
||||
|
||||
|
||||
add_corelib( # Sets the name of the library.
|
||||
|
@ -758,10 +491,15 @@ endif (WIN32)
|
|||
target_link_libraries(libYap ${GMP_LIBRARIES} )
|
||||
endif (GMP_FOUND)
|
||||
|
||||
if (READLINE_FOUND)
|
||||
include_directories( ${READLINE_INCLUDE_DIR} )
|
||||
target_link_libraries(libYap ${READLINE_LIBRARIES} )
|
||||
# required for configure
|
||||
list (APPEND CMAKE_REQUIRED_LIBRARIES ${READLINE_LIBRARIES})
|
||||
list (APPEND CMAKE_REQUIRED_INCLUDES ${READLINE_INCLUDE_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
include (Sources)
|
||||
|
||||
set(YAP_STARTUP startup.yss)
|
||||
## define system
|
||||
|
||||
|
@ -781,7 +519,7 @@ 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
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
|
@ -789,27 +527,19 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|||
# (but later on when installing)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "${libdir};${dlls}:")
|
||||
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}
|
||||
)
|
||||
|
||||
# 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)
|
||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
IF("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${libdir};${dlls}")
|
||||
SET(CMAKE_INSTALL_RPATH "${libdir}")
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
|
||||
include_directories (H
|
||||
H/generated
|
||||
include os OPTYap utf8proc JIT/HPP)
|
||||
|
@ -827,6 +557,14 @@ include( Threads )
|
|||
#
|
||||
list(APPEND YAP_SYSTEM_OPTIONS "thread support")
|
||||
|
||||
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}
|
||||
)
|
||||
|
||||
#utf-8 is not an option
|
||||
# we use the nice UTF-8 package
|
||||
#available at the Julia project
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
``
|
||||
<center>
|
||||
![The YAP Logo](docs/icons/yap_128x128x32.png)
|
||||
</center>
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
#
|
||||
# Optional Components
|
||||
#
|
||||
include(CheckIncludeFileCXX)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckPrototypeExists)
|
||||
include(CheckLibraryExists)
|
||||
include(CheckTypeSize)
|
||||
include(CheckVariableExists)
|
||||
include(CheckCXXSourceCompiles)
|
||||
include(TestBigEndian)
|
||||
include(GetGitRevisionDescription)
|
||||
|
||||
|
||||
# modern systems do this.
|
||||
|
||||
|
@ -211,7 +197,6 @@ endif (HAVE_LIBLOG)
|
|||
# set(EXTRALIBS ${EXTRALIBS} socket)
|
||||
# endif (HAVE_LIBSOCKET)
|
||||
|
||||
|
||||
find_library(HAVE_LIBPTHREAD pthread)
|
||||
if (HAVE_LIBPTHREAD)
|
||||
target_link_libraries(libYap pthread)
|
||||
|
@ -402,6 +387,28 @@ git_describe(GIT_DESCRIBE)
|
|||
#Test standard headers (mimics AC_HEADER_STDC)
|
||||
include(TestSTDC)
|
||||
|
||||
|
||||
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
|
||||
check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H )
|
||||
check_function_exists( add_history HAVE_ADD_HISTORY )
|
||||
check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP)
|
||||
check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT)
|
||||
check_function_exists( rl_discard_argument HAVE_RL_DISCARD_ARGUMENT)
|
||||
check_symbol_exists( rl_filename_completion_function stdio.h;readline/readline.h HAVE_RL_FILENAME_COMPLETION_FUNCTION)
|
||||
check_function_exists( rl_free_line_state HAVE_RL_FREE_LINE_STATE )
|
||||
check_function_exists( rl_insert_close HAVE_RL_INSERT_CLOSE )
|
||||
check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL )
|
||||
check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT )
|
||||
check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT)
|
||||
check_symbol_exists( rl_catch_signals "stdio.h;readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
|
||||
check_type_size( rl_completion_func_t RL_COMPLETION_FUNC_T )
|
||||
check_symbol_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE )
|
||||
CHECK_TYPE_SIZE( rl_hook_func_t RL_HOOK_FUNC_T )
|
||||
check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
|
||||
check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
|
||||
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/YapIOConfig.h)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake
|
||||
${CMAKE_BINARY_DIR}/YapConfig.h)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../YapTermConfig.h.cmake
|
||||
|
@ -409,5 +416,3 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../YapTermConfig.h.cmake
|
|||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake
|
||||
${CMAKE_BINARY_DIR}/config.h)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../GitSHA1.c.in GitSHA1.c @ONLY)
|
||||
configure_file(${CMAKE_CURRENT_LIST_DIR}/../os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/YapIOConfig.h)
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ else()
|
|||
llvm_set(SYSTEM_LIBS system-libs)
|
||||
string(REPLACE "\n" " " LLVM_LDFLAGS "${LLVM_LDFLAGS} ${LLVM_SYSTEM_LIBS}")
|
||||
endif()
|
||||
llvm_set(LIBRARY_DIRS libdir true)
|
||||
llvm_set(LIBRARY_DIRS CMAKE_INSTALL_LIBDIR true)
|
||||
llvm_set_libs(LIBRARIES libfiles "${LLVM_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
||||
|
|
|
@ -1,183 +1,78 @@
|
|||
|
||||
#
|
||||
# FindLibR.cmake
|
||||
# - This module locates an installed R distribution.
|
||||
#
|
||||
# Copyright (C) 2009-11 by RStudio, Inc.
|
||||
# Defines the following:
|
||||
# R_COMMAND - Path to R command
|
||||
# R_HOME - Path to 'R home', as reported by R
|
||||
# R_INCLUDE_DIR - Path to R include directory
|
||||
# R_LIBRARY_BASE - Path to R library
|
||||
# R_LIBRARY_BLAS - Path to Rblas / blas library
|
||||
# R_LIBRARY_LAPACK - Path to Rlapack / lapack library
|
||||
# R_LIBRARY_READLINE - Path to readline library
|
||||
# R_LIBRARIES - Array of: R_LIBRARY_BASE, R_LIBRARY_BLAS, R_LIBRARY_LAPACK, R_LIBRARY_BASE [, R_LIBRARY_READLINE]
|
||||
#
|
||||
# This program is licensed to you under the terms of version 3 of the
|
||||
# GNU Affero General Public License. This program is distributed WITHOUT
|
||||
# ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
|
||||
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
|
||||
# AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
|
||||
# VTK_R_HOME - (deprecated, use R_HOME instead) Path to 'R home', as reported by R
|
||||
#
|
||||
# Variable search order:
|
||||
# 1. Attempt to locate and set R_COMMAND
|
||||
# - If unsuccessful, generate error and prompt user to manually set R_COMMAND
|
||||
# 2. Use R_COMMAND to set R_HOME
|
||||
# 3. Locate other libraries in the priority:
|
||||
# 1. Within a user-built instance of R at R_HOME
|
||||
# 2. Within an installed instance of R
|
||||
# 3. Within external system libraries
|
||||
#
|
||||
|
||||
# LIBR_FOUND
|
||||
# LIBR_HOME
|
||||
# LIBR_INCLUDE_DIRS
|
||||
# LIBR_DOC_DIR
|
||||
# LIBR_LIBRARIES
|
||||
set(TEMP_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
||||
set(CMAKE_FIND_APPBUNDLE "NEVER")
|
||||
find_program(R_COMMAND R DOC "R executable.")
|
||||
set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE})
|
||||
|
||||
# detection for OSX (look for R framework)
|
||||
if(APPLE)
|
||||
|
||||
find_library(LIBR_LIBRARIES R)
|
||||
if(LIBR_LIBRARIES)
|
||||
set(LIBR_HOME "${LIBR_LIBRARIES}/Resources" CACHE PATH "R home directory")
|
||||
set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
|
||||
set(LIBR_DOC_DIR "${LIBR_HOME}/doc" CACHE PATH "R doc directory")
|
||||
set(LIBR_EXECUTABLE "${LIBR_HOME}/R" CACHE PATH "R executable")
|
||||
endif()
|
||||
|
||||
# detection for UNIX & Win32
|
||||
if(R_COMMAND)
|
||||
execute_process(WORKING_DIRECTORY .
|
||||
COMMAND ${R_COMMAND} RHOME
|
||||
OUTPUT_VARIABLE R_ROOT_DIR
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
# deprecated
|
||||
if(VTK_R_HOME)
|
||||
set(R_HOME ${VTK_R_HOME} CACHE PATH "R home directory obtained from R RHOME")
|
||||
else()
|
||||
set(R_HOME ${R_ROOT_DIR} CACHE PATH "R home directory obtained from R RHOME")
|
||||
set(VTK_R_HOME ${R_HOME})
|
||||
endif()
|
||||
# /deprecated
|
||||
# the following command does nothing currently, but will be used when deprecated code is removed
|
||||
set(R_HOME ${R_ROOT_DIR} CACHE PATH "R home directory obtained from R RHOME")
|
||||
|
||||
# Find R executable and paths (UNIX)
|
||||
if(UNIX)
|
||||
find_path(R_INCLUDE_DIR R.h
|
||||
HINTS ${R_ROOT_DIR}
|
||||
PATHS /usr/local/lib /usr/local/lib64 /usr/share
|
||||
PATH_SUFFIXES include R/include
|
||||
DOC "Path to file R.h")
|
||||
|
||||
# find executable
|
||||
find_program(LIBR_EXECUTABLE R)
|
||||
if(LIBR_EXECUTABLE-NOTFOUND)
|
||||
message(STATUS "Unable to locate R executable")
|
||||
endif()
|
||||
find_library(R_LIBRARY_BASE R
|
||||
HINTS ${R_ROOT_DIR}/lib
|
||||
DOC "R library (example libR.a, libR.dylib, etc.).")
|
||||
|
||||
# ask R for the home path
|
||||
if(NOT LIBR_HOME)
|
||||
execute_process(
|
||||
COMMAND ${LIBR_EXECUTABLE} "--slave" "--vanilla" "-e" "cat(R.home())"
|
||||
OUTPUT_VARIABLE LIBR_HOME
|
||||
)
|
||||
if(LIBR_HOME)
|
||||
set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory")
|
||||
endif()
|
||||
endif()
|
||||
find_library(R_LIBRARY_BLAS NAMES Rblas blas
|
||||
HINTS ${R_ROOT_DIR}/lib
|
||||
DOC "Rblas library (example libRblas.a, libRblas.dylib, etc.).")
|
||||
|
||||
# ask R for the include dir
|
||||
if(NOT LIBR_INCLUDE_DIRS)
|
||||
execute_process(
|
||||
COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('include'))"
|
||||
OUTPUT_VARIABLE LIBR_INCLUDE_DIRS
|
||||
)
|
||||
if(LIBR_INCLUDE_DIRS)
|
||||
set(LIBR_INCLUDE_DIRS ${LIBR_INCLUDE_DIRS} CACHE PATH "R include directory")
|
||||
endif()
|
||||
endif()
|
||||
find_library(R_LIBRARY_LAPACK NAMES Rlapack lapack
|
||||
HINTS ${R_ROOT_DIR}/lib
|
||||
DOC "Rlapack library (example libRlapack.a, libRlapack.dylib, etc.).")
|
||||
|
||||
# ask R for the doc dir
|
||||
if(NOT LIBR_DOC_DIR)
|
||||
execute_process(
|
||||
COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('doc'))"
|
||||
OUTPUT_VARIABLE LIBR_DOC_DIR
|
||||
)
|
||||
if(LIBR_DOC_DIR)
|
||||
set(LIBR_DOC_DIR ${LIBR_DOC_DIR} CACHE PATH "R doc directory")
|
||||
endif()
|
||||
endif()
|
||||
find_library(R_LIBRARY_READLINE readline
|
||||
DOC "(Optional) system readline library. Only required if the R libraries were built with readline support.")
|
||||
|
||||
# ask R for the lib dir
|
||||
if(NOT LIBR_LIB_DIR)
|
||||
execute_process(
|
||||
COMMAND ${LIBR_EXECUTABLE} "--slave" "--no-save" "-e" "cat(R.home('lib'))"
|
||||
OUTPUT_VARIABLE LIBR_LIB_DIR
|
||||
)
|
||||
endif()
|
||||
|
||||
# Find R executable and paths (Win32)
|
||||
else()
|
||||
|
||||
# find the home path
|
||||
if(NOT LIBR_HOME)
|
||||
|
||||
# read home from the registry
|
||||
get_filename_component(LIBR_HOME
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\R-core\\R;InstallPath]"
|
||||
ABSOLUTE CACHE)
|
||||
|
||||
# print message if not found
|
||||
if(NOT LIBR_HOME)
|
||||
message(STATUS "Unable to locate R home (not written to registry)")
|
||||
message(SEND_ERROR "FindR.cmake requires the following variables to be set: R_COMMAND")
|
||||
endif()
|
||||
|
||||
# Note: R_LIBRARY_BASE is added to R_LIBRARIES twice; this may be due to circular linking dependencies; needs further investigation
|
||||
set(R_LIBRARIES ${R_LIBRARY_BASE} ${R_LIBRARY_BLAS} ${R_LIBRARY_LAPACK} ${R_LIBRARY_BASE})
|
||||
if(R_LIBRARY_READLINE)
|
||||
set(R_LIBRARIES ${R_LIBRARIES} ${R_LIBRARY_READLINE})
|
||||
endif()
|
||||
|
||||
# set other R paths based on home path
|
||||
set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
|
||||
set(LIBR_DOC_DIR "${LIBR_HOME}/doc" CACHE PATH "R doc directory")
|
||||
|
||||
# set library hint path based on whether we are doing a special session 64 build
|
||||
if(LIBR_FIND_WINDOWS_64BIT)
|
||||
set(LIBRARY_ARCH_HINT_PATH "${LIBR_HOME}/bin/x64")
|
||||
else()
|
||||
set(LIBRARY_ARCH_HINT_PATH "${LIBR_HOME}/bin/i386")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# look for the R executable
|
||||
find_program(LIBR_EXECUTABLE R
|
||||
HINTS ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
|
||||
if(LIBR_EXECUTABLE-NOTFOUND)
|
||||
message(STATUS "Unable to locate R executable")
|
||||
endif()
|
||||
|
||||
# look for the core R library
|
||||
find_library(LIBR_CORE_LIBRARY NAMES R
|
||||
HINTS ${LIBR_LIB_DIR} ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
|
||||
if(LIBR_CORE_LIBRARY)
|
||||
set(LIBR_LIBRARIES ${LIBR_CORE_LIBRARY})
|
||||
else()
|
||||
message(STATUS "Could not find libR shared library.")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
# look for lapack
|
||||
find_library(LIBR_LAPACK_LIBRARY NAMES Rlapack
|
||||
HINTS ${LIBR_LIB_DIR} ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
|
||||
if(LIBR_LAPACK_LIBRARY)
|
||||
set(LIBR_LIBRARIES ${LIBR_LIBRARIES} ${LIBR_LAPACK_LIBRARY})
|
||||
if(UNIX)
|
||||
set(LIBR_LIBRARIES ${LIBR_LIBRARIES} gfortran)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# look for blas
|
||||
find_library(LIBR_BLAS_LIBRARY NAMES Rblas
|
||||
HINTS ${LIBR_LIB_DIR} ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
|
||||
if(LIBR_BLAS_LIBRARY)
|
||||
set(LIBR_LIBRARIES ${LIBR_LIBRARIES} ${LIBR_BLAS_LIBRARY})
|
||||
endif()
|
||||
|
||||
# look for rgraphapp
|
||||
find_library(LIBR_GRAPHAPP_LIBRARY NAMES Rgraphapp
|
||||
HINTS ${LIBR_LIB_DIR} ${LIBRARY_ARCH_HINT_PATH} ${LIBR_HOME}/bin)
|
||||
if(LIBR_GRAPHAPP_LIBRARY)
|
||||
set(LIBR_LIBRARIES ${LIBR_LIBRARIES} ${LIBR_GRAPHAPP_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# cache LIBR_LIBRARIES
|
||||
if(LIBR_LIBRARIES)
|
||||
set(LIBR_LIBRARIES ${LIBR_LIBRARIES} CACHE PATH "R runtime libraries")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
# define find requirements
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(LibR DEFAULT_MSG
|
||||
LIBR_HOME
|
||||
LIBR_EXECUTABLE
|
||||
LIBR_INCLUDE_DIRS
|
||||
LIBR_LIBRARIES
|
||||
LIBR_DOC_DIR
|
||||
)
|
||||
|
||||
if(LIBR_FOUND)
|
||||
message(STATUS "Found R: ${LIBR_HOME}")
|
||||
endif()
|
||||
|
||||
# mark low-level variables from FIND_* calls as advanced
|
||||
mark_as_advanced(
|
||||
LIBR_CORE_LIBRARY
|
||||
LIBR_LAPACK_LIBRARY
|
||||
LIBR_BLAS_LIBRARY
|
||||
)
|
||||
|
|
|
@ -12,49 +12,14 @@
|
|||
# So we look for another one by default
|
||||
#
|
||||
# # try to extract R from readline to avoid collision
|
||||
IF(APPLE)
|
||||
FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS
|
||||
${CMAKE_INCLUDE_PATH}
|
||||
${R_INCLUDE_DIR}
|
||||
/sw/include
|
||||
/opt/local/include
|
||||
/opt/include
|
||||
/usr/local/opt/readline/include #brew
|
||||
/usr/local/include
|
||||
/usr/include/
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
ENDIF(APPLE)
|
||||
FIND_PATH(READLINE_INCLUDE_DIR NAMES readline/readline.h)
|
||||
|
||||
|
||||
# Apple readline does not support readline hooks
|
||||
# So we look for another one by default
|
||||
IF(APPLE)
|
||||
FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline PATHS
|
||||
${CMAKE_LIBRARY_PATH}
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/usr/local/opt/readline/lib #brew
|
||||
/opt/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
ENDIF(APPLE)
|
||||
FIND_LIBRARY(READLINE_readline_LIBRARY NAMES readline)
|
||||
|
||||
# Sometimes readline really needs ncurses
|
||||
IF(APPLE)
|
||||
FIND_LIBRARY(READLINE_ncurses_LIBRARY NAMES ncurses PATHS
|
||||
/sw/lib
|
||||
/opt/local/lib
|
||||
/opt/lib
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
ENDIF(APPLE)
|
||||
FIND_LIBRARY(READLINE_ncurses_LIBRARY NAMES ncurses)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
|
@ -63,6 +28,9 @@ MARK_AS_ADVANCED(
|
|||
READLINE_ncurses_LIBRARY
|
||||
)
|
||||
|
||||
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}")
|
||||
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ")
|
||||
|
||||
SET( READLINE_FOUND "NO" )
|
||||
IF(READLINE_INCLUDE_DIR)
|
||||
IF(READLINE_readline_LIBRARY)
|
||||
|
@ -79,8 +47,11 @@ IF(READLINE_INCLUDE_DIR)
|
|||
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)
|
||||
MESSAGE(SYSTEM_ERROR_FATAL "Could not find readline -- please give some paths to CMake")
|
||||
|
@ -92,4 +63,5 @@ find_package_handle_standard_args(Readline READLINE_INCLUDE_DIR READLINE_LIBRARI
|
|||
|
||||
MARK_AS_ADVANCED(
|
||||
READLINE_FOUND
|
||||
HAVE_LIBREADLINE
|
||||
)
|
||||
|
|
|
@ -1,22 +1,3 @@
|
|||
# include subdirectories configuration
|
||||
## after we have all functionality in
|
||||
#
|
||||
# ADD_SUBDIRECTORY(console/terminal)
|
||||
|
||||
|
||||
|
||||
option (WITH_READLINE "GNU readline console" ON)
|
||||
|
||||
if (WITH_READLINE)
|
||||
macro_optional_find_package (Readline ON)
|
||||
|
||||
|
||||
include(CheckFunctionExists)
|
||||
include(CheckSymbolExists)
|
||||
include(CheckVariableExists)
|
||||
|
||||
|
||||
if (READLINE_FOUND)
|
||||
# - Find the readline library
|
||||
# This module defines
|
||||
# READLINE_INCLUDE_DIR, path to readline/readline.h, etc.
|
||||
|
@ -24,27 +5,42 @@ include(CheckVariableExists)
|
|||
# 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.
|
||||
# READLINE_ncurses_LIBRARY, where to find the ncurses library [might not be defined]
|
||||
check_include_files( "stdio.h;readline/readline.h" HAVE_READLINE_READLINE_H )
|
||||
check_include_files( "stdio.h;readline/history.h" HAVE_READLINE_HISTORY_H )
|
||||
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} PARENT_SCOPE)
|
||||
check_function_exists( add_history HAVE_ADD_HISTORY )
|
||||
check_function_exists( rl_begin_undo_group HAVE_RL_BEGIN_UNDO_GROUP)
|
||||
check_function_exists( rl_clear_pending_input HAVE_RL_CLEAR_PENDING_INPUT)
|
||||
check_function_exists( rl_discard_argument HAVE_RL_DISCARD_ARGUMENT)
|
||||
check_symbol_exists( rl_filename_completion_function stdio.h;readline/readline.h HAVE_RL_FILENAME_COMPLETION_FUNCTION)
|
||||
check_function_exists( rl_free_line_state HAVE_RL_FREE_LINE_STATE )
|
||||
check_function_exists( rl_insert_close HAVE_RL_INSERT_CLOSE )
|
||||
check_function_exists( rl_reset_after_signal HAVE_RL_RESET_AFTER_SIGNAL )
|
||||
check_function_exists( rl_set_keyboard_input_timeout HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT )
|
||||
check_function_exists( rl_set_prompt HAVE_RL_SET_PROMPT)
|
||||
check_symbol_exists( rl_catch_signals "stdio.h;readline/readline.h" HAVE_DECL_RL_CATCH_SIGNALS )
|
||||
check_type_size( rl_completion_func_t RL_COMPLETION_FUNC_T )
|
||||
check_symbol_exists( rl_done stdio.h;readline/readline.h HAVE_DECL_RL_DONE )
|
||||
CHECK_TYPE_SIZE( rl_hook_func_t RL_HOOK_FUNC_T )
|
||||
check_symbol_exists( rl_event_hook stdio.h;readline/readline.h HAVE_DECL_RL_EVENT_HOOK )
|
||||
check_symbol_exists( rl_readline_state stdio.h;readline/readline.h HAVE_DECL_RL_READLINE_STATE )
|
||||
endif (READLINE_FOUND)
|
||||
# , where to find the ncurses library [might not be defined]
|
||||
|
||||
|
||||
endif (WITH_READLINE)
|
||||
# include subdirectories configuration
|
||||
## after we have all functionality in
|
||||
#
|
||||
# ADD_SUBDIRECTORY(console/terminal)
|
||||
|
||||
option (WITH_READLINE "GNU readline console" ON)
|
||||
|
||||
|
||||
if (WITH_READLINE)
|
||||
find_library(READLINE_ncurses_LIBRARY
|
||||
NAMES ncurses
|
||||
HINTS ${Readline_ROOT_DIR}/lib
|
||||
)
|
||||
|
||||
find_path(READLINE_INCLUDE_DIR
|
||||
NAMES readline/readline.h
|
||||
HINTS ${Readline_ROOT_DIR}/include
|
||||
)
|
||||
find_library(READLINE_readline_LIBRARY
|
||||
NAMES readline
|
||||
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} )
|
||||
endif()
|
||||
message(STATUS "readline headers found at ${READLINE_INCLUDE_DIR}")
|
||||
message(STATUS "readline library found at ${READLINE_readline_LIBRARY} ${READLINE_ncurses_LIBRARY} ")
|
||||
endif ()
|
||||
set(YAP_SYSTEM_OPTIONS "readline" ${YAP_SYSTEM_OPTIONS} )
|
||||
|
||||
|
||||
set(EXTRALIBS ${EXTRALIBS} readline)
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -2058,4 +2058,3 @@ calls it, or to nothing if 'inline' is not supported under any name. */
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,24 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.12
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
# export CC=$SYS_PREFIX/bin/clang
|
||||
# export CXX=$SYS_PREFIX/bin/clang++
|
||||
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_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
|
||||
|
||||
mkdir $PREFIX/conda
|
||||
cd $PREFIX/conda
|
||||
# The datarootdir option places the docs into a temp folder that won't
|
||||
CC=$SYS_PREFIX/bin/clang \
|
||||
CXX=$SYS_PREFIX/bin/clang++ \
|
||||
$SYS_PREFIX/bin/cmake \
|
||||
-DCMAKE_INCLUDE_PATH="$SYS_PREFIX"/include \
|
||||
-DCMAKE_LIBRARY_PATH="$SYS_PREFIX"/lib \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
$CMAKE --build=. --target=install\
|
||||
-DCMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH" \
|
||||
-DCMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH" \
|
||||
-DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \
|
||||
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
|
||||
-DPYTHON_EXECUTABLE:FILEPATH="$PYTHON_EXECUTABLE" \
|
||||
-DPYTHON_LIBRARY:FILEPATH="$PYTHON_LIBRARY" \
|
||||
-DPYTHON_INCLUDE_DIR:PATH="$PYTHON_INCLUDE_DIR" \
|
||||
$RECIPE_DIR/..
|
||||
CC=$SYS_PREFIX/bin/clang \
|
||||
CXX=$SYS_PREFIX/bin/clang++ \
|
||||
make
|
||||
CC=$SYS_PREFIX/bin/clang \
|
||||
CXX=$SYS_PREFIX/bin/clang++ \
|
||||
make install
|
||||
|
||||
make -j install CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX"
|
||||
|
||||
# Remove the created lib64 directory
|
||||
|
||||
rm -rf $PREFIX/conda
|
||||
# rm -rf $PREFIX/conda
|
||||
|
|
|
@ -5,14 +5,18 @@ package:
|
|||
requirements:
|
||||
build:
|
||||
- cmake
|
||||
- clang
|
||||
- swig
|
||||
- readline
|
||||
- gmp
|
||||
- python
|
||||
- r
|
||||
- notebook
|
||||
run:
|
||||
- readline
|
||||
- gmp
|
||||
|
||||
|
||||
- r
|
||||
- notebook
|
||||
about:
|
||||
home: http://www.github.com/vscosta/yap-6.3.git
|
||||
license: LGPL2
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#cmakedefine HAVE_READLINE_READLINE_H ${HAVE_READLINE_READLINE_H}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_LIBREADLINE) && defined(HAVE_READLINE_READLINE_H)
|
||||
#if defined(FOUND_READLINE)
|
||||
#define USE_READLINE 1
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static char SccsId[] = "%W% %G%";
|
|||
|
||||
#include "iopreds.h"
|
||||
|
||||
#if USE_READLINE
|
||||
#if defined(HAVE_LIBREADLINE)
|
||||
|
||||
#include <readline/history.h>
|
||||
#include <readline/readline.h>
|
||||
|
|
|
@ -81,9 +81,9 @@ extensions=[Extension('_yap', native_sources,
|
|||
('MINOR_VERSION', '0'),
|
||||
('_YAP_NOT_INSTALLED_', '1'),
|
||||
('YAP_PYTHON', '1')],
|
||||
runtime_library_dirs=['yap4py','${libdir}','${bindir}'],
|
||||
runtime_library_dirs=['yap4py','${RCMAKE_INSTALL_LIBDIR}','${CMAKE_INSTALL_BINDIR}'],
|
||||
swig_opts=['-modern', '-c++', '-py3','-I${RELATIVE_SOURCE}/CXX'],
|
||||
library_dirs=['../../..','../../../CXX','../../packages/python',"${dlls}","${bindir}", '.'],
|
||||
library_dirs=['../../..','../../../CXX','../../packages/python',"${dlls}","${CMAKE_INSTALL_BINDIR}", '.'],
|
||||
extra_link_args=my_extra_link_args,
|
||||
extra_compile_args=['-g3','-O0'],
|
||||
libraries=['Yap','${GMP_LIBRARIES}'],
|
||||
|
|
|
@ -2,15 +2,34 @@
|
|||
# PROJECT ( YAP_REAL C )
|
||||
|
||||
|
||||
# LIBR_FOUND
|
||||
# LIBR_HOME
|
||||
# LIBR_INCLUDE_DIRS
|
||||
# LIBR_DOC_DIR
|
||||
# LIBR_LIBRARIES
|
||||
#
|
||||
macro_optional_find_package (LibR ON)
|
||||
# - This module locates an installed R distribution.
|
||||
#
|
||||
# Defines the following:
|
||||
# R_COMMAND - Path to R command
|
||||
# R_HOME - Path to 'R home', as reported by R
|
||||
# R_INCLUDE_DIR - Path to R include directory
|
||||
# R_LIBRARY_BASE - Path to R library
|
||||
# R_LIBRARY_BLAS - Path to Rblas / blas library
|
||||
# R_LIBRARY_LAPACK - Path to Rlapack / lapack library
|
||||
# R_LIBRARY_READLINE - Path to readline library
|
||||
# R_LIBRARIES - Array of: R_LIBRARY_BASE, R_LIBRARY_BLAS, R_LIBRARY_LAPACK, R_LIBRARY_BASE [, R_LIBRARY_READLINE]
|
||||
#
|
||||
# VTK_R_HOME - (deprecated, use R_HOME instead) Path to 'R home', as reported by R
|
||||
#
|
||||
# Variable search order:
|
||||
# 1. Attempt to locate and set R_COMMAND
|
||||
# - If unsuccessful, generate error and prompt user to manually set R_COMMAND
|
||||
# 2. Use R_COMMAND to set R_HOME
|
||||
# 3. Locate other libraries in the priority:
|
||||
# 1. Within a user-built instance of R at R_HOME
|
||||
# 2. Within an installed instance of R
|
||||
# 3. Within external system libraries
|
||||
#
|
||||
|
||||
if (LIBR_FOUND)
|
||||
macro_optional_find_package (R ON)
|
||||
|
||||
if (R_HOME)
|
||||
|
||||
set (REAL_SOURCES
|
||||
real.c
|
||||
|
@ -24,7 +43,7 @@ add_to_group( REAL_PL pl_library)
|
|||
|
||||
include_directories (
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${LIBR_INCLUDE_DIRS}
|
||||
${R_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
set (CMAKE_REQUIRED_INCLUDES
|
||||
|
@ -34,7 +53,7 @@ include_directories (
|
|||
|
||||
add_lib(real ${REAL_SOURCES})
|
||||
|
||||
target_link_libraries (real ${LIBR_LIBRARIES} libYap)
|
||||
target_link_libraries (real ${R_LIBRARIES} libYap)
|
||||
|
||||
check_include_files( "stdio.h;R.h" HAVE_R_H )
|
||||
check_include_files( "R.h;Rembedded.h" HAVE_R_EMBEDDED_H )
|
||||
|
@ -52,5 +71,4 @@ include_directories (
|
|||
DESTINATION ${libpl}
|
||||
)
|
||||
|
||||
|
||||
endif (LIBR_FOUND)
|
||||
endif()
|
||||
|
|
|
@ -310,7 +310,7 @@ main_message(error(type_error(Type,Who), _What), Level, _LC) -->
|
|||
[ ' ~a: ~q should be of type ~a' - [Level,Who,Type]],
|
||||
[ nl ].
|
||||
main_message(error(system_error(Who), _What), Level, _LC) -->
|
||||
[ ' ~a: ~q error' - [Level,Who]],
|
||||
[ ' ~a: ~q' - [Level,Who]],
|
||||
[ nl ].
|
||||
main_message(error(uninstantiation_error(T),_), Level, _LC) -->
|
||||
[ ' ~a: found ~q, expected unbound variable ' - [Level,T], nl ].
|
||||
|
|
Reference in New Issue