Compiling rdf_db.dll

Haitao Zhang <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <CAFUyvhpurqxprwAZFVipLNhnOiDz_Fm0BzjnFW6W_Vh7wX_Ycg@mail.gmail.com>
I would like to add the SPG index to the rdf_db so I tried to recompile
rdf_db.dll after adding the SPG index following instructions. But the
compiled DLL crashes swipl. The compiler is configured as follows:
 gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o rdf_db.o rdf_db.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o atom.o atom.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o md5.o md5.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o atom_map.o atom_map.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o debug.o debug.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o hash.o hash.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o murmur.o murmur.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o query.o query.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o resource.o resource.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o error.o error.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o skiplist.o skiplist.c
gcc -O2 -Wall -fno-strict-aliasing -pthread -D_REENTRANT -D__WINDOWS__
-D_WINDOW
S -I/c/Program\ Files/swipl/include
-I/home/haitao/Documents/Prolog/pl-devel/src
/../include  -D__SWI_PROLOG__ -I.   -c -o snapshot.o snapshot.c
gcc -shared -O2 -pthread -L/c/Program\ Files/swipl/lib  -o rdf_db.dll
rdf_db.o a
tom.o md5.o atom_map.o debug.o hash.o murmur.o query.o resource.o error.o
skipli
st.o snapshot.o  -lswipl

My local config.h is:
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.in by autoheader.  */

/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */

/* The normal alignment of `double', in bytes. */
#define ALIGNOF_DOUBLE 8

/* The normal alignment of `int64_t', in bytes. */
#define ALIGNOF_INT64_T 8

/* The normal alignment of `void*', in bytes. */
#define ALIGNOF_VOIDP 8

#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1

The config.h is a hand hack because pl-devel/configure dies on my mingw32.
I am guessing the rdf_db shouldn't critically depend on something there but
I may be wrong.

Before I added -D_REENTRANT -D__WINDOWS__ -D_WINDOW to the compiler option,
I got the following stack trace:
%@ Stack trace labeled "crash":
%@   [0]
<C:\WINDOWS\SYSTEM32\ntdll.dll>:RtlLeaveCriticalSection+00007FF9C21EBB96
%@   [1]
<C:\WINDOWS\SYSTEM32\ntdll.dll>:RtlEnterCriticalSection+00007FF9C21EB623
%@   [2] <c:\program files\swipl\bin\rdf_db.dll>:+0000000071107BA4
%@   [3] <c:\program files\swipl\bin\rdf_db.dll>:+000000007110820D
%@   [4] <c:\program files\swipl\bin\rdf_db.dll>:+0000000071108311
%@   [5] <c:\program files\swipl\bin\rdf_db.dll>:+000000007110E811
%@   [6] <c:\Program
Files\swipl\bin\libswipl.dll>:PL_next_solution+0000000070213989
%@   [7] <c:\Program
Files\swipl\bin\libswipl.dll>:PL_is_acyclic+0000000070246D78
%@   [8] <c:\Program
Files\swipl\bin\libswipl.dll>:PL_is_acyclic+00000000702474CE
%@   [9] <c:\Program
Files\swipl\bin\libswipl.dll>:PL_toplevel+000000007020B2BD
%@

After I added the compiler option, I was simply told that the program died:
%@ This application has requested the Runtime to terminate it in an unusual
way.
%@ Please contact the application's support team for more information.

Any idea how I should proceed from here?

Thanks,
Haitao
-------------- next part --------------
HTML attachment scrubbed and removed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.