Can't make native library on Linux

103 views
Skip to first unread message

Руслан Сорокин

unread,
Apr 5, 2024, 2:00:29 PMApr 5
to CLIPSESG
Dear CLIPS users and team!
I downloaded from SourceForge r884 branch of CLIPS distribution and try to create native library on Linux in accordance with 7.6.3 of Interface guide:

ru@ru-sitrol:~$ cd CLIPS/clipsrules-code-r884-branches-64x/clipsjni/library-src/
ru@ru-sitrol:~/CLIPS/clipsrules-code-r884-branches-64x/clipsjni/library-src$ make -f makefile.lnx mint
make: *** No rule to make target 'agenda.c', needed by 'agenda.o'.  Stop.
ru@ru-sitrol:~/CLIPS/clipsrules-code-r884-branches-64x/clipsjni/library-src$ make -f makefile.lnx ubuntu
make: *** No rule to make target 'agenda.c', needed by 'agenda.o'.  Stop.
ru@ru-sitrol:~/CLIPS/clipsrules-code-r884-branches-64x/clipsjni/library-src$ make -f makefile.lnx
make: *** No rule to make target 'agenda.c', needed by 'agenda.o'.  Stop.

Any help would be greatly appreciated.
Sincerely,
  Ru

CLIPS Support

unread,
Apr 6, 2024, 5:29:08 PMApr 6
to CLIPSESG

The instructions are for use with the files clips_jni_641.zip or clips_jni_641.tar.gz from the Files tab on SourceForge. If you download the files from the subversion repository, you need to copy the C source files from the core directory to the library-src directory. The library-src directory only contains the CLIPSJNI related files.

Руслан Сорокин

unread,
Apr 7, 2024, 4:03:31 AMApr 7
to CLIPSESG
Thank you!
After making Linux library got this error:

..
Caused by: java.lang.NoSuchMethodError: Lnet/sf/clipsrules/jni/ExternalAddressValue;.<init>(JLnet/sf/clipsrules/jni/Environment;)V
at net.sf.clipsrules.jni.Environment.createEnvironment(Native Method)
at net.sf.clipsrules.jni.Environment.<init>(Environment.java:59)
at clo.clipsjni$fn__893.invokeStatic(clipsjni.clj:34)
at clo.clipsjni$fn__893.invoke(clipsjni.clj:34)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3714)
... 49 more

My code working good with previous version of Linux library.

воскресенье, 7 апреля 2024 г. в 00:29:08 UTC+3, CLIPS Support:

CLIPS Support

unread,
Apr 7, 2024, 7:39:27 PMApr 7
to CLIPSESG
You need to rebuild the jar files as well:

clipsjni$ make -f makefile.lnx

Руслан Сорокин

unread,
Apr 8, 2024, 2:08:33 AMApr 8
to CLIPSESG
This solved the problem.
cam.clp example runs now perfectly!

Thank you very much.

понедельник, 8 апреля 2024 г. в 02:39:27 UTC+3, CLIPS Support:

Руслан Сорокин

unread,
Apr 8, 2024, 6:53:16 AMApr 8
to CLIPSESG
Alas! On Windows running cam.clp ! got this:

tSolution found: ttMove 1 missionary and 1 cannibal to shore-2.
Move 1 missionary to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 missionary to shore-1.
Move 1 missionary and 1 cannibal to shore-2.
[PRCCODE4] WARNING: Execution halted during the actions of defrule 'shore-1-move'.

and even this:

[PRCCODE4] WARNING: Execution halted during the actions of defrule 'shore-1-move'.
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffcd5109df7, pid=6164, tid=11068
#
# JRE version: Java(TM) SE Runtime Environment (17.0.10+11) (build 17.0.10+11-LTS-240)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.10+11-LTS-240, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [CLIPSJNI.dll+0x39df7]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\russor\clojure\pro-clips\hs_err_pid6164.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


понедельник, 8 апреля 2024 г. в 09:08:33 UTC+3, Руслан Сорокин:

CLIPS Support

unread,
Apr 8, 2024, 8:32:00 PMApr 8
to CLIPSESG
I couldn't get it to crash with the r884 branch. I ran it several thousand times without issues.

c:\Users\garyriley\Desktop\r884\clipsjni>java -jar CLIPSJNI.jar
         CLIPS (6.4.2 3/2/24)
CLIPS> (load cam.clp)
+%::$$!**+**+%***
TRUE
CLIPS> (reset)
CLIPS> (run)

