Solaris 10 SPARC SWI-Prolog 7.6.3 build/install issues

136 views
Skip to first unread message

Richard Jackson

unread,
Jan 12, 2018, 11:07:35 AM1/12/18
to swi-p...@googlegroups.com
I am new to SWI-Prolog.

I encountered a few issues building SWI-Prolog 7.6.3 that may be a result of me not being familiar with SWI-Prolog.  The immediate issue is receiving the 'Could not find system resources' trying to start swipl.  I did not find http://www.swi-prolog.org/FAQ/FindResources.txt helpful.  I ran truss to follow the system calls for swipl to find it looking for './swipl.prc' or '/usr/local/swi-prolog/lib/swipl-763/boot32.prc' on my 64-bit SPARC.  I do have swipl.prc in my source directory where I built SWI-Prolog but no boot32.prc.  My question is, what is the SWI-Prolog best practice solution?  Copy swipl.prc to /usr/local/swi-prolog/lib/swipl-763/boot32.prc?  I see in the truss output that /usr/local/swi-prolog/lib/swipl-763/swipl.home was unsuccessfully opened -- does not exist.  Should I create the swipl.home file with a reference to where the swipl.prc file exist?  swipl thinks its 'current_prolog_flag(home,Home). is the source directory where it was built.  So, instead should I work on changing the default Home swipl is using.  Looking for advice on how best to proceed.

This is how I built SWI-Prolog under Solaris 10 SPARC using GNU gcc and make

I found I had to set 'CC_FOR_BUILD=gcc' during configure because the generated Makefile has CC_FOR_BUILD=cc even with CC=gcc set properly.

I had to set 'ax_cv_c_float_words_bigendian=yes' because the configure floating point endian test fails. SPARC is big-endian.

I had to change src/pl-write.c line 976 from 'return writeINF(n, buf);' to 'return writeINF(f, buf);', n is undefined.

During the make I had to set CMFLAGS="-D_POSIX_PTHREAD_SEMANTICS" to avoid an error with too many arguments for function sigwait().

cd swipl-7.6.3/src
CC_FOR_BUILD=gcc ax_cv_c_float_words_bigendian=yes ./configure --prefix=/usr/local/swi-prolog
cp -p pl-write.c pl-write.c.orig
modify pl-write.c
diff -c pl-write.c pl-write.c.orig
----------------------------------
*** pl-write.c Thu Jan 11 13:24:57 2018
--- pl-write.c.orig Wed Nov 29 04:42:48 2017
***************
*** 973,979 ****
return writeNaN(f, buf);
case FP_NINF:
case FP_PINF:
! return writeINF(f, buf);
case FP_NDENORM: /* pos/neg denormalized non-zero */
case FP_PDENORM:
case FP_NNORM: /* pos/neg normalized non-zero */
--- 973,979 ----
return writeNaN(f, buf);
case FP_NINF:
case FP_PINF:
! return writeINF(n, buf);
case FP_NDENORM: /* pos/neg denormalized non-zero */
case FP_PDENORM:
case FP_NNORM: /* pos/neg normalized non-zero */
----------------------------------
gmake CMFLAGS="-D_POSIX_PTHREAD_SEMANTICS" 
gmake install

The following are the actual errors;

---------------------------------

Error without ax_cv_c_float_words_bigendian=yes

 

...

checking whether byte ordering is bigendian... yes

checking whether float word ordering is bigendian... unknown

configure: error:

 

Unknown float word ordering. You need to manually preset

ax_cv_c_float_words_bigendian=no (or yes) according to your system.

----------------------------------

Error without CC_FOR_BUILD=gcc during gmake build.

           

...

ar cq libtai.a tai_add.o tai_now.o tai_pack.o tai_sub.o tai_unpack.o taia_add.o

taia_approx.o taia_fmtfrac.o taia_frac.o taia_half.o taia_less.o taia_now.o taia

_pack.o taia_sub.o taia_tai.o taia_unpack.o caldate_fmt.o caldate_scan.o caldate

_fmjd.o caldate_mjd.o caldate_norm.o caldate_ster.o leapsecs_read.o leapsecs_ini

