Warning about using the package library with Poplog V16 (64 bit)

This was originally posted at:
https://www.mail-archive.com/pop-forum@cs.bham.ac.uk/msg00294.html

Go to the original location if any of the links below fail to work.

Posted by Aaron Sloman Thu, 11 Jul 2019

When I set up the location for the new 64-bit poplog with installation and use
scripts, now based at
http://www.cs.bham.ac.uk/research/projects/poplog/v16

I had forgotten the warning from Waldek Hebisch about the popvision and
neural libraries:
   $usepop/pop/packages/popvision
   $usepop/pop/packages/neural
namely (slightly edited version of Waldek's note):

The packages currently contain 32-bit libraries which will not work on
64-bit machines.

As a quick workaround, to remove/update everything from
        'packages/popvision/lib/bin/linux/'
and from
        'packages/popvision/lib'
in the lib directory do:

	for A in *.c ; do gcc -O2 -fPIC -shared $A -o bin/linux/${A%c}so; done

to create libraries appropriate for the current machine.

A better approach would use per architecture subdirector8s like 'arm',
'i386' and 'x86_64', or maybe 'arm-linux', 'i386-linux' and 'x86_64-linux'
if we want to support more operating systems.  But that would require some
work to propagate information about the architecture and use it when
needed...  So for now, users of those packages will have to take appropriate
action.

Similarly, 'packages/neural/bin/pclinux' contains 32-bit libraries.
Again one needs to remove them.  Then after changing directory
to 'packages/neural/src/c' do the following:

for A in *.c ; do gcc -O2 -fPIC -shared $A -o ../../bin/pclinux/${A%c}so; done

to create libraries for the current machine.
----

Waldek also added:

To load 'mlp' I also needed the diff below (poplog_base defines 'bytevec'
and 'ushortvec').  But results still look wrong...

--- packages/popvision/lib/array_random.p       1998-08-13 13:46:41.000000000 +0000
+++ packages/popvision/lib/array_random.p       2019-07-06 23:23:38.859218572 +0000
@@ -47,7 +47,7 @@
     (seed >> shift) /* -> s3 */;
 enddefine;

-defclass lconstant ushortvec :ushort;
+;;; defclass lconstant ushortvec :ushort;
 lconstant seedvec = initushortvec(3),
     shortbits = 2**SIZEOFTYPE(:ushort,:1) - 1;

--- packages/popvision/lib/mlp.p        2000-03-02 10:50:55.000000000 +0000
+++ packages/popvision/lib/mlp.p        2019-07-06 23:25:32.099069863 +0000
@@ -89,7 +89,7 @@
     (seed >> shift) /* -> s3 */;
 enddefine;

-defclass lconstant ushortvec :ushort;
+;;; defclass lconstant ushortvec :ushort;
 lconstant seedvec = initushortvec(3),
     shortbits = 2**SIZEOFTYPE(:ushort,:1) - 1;

--- packages/popvision/lib/newbytearray.p       2003-07-15 08:36:48.000000000 +0000
+++ packages/popvision/lib/newbytearray.p       2019-07-06 23:22:05.831409167 +0000
@@ -12,7 +12,7 @@
 uses popvision
 uses oldarray

-defclass bytevec :byte;
+;;; defclass bytevec :byte;

 define newbytearray = newanyarray(% bytevec_key %); enddefine;
====

I shall not have time to do anything about this in the foreseeable future.

If anyone is willing to try the instructions and/or suggest modifications,
please let me know the outcome.

Thanks

Aaron Sloman
http://www.cs.bham.ac.uk/~axs