Menu

migrating from 6.24

Help
2021-11-18
2021-11-19
  • Praveen Kumar

    Praveen Kumar - 2021-11-18

    We are migrating our project to centos 7. CLIPS 6.24 no longer compiles. I believe clips 6.31 or 6.40 are both supported on centos 7. Which one should I go with?

    CLIPS 6.40 has significantly changed from 6.24. Is there anyway I can link to the newer clips with minimal change to my clips api?

     
    • Gary Riley

      Gary Riley - 2021-11-18

      I compiled CLIPS 6.24 on CentOS 7.5. The only errors I got were when trying to compile CLIPS as C++ code.

      [parallels@localhost source]$ gcc -w -xc++ -o clips *.c -lstdc++ -lm
      evaluatn.c: In function unsigned int GetAtomicHashValue(short unsigned int, void*, int)’:
      evaluatn.c:920:34: error: cast from void* to unsigned int loses precision [-fpermissive]
                tvalue = (unsigned int) value;
                                        ^
      multifld.c: In function unsigned int HashMultifield(multifield*, unsigned int)’:
      multifld.c:651:57: error: cast from void* to int loses precision [-fpermissive]
                   count += (unsigned int) (((int) fieldPtr[i].value) * (i + 29));
                                                               ^
      utility.c: In function unsigned int ItemHashValue(void*, short unsigned int, void*, unsigned int)’:
      utility.c:732:28: error: cast from void* to unsigned int loses precision [-fpermissive]
               return(((unsigned) theValue) % theRange);
                                  ^
      [parallels@localhost source]$ 
      

      The attached files contain the fixes backported from the 6.3 CLIPS code for these errors. You can try them to see if they resolve the issues you're encountering.

      The primary change in the 6.4 release was the redesign of the C API, so if you don't want to rewrite your code to use the new API you're better off using the 6.3 release.

       
  • Praveen Kumar

    Praveen Kumar - 2021-11-19

    Thank you! Compiling error with those files is resolved. I am getting this error with 6.24 now:

    /usr/bin/ld: cannot find -ltermcap
    collect2: error: ld returned 1 exit status
    make: *** [/privdir/dlcm941/software/clips/6.24/bin/clips64] Error 1

    I am also trying to compile my code with 6.31 by using compiler options ALLOW_ENVIRONMENT_GLOBALS as shown below:

    .c.o :
    $(CC) -c -D$(CLIPS_OS) -DALLOW_ENVIRONMENT_GLOBALS $(CFLAGS) $(WARNINGS) $<

    while running make:

    gcc -c -DLINUX -DALLOW_ENVIRONMENT_GLOBALS -std=c99 -O3 -fno-strict-aliasing -Wall -Wundef -Wpointer-arith -Wshadow -Wstrict-aliasing -Winline -Wredundant-decls -Waggregate-return main.c

    This is not picking functions I need from 6.24.
    Please let me know what I am doing wrong with the ALLOW_ENVIRONMENT_GLOBALS ?

     
    • Gary Riley

      Gary Riley - 2021-11-19

      The micro emacs editor is no longer included with newer version of CLIPS because there's no longer any need for a built-in editor for CLIPS when it's running as a terminal application. When you're compiling CLIPS 6.24, set the EMACS_EDITOR flag in setup.h to 0 and don't try to link to the termcap library. For the other issue, try using -DALLOW_ENVIRONMENT_GLOBALS=1.

       

Log in to post a comment.