t.o leapsecs_add.o leapsecs_sub.o caltime_fmt.o caltime_scan.o caltime_tai.o cal

time_utc.o

ranlib libtai.a

gmake[1]: Leaving directory `/sys2/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/libtai'

gcc -Wall -O2 -fno-strict-aliasing  -pthread  -o defatom ./defatom.c

./defatom "."

cc -g -O2 -o mkvmi ./mkvmi.c

cc: Warning: option -2 passed to ld

ld: fatal: unrecognized option '-2'

ld: fatal: use the -z help option for usage information

gmake: *** [mkvmi] Error 1

----------------------------------

Error without CMFLAGS="-D_POSIX_PTHREAD_SEMANTICS"

...

gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing  -pthread  pl-term.c -o pl-term.o

gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing  -pthread  pl-thread.c -o pl-thread.o

pl-thread.c: In function 'thread_wait_signal':

pl-thread.c:1510:5: error: too many arguments to function 'sigwait'

In file included from pl-incl.h:287:0,

                 from pl-thread.c:54:

/usr/include/signal.h:222:12: note: declared here

gmake: *** [pl-thread.o] Error 1

pl-write.c undeclared variable

 

gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing  -pthread  pl-write.c -o pl-write.o          

pl-write.c: In function 'format_special_float':

pl-write.c:976:23: error: 'n' undeclared (first use in this function)

pl-write.c:976:23: note: each undeclared identifier is reported only once for ea

ch function it appears in

gmake: *** [pl-write.o] Error 1

----------------------------------

Richard Jackson

unread,
Jan 12, 2018, 1:55:02 PM1/12/18
to SWI-Prolog
On Solaris 10 I found if configure uses 'fgrep noonsees conftest...' or '/usr/xpg4/bin/grep -F noonsees' instead of 'grep noonsees configtest...' then the floating point endian test works properly.  This verifies that the configure test should have set ax_cv_c_float_words_bigendian=yes.

Richard Jackson

unread,
Jan 13, 2018, 5:52:16 PM1/13/18
to SWI-Prolog
I copied src.swipl.prc to $prefix/lib/swipl-7.6.3/boot32.prc.  Is that correct?

I am able to execute 'swipl' as a user without an error.   Next I will research why swipl thinks my 64 OS is 32 bit.  


On Friday, January 12, 2018 at 11:07:35 AM UTC-5, Richard Jackson wrote:

Jan Wielemaker

unread,
Jan 14, 2018, 5:00:34 AM1/14/18
to Richard Jackson, SWI-Prolog
On 13/01/18 23:52, Richard Jackson wrote:
> I copied src.swipl.prc to $prefix/lib/swipl-7.6.3/boot32.prc. Is that
> correct?

In theory of course this should be boot64.prc ...

> I am able to execute 'swipl' as a user without an error. Next I will
> research why swipl thinks my 64 OS is 32 bit.


In pl-init.c we find

#ifndef BOOTFILE /* normally delivered through config.h */
#if SIZEOF_VOIDP == 4
#define BOOTFILE "boot32.prc"
#else
#if SIZEOF_VOIDP == 8
#define BOOTFILE "boot64.prc"
#else
#define BOOTFILE "boot.prc"
#endif
#endif
#endif

Seems something went wrong detecting SIZEOF_VOIDP!? If that is the
case there are probably more issues :(

I pushed fixes for the C compiler, sigwait and writing floats the
swipl-devel.git (https://github.com/SWI-Prolog/swipl-devel).

Please test this git version. Once we got it all figured out I
will backport the changes to the stable version.

For the AX_C_FLOAT_WORDS_BIGENDIAN, any clue why grep fails? One
option is to first find an applicable grep first :(

Cheers --- Jan
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/swi-prolog.
> For more options, visit https://groups.google.com/d/optout.

Richard Jackson

unread,
Jan 14, 2018, 10:37:47 AM1/14/18
to swi-p...@googlegroups.com
Last night I reviewed configure and figured out it does a sizeof(void*) which returns 4.  This is correct since I did not use the gcc -m64 option to compile 64-bit.  I will rebuild using gcc -m64.  After that sizeof(void*) should return 8 -- 64-bit.


On Friday, January 12, 2018 at 11:07:35 AM UTC-5, Richard Jackson wrote:

Jan Wielemaker

unread,
Jan 14, 2018, 10:45:53 AM1/14/18
to Richard Jackson, SWI-Prolog
On 14/01/18 16:37, Richard Jackson wrote:
> Last night I reviewed configure and figured out it does a sizeof(void*)
> which returns 4.  This is correct since since I did not use the gcc -m64
> option to compile 64-bit.  I will rebuild using gcc -m64.  After that
> sizeof(void*) should return 8 -- 64-bit.

Good. That is explained. Now, why didn't it just install boot32.prc?
Note that after compiling you should be able to run ./swipl.sh and
after installing just `swipl`.

(and, why does the float endian check fail with default grep?)

--- Jan

Richard Jackson

unread,
Jan 14, 2018, 11:27:50 AM1/14/18
to SWI-Prolog
Discovered the make install did not complete due to an error;

done
for f in block.pl timeout.pl system.pl arrays.pl lists.pl terms.pl sockets.pl swipl-lfr.pl; do \
/usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644 ../library/dialect/sicstus/$f /usr/local/swi-prolog/lib/swipl-7.6.3/library/dialect/sicstus; \
done
/usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644 ./compat/sicstus.h /usr/local/swi-prolog/lib/swipl-7.6.3/include/sicstus/sicstus.h
for f in ; do \
/usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644 ../library/dialect/ifprolog/$f /usr/local/swi-prolog/lib/swipl-7.6.3/library/dialect/ifprolog; \
done
/bin/sh: syntax error at line 1: `;' unexpected
gmake: *** [iifprolog] Error 2

