Snippets

Sebastian Sardina FAQ for using SARL + SWI/JPL Prolog + Maven

Updated by Sebastian Sardina

File SARL-FAQ.markdown Modified

  • Ignore whitespace
  • Hide word diff
 The `Initialize` event is fired by the `registerBehavior` function. As you could see, this function does not provide a mean for passing initialization parameters.
 I think the ability to set the Initialize parameters when registering the behaviors is a missed feature from the SARL API.
 
-Until it is solved (see [open issue here](https://github.com/sarl/sarl/issues/859)), you could use the following work around:
+The issue has been resolved in [this issue](https://github.com/sarl/sarl/issues/859)) and should be available in SARL 0.8.0+. For 0.7.x, you could use the following work around:
 
 
 	behavior MyBehavior {
 Note that because registration happens after the creation of the behavior module, the `initParam` will be available at time of `Initialize` execution.
 
 
+
+
 ## Cannot access agent owner of a skill in Initialize behavior, why?
 
 Summary of See [this thread](https://groups.google.com/forum/#!topic/sarl/tEGCk90anNk)
Updated by Sebastian Sardina

File SARL-FAQ.markdown Modified

  • Ignore whitespace
  • Hide word diff
         @executable_path/../swipl/lib/x86_64-darwin15.6.0/libswipl.dylib (compatibility version 0.0.0, current version 7.6.4)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
 
-
 If an entry is not a valid path on your system you can change it using the command:
 
     install_name_tool -change <the_invalid_path> <your_new_valid_path> libjpl.dylib
 
-Above, for example, the problem is with `libswipl.dylib`, which is not installed in  `@executable_path/../swipl/lib/x86_64-darwin15.6.0/libswipl.dylib` but instead in `/usr/local/lib/swipl-7.7.19/lib/x86_64-darwin17.7.0/libswipl.dylib`
+Above, for example, `libswipl.dylib` is not installed in  `@executable_path/../swipl/lib/x86_64-darwin15.6.0/libswipl.dylib` but instead in `/usr/local/lib/swipl-7.7.19/lib/x86_64-darwin17.7.0/libswipl.dylib`
+So we can do:
+
+    install_name_tool -change @rpath/libjsig.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/lib/server/libjsig.dylib libjpl.dylib
+    install_name_tool -change @rpath/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/jre/lib/server/libjvm.dylib libjpl.dylib
+    install_name_tool -change @executable_path/../swipl/lib/x86_64-darwin15.6.0/libswipl.dylib /usr/local/lib/swipl-7.7.19/lib/x86_64-darwin17.7.0/libswipl.dylib libjpl.dylib
+
+As you can see the goal here is to replace of the run-path dependent part (`@rpath` or `@executable_path`) with an absolute path on your system.
 
 After doing this step using `install_name_tool`, your lib should not depend on any external run-path:
 
Updated by Sebastian Sardina

File SARL-FAQ.markdown Modified

  • Ignore whitespace
  • Hide word diff
 
 Note that with version `3.1.0`  this may take quite longer to compile, as all dependencies are packaged into a single, often large, JAR file.
 
-# I get "no compiler is provided" error, why?
+## I get "no compiler is provided" error, why?
 
 Make sure you:
 
Updated by Sebastian Sardina

File SARL-FAQ.markdown Modified

  • Ignore whitespace
  • Hide word diff
 # SWI-PROLOG
 
 
-## Making JPL workk under Mac OS
+## Making JPL work under Mac OS
 
 (notes from student The Champion in the context of my AOPD course in 2018)
  
 
 Note that with version `3.1.0`  this may take quite longer to compile, as all dependencies are packaged into a single, often large, JAR file.
 
+# I get "no compiler is provided" error, why?
+
+Make sure you:
+
+1. Have [JDK](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) installed in your system (the Java development framework that comes with the compiler `javac`), not just the Java runtime environment JRE. 
+2. Your `PATH` environemnt variable points to the directory where `java` and `javac` of the JDK where installed.
+3. Your `JAVA_HOME` points to the directory where the JDK was installed. Alternative, you will need to specify it in your `pom.xm`; see [here](http://roufid.com/no-compiler-is-provided-in-this-environment/) .
 
 -----------------------
 # SARL
Updated by Sebastian Sardina

File SARL-FAQ.markdown Modified

  • Ignore whitespace
  • Hide word diff
 # SWI-PROLOG
 
 
-## MAKING JPL WORK IN Mac OS
+## Making JPL workk under Mac OS
 
 (notes from student The Champion in the context of my AOPD course in 2018)
  
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.