[elephant-devel] Test on windows + ACL

Frank Schorr franks-muc at web.de
Tue Feb 27 23:07:30 UTC 2007


On mswin and ACL 8 trial:
 
(asdf:operate 'asdf:load-op :elephant)
(asdf:operate 'asdf:load-op :ele-bdb)
(asdf:operate 'asdf:load-op :elephant-tests)
(do-backend-tests '(:BDB "c:/temp/testbdb/"))

Doing 124 pending tests of 124 tests total.
 FIXNUMS FIXNUM-TYPE-1 READ-32-BIT-FIXNUM READ-64-BIT-FIXNUM WRITE-32-BIT-FIXNUM WRITE-64-BIT-FIXNUM BIGNUMS FLOATS RATIONALS BASE-STRINGS STRINGS
 HARD-STRINGS SYMBOLS CHARS PATHNAMES CONSES HASH-TABLES-1 HASH-TABLES-2 ARRAYS-1 ARRAYS-2 TEST-DEEP-EQUALP OBJECTS STRUCTS STRUCT-NON-STD-CONSTRUCT
 CIRCULAR PERSISTENT NON-TRANSIENT-CLASS-SLOT-1 NON-TRANSIENT-CLASS-SLOT-2 TRANSIENT-CLASS-SLOT CLASS-DEFINERS BAD-INHERITENCE MIXES MIXES-RIGHT-SLOTS
 INHERIT INHERIT-RIGHT-SLOTS INITFORM-CLASSES INITFORM-TEST INITARG-TEST NO-EVAL-INITFORM REDEFCLASS MAKUNBOUND UPDATE-CLASS CHANGE-CLASS CHANGE-CLASS3
 BASICPERSISTENCE TESTOID BTREE-MAKE BTREE-PUT BTREE-GET REMOVE-KV REMOVED MAP-BTREE INDEXED-BTREE-MAKE ADD-INDICES TEST-INDICES INDEXED-PUT INDEXED-GET
 SIMPLE-SLOT-GET INDEXED-GET-FROM-SLOT1 INDEXED-GET-FROM-SLOT2 REMOVE-KV-INDEXED NO-KEY-NOR-INDICES REMOVE-KV-FROM-SLOT1 NO-KEY-NOR-INDICES-SLOT1
 REMOVE-KV-FROM-SLOT2 NO-KEY-NOR-INDICES-SLOT2 MAP-INDEXED GET-FIRST GET-FIRST2 GET-LAST GET-LAST2 SET SET2 SET-RANGE SET-RANGE2 MAP-INDEXED-INDEX
 REM-KV REM-IDEXKV MAKE-INDEXED2 ADD-INDICES2 PUT-INDEXED2 GET-INDEXED2 GET-FROM-INDEX3 DUP-TEST NODUP-TEST PREV-NODUP-TEST PNODUP-TEST PPREV-NODUP-TEST
 CUR-DEL1 INDEXED-DELETE TEST-DELETED INDEXED-DELETE2 TEST-DELETED2 CUR-DEL2 GET-BOTH PGET-BOTH PGET-BOTH-RANGE PCURSOR NEWINDEX PCURSOR2 ADD-GET-REMOVE
 ADD-GET-REMOVE-SYMBOL EXISTSP
Warning: Manually finalizing class IDX-ONE
 DISABLE-CLASS-INDEXING-TEST INDEXING-BASIC-TRIVIAL INDEXING-BASIC INDEXING-INHERIT INDEXING-RANGE INDEXING-SLOT-MAKUNBOUND
Warning: Manually finalizing class IDX-FIVE-DEL
 INDEXING-WIPE-INDEX INDEXING-RECONNECT-DB INDEXING-CHANGE-CLASS INDEXING-REDEF-CLASS
Warning: Manually finalizing class STRESS-INDEX

Ranged get of 10/700 objects = Linear: 0.671 sec Indexed: 0.02 sec
 INDEXING-TIMING
Single store mode: ignoring REMOVE-ELEMENT
Single store mode: ignoring MIGRATE-BASIC
Single store mode: ignoring MIGRATE-BTREE
Single store mode: ignoring MIGRATE-IDX-BTREE
Single store mode: ignoring MIGRATE-PCLASS
Single store mode: ignoring  MIGRATE-IPCLASS PREPARES-BDB TEST-SEQ1 TEST-SEQ2 CLEANSUP-BDB
No tests failed.
T


This is what I did: 
in elephant.asd: 
the run-shell-command generated this error, which is strange since output stream was not defined. 
Error: stream #<LISTENER-PANE :LISTENER-PANE in IDE GUI @ #x20b10a02> can't be used as output
[condition type: SIMPLE-ERROR]

I used excl.osi:command-output. The following perform makes libmemutil.dll in the correct 
directory (where memutil.fasl is)

(defmethod perform ((o compile-op) (c elephant-c-source))
  "Run the appropriate compiler for this platform on the source, getting
   the specific options from 'compiler-options method.  Default options 
   can be overridden or augmented by subclass methods"
  #+(or mswindows windows)
  (progn
    (let* ((pathname (component-pathname c))
           (directory (directory-namestring pathname)))
      (let ((command (format nil "~A ~{~A ~}"
                       (c-compiler-path c)
                       (compiler-options (c-compiler c) c
                                         :input-file (format nil "\"~A\"" (namestring pathname))
                                         :output-file nil
                                         :library nil))))
        (multiple-value-bind (stdout-lines stderr-lines exit-status) 
            (excl.osi:command-output command :directory directory) 
          (unless (zerop exit-status)
            (error 'operation-error :component c :operation o))))
      
      (let ((command (format nil "dlltool -z ~A --export-all-symbols -e exports.o -l ~A ~A"
                       (format nil "\"~A\"" (namestring (make-pathname :type "def" :defaults pathname)))
                       (format nil "\"~A\"" (namestring (make-pathname :type "lib" :defaults pathname)))
                       (format nil "\"~A\"" (namestring (make-pathname :type "o" :defaults pathname))))))
        (multiple-value-bind (stdout-lines stderr-lines exit-status) 
            (excl.osi:command-output command :directory directory) 
          (unless (zerop exit-status)
            (error 'operation-error :component c :operation o))))
      
      (let ((command (format nil "~A ~{~A ~}" ;; -I~A -L~A -l~A"
                       (c-compiler-path c)
                       (compiler-options (c-compiler c) c
                                         :input-file
                                         (list (format nil "\"~A\"" (namestring 
                                                                     (make-pathname :type "o" :defaults pathname)))
                                               "exports.o")
                                         :output-file (format nil "\"~A\"" (first (output-files o c)))
                                         :library t))))
        (multiple-value-bind (stdout-lines stderr-lines exit-status) 
            (excl.osi:command-output command :directory directory) 
          (unless (zerop exit-status)
            (error 'operation-error :component c :operation o))))))

  #-(or mswindows windows)
  (unless (zerop (run-shell-command
		  "~A ~{~A ~}"
		  (c-compiler-path c)
		  (compiler-options (c-compiler c) c
				    :input-file (namestring (component-pathname c))
				    :output-file (namestring (first (output-files o c))))))
    (error 'operation-error :component c :operation o)))


The compiler options are not correct for libberkeley-db.dll.
Since I did not undestand the concept, I did not try to amend the method further. 

I changed 

(defmethod compiler-options ((compiler (eql :cygwin)) (c elephant-c-source) &key input-file output-file library &allow-other-keys)
  (unless (or input-file output-file)  
    (error "Must specify at least one of output and input files"))  
    .....

Since there is no output file sometimes.


This produced a correct libberkeley-db.dll:

gcc -mno-cygwin -mwindows -c -Wall -std=c99 -L/c/Programme/Oracle/Berkeley\ DB\ 4.5.20/lib/ -I/c/Programme/Oracle/Berkeley\ DB\ 4.5.20/include/ libberkeley-db.c
dlltool -z libberkeley-db.def --export-all-symbols -e exports.o -l libberkeley-db.lib libberkeley-db.o
gcc -shared -mno-cygwin -mwindows -L/c/Programme/Oracle/Berkeley\ DB\ 4.5.20/bin/ -llibdb45 libberkeley-db.o exports.o -o libberkeley-db.dll

At first, there was this error: 

In file included from libberkeley-db.c:165:
/c/Programme/Oracle/Berkeley DB 4.5.20/include/db.h:99: error: conflicting types
 for 'ssize_t'
/usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/include/sys/types
.h:104: error: previous declaration of 'ssize_t' was here


I commented these lines out in C:\cygwin\usr\include\mingw\sys\types.h:

/*    
 *#ifndef _SSIZE_T_
 *#define _SSIZE_T_
 *typedef long _ssize_t;
 *
 *#ifndef	_NO_OLDNAMES
 *typedef _ssize_t ssize_t;
 *#endif
 *#endif * Not _SSIZE_T_ *
*/

apparently this this did not cooperate with 

#ifdef _WIN64
typedef int64_t ssize_t;
#else
typedef int32_t ssize_t;
#endif

in db.h.


There is one remaining warning: 

libberkeley-db.c: In function `case_cmp':
libberkeley-db.c:1233: warning: implicit declaration of function `_strnicmp'


Now, doing (do-backend-tests '(:BDB "c:/temp/testbdb/")) a second or third ... time produces this:

1 out of 124 total tests failed: INDEXING-WIPE-INDEX.
NIL


When I delete all files in "c:/temp/testbdb/" the first test is ok, second has 1 out of 124 failed. 

Elephant is nearly ready for mswin !!!

Frank
______________________________________________________________________
XXL-Speicher, PC-Virenschutz, Spartarife & mehr: Nur im WEB.DE Club!		
Jetzt gratis testen! http://freemail.web.de/home/landingpad/?mc=021130




More information about the elephant-devel mailing list