common.mk has at the end of the file
IFPROLOG=

Is that what you expect?  make install failing most likely explains why the install is not correct


Richard Jackson

unread,
Jan 14, 2018, 2:41:51 PM1/14/18
to SWI-Prolog
Jan, I think I figured out the grep issue.  Autoconf has macros to select the best grep/egrep/fgrep.


The above links mentions 'grep' limitations with Solaris and other OS platforms that may be addressed by using the appropriate autoconf macro.

I have never setup autoconf but it appears a project is able to select the autoconf macros used.

The recommendation at the link above is to use autoconf macro AC_PROG_GREP instead of simply using 'grep' since unfortunately 'grep' is not uniform across the various OS platforms.  If you use fgrep then you will want to also use the AC_PROG_FGREP autoconf macro., too.  There is also a egrep macro AC_PROG_EGREP.

I noted in src/configure.ac, for example, some of the other autoconf macros are used


On Friday, January 12, 2018 at 11:07:35 AM UTC-5, Richard Jackson wrote:

Jan Wielemaker

unread,
Jan 15, 2018, 4:30:35 AM1/15/18
to Richard Jackson, SWI-Prolog
On 14/01/18 17:27, Richard Jackson wrote:
> Discovered the make install did not complete due to an error;
>
> done
> for f in block.pl timeout.pl system.pl arrays.pl lists.pl terms.pl
> sockets.pl swipl-lfr.pl; do \
> /usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644
> ../library/dialect/sicstus/$f
> /usr/local/swi-prolog/lib/swipl-7.6.3/library/dialect/sicstus; \
> done
> /usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644
> ./compat/sicstus.h
> /usr/local/swi-prolog/lib/swipl-7.6.3/include/sicstus/sicstus.h
> for f in ; do \
> /usr/local/src/SWI-Prolog_7.6.3/swipl-7.6.3/src/./install-sh -c -m 644
> ../library/dialect/ifprolog/$f
> /usr/local/swi-prolog/lib/swipl-7.6.3/library/dialect/ifprolog; \
> done
> /bin/sh: syntax error at line 1: `;' unexpected
> gmake: *** [iifprolog] Error 2
>
> common.mk has at the end of the file
> IFPROLOG=
>
> Is that what you expect?  make install failing most likely explains why
> the install is not correct

Thanks. Pushed a fix for that using a Makefile conditional statement to
avoid the empty `for` loop. I'd like to keep the general statement for
consistency with the other dialect emulation libraries.

Cheers --- Jan

Jan Wielemaker

unread,
Jan 15, 2018, 5:02:54 AM1/15/18
to Richard Jackson, SWI-Prolog
Hi Richard,

Thanks. I hypothesis is that the problem is not about finding grep, but
about Solaris grep refusing to grep a binary file. As fgrep seems to
work we could use AC_PROG_FGREP. Pushed a patch for that.

I think that should make the build work from the default sources.
Please test (using swipl-devel.git). Please also run `make check`
to see whether all tests are passed.

Thanks for your patience.

Cheers --- Jan
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.

Richard Jackson

unread,
Jan 15, 2018, 8:21:16 AM1/15/18
to SWI-Prolog
Jan, exactly the issue is not finding grep but finding a workable grep.

This Solaris 10 SPARC does not have git.  I did git the clone from a different system but I must run prepare from the Solaris 10 SPARC system.  Unless you have a tar you want me to use I will work on installing git.  Richard

Jan Wielemaker

unread,
Jan 15, 2018, 8:41:02 AM1/15/18
to Richard Jackson, SWI-Prolog
On 15/01/18 14:21, Richard Jackson wrote:
> Jan, exactly the issue is not finding grep but finding a workable grep.

I know. The issues with Solaris mentioned do not seem relevant though.
The most relevant remark is probably "Posix does not specify the
behavior of grep on binary files". It is a bit guessing though. Anyway,
this patch shouldn't break anything and if this patch works for Solaris
we solved one problem. I guess the test is implemented as it is to
support cross compilation. I would have gone for a AC_TRY_RUN test which
wouldn't have suffered from grep issues but wouldn't work for cross
compilation.

> This Solaris 10 SPARC does not have git. I did git the clone from a
> different system but I must run prepare from the Solaris 10 SPARC
> system. Unless you have a tar you want me to use I will work on
> installing git. Richard

If you have another platform with a complete GNU userland (e.g., Linux),
this should create a source archive in the parent directory:

git clone https://github.com/SWI-Prolog/swipl-devel
cd swipl-devel
./prepare
./scripts/make-src-tape

(the -tape shows my age :)

If that is a problem, let me know and I'll dump an archive somewhere for
you to download.

Cheers --- Jan
> > I noted in src/configure.ac <http://configure.ac>, for example,
> > an email to swi-prolog+...@googlegroups.com <javascript:>
> > <mailto:swi-prolog+...@googlegroups.com <javascript:>>.
> <https://groups.google.com/group/swi-prolog>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.

Richard Jackson

unread,
Jan 15, 2018, 6:53:10 PM1/15/18
to SWI-Prolog
Jan,

I do not have an ideal git/autoconf environment, yet.  However, I was able test swipl-devel.

I still need to use 

gmake CMFLAGS="-D_POSIX_PTHREAD_SEMANTICS" 

to get past this error...

--------------------------
gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing -pthread pl-init.c -o pl-
init.o
pl-init.c: In function 'vsysError':
pl-init.c:1432:3: error: too few arguments to function 'ctime_r'
In file included from /usr/include/sys/time.h:421:0,
from /usr/include/sys/select.h:23,
from /usr/include/sys/types.h:629,
from /usr/include/unistd.h:20,
from rc/rc.h:70,
from pl-init.c:43:
/usr/include/time.h:299:14: note: declared here
pl-init.c: In function 'vfatalError':
pl-init.c:1506:3: error: too few arguments to function 'ctime_r'
In file included from /usr/include/sys/time.h:421:0,
from /usr/include/sys/select.h:23,
from /usr/include/sys/types.h:629,
from /usr/include/unistd.h:20,
from rc/rc.h:70,
from pl-init.c:43:
/usr/include/time.h:299:14: note: declared here
gmake: *** [pl-init.o] Error 1
--------------------------

I am investigating this make error now...

ar: creating ../lib/sparc-solaris2.10/libswipl.a
ranlib ../lib/sparc-solaris2.10/libswipl.a
gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing -D_POSIX_PTHREAD_SEMANTICS pl-main.c -o pl-main.o
gcc -rdynamic -pthread -o swipl pl-main.o -L../lib/sparc-solaris2.10 -lswipl -lgmp -lrt -lncurses -lm -lrt -ldl
Undefined first referenced
symbol in file
MIX ../lib/sparc-solaris2.10/libswipl.a(pl-hash.
o)
ld: fatal: symbol referencing errors. No output written to swipl
collect2: error: ld returned 1 exit status
gmake: *** [swipl] Error 1

I will build a RHEL7 system that has git/autoconf and access to the Internet then re-test.  RHEL6.9 autoconf is 2.63 but your configure requires minimum 2.66 autoconf.

On Friday, January 12, 2018 at 11:07:35 AM UTC-5, Richard Jackson wrote:

Jan Wielemaker

unread,
Jan 16, 2018, 3:08:56 AM1/16/18
to Richard Jackson, SWI-Prolog
Might be best to move this into configure. I'll have a look.

> I am investigating this make error now...
>
> ar: creating ../lib/sparc-solaris2.10/libswipl.a
> ranlib ../lib/sparc-solaris2.10/libswipl.a
> gcc -c -I. -I. -I./rc -Wall -O2 -fno-strict-aliasing
> -D_POSIX_PTHREAD_SEMANTICS pl-main.c -o pl-main.o
> gcc -rdynamic -pthread -o swipl pl-main.o -L../lib/sparc-solaris2.10
> -lswipl -lgmp -lrt -lncurses -lm -lrt -ldl
> Undefined first referenced
> symbol in file
> MIX ../lib/sparc-solaris2.10/libswipl.a(pl-hash.
> o)
> ld: fatal: symbol referencing errors. No output written to swipl
> collect2: error: ld returned 1 exit status
> gmake: *** [swipl] Error 1

There is clearly a problem with the MIX macro for WORDS_BIGENDIAN
code. This is in MurmurHashIntptr().

Cheers --- Jan

Jan Wielemaker

unread,
Jan 16, 2018, 5:39:12 AM1/16/18
to Richard Jackson, SWI-Prolog
On 16/01/18 09:08, Jan Wielemaker wrote:
> On 16/01/18 00:53, Richard Jackson wrote:

>> gmake CMFLAGS="-D_POSIX_PTHREAD_SEMANTICS"

> Might be best to move this into configure.  I'll have a look.
>
>> I am investigating this make error now...

>> Undefined first referenced
>> symbol in file
>> MIX ../lib/sparc-solaris2.10/libswipl.a(pl-hash.
>> o)
>> ld: fatal: symbol referencing errors. No output written to swipl
>> collect2: error: ld returned 1 exit status
>> gmake: *** [swipl] Error 1
>
> There is clearly a problem with the MIX macro for WORDS_BIGENDIAN
> code.  This is in MurmurHashIntptr().

Pushed fixes for both. The MIX issue was not in 7.6.4 as this was new
(messed up) code.

Please test (and don't hesitate to ask for a link to a source archive
if this is not easy for you; it takes me 2 minutes).

Nearly there (I hope ...)

Thanks --- Jan

Richard Jackson

unread,
Jan 16, 2018, 5:15:05 PM1/16/18
to SWI-Prolog
Jan,

I setup a test server to support this testing.

I ran a default gcc 32-bit build without a detectable error.  The configure, gmake, and gmake install all seemed to process normally.  Congratulations!  

I will test building gcc 64-bit next and post the results.  Richard

ps. I use to work with 9-track tapes, too.

Richard Jackson

unread,
Jan 16, 2018, 8:11:01 PM1/16/18
to SWI-Prolog
Jan, I am happy to report 64-bit built.



/usr/local/swi-prologtest/bin/swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 7.7.8)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

1 ?- halt.

Note above swipl reports "threaded, 64 bits, version 7.7.8)"

Please note I followed the autoconf recommendation on how to specify -m64 for gcc.


I did this for the configure command...

CC="gcc -m64" ./configure --prefix=/usr/local/swi-prologtest
gmake
gmake install

Jan Wielemaker

unread,
Jan 17, 2018, 3:14:56 AM1/17/18
to Richard Jackson, SWI-Prolog
On 17/01/18 02:11, Richard Jackson wrote:
> Jan, I am happy to report 64-bit built.

Thanks for reporting. Seems Solaris is fine again.

--- Jan

Richard Jackson

unread,
Jan 17, 2018, 6:26:57 AM1/17/18
to SWI-Prolog
Jan, is there an estimate when the fixes will make it into the stable version?  Thank you, Richard

Jan Wielemaker

unread,
Jan 17, 2018, 6:46:34 AM1/17/18
to Richard Jackson, SWI-Prolog
On 01/17/2018 12:26 PM, Richard Jackson wrote:
> Jan, is there an estimate when the fixes will make it into the stable
> version?  Thank you, Richard

With the patch release (7.6.5). That waits until there is something
seriously wrong with 7.6.4 or there are enough `small' issues fixed.
The exact date is unpredictable.

