Merge branch 'master' of ../yap-6.2
This commit is contained in:
commit
fa0e2d6954
88
C/absmi.c
88
C/absmi.c
@ -2214,7 +2214,13 @@ Yap_absmi(int inp)
|
||||
|
||||
/* cut */
|
||||
Op(cut, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCut, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
/* assume cut is always in stack */
|
||||
@ -2254,7 +2260,13 @@ Yap_absmi(int inp)
|
||||
/* cut_t */
|
||||
/* cut_t does the same as cut */
|
||||
Op(cut_t, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCutT, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut_t:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
|
||||
@ -2309,7 +2321,13 @@ Yap_absmi(int inp)
|
||||
|
||||
/* cut_e */
|
||||
Op(cut_e, e);
|
||||
PREG = NEXTOP(PREG, e);
|
||||
#ifdef COROUTINING
|
||||
CACHE_Y_AS_ENV(YREG);
|
||||
check_stack(NoStackCutE, H);
|
||||
ENDCACHE_Y_AS_ENV();
|
||||
do_cut_e:
|
||||
#endif
|
||||
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, e),Osbpp),l);
|
||||
{
|
||||
choiceptr d0;
|
||||
/* we assume dealloc leaves in S the previous env */
|
||||
@ -2742,6 +2760,66 @@ Yap_absmi(int inp)
|
||||
|
||||
#ifdef COROUTINING
|
||||
|
||||
/* This is easier: I know there is an environment so I cannot do allocate */
|
||||
NoStackCut:
|
||||
/* find something to fool S */
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)YREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut;
|
||||
|
||||
NoStackCutT:
|
||||
/* find something to fool S */
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut_t;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)YREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut_t;
|
||||
|
||||
NoStackCutE:
|
||||
if (!ActiveSignals || ActiveSignals & YAP_CDOVF_SIGNAL) {
|
||||
goto do_cut_t;
|
||||
}
|
||||
if (ActiveSignals & YAP_FAIL_SIGNAL) {
|
||||
ActiveSignals &= ~YAP_FAIL_SIGNAL;
|
||||
if (!ActiveSignals)
|
||||
CreepFlag = CalculateStackGap();
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = MkIntegerTerm(LCL0-(CELL *)SREG[E_CB]);
|
||||
PREG = NEXTOP(PREG,e);
|
||||
goto creep_either;
|
||||
}
|
||||
/* don't do debugging and friends here */
|
||||
goto do_cut_e;
|
||||
|
||||
/* This is easier: I know there is an environment so I cannot do allocate */
|
||||
NoStackCommitY:
|
||||
PP = PREG->u.yp.p0;
|
||||
@ -2756,7 +2834,7 @@ Yap_absmi(int inp)
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(FunctorRestoreRegs,0));
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
XREGS[0] = YREG[PREG->u.yp.y];
|
||||
PREG = NEXTOP(PREG,yp);
|
||||
goto creep_either;
|
||||
@ -2778,7 +2856,7 @@ Yap_absmi(int inp)
|
||||
FAIL();
|
||||
}
|
||||
if (!(ActiveSignals & YAP_CREEP_SIGNAL)) {
|
||||
SREG = (CELL *)RepPredProp(Yap_GetPredPropByFunc(FunctorRestoreRegs,0));
|
||||
SREG = (CELL *)PredRestoreRegs;
|
||||
#if USE_THREADED_CODE
|
||||
if (PREG->opc == (OPCODE)OpAddress[_fcall])
|
||||
#else
|
||||
|
@ -3397,8 +3397,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
|
||||
code_p = a_cnp(_native_me, code_p, pass_no, cip);
|
||||
break;
|
||||
case cutexit_op:
|
||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||
if (cip->CurrentPred->PredFlags & LogUpdatePredFlag &&
|
||||
(*clause_has_blobsp || *clause_has_dbtermp) &&
|
||||
!clinfo.alloc_found)
|
||||
code_p = a_cle(_alloc_for_logical_pred, code_p, pass_no, cip);
|
||||
@ -3409,7 +3408,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp
|
||||
!clinfo.alloc_found)
|
||||
code_p = a_e(_unlock_lu, code_p, pass_no);
|
||||
#endif
|
||||
code_p = a_pl(_procceed, cip->CurrentPred, code_p, pass_no);
|
||||
code_p = a_cut(&clinfo, code_p, pass_no, cip);
|
||||
break;
|
||||
case allocate_op:
|
||||
clinfo.alloc_found = 2;
|
||||
|
@ -1413,8 +1413,13 @@ YAP_Execute(PredEntry *pe, CPredicate exec_code)
|
||||
if (pe->PredFlags & SWIEnvPredFlag) {
|
||||
CPredicateV codev = (CPredicateV)exec_code;
|
||||
struct foreign_context ctx;
|
||||
UInt i;
|
||||
Int sl = 0;
|
||||
ctx.engine = NULL;
|
||||
return ((codev)((&ARG1)-LCL0,0,&ctx));
|
||||
for (i=pe->ArityOfPE; i > 0; i--) {
|
||||
sl = Yap_InitSlot(XREGS[i]);
|
||||
}
|
||||
return ((codev)(sl,0,&ctx));
|
||||
}
|
||||
if (pe->PredFlags & CArgsPredFlag) {
|
||||
Int out = execute_cargs(pe, exec_code);
|
||||
|
@ -1495,12 +1495,19 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
||||
PELOCK(42,cglobs->cint.CurrentPred);
|
||||
if (is_tabled(cglobs->cint.CurrentPred)) {
|
||||
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(table_new_answer_op, Zero, cglobs->cint.CurrentPred->ArityOfPE, &cglobs->cint);
|
||||
}
|
||||
else
|
||||
#endif /* TABLING */
|
||||
{
|
||||
Yap_emit_3ops(cutexit_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(procceed_op, Zero, Zero, &cglobs->cint);
|
||||
}
|
||||
#ifdef TABLING
|
||||
UNLOCK(cglobs->cint.CurrentPred->PELock);
|
||||
@ -1509,6 +1516,8 @@ c_goal(Term Goal, Term mod, compiler_struct *cglobs)
|
||||
else {
|
||||
Yap_emit_3ops(cut_op, Zero, Zero, Zero, &cglobs->cint);
|
||||
/* needs to adjust previous commits */
|
||||
Yap_emit(empty_call_op, Zero, Zero, &cglobs->cint);
|
||||
Yap_emit(restore_tmps_and_skip_op, Zero, Zero, &cglobs->cint);
|
||||
adjust_current_commits(cglobs);
|
||||
}
|
||||
return;
|
||||
|
@ -172,6 +172,8 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
LOCK(Yap_heap_regs->low_level_trace_lock);
|
||||
sc = Yap_heap_regs;
|
||||
vsc_count++;
|
||||
if (vsc_count==29)
|
||||
jmp_deb(1);
|
||||
#ifdef THREADS
|
||||
MY_ThreadHandle.thread_inst_count++;
|
||||
#endif
|
||||
|
2
H/Yap.h
2
H/Yap.h
@ -268,6 +268,8 @@ extern char Yap_Option[20];
|
||||
#define MMAP_ADDR 0x200000000
|
||||
#elif defined(__APPLE__) && !__LP64__
|
||||
#define MMAP_ADDR 0x20000000
|
||||
#elif defined(__powerpc__)
|
||||
#define MMAP_ADDR 0x20000000
|
||||
#else
|
||||
#define MMAP_ADDR 0x10000000
|
||||
#endif
|
||||
|
@ -133,6 +133,7 @@
|
||||
#define PredHandleThrow Yap_heap_regs->pred_handle_throw
|
||||
#define PredIs Yap_heap_regs->pred_is
|
||||
#define PredSafeCallCleanup Yap_heap_regs->pred_safe_call_cleanup
|
||||
#define PredRestoreRegs Yap_heap_regs->pred_restore_regs
|
||||
#ifdef YAPOR
|
||||
#define PredGetwork Yap_heap_regs->pred_getwork
|
||||
#define PredGetworkSeq Yap_heap_regs->pred_getwork_seq
|
||||
|
@ -133,6 +133,7 @@
|
||||
struct pred_entry *pred_handle_throw;
|
||||
struct pred_entry *pred_is;
|
||||
struct pred_entry *pred_safe_call_cleanup;
|
||||
struct pred_entry *pred_restore_regs;
|
||||
#ifdef YAPOR
|
||||
struct pred_entry *pred_getwork;
|
||||
struct pred_entry *pred_getwork_seq;
|
||||
|
@ -133,6 +133,7 @@
|
||||
Yap_heap_regs->pred_handle_throw = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_is = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_safe_call_cleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_restore_regs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE));
|
||||
#ifdef YAPOR
|
||||
Yap_heap_regs->pred_getwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE));
|
||||
Yap_heap_regs->pred_getwork_seq = RepPredProp(PredPropByAtom(AtomGetworkSeq,PROLOG_MODULE));
|
||||
|
@ -133,6 +133,7 @@
|
||||
Yap_heap_regs->pred_handle_throw = PtoPredAdjust(Yap_heap_regs->pred_handle_throw);
|
||||
Yap_heap_regs->pred_is = PtoPredAdjust(Yap_heap_regs->pred_is);
|
||||
Yap_heap_regs->pred_safe_call_cleanup = PtoPredAdjust(Yap_heap_regs->pred_safe_call_cleanup);
|
||||
Yap_heap_regs->pred_restore_regs = PtoPredAdjust(Yap_heap_regs->pred_restore_regs);
|
||||
#ifdef YAPOR
|
||||
Yap_heap_regs->pred_getwork = PtoPredAdjust(Yap_heap_regs->pred_getwork);
|
||||
Yap_heap_regs->pred_getwork_seq = PtoPredAdjust(Yap_heap_regs->pred_getwork_seq);
|
||||
|
12
Makefile.in
12
Makefile.in
@ -96,6 +96,7 @@ TEXI2DVI=texi2dvi
|
||||
TEXI2HTML=texi2html
|
||||
TEXI2PDF=texi2pdf
|
||||
YAPLIB=@YAPLIB@
|
||||
SONAMEFLAG=@SONAMEFLAG@
|
||||
|
||||
#4.1VPATH=@srcdir@:@srcdir@/OPTYap
|
||||
CWD=$(PWD)
|
||||
@ -539,7 +540,7 @@ libYap.a: $(LIB_OBJECTS)
|
||||
$(RANLIB) libYap.a
|
||||
|
||||
@DYNYAPLIB@: $(LIB_OBJECTS)
|
||||
@YAPLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS)
|
||||
@YAPLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS) $(SONAMEFLAG)
|
||||
|
||||
install: install_bin install_data
|
||||
|
||||
@ -635,7 +636,11 @@ install_library: @YAPLIB@
|
||||
mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
||||
for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done
|
||||
|
||||
install_data:
|
||||
install_data: install_copied_files install_bin
|
||||
@ENABLE_CHR@ (cd packages/chr ; $(MAKE) install)
|
||||
@ENABLE_CHR@ (cd packages/clpqr ; $(MAKE) install)
|
||||
|
||||
install_copied_files:
|
||||
(cd library ; $(MAKE) install)
|
||||
(cd packages/swi-minisat2; $(MAKE) install)
|
||||
(cd LGPL ; $(MAKE) install)
|
||||
@ -646,9 +651,6 @@ install_data:
|
||||
(cd packages/CLPBN ; $(MAKE) install)
|
||||
(cd packages/meld; $(MAKE) install)
|
||||
(cd packages/ProbLog ; $(MAKE) install)
|
||||
@ENABLE_CHR@ (cd packages/chr ; $(MAKE) install)
|
||||
@ENABLE_CHR@ (cd packages/clpqr ; $(MAKE) install)
|
||||
|
||||
|
||||
##########
|
||||
TAGS: $(C_SOURCES) $(PL_SOURCES) $(HEADERS)
|
||||
|
15
configure
vendored
15
configure
vendored
@ -643,6 +643,7 @@ ENABLE_CLPQR
|
||||
ENABLE_CHR
|
||||
NO_BUILTIN_REGEXP
|
||||
YAP_EXTRAS
|
||||
SONAMEFLAG
|
||||
DYNYAPLIB
|
||||
YAPLIB
|
||||
EXTRA_LIBS_FOR_SWIDLLS
|
||||
@ -6932,6 +6933,7 @@ fi
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,-soname=$DYNYAPLIB"
|
||||
fi
|
||||
if test "$have_nsl" = yes
|
||||
then
|
||||
@ -6961,6 +6963,7 @@ fi
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7004,6 +7007,7 @@ fi
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7017,6 +7021,7 @@ fi
|
||||
#INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7073,6 +7078,7 @@ fi
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7087,6 +7093,7 @@ fi
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7164,7 +7171,8 @@ fi
|
||||
fi
|
||||
CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.dylib"
|
||||
SONAMEFLAG=""
|
||||
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.$SO"
|
||||
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
;;
|
||||
*netbsd*|*openbsd*|*freebsd*|*dragonfly*)
|
||||
@ -7187,6 +7195,7 @@ fi
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,--soname=$DYNYAPLIB"
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -Wl,-R,\$(YAPLIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -7203,6 +7212,7 @@ fi
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,--soname=$DYNYAPLIB"
|
||||
if test "$dynamic_loading" = "yes"
|
||||
then
|
||||
YAPLIB_LD="\$(CC)"
|
||||
@ -7221,6 +7231,7 @@ fi
|
||||
# and -fomit-frame-point -DBP_FREE
|
||||
YAPLIB="yap.dll"
|
||||
DYNYAPLIB="yap.dll"
|
||||
SONAMEFLAG=""
|
||||
SHLIB_CFLAGS="$CFLAGS"
|
||||
SHLIB_CXXFLAGS="$CXXFLAGS"
|
||||
if test "$target_win64" = no
|
||||
@ -7300,6 +7311,7 @@ fi
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -8442,6 +8454,7 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc threaded code" >&5
|
||||
|
14
configure.in
14
configure.in
@ -915,6 +915,7 @@ case "$target_os" in
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,-soname=$DYNYAPLIB"
|
||||
fi
|
||||
if test "$have_nsl" = yes
|
||||
then
|
||||
@ -944,6 +945,7 @@ case "$target_os" in
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -983,6 +985,7 @@ case "$target_os" in
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -996,6 +999,7 @@ case "$target_os" in
|
||||
#INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -1014,6 +1018,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -1028,6 +1033,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -1066,7 +1072,8 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
fi
|
||||
CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.dylib"
|
||||
SONAMEFLAG=""
|
||||
YAPLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.$SO"
|
||||
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
;;
|
||||
*netbsd*|*openbsd*|*freebsd*|*dragonfly*)
|
||||
@ -1089,6 +1096,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,--soname=$DYNYAPLIB"
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -Wl,-R,\$(YAPLIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -1105,6 +1113,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
INSTALL_DLLS=""
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG="-Wl,--soname=$DYNYAPLIB"
|
||||
if test "$dynamic_loading" = "yes"
|
||||
then
|
||||
YAPLIB_LD="\$(CC)"
|
||||
@ -1123,6 +1132,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
# and -fomit-frame-point -DBP_FREE
|
||||
YAPLIB="yap.dll"
|
||||
DYNYAPLIB="yap.dll"
|
||||
SONAMEFLAG=""
|
||||
SHLIB_CFLAGS="$CFLAGS"
|
||||
SHLIB_CXXFLAGS="$CXXFLAGS"
|
||||
if test "$target_win64" = no
|
||||
@ -1163,6 +1173,7 @@ dnl Linux has both elf and a.out, in this case we found elf
|
||||
fi
|
||||
LDFLAGS="$LDFLAGS -L\$(abs_top_builddir) -Wl,-R,\$(LIBDIR) -Wl,-R,\$(YAPLIBDIR)"
|
||||
DYNYAPLIB=libYap."$SO"
|
||||
SONAMEFLAG=""
|
||||
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
|
||||
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir)"
|
||||
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
|
||||
@ -1469,6 +1480,7 @@ dnl objects in YAP library
|
||||
AC_SUBST(YAPLIB)
|
||||
AC_SUBST(DYNYAPLIB)
|
||||
AC_SUBST(LDFLAGS)
|
||||
AC_SUBST(SONAMEFLAG)
|
||||
dnl install_info
|
||||
AC_SUBST(INSTALL_INFO)
|
||||
dnl let YAP_EXTRAS fall through configure, from the env into Makefile
|
||||
|
@ -20,6 +20,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
#
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -47,10 +48,10 @@ matrix.o: $(srcdir)/matrix.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/matrix.c -o matrix.o
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@matrix.@SO@: matrix.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o matrix.@SO@ matrix.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o matrix.@SO@ matrix.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -20,6 +20,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
#
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -47,10 +48,10 @@ yap_random.o: $(srcdir)/yap_random.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/yap_random.c -o yap_random.o
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@yap_random.@SO@: yap_random.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o yap_random.@SO@ yap_random.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o yap_random.@SO@ yap_random.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -20,6 +20,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
#
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -59,22 +60,22 @@ regexec.o: $(srcdir)/regexec.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/regexec.c -o regexec.o
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@regexp.@SO@: regexp.o @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o regexp.@SO@ regexp.o @EXTRA_LIBS_FOR_DLLS@ @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o regexp.@SO@ regexp.o @EXTRA_LIBS_FOR_DLLS@ @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
|
||||
|
||||
@DO_SECOND_LD@regcomp.@SO@: regcomp.o @MERGE_DLL_OBJS@ regfree.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o regcomp.@SO@ regcomp.o @MERGE_DLL_OBJS@ regfree.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o regcomp.@SO@ regcomp.o @MERGE_DLL_OBJS@ regfree.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@regerror.@SO@: regerror.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o regerror.@SO@ regerror.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o regerror.@SO@ regerror.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@regfree.@SO@: regfree.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o regfree.@SO@ regfree.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o regfree.@SO@ regfree.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@regexec.@SO@: regexec.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o regexec.@SO@ regexec.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o regexec.@SO@ regexec.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -25,6 +25,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
CC=@CC@
|
||||
MPI_CC=mpicc
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -52,10 +53,10 @@ yaprl.o: $(srcdir)/yap_rl.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/yap_rl.c -o yaprl.o
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@yap_rl.@SO@: $(OBJS)
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o yap_rl.@SO@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o yap_rl.@SO@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
@if test "$(SOBJS)" = "no"; then echo ""; else $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR); fi
|
||||
|
@ -43,6 +43,7 @@
|
||||
mktime/2,
|
||||
tmpnam/1,
|
||||
tmp_file/2,
|
||||
tmpdir/1,
|
||||
wait/2,
|
||||
working_directory/2
|
||||
]).
|
||||
@ -138,7 +139,7 @@ rm_directory(File, Ignore) :-
|
||||
|
||||
delete_directory(on, File, Ignore) :-
|
||||
directory_files(File, FileList, Ignore),
|
||||
dir_separator(D),
|
||||
path_separator(D),
|
||||
atom_concat(File, D, FileP),
|
||||
delete_dirfiles(FileList, FileP, Ignore),
|
||||
rmdir(File, Ignore).
|
||||
@ -501,13 +502,13 @@ tmp_file(Base,X) :-
|
||||
throw(error(instantiation_error,tmp_file(Base,X))).
|
||||
tmp_file(Base,X) :-
|
||||
atom(Base), !,
|
||||
tmpdir(Dir, Error),
|
||||
handle_system_error(Error, off, tmp_file(Base,Error)),
|
||||
tmpdir(Dir),
|
||||
handle_system_error(Error, off, tmp_file(Base,X)),
|
||||
pid(PID, Error),
|
||||
handle_system_error(Error, off, tmp_file(Base,Error)),
|
||||
handle_system_error(Error, off, tmp_file(Base,X)),
|
||||
tmp_file_sequence(I),
|
||||
dir_separator(D),
|
||||
atomic_concat([Dir,D,yap_,Base,'_',PID,'_',I],X).
|
||||
% path_separator(D),
|
||||
atomic_concat([Dir,yap_,Base,'_',PID,'_',I],X).
|
||||
tmp_file(Base,X) :-
|
||||
throw(error(type_error(atom,Base),tmp_file(Base,X))).
|
||||
|
||||
@ -518,3 +519,18 @@ tmp_file_sequence(X) :-
|
||||
tmp_file_sequence(0) :-
|
||||
assert(tmp_file_sequence_counter(1)).
|
||||
|
||||
%%% Added from Theo, path_seperator is used to replace the c predicate dir_separator which is not OS aware
|
||||
|
||||
tmpdir(TmpDir):-
|
||||
tmpdir(Dir, Error),
|
||||
handle_system_error(Error, off, tmpdir(Dir)),
|
||||
path_separator(D),
|
||||
(atom_concat(_, D, Dir) ->
|
||||
TmpDir = Dir
|
||||
;
|
||||
atom_concat(Dir, D, TmpDir)
|
||||
).
|
||||
|
||||
path_separator('\\'):-
|
||||
win, !.
|
||||
path_separator('/').
|
||||
|
@ -20,6 +20,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
#
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -47,10 +48,10 @@ sys.o: $(srcdir)/sys.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/sys.c -o sys.o
|
||||
|
||||
@DO_SECOND_LD@@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@sys.@SO@: sys.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o sys.@SO@ sys.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o sys.@SO@ sys.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -20,6 +20,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
#
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -60,13 +61,13 @@ itries.o: $(srcdir)/core_tries.h $(srcdir)/base_itries.h $(srcdir)/itries.c
|
||||
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/itries.c -o itries.o
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@tries.@SO@: core_tries.o base_tries.o tries.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o tries.@SO@ core_tries.o base_tries.o tries.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o tries.@SO@ core_tries.o base_tries.o tries.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@itries.@SO@: core_tries.o base_itries.o itries.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o itries.@SO@ core_tries.o base_itries.o itries.o @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o itries.@SO@ core_tries.o base_itries.o itries.o @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -141,6 +141,7 @@ struct pred_entry *pred_throw PredThrow MkPred FunctorThrow PROLOG_MODULE
|
||||
struct pred_entry *pred_handle_throw PredHandleThrow MkPred FunctorHandleThrow PROLOG_MODULE
|
||||
struct pred_entry *pred_is PredIs MkPred FunctorIs PROLOG_MODULE
|
||||
struct pred_entry *pred_safe_call_cleanup PredSafeCallCleanup MkPred FunctorSafeCallCleanup PROLOG_MODULE
|
||||
struct pred_entry *pred_restore_regs PredRestoreRegs MkPred FunctorRestoreRegs PROLOG_MODULE
|
||||
#ifdef YAPOR
|
||||
struct pred_entry *pred_getwork PredGetwork MkPred AtomGetwork 0 PROLOG_MODULE
|
||||
struct pred_entry *pred_getwork_seq PredGetworkSeq MkPred AtomGetworkSeq 0 PROLOG_MODULE
|
||||
|
@ -22,6 +22,7 @@ YAPLIBDIR=@libdir@/Yap
|
||||
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include @CPPFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -78,10 +79,10 @@ uxnt.o: $(srcdir)/uxnt/uxnt.c
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
@DO_SECOND_LD@%.@SO@: %.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $< @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
@DO_SECOND_LD@libplstream.@SO@: $(OBJS)
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o libplstream.@SO@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o libplstream.@SO@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -4344,7 +4344,7 @@ get_stream_handle_no_errors(term_t t, int read, int write, IOSTREAM **s)
|
||||
{ GET_LD
|
||||
if ( t == 0 )
|
||||
{ if (write) *s = getStream(Scurout);
|
||||
else *s = getStream(Scurout);
|
||||
else *s = getStream(Scurin);
|
||||
return TRUE;
|
||||
}
|
||||
return get_stream_handle(t, s, SH_ALIAS);
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% $Date: 2010-12-16 13:33:43 +0100 (Thu, 16 Dec 2010) $
|
||||
% $Revision: 5156 $
|
||||
% $Date: 2010-12-20 12:35:25 +0100 (Mon, 20 Dec 2010) $
|
||||
% $Revision: 5161 $
|
||||
%
|
||||
% This file is part of ProbLog
|
||||
% http://dtai.cs.kuleuven.be/problog
|
||||
@ -282,7 +282,9 @@
|
||||
problog_define_flag(use_naive_trie, problog_flag_validate_boolean, 'use the naive algorithm to generate bdd scripts', false),
|
||||
problog_define_flag(use_old_trie, problog_flag_validate_boolean, 'use the old trie 2 trie transformation no nested', true),
|
||||
problog_define_flag(use_dec_trie, problog_flag_validate_boolean, 'use the decomposition method', false),
|
||||
problog_define_flag(deref_terms, problog_flag_validate_boolean, 'deref BDD terms after last use', false)
|
||||
problog_define_flag(deref_terms, problog_flag_validate_boolean, 'deref BDD terms after last use', false),
|
||||
problog_define_flag(export_map_file, problog_flag_validate_boolean, 'activates export of a variable map file', false, output),
|
||||
problog_define_flag(map_file, problog_flag_validate_file, 'the file to output the variable map', map_file, output)
|
||||
)).
|
||||
|
||||
|
||||
@ -657,40 +659,52 @@ bdd_ptree_script(Trie, FileBDD, FileParam) :-
|
||||
retractall(compression(_, _)).
|
||||
|
||||
% write parameter file by iterating over all var/not(var) occuring in the tree
|
||||
bdd_vars_script([]).
|
||||
bdd_vars_script([A|B]) :-
|
||||
(
|
||||
A=not(ID)
|
||||
->
|
||||
bdd_vars_script_intern(ID);
|
||||
bdd_vars_script_intern(A)
|
||||
),
|
||||
bdd_vars_script(B).
|
||||
bdd_vars_script_intern(A) :-
|
||||
(
|
||||
number(A)
|
||||
->
|
||||
(
|
||||
% it's a ground fact
|
||||
get_var_name(A,NameA),
|
||||
(problog:decision_fact(A,_) ->
|
||||
% it's a ground decision
|
||||
(problog:problog_control(check,internal_strategy) ->
|
||||
problog:get_fact_probability(A,P),
|
||||
format('@~w~n~12f~n~w~n',[NameA,P,1])
|
||||
;
|
||||
format('@~w~n~12f~n~w~n',[NameA,0,1])
|
||||
)
|
||||
;
|
||||
% it's a normal ProbLog fact
|
||||
|
||||
bdd_vars_script(Vars):-
|
||||
bdd_vars_script(Vars, Names),
|
||||
(problog_flag(export_map_file, true) ->
|
||||
problog_flag(map_file, MapFile),
|
||||
os:convert_filename_to_working_path(MapFile, MapFileName),
|
||||
flush_output,
|
||||
tell(MapFileName),
|
||||
problog:get_fact_list(Vars, Facts),
|
||||
writemap(Names, Facts),
|
||||
flush_output,
|
||||
told
|
||||
;
|
||||
true
|
||||
).
|
||||
writemap([],[]).
|
||||
writemap([Name|Names],[Fact|Facts]):-
|
||||
write(map(Name,Fact)),nl,
|
||||
writemap(Names, Facts).
|
||||
|
||||
bdd_vars_script([], []).
|
||||
bdd_vars_script([not(A)|B], Names) :-
|
||||
!, bdd_vars_script([A|B], Names).
|
||||
bdd_vars_script([A|B], [NameA|Names]) :-
|
||||
bdd_vars_script_intern(A, NameA),
|
||||
bdd_vars_script(B, Names).
|
||||
|
||||
bdd_vars_script_intern(A, NameA) :-
|
||||
(number(A) -> % it's a ground fact
|
||||
get_var_name(A,NameA),
|
||||
(problog:decision_fact(A,_) -> % it's a ground decision
|
||||
(problog:problog_control(check,internal_strategy) ->
|
||||
problog:get_fact_probability(A,P),
|
||||
format('@~w~n~12f~n',[NameA,P])
|
||||
format('@~w~n~12f~n~w~n',[NameA,P,1])
|
||||
;
|
||||
format('@~w~n~12f~n~w~n',[NameA,0,1])
|
||||
)
|
||||
); % it's somethin else, call the specialist
|
||||
% it's a non-ground or continuous fact
|
||||
bdd_vars_script_intern2(A)
|
||||
).
|
||||
bdd_vars_script_intern2(A) :-
|
||||
; % it's a normal ProbLog fact
|
||||
problog:get_fact_probability(A,P),
|
||||
format('@~w~n~12f~n',[NameA,P])
|
||||
)
|
||||
; % it's somethin else, call the specialist - it's a non-ground or continuous fact
|
||||
bdd_vars_script_intern2(A, NameA)
|
||||
).
|
||||
|
||||
bdd_vars_script_intern2(A, NameA) :-
|
||||
get_var_name(A,NameA),
|
||||
atom_codes(A,A_Codes),
|
||||
|
||||
|
@ -39,7 +39,7 @@ CRYPTLIBS=@CLIB_CRYPTLIBS@
|
||||
PTHREADLIBS=@CLIB_PTHREADS@
|
||||
|
||||
LD=@DO_SECOND_LD@ @SHLIB_LD@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@ @LDFLAGS@
|
||||
|
||||
BINTARGET=$(DESTDIR)$(YAPLIBDIR)
|
||||
PLTARGET=$(DESTDIR)$(SHAREDIR)
|
||||
|
@ -39,7 +39,7 @@ CWD=$(PWD)
|
||||
#
|
||||
|
||||
LD=@DO_SECOND_LD@ @SHLIB_LD@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@ @LDFLAGS@
|
||||
|
||||
BINTARGET=$(DESTDIR)$(YAPLIBDIR)
|
||||
PLTARGET=$(DESTDIR)$(SHAREDIR)/http
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 73e4e086d06c54210100f0faaeccbea276c707eb
|
||||
Subproject commit 29151b2fe68f2dc727cdc07040e1fa1ad4fcca20
|
@ -48,7 +48,7 @@ CWD=$(PWD)
|
||||
#
|
||||
|
||||
LD=@DO_SECOND_LD@ @SHLIB_LD@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@ @LDFLAGS@
|
||||
|
||||
BINTARGET=$(DESTDIR)$(YAPLIBDIR)
|
||||
PLTARGET=$(DESTDIR)$(SHAREDIR)/semweb
|
||||
|
@ -31,6 +31,7 @@ LN_S=@LN_S@
|
||||
DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
|
||||
CC=@CC@
|
||||
CFLAGS= @SHLIB_CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../.. -I$(srcdir)/../../include @CPPFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
MKINDEX=true
|
||||
|
||||
LD=$(CC)
|
||||
@ -117,7 +118,7 @@ ifeq (@PROLOG_SYSTEM@,yap)
|
||||
$(CC) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
@DO_SECOND_LD@sgml2pl.@SO@: $(PLOBJ)
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o sgml2pl.@SO@ $(PLOBJ) @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o sgml2pl.@SO@ $(PLOBJ) @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
|
||||
all: $(TARGETS) $(PROGRAMS)
|
||||
|
||||
|
@ -23,6 +23,7 @@ DEFS=@DEFS@ -D_YAP_NOT_INSTALLED_=1
|
||||
CC=@CC@
|
||||
CXX=@CXX@
|
||||
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../../.. -I$(srcdir)/../../../include @CPPFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
@ -70,7 +71,7 @@ pl-minisat.o : $(srcdir)/pl-minisat.C
|
||||
$(CXX) -c $(CXXFLAGS) $(srcdir)/pl-minisat.C -o pl-minisat.o
|
||||
|
||||
@DO_SECOND_LD@pl-minisat.@SO@: $(OBJS)
|
||||
@DO_SECOND_LD@ @SHLIB_CXX_LD@ -o pl-minisat.@SO@ $(OBJS) @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_CXX_LD@ $(LDFLAGS) -o pl-minisat.@SO@ $(OBJS) @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -49,7 +49,7 @@ pl-tai.o: $(srcdir)/pl-tai.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/pl-tai.c -o pl-tai.o
|
||||
|
||||
@DO_SECOND_LD@pl-tai.@SO@: pl-tai.o
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ -o pl-tai.@SO@ pl-tai.o libtai/libtai.a @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o pl-tai.@SO@ pl-tai.o libtai/libtai.a @EXTRA_LIBS_FOR_SWIDLLS@
|
||||
|
||||
install: all
|
||||
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR)
|
||||
|
@ -46,7 +46,7 @@ CWD=$(PWD)
|
||||
#
|
||||
|
||||
LD=@DO_SECOND_LD@ @SHLIB_LD@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@
|
||||
LDFLAGS=@EXTRA_LIBS_FOR_SWIDLLS@ @LDFLAGS@
|
||||
|
||||
BINTARGET=$(DESTDIR)$(YAPLIBDIR)
|
||||
PLTARGET=$(DESTDIR)$(SHAREDIR)
|
||||
|
Reference in New Issue
Block a user