Solution found:


Move 1 missionary and 1 cannibal to shore-2.
Move 1 missionary to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 missionary to shore-1.
Move 1 missionary and 1 cannibal to shore-2.

Solution found:


Move 1 missionary and 1 cannibal to shore-2.
Move 1 missionary to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.

Solution found:


Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 missionary to shore-1.
Move 1 missionary and 1 cannibal to shore-2.

Solution found:


Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
CLIPS> (loop-for-count 10000 (reset) (run))
   .
   .
   .

Руслан Сорокин

unread,
Apr 9, 2024, 2:42:05 AMApr 9
to CLIPSESG
It is strange. On Linux all well.
May be I should rebuild DLL also?
Honestly, I tried but can't start MVS 2022 on CLIPS.sln. It laments that NET Framework outdated and hangs in the end.
OK. Thank you. I'll look in my code more carefully..

вторник, 9 апреля 2024 г. в 03:32:00 UTC+3, CLIPS Support:

Руслан Сорокин

unread,
Apr 9, 2024, 3:38:36 AMApr 9
to CLIPSESG
Just noticed:
My:
C:\Users\russor\Downloads\clipsrules-code-r884-branches\64x\clipsjni>java -jar CLIPSJNI.jar
         CLIPS (6.4.1 4/8/23)
CLIPS> (load cam.clp)
+%::$$!**+**+%***
TRUE
CLIPS> (reset)
CLIPS> (run)
tSolution found: ttMove 1 missionary and 1 cannibal to shore-2.
Move 1 missionary to shore-1.
Move 2 cannibals to shore-2.
Move 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 missionary and 1 cannibal to shore-1.
Move 2 missionaries to shore-2.
Move 1 cannibal to shore-1.
Move 2 cannibals to shore-2.
Move 1 missionary to shore-1.
Move 1 missionary and 1 cannibal to shore-2.
[ARGACCES2] Function '<' expected argument #2 to be of type integer or float.

[DRIVE1] This error occurred in the join network.
   Problem resides in associated join
      Of pattern #2 in rule circular-path

[ARGACCES2] Function '<' expected argument #1 to be of type integer or float.

[DRIVE1] This error occurred in the join network.
   Problem resides in associated join
      Of pattern #2 in rule circular-path

[ARGACCES2] Function '<' expected argument #1 to be of type integer or float.

[DRIVE1] This error occurred in the join network.
   Problem resides in associated join
      Of pattern #2 in rule circular-path


[PRCCODE4] WARNING: Execution halted during the actions of defrule 'shore-1-move'.
CLIPS>

Yours:
c:\Users\garyriley\Desktop\r884\clipsjni>java -jar CLIPSJNI.jar
         CLIPS (6.4.2 3/2/24)
CLIPS> (load cam.clp)

Different versions!

вторник, 9 апреля 2024 г. в 09:42:05 UTC+3, Руслан Сорокин:

CLIPS Support

unread,
Apr 9, 2024, 12:38:05 PMApr 9
to CLIPSESG
Yes, it's a different version. It's the fix for the bug you found in this thread: https://groups.google.com/g/CLIPSESG/c/6O4OyzpU58Y

CLIPS Support

unread,
Apr 9, 2024, 12:42:27 PMApr 9
to CLIPSESG
If you're downloading bug fixes from the svn repository then you need to rebuild the DLL and jar files. You don't have to launch CLIPS.sln to rebuild the DLL. You can just use nmake from a DOS shell similar to how you build the shared library on Linux using make.

Руслан Сорокин

unread,
Apr 10, 2024, 5:46:23 AMApr 10
to CLIPSESG
This is a sad history of using nmake.

PS C:\Users\russor\Downloads\CLIPSr884> cd .\branches\64x\clipsjni\
PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni> nmake makefile.win

Служебная программа обслуживания программ Microsoft (R), версия 14.39.33523.0
(C) Корпорация Майкрософт (Microsoft Corporation).  Все права защищены.

        if not exist bin\clipsjni mkdir bin\clipsjni
        javac -d bin\clipsjni java-src\net\sf\clipsrules\..

...
...

Скопировано файлов:         1.
        jar -cfe CLIPSIDE.jar net.sf.clipsrules.jni.examples.ide.CLIPSIDE bin\ide\net\sf\clipsrules\jni\examples\ide\CLIPSIDE.class -C bin\ide net
        jar -uf CLIPSIDE.jar -C bin\clipsjni net

So far so good. CLIPSJNI.jar and CLIPSIDE.jar are created.

PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni> cd .\library-src\
PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni\library-src> nmake makefile.win

Служебная программа обслуживания программ Microsoft (R), версия 14.39.33523.0
(C) Корпорация Майкрософт (Microsoft Corporation).  Все права защищены.

NMAKE : fatal error U1073: не хватает сведений для построения "agenda.c"
Stop.

Here I copied files from a CLIPSr884\branches\64x\core dirctoty to a CLIPSr884\branches\64x\clipsjni\library-src directory
excluding a makefile.win file.


PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni\library-src> nmake makefile.win

Служебная программа обслуживания программ Microsoft (R), версия 14.39.33523.0
(C) Корпорация Майкрософт (Microsoft Corporation).  Все права защищены.

makefile(16) : fatal error U1104: Неизвестная текстовая функция "shell"
Stop.

Here I replaced the file makefile.win with the same file from the core directory.

PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni\library-src> nmake makefile.win

Служебная программа обслуживания программ Microsoft (R), версия 14.39.33523.0
(C) Корпорация Майкрософт (Microsoft Corporation).  Все права защищены.

makefile(16) : fatal error U1104: Неизвестная текстовая функция "shell"
Stop.
PS C:\Users\russor\Downloads\CLIPSr884\branches\64x\clipsjni\library-src>

вторник, 9 апреля 2024 г. в 19:42:27 UTC+3, CLIPS Support:

CLIPS Support

unread,
Apr 10, 2024, 7:41:24 PMApr 10
to CLIPSESG
Try downloading clips_jni_641.zip from https://sourceforge.net/projects/clipsrules/files/CLIPS/6.4.1/ and see if you can build the library from that source. It's already setup with all the files in place, so you shouldn't have to do anything than enter the nmake command to create the library. If you still see the same error, that will rule out any issues with the correct files being in the right directories. 

What is the English translation of Неизвестная текстовая функция "shell"? Google translate translates as non-textile "shell" function, but that doesn't strike me as accurate.

Basile Starynkevitch

unread,
Apr 11, 2024, 1:01:35 AMApr 11
to clip...@googlegroups.com

On 4/11/24 01:41, CLIPS Support wrote:
> Try downloading clips_jni_641.zip from
> https://sourceforge.net/projects/clipsrules/files/CLIPS/6.4.1/ and see
> if you can build the library from that source. It's already setup with
> all the files in place, so you shouldn't have to do anything than
> enter the nmake command to create the library. If you still see the
> same error, that will rule out any issues with the correct files being
> in the right directories.
>
> What is the English translation of Неизвестная текстовая функция
> "shell"? Google translate translates as non-textile "shell" function,
> but that doesn't strike me as accurate.
>

Unknown textual function "shell"


BTW, with others i am working on making
https://github.com/RefPerSys/RefPerSys a better inference engine (GPLv3+
licensed)


--
Basile Starynkevitch <bas...@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/

Руслан Сорокин

unread,
Apr 11, 2024, 3:33:53 AMApr 11
to CLIPSESG
Honestly, I allways try to install english versions of software including OS-es, because rusification still leaves much to be desired. But now I have only russian version of Windows and MVS 2022 installed in russian :( Now I managed to swich MVS tu russian :) Nevertheless I got the same result :(

** Visual Studio 2022 Developer PowerShell v17.9.5
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
PS cd ..\..\Downloads\clips_core_source_641\core\
PS C:\Users\russor\Downloads\clips_core_source_641\core> nmake .\makefile.win

Microsoft (R) Program Maintenance Utility Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.

makefile(16) : fatal error U1104: Unknown text function 'shell'
Stop.
PS C:\Users\russor\Downloads\clips_core_source_641\core>

четверг, 11 апреля 2024 г. в 08:01:35 UTC+3, Basile Starynkevitch:

CLIPS Support

unread,
Apr 11, 2024, 2:11:38 PMApr 11
to CLIPSESG
I'm stumped by that error message as 'shell' doesn't appear anywhere in the makefile. I checked in the updated versions of the DLL and jar files to the svn repository (r886), so you can use those if you don't otherwise have any need to modify the DLL.

Руслан Сорокин

unread,
Apr 12, 2024, 2:32:25 AMApr 12
to CLIPSESG
Great!
This solved the problem.
Thank you very much!

четверг, 11 апреля 2024 г. в 21:11:38 UTC+3, CLIPS Support:
Reply all
Reply to author
Forward
0 new messages