You have some options:

- Pick the devel versions. They are released every couple of weeks.
The current devel versions are nice and stable. Of course, there
are times this is not the case and thus you should be a little
careful updating.
- Clone the stable git, add the devel as remote, fetch it and
cherry-pick the changes. Then run the ./scripts/make-src-tape
to roll your own tarball.

Cheers --- Jan

>
> On Wednesday, January 17, 2018 at 3:14:56 AM UTC-5, Jan Wielemaker wrote:
>
> On 17/01/18 02:11, Richard Jackson wrote:
> > Jan, I am happy to report 64-bit built.
>
> Thanks for reporting.  Seems Solaris is fine again.
>
>         --- Jan
>

Richard Jackson

unread,
Feb 12, 2018, 10:40:59 AM2/12/18
to SWI-Prolog
Good day Jan,

I did a clean build of devel 7.7.8 so I could cleanly do a 'gmake clean'.

I am beginning to research the errors...

./swipl.sh -q -f ./test.pl -O -F none -g test -t halt
SWI-Prolog test suite. To run all tests run ?- test.

Running test set "syntax" ............................... done.
Running test set "write_test" .............. done.
Running test set "format_test" ........ done.
Running test set "unify" .. done.
Running test set "occurs_check" ...... done.
Running test set "unifiable" ... done.
Running test set "arithmetic" .................................... done.
Running test set "arithmetic_functions" done.
Running test set "floattest" ........ done.
Running test set "chars" .. done.
Running test set "wchars" .. done.
Running test set "depth_limit" ..... done.
Running test set "type_test" .... done.
Running test set "meta" ............... done.
Running test set "avar" ........................... done.
Running test set "gvar" ..... done.
Running test set "copy_term" .............. done.
Running test set "term_hash" ........ done.
Running test set "cyclic" .......... done.
Running test set "cleanup" ............. done.
Running test set "term" ........... done.
Running test set "list" ........... done.
Running test set "sets" ......... done.
Running test set "atom_handling" ........................ done.
Running test set "string_handling" ..... done.
Running test set "proc" ........ done.
Running test set "cl" ........... done.
Running test set "record" ....... done.
Running test set "compiler" ....... done.
Running test set "flag" . done.
Running test set "update" ... done.
Running test set "gc" ........ done.
Running test set "intoverflow" ... done.
Running test set "control" ......... done.
Running test set "exception" ........ done.
Running test set "term_atom" .. done.
Running test set "os" .. done.
Running test set "io" .. done.
Running test set "popen" ... done.
Running test set "timeout" . done.
Running test set "file" ............. done.
Running test set "seek" . done.
Running test set "load_program" . done.
Running test set "ctype" ...... done.
Running test set "thread" ....... done.
Running test set "mutex" ... done.
Running scripts from unprotected .............................. done
Running scripts from core ...........................................Skipped toplevel answer tests; requires clib
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
ERROR: /usr/local/src/swipl-devel/packages/clib/memfile.pl:55:
/usr/local/src/swipl-devel/packages/clib/memfile.pl:55: Initialization goal raised exception:
'$open_shared_object'/3: ld.so.1: swipl: fatal: memfile: open failed: No such file or directory
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_line_position/4 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:utf8_position_memory_file/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_string/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_atom/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_codes/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_string/2 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_codes/2 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_to_atom/2 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:atom_to_memory_file/2 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:insert_memory_file/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:delete_memory_file/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:open_memory_file/3 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:memory_file_substring/5 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:open_memory_file/4 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:new_memory_file/1 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:free_memory_file/1 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:size_memory_file/2 is not defined
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl:45:
Exported procedure memory_file:size_memory_file/3 is not defined
Script /usr/local/src/swipl-devel/src/Tests/core/test_singleton.pl failed: test_singleton:copied_singletons/2: Undefined procedure: memory_file:new_memory_file/1
.....................................................................................................................................................................................................................................
ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_write.pl:133:
test nan: failed

Script /usr/local/src/swipl-devel/src/Tests/core/test_write.pl failed
done
Running scripts from attvar .. done
Running scripts from library ..............................................................................................................................................
Warning: /usr/local/src/swipl-devel/src/Tests/library/test_tabling.pl:947:
Using CLP(FD) with bounded arithmetic may yield wrong results.
................................................................................................ done
Running scripts from charset . done
Running scripts from eclipse
% Running ECLiPSe tests from file /usr/local/src/swipl-devel/src/Tests/eclipse/string_tests.tst
.......................................................................................................................................................................
% Finished tests from file /usr/local/src/swipl-devel/src/Tests/eclipse/string_tests.tst
% 167 tests found.
% 167 tests succeeded.
. done
Running scripts from clp . done
Running scripts from GC ......................... done
Running scripts from thread ....................................................................................... done
Running scripts from save Skipped saved state tests; requires clib
. done
% Started at Mon Feb 12 16:18:03 2018
% 0.000 seconds cpu time for 73,982,158 inferences
% 9,552 atoms, 6,399 functors, 6,437 predicates, 444 modules, 458,409 VM-codes
%
% Limit Allocated In use
% Local stack: 268,439,552 126,976 1,984 Bytes
% Global stack: 268,443,648 126,960 704 Bytes
% Trail stack: 268,435,456 129,016 80 Bytes
%
% 2,127 garbage collections gained 214,788,160 bytes in 0.000 seconds.
% 5,489 atom garbage collections gained 8,211,685 atoms in 0.000 seconds.
% 490 clause garbage collections gained 233,059 clauses in 0.000 seconds.
% Stack shifts: 872 local, 1,146 global, 625 trail in 0.000 seconds
% 2 threads, 4,732 finished threads used 0.000 seconds
% 0 engines, 466 finished engines
*** 2 tests failed ***

gmake: *** [check] Error 1

Jan Wielemaker

unread,
Feb 12, 2018, 10:59:27 AM2/12/18
to Richard Jackson, SWI-Prolog
All this suggests that the package clib not installed correctly. Did
you install using a (modified) copy of the build.temp file at the
top? If so, some checking is needed:

- Are there .o and .so files in packages/clib?
- What does ldd (I vaguely recall the name of this tool came from
Solaris) report on memfile.so?
- Possibly there are issues getting the environment right to make
swipl find the shared object dependencies. In theory, the installed
version can find the libraries thanks to the -rpath link option and
the non-installed due to variables set by swipl.sh in the build dir.
Possibly it uses the wrong variables for Solaris?

First step is to figure out what is happening there.

> ERROR: /usr/local/src/swipl-devel/src/Tests/core/test_write.pl:133:
> test nan: failed

This is not a big surprise. This code is highly non-portable. See
writeNAN() in pl-write.c. Except for exchanging NaN with foreign
libraries it has no impact though. Normal Prolog doesn't produce
NaN as all undefined math raises an exception.

> Warning: /usr/local/src/swipl-devel/src/Tests/library/test_tabling.pl:947:
> Using CLP(FD) with bounded arithmetic may yield wrong results.

You need libgmp installed if you want to avoid this. Then rebuild from
scratch.

> *** 2 tests failed ***

Not that bad :) Fair probability that it is some little portability matter
in the linker to get extensions working and some tweaking with writeNaN().

Cheers --- Jan

Richard Jackson

unread,
Feb 12, 2018, 12:58:11 PM2/12/18
to SWI-Prolog
Jan,

Duh!

The https://eu.swi-prolog.org/build/unix.html instructions does not document when to do the 'make check' so I did it after the swipl*/src  'make install' prior to building and installing the packages.  I now realize the swipl*/src 'make check' expects the packages to be installed.

One thought is to have the swipl*/src 'make check' check swipl non-packages.  Then perhaps another swipl/packages 'make check' to check the packages.  Or, one big happy 'make check' after swipl and the packages are installed. Either way it would be helpful to mention when 'make check' should be run

I will work on building the packages and let you know how that goes.  Thank you, Richard

Jan Wielemaker

unread,
Feb 12, 2018, 1:08:09 PM2/12/18
to Richard Jackson, SWI-Prolog
On 12/02/18 18:58, Richard Jackson wrote:
> Jan,
>
> Duh!
>
> The https://eu.swi-prolog.org/build/unix.html instructions does not
> document when to do the 'make check' so I did it after the swipl*/src
> 'make install' prior to building and installing the packages. I now
> realize the swipl*/src 'make check' expects the packages to be installed.

Yes. That isn't great. Some of the (notably I/O) tests however require
stuff that is provided by the packages. Ideally that should merely say
that the packages are not installed and therefore the test is skipped.
Same happens if you disable features such as multi-threading support.

The normal procedure is to copy build.templ to build in the top-dir,
edit it and run it to build and install the system. Next you can run
`make check' in the toplevel directory to run the core and package
tests.

Cheers --- Jan

>
> One thought is to have the swipl*/src 'make check' check swipl
> non-packages. Then perhaps another swipl/packages 'make check' to check
> the packages. Or, one big happy 'make check' after swipl and the
> packages are installed. Either way it would be helpful to mention when
> 'make check' should be run
>
> I will work on building the packages and let you know how that goes.
> Thank you, Richard
>
> On Monday, February 12, 2018 at 10:59:27 AM UTC-5, Jan Wielemaker wrote:
>
> On 02/12/2018 04:40 PM, Richard Jackson wrote:
> > Good day Jan,
> >
> > I did a clean build of devel 7.7.8 so I could cleanly do a 'gmake
> clean'.
> >
> > I am beginning to research the errors...
> >
> > ./swipl.sh -q -f ./test.pl <http://test.pl> -O -F none -g test -t
> <http://memfile.pl:55>:
> > /usr/local/src/swipl-devel/packages/clib/memfile.pl:55
> <http://memfile.pl:55>: Initialization
> > goal raised exception:
> > '$open_shared_object'/3: ld.so.1: swipl: fatal: memfile: open
> failed: No
> > such file or directory
>
> All this suggests that the package clib not installed correctly. Did
> you install using a (modified) copy of the build.temp file at the
> top? If so, some checking is needed:
>
> - Are there .o and .so files in packages/clib?
> - What does ldd (I vaguely recall the name of this tool came from
> Solaris) report on memfile.so?
> - Possibly there are issues getting the environment right to make
> swipl find the shared object dependencies. In theory, the
> installed
> version can find the libraries thanks to the -rpath link
> option and
> the non-installed due to variables set by swipl.sh in the
> build dir.
> Possibly it uses the wrong variables for Solaris?
>
> First step is to figure out what is happening there.
>
> > ERROR:
> /usr/local/src/swipl-devel/src/Tests/core/test_write.pl:133
> <http://test_write.pl:133>:
> > test nan: failed
>
> This is not a big surprise. This code is highly non-portable. See
> writeNAN() in pl-write.c. Except for exchanging NaN with foreign
> libraries it has no impact though. Normal Prolog doesn't produce
> NaN as all undefined math raises an exception.
>
> > Warning:
> /usr/local/src/swipl-devel/src/Tests/library/test_tabling.pl:947
> <http://test_tabling.pl:947>:
> > Using CLP(FD) with bounded arithmetic may yield wrong results.
>
> You need libgmp installed if you want to avoid this. Then rebuild from
> scratch.
>
> > *** 2 tests failed ***
>
> Not that bad :) Fair probability that it is some little portability
> matter
> in the linker to get extensions working and some tweaking with
> writeNaN().
>
> Cheers --- Jan
>
> --
> You received this message because you are subscribed to the Google
> Groups "SWI-Prolog" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to swi-prolog+...@googlegroups.com
> <mailto:swi-prolog+...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages