pax_global_header 0000666 0000000 0000000 00000000064 13156463772 0014530 g ustar 00root root 0000000 0000000 52 comment=c8b2a316f38d860d6e677ada250101c877b64c43
clisp-2.49.20170913/ 0000775 0000000 0000000 00000000000 13156463772 0013505 5 ustar 00root root 0000000 0000000 clisp-2.49.20170913/.gitignore 0000664 0000000 0000000 00000000551 13156463772 0015476 0 ustar 00root root 0000000 0000000 # autoconf
autom4te.cache
# backup files
*.orig
*~
doc/html
doc/impnotes.fo
doc/impnotes.pdf
doc/impnotes.tex
doc/impnotes.texi
doc/impnotes.xml
doc/impnotes-src.zip
doc/*.err
doc/clisp.1
doc/clisp.html
doc/clisp.xml
doc/clisp-link.1
doc/clisp-link.html
doc/clisp-link.xml
doc/*.tdb
doc/catalog.xml
doc/docbook-xsl
doc/docbook-dtd
doc/id-href.map
emacs/*.elc
clisp-2.49.20170913/ANNOUNCE 0000664 0000000 0000000 00000006270 13156463772 0014643 0 ustar 00root root 0000000 0000000 This is GNU CLISP, an ANSI Common Lisp implementation.
Availability
============
GNU CLISP is available via anonymous ftp (sources and selected binaries) from
and its mirrors.
More information at
,
and
.
See file on these sites, e.g.
,
where you will find links to general Common Lisp information
and documentation, as well as CLISP-specific links.
Mailing lists
=============
There are three mailing lists for users of CLISP. You will find
subscription information and archives on the homepage mentioned above.
-------------------------------------------------------------------------------
Common Lisp CLISP
Common Lisp is
* a general-purpose programming language and an AI language
* interactive
* a Lisp for professional use
Common Lisp programs are
* easy to test (interactive)
* easy to maintain (depending on programming style)
* portable across hardware/OS platforms and implementations
(there is a standard for the language and the library functions)
Our Common Lisp CLISP
* needs only 4 MB of memory
* implements most of the ANSI standard (including CLOS),
as well as many extensions (including MOP)
* can call your preferred editor
* is freely redistributable
Common Lisp provides
* clear syntax, carefully designed semantics
* several data types: numbers, strings, arrays, lists, characters, symbols,
structures, streams etc.
* runtime typing: the programmer need not bother about type declarations,
but he gets notified on type violations.
* many generic functions:
88 arithmetic functions for all kinds of numbers (integers, ratios,
floating point numbers, complex numbers),
44 search/filter/sort functions for lists, arrays and strings
* automatic memory management (garbage collection)
* packaging of programs into modules
* an object system, generic functions with powerful method combination
* macros: every programmer can make his own language extensions
Our Common Lisp CLISP provides
* an interpreter
* a compiler which makes execution of programs 5 times faster
* all data types with unlimited size (the size need never be declared,
the size of lists and arrays may be changed dynamically)
* integers of arbitrary length, unlimited floating point number precision
* 800+ library functions and macros, 600+ of them written in C
CLISP compares well with other ANSI CL implementations wrt performance
in most areas, such as CLOS, I/O, lists, integer arithmetics (CLISP's
bignum performance is better than that of some other CL implementations).
The worst performance CLISP exhibits in the area of floating point
arithmetics. While showing nothing spectacularly bad and easily
outperforming Java, Perl, TCL and any Scheme interpreter, CLISP is slower
than another open-source CL implementation, CMU CL (http://www.cons.org/cmucl),
which outperforms C and FORTRAN. If your code is heavily numeric, you
might prefer CMUCL, otherwise CLISP is a wise choice.
-------------------------------------------------------------------------------
clisp-2.49.20170913/COPYRIGHT 0000664 0000000 0000000 00000007570 13156463772 0015011 0 ustar 00root root 0000000 0000000 Hey Emacs! -*- coding: utf-8 -*-
Copyright (c) 1992-2016 Bruno Haible, Michael Stoll, Sam Steingold
All Rights Reserved
Summary:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation; see file GNU-GPL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Note:
This copyright does NOT cover user programs that run in CLISP and
third-party packages not part of CLISP, if
a) They only reference external symbols in CLISP's public packages
that define API also provided by many other Common Lisp implementations
(namely the packages COMMON-LISP, COMMON-LISP-USER, KEYWORD, CLOS,
GRAY, EXT), i.e. if they don't rely on CLISP internals and would as
well run in any other Common Lisp implementation. Or
b) They only reference external symbols in CLISP's public packages
that define API also provided by many other Common Lisp implementations
(namely the packages COMMON-LISP, COMMON-LISP-USER, KEYWORD, CLOS,
GRAY, EXT) and some external, not CLISP specific, symbols in
third-party packages that are released with source code under a
GPL compatible license and that run in a great number of Common Lisp
implementations, i.e. if they rely on CLISP internals only to the
extent needed for gaining some functionality also available in a
great number of Common Lisp implementations.
Such user programs are not covered by the term "derived work" used in
the GNU GPL. Neither is their compiled code, i.e. the result of compiling
them by use of the function COMPILE-FILE. We refer to such user programs
as "independent work".
You may copy and distribute memory image files generated by the
function SAVEINITMEM, if it was generated only from CLISP and independent
work, and provided that you accompany them, in the sense of section 3
of the GNU GPL, with the source code of CLISP - precisely the same CLISP
version that was used to build the memory image -, the source or compiled
code of the user programs needed to rebuild the memory image (source
code for all the parts that are not independent work, see above), and
a precise description how to rebuild the memory image from these.
Foreign non-Lisp code that is linked with CLISP or loaded into CLISP
through dynamic linking is not exempted from this copyright. I.e. such
code, when distributed for use with CLISP, must be distributed under
the GPL.
Authors:
Generic CLISP: Bruno Haible, Michael Stoll
Atari version: Bruno Haible, Michael Stoll
Amiga version: Bruno Haible, Jörg Höhle
Acorn version: Bruno Haible, Peter Burwood
DOS version: Bruno Haible, Bernhard Degel, Jürgen Weber
OS/2 version: Bruno Haible
Unix version: Bruno Haible
Multithreading: Vladimir Tzankov
Maintenance:
Bruno Haible, Michael Stoll 1992-1993
Bruno Haible, Marcus Daniels 1994-1997
Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Bruno Haible, Sam Steingold 1999-2001
Sam Steingold 2002-2010
Email addresses (September 1992 or newer):
Bruno Haible bruno@clisp.org
Michael Stoll michael@rhein.iam.uni-bonn.de
Jörg Höhle Joerg-Cyril.Hoehle@t-systems.com
Peter Burwood clisp@arcangel.dircon.co.uk
Marcus Daniels marcus@sysc.pdx.edu
Pierpaolo Bernardi bernardp@cli.di.unipi.it
Sam Steingold sds@gnu.org
clisp-2.49.20170913/GNU-GPL 0000664 0000000 0000000 00000043357 13156463772 0014515 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
clisp-2.49.20170913/INSTALL 0000664 0000000 0000000 00000006163 13156463772 0014544 0 ustar 00root root 0000000 0000000 This is the source distribution of CLISP, an ANSI Common Lisp implementation.
Available from .
More information at ,
and .
Contents:
---------
It consists of the following directories and files:
Documentation:
INSTALL this text
SUMMARY description, summary
ANNOUNCE announcement
COPYRIGHT copyright notice
GNU-GPL free software license
Source:
src/_README README master
src/*.c C source files
src/*.d C source files
src/*.lisp Lisp source files
doc/* documentation
Installation:
configure main configuration script
src/configure auxiliary configuration script
src/*.in auxiliary files
utils/* auxiliary programs
unix/ installing on Unix (including Mac OS/X & mingw)
win32msvc/ installing on Win32, using MSVC
Other:
src/gmalloc.c a GNU malloc library routine
modules: add-on sofware
modules/queens/ sample external module for CLISP for you to explore
base: normally included in all linking sets
syscalls portable OS call interface
i18n user program internationalization
regexp POSIX regular expressions
readline advances command line editing and history
optional: will be available in "clisp -K full"
database
gdbm interface to GNU DBM
berkeley-db interface to Berkeley DB from Sleepycat Software
dirkey windows registry
postgresql PostGreSQL RDMBS interface
oracle Oracle RDMBS interface
math
libsvm Support Vector Machine predictive analytics
pari PARI Computer Algebra System
matlab matrix calculations using Matlab
netica Bayesian belief networks and influence diagrams
matching, file processing
pcre Perl-compatible regular expressions
zlib compress vectors
communication, networking
rawsock low level socket interface
dbus interface to the D-Bus message bus system
fastcgi FastCGI interface for web development
graphics
clx/mit-clx, clx/new-clx interfaces to Xlib
gtk2 interface to the GTK library using glade
bindings
glibc interface to most of the GNU libc library
win32 interface to some win32 functions
Installation:
-------------
For instruction on how to install CLISP
* on Unix (including cygwin): see file unix/INSTALL.
* on Win32 using MinGW: see file unix/INSTALL.
* on Win32 using MSVC++: see file win32msvc/INSTALL.
Authors:
--------
Bruno Haible
Michael Stoll
Marcus Daniels
Pierpaolo Bernardi
Sam Steingold
Email:
clisp-2.49.20170913/Makefile.devel 0000664 0000000 0000000 00000143402 13156463772 0016247 0 ustar 00root root 0000000 0000000 # This is the developer's -*- Makefile -*-, not the user's Makefile.
# Do not use it unless you know exactly what you are doing!
# Expects GNU make
# Some important programs:
SHELL = /bin/sh
MAKE = make
PERL = perl
GROFF = nroff -man
# GROFF = groff -mandoc
RM = rm -f
RMRF = rm -rf
CP = cp -afv
WGET = wget --execute netrc=off --no-verbose --retry-connrefused --timeout=60
HG = hg
# http://ctags.sourceforge.net
CTAGS = ctags
# Shortcut (evaluated by make once only).
CURDIR=$(shell pwd)
# List of targets that do not correspond to files on disk.
.PHONY : all build-prerequisites htmldoc makefiles configures check-configures \
update-ansi-tests update-asdf update-gmalloc potfiles fixperms \
view-man view-html check-sbcl install-gcc \
multibuild-linux-x86 multibuild-darwin-powerpc \
build-aux-update gnulib-imported distrib release pre-release \
upload upload-ssh upload-sf upload-gnu \
src-distrib doc-distrib gnu-distrib tag-release tp-mail
# ==============================================================================
# Targets that create files for use in the distribution. Run at any moment.
all : build-prerequisites makefiles potfiles htmldoc
# ------------------------------------------------------------------------------
# Create files that are necessary for building CLISP.
build-prerequisites : check-configures fixperms \
src/version.h \
src/asmi386.h src/ari80386.msvc.c src/sp80386.msvc.c
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create the configure files.
MODULES=berkeley-db clx/new-clx dirkey fastcgi i18n oracle pari pcre dbus \
postgresql rawsock readline regexp syscalls zlib gtk2 gdbm libsvm
CONFIG_H_IN = src/config.h.in $(patsubst %,modules/%/config.h.in,$(MODULES))
MOD_CONFIGURES=$(patsubst %,modules/%/configure,$(MODULES))
CONFIGURES=src/configure $(MOD_CONFIGURES)
configures : $(CONFIGURES) $(CONFIG_H_IN) src/gllib/Makefile.in
src/aclocal.m4 : $(wildcard src/m4/*.m4) $(wildcard src/glm4/*.m4) \
$(addsuffix .in,$(CONFIGURES))
$(RM) src/configure.ac
$(CP) src/configure.in src/configure.ac
cat $(addsuffix .in,$(MOD_CONFIGURES)) | \
egrep -v -e 'AC_(INIT|PREREQ|CANONICAL_|GNU_SOURCE|CONFIG_HEADER|OUTPUT)' \
-e 'AC_CONFIG_FILE.*(Makefile|link\.sh)' >> src/configure.ac
cd src && aclocal --output=aclocal.m4 -I $(CURDIR)/src/m4 -I $(CURDIR)/src/glm4
$(RM) src/configure.ac
AUTOCONF_FILES = src/aclocal.m4
AUTOCONF_CACHE = autom4te.cache
$(CONFIGURES) : %/configure : %/configure.in $(AUTOCONF_FILES) version.sh
# Need to remove $(AUTOCONF_CACHE) before running autotonf, otherwise
# changes to version.sh are not taken into account.
cd $* && $(RMRF) $(AUTOCONF_CACHE) && autoconf --include=$(CURDIR)/src
$(CONFIG_H_IN) : %/config.h.in : %/configure.in $(AUTOCONF_FILES)
cd $* && autoheader --include=$(CURDIR)/src
src/gllib/Makefile.in : src/gllib/Makefile.am src/configure.in src/aclocal.m4
cd src && automake --gnits gllib/Makefile && \
sed -i -e 's,$$(top_srcdir)/src/build-aux,$$(top_srcdir)/build-aux,' \
gllib/Makefile.in
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Syntax check of the configure files.
check-configures : configures
set -e; for f in $(CONFIGURES); do bash -x -n $$f; done
$(RMRF) `find . -name $(AUTOCONF_CACHE)`;
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Fix execution permissions of files.
fixperms :
./utils/fix-perms.sh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Create src/version.h.
src/version.h: version.sh
. ./version.sh ; { \
echo "/* generated by Makefile.devel from version.sh */" ; \
echo "#define PACKAGE_NAME \"GNU CLISP\"" ; \
echo "#define PACKAGE_TARNAME \"clisp\"" ; \
echo "#define PACKAGE_VERSION \"$$VERSION_NUMBER ($$RELEASE_DATE)\"" ; \
echo "#define PACKAGE_STRING \"GNU CLISP $$VERSION_NUMBER ($$RELEASE_DATE)\"" ; \
echo "#define PACKAGE_BUGREPORT \"http://clisp.org/\""; \
} > src/version.h
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
src/asmi386.h : src/asmi386.hh
sed -e 's,//.*$$,,' < src/asmi386.hh > src/asmi386.h
src/ari80386.msvc.c : src/ari80386.d src/asmi386.sh
src/asmi386.sh -no-C < src/ari80386.d > src/ari80386.msvc.c
src/sp80386.msvc.c : src/sp80386.d src/asmi386.sh
src/asmi386.sh -no-C < src/sp80386.d > src/sp80386.msvc.c
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
# Create Makefiles for Windows platform.
MAKEMAKE_TMP=src/makemake
makefiles : win32msvc/makefile.msvc7 win32msvc/makefile.msvc6
$(RM) $(MAKEMAKE_TMP)
win32msvc/makefile.msvc6 : $(MAKEMAKE_TMP)
cd src && ./makemake --with-dynamic-ffi --without-dynamic-modules \
win32msvc msvc6 > ../win32msvc/makefile.msvc6
win32msvc/makefile.msvc7 : $(MAKEMAKE_TMP)
cd src && ./makemake --with-dynamic-ffi --without-dynamic-modules \
win32msvc msvc7 > ../win32msvc/makefile.msvc7
$(MAKEMAKE_TMP) : src/makemake.in version.sh
. ./version.sh; \
sed -e "s/@PACKAGE_VERSION@/$${VERSION_NUMBER}/g" \
-e "s/@CLISP_DECOLONIZE@/echo $$x/" src/makemake.in \
-e "s/@module_configure_flags@/--disable-option-checking/" \
-e "s,@SHELL@,/bin/sh," > $(MAKEMAKE_TMP)
chmod a+x $(MAKEMAKE_TMP)
# ------------------------------------------------------------------------------
# Internationalization: Create the POT and PO files.
# Requires a build in the 'build' directory.
CLISP=$(CURDIR)/build/clisp
potfiles :
cd src/po && CLISP='$(CLISP)' $(MAKE) -f Makefile.devel && $(MAKE) -f Makefile.devel clean
# ------------------------------------------------------------------------------
# Regenerate the HTML formatted documentation from XML (DocBook) format.
htmldoc:
make -C doc all html
# ------------------------------------------------------------------------------
# ==============================================================================
# Targets that create files for use in the distribution. Run only occasionally.
# ------------------------------------------------------------------------------
# Fetch the most recent gnulib.
GNULIB_CVS_ROOT = :pserver:anonymous@pserver.git.sv.gnu.org:/gnulib.git
GNULIB_CVS_REPOSITORY = HEAD
GNULIB_GIT = git://git.savannah.gnu.org/gnulib.git
GNULIB_CHECKOUT := gnulib
update-gnulib:
if test -d $(GNULIB_CHECKOUT); then \
cd $(GNULIB_CHECKOUT) ; \
if test -d .git; then git pull; else cvs update -d -P; fi \
else \
if git --version >/dev/null 2>&1; then \
git clone "$(GNULIB_GIT)" $(GNULIB_CHECKOUT) ; \
else cvs -d "$(GNULIB_CVS_ROOT)" checkout -d $(GNULIB_CHECKOUT) $(GNULIB_CVS_REPOSITORY); fi \
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Regenerate all files created from gnulib.
GNULIB_TOOL = $(GNULIB_CHECKOUT)/gnulib-tool --import \
--no-vc-files --no-libtool --no-changelog --aux-dir=src/build-aux
GNULIB_CORE = no-c++ stdint stdbool havelib gettext localcharset stdlib \
unistd alloca-opt environ lstat stat readlink sys_uio sys_select \
mkfifo mknod mkstemp mkdtemp getloadavg bind accept listen recv send \
getsockopt shutdown connect socket setsockopt getsockname getpeername \
uniwidth/width streq uniname/uniname unitypes link-follow close select \
host-cpu-c-abi socklen sockets fd-hook setenv unsetenv errno ioctl \
arpa_inet netinet_in inet_ntop inet_pton socketlib strerror_r-posix \
nocrash libsigsegv gnu-make gettimeofday getpagesize sys_time sys_wait \
vma-iter c-strtod noreturn
GNULIB_SYSCALLS = mktime strftime strptime strverscmp uname fnmatch-gnu
GNULIB_IMPORTS = $(GNULIB_CORE) $(GNULIB_SYSCALLS) regex recvfrom sendto
GNULIB_COMMON = $(GNULIB_CORE) $(GNULIB_MODULES)
GNULIB_IMPORTED_LOG = /tmp/gnulib-imported.log
gnulib-imported : update-gnulib force
$(RMRF) src/glm4 src/gllib
$(RM) configure.ac; ln -sv src/configure.in configure.ac
$(RM) src/glm4/gnulib-cache.m4 $(GNULIB_IMPORTED_LOG)
$(GNULIB_TOOL) --source-base=src/gllib --m4-base=src/glm4 \
--avoid=xalloc-die \
$(GNULIB_IMPORTS) 2>&1 | tee -a $(GNULIB_IMPORTED_LOG)
$(RM) configure.ac src/gl*/*~
cd src/glm4; \
for f in *.m4; do \
if test -f ../m4/$$f; then \
echo == $$f; \
if cmp $$f ../m4/$$f; then \
cd ../m4; $(HG) rm -f $$f; cd ../glm4; \
fi; \
fi; \
done
$(HG) revert src/gllib/Makefile.in src/gllib/README src/glm4/README
$(HG) st --unknown --deleted
@echo the import log is in $(GNULIB_IMPORTED_LOG)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Fetch and regenerate other build infrastructure files.
# it is important to get ltmain.sh and libtool.m4 from the same version of
# libtool. Don't rely on what's installed in /usr/share or similar.
LIBTOOL_VERSION = 2.4.6
LIBTOOL_SOURCE_FILE = libtool-$(LIBTOOL_VERSION).tar.gz
LIBTOOL_SOURCE_URL = http://ftp.gnu.org/gnu/libtool/$(LIBTOOL_SOURCE_FILE)
# an alternative way to update libtool files is "cd src; libtoolize --copy"
AUTOMAKE_VERSION = 1.15
AUTOMAKE_GIT = http://git.savannah.gnu.org/cgit/automake.git/plain/lib/
GTK_GIT_ROOT = https://git.gnome.org/browse/gtk+/plain
GNULIB_AUX=config.guess config.rpath config.sub
# it is important not to have "*.m4" targets with ": force" dependencies
# because otherwise every make will rebuild all configures
build-aux-update : update-gnulib force
for f in $(GNULIB_AUX); do \
$(CP) $(GNULIB_CHECKOUT)/build-aux/$$f src/build-aux; \
done
for f in ar-lib compile depcomp install-sh missing ylwrap; do \
$(WGET) -O src/build-aux/$$f $(AUTOMAKE_GIT)$$f?v$(AUTOMAKE_VERSION); \
done
chmod +x src/build-aux/compile src/build-aux/ylwrap
$(RMRF) libtool-$(LIBTOOL_VERSION) $(LIBTOOL_SOURCE_FILE)
test -f $(LIBTOOL_SOURCE_FILE) || $(WGET) $(LIBTOOL_SOURCE_URL)
$(RMRF) libtool-$(LIBTOOL_VERSION)
gunzip -c < $(LIBTOOL_SOURCE_FILE) | tar xf -
$(CP) libtool-$(LIBTOOL_VERSION)/build-aux/ltmain.sh src/build-aux/ltmain.sh
chmod +x src/build-aux/ltmain.sh
for f in libtool ltoptions ltsugar ltversion lt~obsolete; do \
$(CP) libtool-$(LIBTOOL_VERSION)/m4/$$f.m4 src/m4/; \
done
$(RMRF) libtool-$(LIBTOOL_VERSION) $(LIBTOOL_SOURCE_FILE)
cd src/m4; $(RM) gtk-2.0.m4; $(WGET) -O gtk-2.0.m4 '$(GTK_GIT_ROOT)/m4macros/gtk-2.0.m4?h=gtk-2-24'
cd src/m4; $(RM) gtk-3.0.m4; $(WGET) -O gtk-3.0.m4 '$(GTK_GIT_ROOT)/m4macros/gtk-3.0.m4?h=gtk-3-22'
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
GMALLOC_URL = http://git.savannah.gnu.org/cgit/emacs.git/plain/src/gmalloc.c
update-gmalloc : force
$(WGET) -O src/gmalloc.c $(GMALLOC_URL)
# ------------------------------------------------------------------------------
ASDF_URL = https://common-lisp.net/project/asdf/asdf.lisp
update-asdf : force
$(WGET) -O modules/asdf/asdf.lisp $(ASDF_URL)
# ------------------------------------------------------------------------------
# ==============================================================================
# Targets to verify the quality of the distribution.
# ------------------------------------------------------------------------------
# Fetch/update the ANSI CL compliance test suite.
all : update-ansi-tests
ANSITESTS_REPO = https://gitlab.common-lisp.net/ansi-test/ansi-test.git
update-ansi-tests:
if test -d ansi-tests; then \
cd ansi-tests && \
git pull; \
else \
git clone $(ANSITESTS_REPO) ansi-tests; \
fi
# ------------------------------------------------------------------------------
# Quality assurance of generated man page documentation.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
view-man :
grep -v '^#[ie]' doc/_clisp.1 | $(GROFF) -Tascii | less
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# all possible browsers, some might not be present, but we do not care
# list GUI first because they put themselves into background
BROWSERS=firefox mozilla netscape opera links lynx
view-html :
grep -v '^#[ie]' doc/_clisp.html > /tmp/clisp.html
for b in $(BROWSERS); do $$b /tmp/clisp.html; done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
# Build and test all essential memory models.
# Options to pass to configure.
MULTIBUILD_MODULES = --with-module=asdf --with-module=rawsock
MULTIBUILD_EXTRAS =
MULTIBUILD_OPTIONS = $(MULTIBUILD_EXTRAS) $(MULTIBUILD_MODULES)
# Compiler options to pass as part of CFLAGS.
MULTIBUILD_CFLAGS = -g
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build and test various configurations, in order to fix bootstrapping problems
# when porting to a 32-bit machine.
#
# Prerequisite: Set the environment variable MULTIBUILD_32_OPTIONS, e.g.
# MULTIBUILD_32_OPTIONS="--with-libsigsegv-prefix=/arch/x86-linux/gnu-inst-libsigsegv/2.11 --with-libffcall-prefix=/arch/x86-linux/gnu-inst-libffcall/1.13pre"
# To build on a 64-bit machine where 64-bit compilation is the default,
# also set the environment variables CC and CXX, for example
# CC="gcc -m32" CXX="g++ -m32"
#
# Use with "make -k", then collects the build-porting32-*/cbcstep*.log.
# Build various configurations. Assumes $CC is GCC and $CXX is GNU g++.
multibuild-porting32-gcc: \
build-porting32-gcc-portability \
build-porting32-gcc-safety3 \
build-porting32-gcc-heapcodes \
build-porting32-gcc-one_free_bit_heapcodes \
build-porting32-gcc-kernelvoid32_heapcodes \
build-porting32-gcc-try1_typecodes \
build-porting32-gcc-try2_typecodes \
build-porting32-gcc-heapcodes-spvw_pages \
build-porting32-gcc-typecodes-spvw_pure_pages \
build-porting32-gcc-typecodes-spvw_mixed_pages \
build-porting32-gcc-heapcodes-spvw_mixed_blocks \
build-porting32-gcc-typecodes-spvw_mixed_blocks \
build-porting32-gcc-spvw_pure_blocks \
build-porting32-gcc-wide \
build-porting32-gcc-limited_memory \
build-porting32-gcc-old_gc \
build-porting32-gcc-multithread_gc \
build-porting32-gcc-generational_gc-old_gc \
build-porting32-gcc-generational_gc-multithread_gc \
build-porting32-gcc-safety0 \
build-porting32-gcc-safety0-optimized \
build-porting32-gcc-debug_gcsafety
# A build that favours portability over optimization.
build-porting32-gcc-portability:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) --enable-portability $@
# Nearly the default. Just with some low-cost safety.
build-porting32-gcc-safety3:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES.
build-porting32-gcc-heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force ONE_FREE_BIT_HEAPCODES.
build-porting32-gcc-one_free_bit_heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DONE_FREE_BIT_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force KERNELVOID32_HEAPCODES.
build-porting32-gcc-kernelvoid32_heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DKERNELVOID32_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TRY_TYPECODES_1.
build-porting32-gcc-try1_typecodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTRY_TYPECODES_1" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TRY_TYPECODES_2.
build-porting32-gcc-try2_typecodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTRY_TYPECODES_2" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES with SPVW_PAGES (no use of mmap).
build-porting32-gcc-heapcodes-spvw_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_PURE_PAGES (no use of mmap).
build-porting32-gcc-typecodes-spvw_pure_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP -DPREFER_PURE_PAGES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_PAGES (no use of mmap).
build-porting32-gcc-typecodes-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting32-gcc-heapcodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting32-gcc-typecodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force SPVW_PURE_BLOCKS (equivalent to SINGLEMAP_MEMORY).
build-porting32-gcc-spvw_pure_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DSINGLEMAP_MEMORY" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force WIDE_SOFT.
build-porting32-gcc-wide:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DWIDE" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force SPVW_MIXED_BLOCKS_OPPOSITE with limited memory size (honor -m option),
build-porting32-gcc-limited_memory:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_VIRTUAL_MEMORY -DNO_ADDRESS_SPACE_ASSUMPTIONS" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-old_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-multithread_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-generational_gc-old_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-generational_gc-multithread_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-safety0:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-safety0-optimized:
$(RMRF) $@
CFLAGS="-O2 -fexpensive-optimizations $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-gcc-debug_gcsafety:
$(RMRF) $@
ulimit -c unlimited; \
CC="$${CXX-g++}" \
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) --with-debug $@
# Build various configurations. Assumes $CC is not GCC.
# Put the optimization options into $CC.
multibuild-porting32-cc: \
build-porting32-cc-portability \
build-porting32-cc-safety3 \
build-porting32-cc-heapcodes \
build-porting32-cc-one_free_bit_heapcodes \
build-porting32-cc-kernelvoid32_heapcodes \
build-porting32-cc-try1_typecodes \
build-porting32-cc-try2_typecodes \
build-porting32-cc-heapcodes-spvw_pages \
build-porting32-cc-typecodes-spvw_pure_pages \
build-porting32-cc-typecodes-spvw_mixed_pages \
build-porting32-cc-heapcodes-spvw_mixed_blocks \
build-porting32-cc-typecodes-spvw_mixed_blocks \
build-porting32-cc-spvw_pure_blocks \
build-porting32-cc-wide \
build-porting32-cc-limited_memory \
build-porting32-cc-old_gc \
build-porting32-cc-multithread_gc \
build-porting32-cc-generational_gc-old_gc \
build-porting32-cc-generational_gc-multithread_gc \
build-porting32-cc-safety0 \
# A build that favours portability over optimization.
build-porting32-cc-portability:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) --enable-portability $@
# Nearly the default. Just with some low-cost safety.
build-porting32-cc-safety3:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES.
build-porting32-cc-heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force ONE_FREE_BIT_HEAPCODES.
build-porting32-cc-one_free_bit_heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DONE_FREE_BIT_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force KERNELVOID32_HEAPCODES.
build-porting32-cc-kernelvoid32_heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DKERNELVOID32_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TRY_TYPECODES_1.
build-porting32-cc-try1_typecodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTRY_TYPECODES_1" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TRY_TYPECODES_2.
build-porting32-cc-try2_typecodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTRY_TYPECODES_2" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES with SPVW_PAGES (no use of mmap).
build-porting32-cc-heapcodes-spvw_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_PURE_PAGES (no use of mmap).
build-porting32-cc-typecodes-spvw_pure_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP -DPREFER_PURE_PAGES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_PAGES (no use of mmap).
build-porting32-cc-typecodes-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force HEAPCODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting32-cc-heapcodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting32-cc-typecodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force SPVW_PURE_BLOCKS (equivalent to SINGLEMAP_MEMORY).
build-porting32-cc-spvw_pure_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DSINGLEMAP_MEMORY" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force WIDE_SOFT.
build-porting32-cc-wide:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DWIDE" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# Force SPVW_MIXED_BLOCKS_OPPOSITE with limited memory size (honor -m option),
build-porting32-cc-limited_memory:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_VIRTUAL_MEMORY -DNO_ADDRESS_SPACE_ASSUMPTIONS" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-cc-old_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-cc-multithread_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-cc-generational_gc-old_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-cc-generational_gc-multithread_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
build-porting32-cc-safety0:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_32_OPTIONS) $@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build and test various configurations, in order to fix bootstrapping problems
# when porting to a 64-bit machine.
#
# Prerequisite: Set the environment variable MULTIBUILD_64_OPTIONS, e.g.
# MULTIBUILD_64_OPTIONS="--with-libsigsegv-prefix=/arch/x86_64-linux-gnu/gnu-inst-libsigsegv/2.11 --with-libffcall-prefix=/arch/x86_64-linux-gnu/gnu-inst-libffcall/1.13pre"
# To build on a 64-bit machine where 32-bit compilation is the default,
# also set the environment variables CC and CXX, for example
# CC="gcc -m64" CXX="g++ -m64"
#
# Use with "make -k", then collects the build-porting64-*/cbcstep*.log.
# Build various configurations. Assumes $CC is GCC and $CXX is GNU g++.
multibuild-porting64-gcc: \
build-porting64-gcc-portability \
build-porting64-gcc-safety3 \
build-porting64-gcc-heapcodes \
build-porting64-gcc-one_free_bit_heapcodes \
build-porting64-gcc-generic64_heapcodes \
build-porting64-gcc-heapcodes-spvw_pages \
build-porting64-gcc-typecodes-spvw_pure_pages \
build-porting64-gcc-typecodes-spvw_mixed_pages \
build-porting64-gcc-heapcodes-spvw_mixed_blocks \
build-porting64-gcc-typecodes-spvw_mixed_blocks \
build-porting64-gcc-spvw_pure_blocks \
build-porting64-gcc-limited_memory \
build-porting64-gcc-old_gc \
build-porting64-gcc-multithread_gc \
build-porting64-gcc-generational_gc-old_gc \
build-porting64-gcc-generational_gc-multithread_gc \
build-porting64-gcc-safety0 \
build-porting64-gcc-safety0-optimized \
build-porting64-gcc-debug_gcsafety
# A build that favours portability over optimization.
build-porting64-gcc-portability:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) --enable-portability $@
# Nearly the default. Just with some low-cost safety.
build-porting64-gcc-safety3:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES.
build-porting64-gcc-heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force ONE_FREE_BIT_HEAPCODES.
build-porting64-gcc-one_free_bit_heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DONE_FREE_BIT_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force GENERIC64_HEAPCODES.
build-porting64-gcc-generic64_heapcodes:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERIC64_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES with SPVW_PAGES (no use of mmap).
build-porting64-gcc-heapcodes-spvw_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_PURE_PAGES (no use of mmap).
build-porting64-gcc-typecodes-spvw_pure_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP -DPREFER_PURE_PAGES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_PAGES (no use of mmap).
build-porting64-gcc-typecodes-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting64-gcc-heapcodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting64-gcc-typecodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force SPVW_PURE_BLOCKS (equivalent to SINGLEMAP_MEMORY).
build-porting64-gcc-spvw_pure_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DSINGLEMAP_MEMORY" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force SPVW_MIXED_BLOCKS_OPPOSITE with limited memory size (honor -m option),
build-porting64-gcc-limited_memory:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_VIRTUAL_MEMORY -DNO_ADDRESS_SPACE_ASSUMPTIONS" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-old_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-multithread_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-generational_gc-old_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-generational_gc-multithread_gc:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-safety0:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-safety0-optimized:
$(RMRF) $@
CFLAGS="-O2 -fexpensive-optimizations $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-gcc-debug_gcsafety:
$(RMRF) $@
ulimit -c unlimited; \
CC="$${CXX-g++}" \
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) --with-debug $@
# Build various configurations. Assumes $CC is not GCC.
# Put the optimization options into $CC.
multibuild-porting64-cc: \
build-porting64-cc-portability \
build-porting64-cc-safety3 \
build-porting64-cc-heapcodes \
build-porting64-cc-one_free_bit_heapcodes \
build-porting64-cc-generic64_heapcodes \
build-porting64-cc-heapcodes-spvw_pages \
build-porting64-cc-typecodes-spvw_pure_pages \
build-porting64-cc-typecodes-spvw_mixed_pages \
build-porting64-cc-heapcodes-spvw_mixed_blocks \
build-porting64-cc-typecodes-spvw_mixed_blocks \
build-porting64-cc-spvw_pure_blocks \
build-porting64-cc-limited_memory \
build-porting64-cc-old_gc \
build-porting64-cc-multithread_gc \
build-porting64-cc-generational_gc-old_gc \
build-porting64-cc-generational_gc-multithread_gc \
build-porting64-cc-safety0
# A build that favours portability over optimization.
build-porting64-cc-portability:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) --enable-portability $@
# Nearly the default. Just with some low-cost safety.
build-porting64-cc-safety3:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES.
build-porting64-cc-heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force ONE_FREE_BIT_HEAPCODES.
build-porting64-cc-one_free_bit_heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DONE_FREE_BIT_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force GENERIC64_HEAPCODES.
build-porting64-cc-generic64_heapcodes:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERIC64_HEAPCODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES with SPVW_PAGES (no use of mmap).
build-porting64-cc-heapcodes-spvw_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_PURE_PAGES (no use of mmap).
build-porting64-cc-typecodes-spvw_pure_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP -DPREFER_PURE_PAGES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_PAGES (no use of mmap).
build-porting64-cc-typecodes-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force HEAPCODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting64-cc-heapcodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DHEAPCODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force TYPECODES with SPVW_MIXED_BLOCKS.
# Possible further options: -DCONS_HEAP_GROWS_UP or -DCONS_HEAP_GROWS_DOWN.
build-porting64-cc-typecodes-spvw_mixed_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DNO_SINGLEMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force SPVW_PURE_BLOCKS (equivalent to SINGLEMAP_MEMORY).
build-porting64-cc-spvw_pure_blocks:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DTYPECODES -DSINGLEMAP_MEMORY" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# Force SPVW_MIXED_BLOCKS_OPPOSITE with limited memory size (honor -m option),
build-porting64-cc-limited_memory:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_VIRTUAL_MEMORY -DNO_ADDRESS_SPACE_ASSUMPTIONS" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-cc-old_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-cc-multithread_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DNO_GENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-cc-generational_gc-old_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC -DOLD_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-cc-generational_gc-multithread_gc:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DSAFETY=3 -DGENERATIONAL_GC" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
build-porting64-cc-safety0:
$(RMRF) $@
CFLAGS="$(MULTIBUILD_CFLAGS)" \
CPPFLAGS="" \
./configure --cbc $(MULTIBUILD_OPTIONS) $(MULTIBUILD_64_OPTIONS) $@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build and test various configurations that are supposed to work on a
# Linux/x86 machine.
multibuild-linux-x86: \
build-porting32-gcc-portability \
build-porting32-gcc-safety3 \
build-porting32-gcc-heapcodes \
build-porting32-gcc-kernelvoid32_heapcodes \
build-porting32-gcc-try1_typecodes \
build-porting32-gcc-try2_typecodes \
build-porting32-gcc-heapcodes-spvw_pages \
build-porting32-gcc-heapcodes-spvw_mixed_blocks \
build-porting32-gcc-wide \
build-porting32-gcc-old_gc \
build-porting32-gcc-multithread_gc \
build-porting32-gcc-generational_gc-old_gc \
build-porting32-gcc-generational_gc-multithread_gc \
build-porting32-gcc-safety0 \
build-porting32-gcc-safety0-optimized \
build-porting32-gcc-debug_gcsafety
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build and test various configurations that are supposed to work on a
# Linux/x86_64 machine.
multibuild-linux-x86_64: multibuild-porting64-gcc
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Build and test all essential memory models on a Mac OS X/PowerPC machine.
multibuild-darwin-powerpc: \
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-staggered \
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-opposite \
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-opposite-fixedmemsize \
build-darwin-powerpc-one_free_bit-spvw_mixed_pages \
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-staggered \
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-opposite \
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-opposite-fixedmemsize \
build-darwin-powerpc-kernelvoid32-spvw_mixed_pages \
build-darwin-powerpc-spvw_pure_blocks \
build-darwin-powerpc-wide
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-staggered:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DONE_FREE_BIT_HEAPCODES -DCONS_HEAP_GROWS_UP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-opposite:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DONE_FREE_BIT_HEAPCODES -DCONS_HEAP_GROWS_DOWN" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-one_free_bit-spvw_mixed_blocks-opposite-fixedmemsize:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DONE_FREE_BIT_HEAPCODES -DNO_VIRTUAL_MEMORY -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-one_free_bit-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DONE_FREE_BIT_HEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-staggered:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DKERNELVOID32_HEAPCODES -DCONS_HEAP_GROWS_UP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-opposite:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DKERNELVOID32_HEAPCODES -DCONS_HEAP_GROWS_DOWN" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-kernelvoid32-spvw_mixed_blocks-opposite-fixedmemsize:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DKERNELVOID32_HEAPCODES -DNO_VIRTUAL_MEMORY -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-kernelvoid32-spvw_mixed_pages:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DKERNELVOID32_HEAPCODES -DNO_SINGLEMAP -DNO_TRIVIALMAP" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-spvw_pure_blocks:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DTYPECODES" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
build-darwin-powerpc-wide:
$(RMRF) $@
CFLAGS="-O $(MULTIBUILD_CFLAGS)" \
CPPFLAGS="-DWIDE" \
./configure --cbc $(MULTIBUILD_OPTIONS) $@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
# Bootstrap SBCL.
SBCL_VERSION = 0.8.15
SBCL_SOURCE_FILE = sbcl-$(SBCL_VERSION)-source.tar.bz2
SBCL_SOURCE_URL = http://www.haible.de/bruno/$(SBCL_SOURCE_FILE)
check-sbcl:
./configure --cbc build-for-sbcl
test -f $(SBCL_SOURCE_FILE) || $(WGET) $(SBCL_SOURCE_URL)
$(RMRF) sbcl-$(SBCL_VERSION)
bunzip2 -c < $(SBCL_SOURCE_FILE) | tar xvf -
clisp=$(CURDIR)/build-for-sbcl/clisp; \
cd sbcl-$(SBCL_VERSION) && sh make.sh $$clisp
# ------------------------------------------------------------------------------
# ==============================================================================
# Targets for miscelleanous tasks for developers.
# ------------------------------------------------------------------------------
# Check syntactic well-formed-ness of XML (DocBook) format documentation files.
# Run after every change of doc/*.xml.
check-doc :
cd doc && make check
# ------------------------------------------------------------------------------
# Download prerequisites of 'htmldoc' target.
# This must not be in "all" because this downloads 23MB XSL + 500kB DTD.
update-docbook-utils :
make -C doc docbook-xsl docbook-dtd
# ------------------------------------------------------------------------------
# Create files that help navigating in the source code using Emacs.
SRCDIRS=src utils benchmarks emacs modules sacla-tests tests
TAGS : force
$(CTAGS) -e -R --langmap=c:.c.d.f $(SRCDIRS)
tags : force
$(CTAGS) -R --langmap=c:.c.d.f $(SRCDIRS)
# ------------------------------------------------------------------------------
# Build a GCC from source.
# Note that this requires ca. 1 GB of disk space.
GCC_VERSION = 3.4.3
GCC_SOURCE_FILE = gcc-$(GCC_VERSION).tar.bz2
GCC_SOURCE_URL = http://ftp.gnu.org/gnu/gcc/gcc-$(GCC_VERSION)/$(GCC_SOURCE_FILE)
# Put here the --prefix that you would like to use for installing gcc.
# It should *not* be the same --prefix as you use for other programs.
GCC_INSTALL_DIR = $(shell dirname $$(dirname $$(which clisp | head -1)))/inst-gcc-$(GCC_VERSION)
install-gcc:
test -f $(GCC_SOURCE_FILE) || $(WGET) $(GCC_SOURCE_URL)
$(RMRF) gcc-$(GCC_VERSION) gcc-$(GCC_VERSION)-build
bunzip2 -c < $(GCC_SOURCE_FILE) | tar xvf -
mkdir gcc-$(GCC_VERSION)-build
gcc_install_dir='$(GCC_INSTALL_DIR)' ; \
cd gcc-$(GCC_VERSION)-build && ../gcc-$(GCC_VERSION)/configure --prefix="$$gcc_install_dir" --enable-shared --enable-threads `if grep __GLIBC__ /usr/include/features.h > /dev/null 2>/dev/null; then echo --enable-__cxa_atexit; fi` --enable-version-specific-runtime-libs --enable-languages=c,c++ --enable-nls
cd gcc-$(GCC_VERSION)-build && make bootstrap
cd gcc-$(GCC_VERSION)-build && make install
$(RMRF) gcc-$(GCC_VERSION)-build
$(RMRF) gcc-$(GCC_VERSION)
# ------------------------------------------------------------------------------
# ==============================================================================
# Targets to produce prereleases and releases.
VER=$(shell . ./version.sh ; echo $$VERSION_NUMBER)
REL=$(shell . ./version.sh ; echo $$RELEASE_DATE)
SUFFIX=
# The distribution's top directory is called TOPDIR here.
TOPDIR=clisp-$(VER)$(SUFFIX)
ARCHIVE=../archives/$(VER)
SRC_DIST=$(ARCHIVE)/$(TOPDIR).tar.bz2
SRC_DIST1=$(ARCHIVE)/$(TOPDIR).tar.gz
DOC_DIST=$(ARCHIVE)/$(TOPDIR)-impnotes.zip
SSHUP=podval:~/public_html/clisp/
# ------------------------------------------------------------------------------
# Produce a prerelease.
# 2-3 weeks before a release
# manually: check for new versions of
# libsvm, netica api, postgresql, berkeley-db, dbus, pcre, readline
pre-release : gnulib-imported build-aux-update update-asdf update-gmalloc tp-mail
# ------------------------------------------------------------------------------
# Produce a release.
# start gpg agent before "make release"!
release : distrib upload tag-release
# ------------------------------------------------------------------------------
# Produce the distribution tarballs for a prerelease or release.
## RELEASE TODO:
# Before doing a "make distrib":
# * update version.sh, src/NEWS, doc/history.xml
# * "make -f Makefile.devel all"
# === Note that for clisp to report its version correctly, src/version.h and
# === src/configure must be regenerated after version.sh is updated
# web pages to be updated:
# * www/index.html, www/impnotes.html, www/clisp.html, www/impnotes/
# dates to be updated (1st release each calendar year):
# * banner in src/spvw.d
# * COPYRIGHT
# * clisp-doc-copyright in doc/impent.xml
# * AC_COPYRIGHT in src/configure.in
## CLISP release announcements go to:
# clisp-announce@lists.sourceforge.net
# info-gnu@gnu.org
# news:comp.lang.lisp
# news:comp.os.linux.announce (linux-announce@news.ornl.gov)
# http://freshmeat.net/projects/clisp/
# https://sourceforge.net/p/clisp/news/new
# WIKIs to be updated: http://en.wikipedia.org/wiki/CLISP
distrib : fixperms src-distrib doc-distrib gnu-distrib
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
T = $(TOPDIR)
SOURCES1 = $T/ANNOUNCE $T/COPYRIGHT $T/GNU-GPL $T/INSTALL $T/SUMMARY $T/configure $T/Makefile.in
SOURCES2 = $T/src
SOURCES4 = $T/utils
SOURCES5 = $T/unix $T/win32msvc
SOURCES6 = $T/modules
# for developers only: $T/benchmarks $T/sacla-tests $T/ansi-tests
SOURCES7 = $T/tests $T/emacs $T/doc $T/Makefile.devel $T/version.sh
SOURCES = $(SOURCES1) $(SOURCES2) $(SOURCES4) $(SOURCES5) $(SOURCES6) $(SOURCES7)
# Assume tar/bzip2/gzip are present
# set this if you are using GNU tar
EXCLUDE=--exclude .hg --exclude \*.fas --exclude \*.lib --exclude \*.obj \
--exclude \*.exe --exclude \*.mem --exclude \*.o --exclude build \
--exclude .hgignore --exclude \*~ --exclude .\#\* \
--exclude $(AUTOCONF_CACHE) --exclude tmp --exclude queued \
--exclude libtool-\*.tar.gz --exclude TAGS --exclude tags \
`grep '^doc/' .hgignore | sed "s,^doc/,--exclude ,"` \
--exclude \*.elc --exclude \*.orig --exclude \*.rej
src-distrib : force
mkdir -p $(ARCHIVE)
ln -s . $(TOPDIR)
tar cvfhj $(SRC_DIST) $(EXCLUDE) $(SOURCES)
$(RM) $(TOPDIR)
echo $(SRC_DIST)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
$(SRC_DIST1) : $(SRC_DIST)
bzcat -v $(SRC_DIST) | gzip -9 -v > $(SRC_DIST1)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
doc-distrib : force
mkdir -p $(ARCHIVE)
ln -s . $(TOPDIR)
zip -9vor $(DOC_DIST) $(TOPDIR)/doc/html -x \*.cvsignore -x \*.symlinks -x \*CVS\* -x .\#\* -x \*~
$(RM) $(TOPDIR)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# http://www.gnu.org/prep/maintain/html_node/Automated-Upload-Procedure.html
GPG=gpg --use-agent --yes
GNU_TOP=$(ARCHIVE)/NEWS $(ARCHIVE)/SUMMARY
GNU_SRC=$(SRC_DIST1) $(SRC_DIST)
GNU_DIST=$(GNU_TOP) $(GNU_SRC)
GNU_SYM=$(ARCHIVE)/$(TOPDIR).symlink.directive
gnu-distrib : $(SRC_DIST1) force
mkdir -p $(ARCHIVE)
$(CP) src/NEWS SUMMARY $(ARCHIVE)
for f in $(GNU_DIST); do $(GPG) -b $$f; done
for f in $(GNU_TOP); do \
$(RM) $$f.directive; \
echo "version: 1.1" >> $$f.directive; \
echo "directory: clisp" >> $$f.directive; \
echo "filename: "`basename $$f` >> $$f.directive; \
$(GPG) --clearsign $$f.directive; \
done
for f in $(GNU_SRC); do \
$(RM) $$f.directive; \
echo "version: 1.1" >> $$f.directive; \
echo "directory: clisp/release/$(VER)" >> $$f.directive; \
echo "filename: "`basename $$f` >> $$f.directive; \
$(GPG) --clearsign $$f.directive; \
done
echo "version: 1.1" > $(GNU_SYM)
echo "directory: clisp/release" >> $(GNU_SYM)
echo "rmsymlink: latest" >> $(GNU_SYM)
echo "symlink: $(VER) latest" >> $(GNU_SYM)
$(GPG) --clearsign $(GNU_SYM)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
# Internationalization: Send a mail to the Translation Project.
TP_EMAIL=coordinator@translationproject.org
MESSAGE_FILE=tp_message
TP_SUFFIX=-pre1
tp-mail : force
echo "Domain: clisp" > $(MESSAGE_FILE)
if test -n "$(TP_SUFFIX)"; then \
f=`make -f Makefile.devel src-distrib SUFFIX=$(TP_SUFFIX) | tail -n 2 | head -n 1`; \
for h in $(SSHUP) ; do scp $$f $${h}; done \
else f=$(SRC_DIST); fi; f=`basename $$f`; \
echo "Location: http://clisp.org/beta/$$f" >> $(MESSAGE_FILE); \
cat $(MESSAGE_FILE); \
mail -s "CLISP pre-release $$f is available" \
-c clisp-devel@lists.sf.net $(TP_EMAIL) < $(MESSAGE_FILE)
$(RM) $(MESSAGE_FILE)
# ------------------------------------------------------------------------------
UPLOAD=$(SRC_DIST) $(SRC_DIST1) $(DOC_DIST) src/NEWS
upload : upload-ssh upload-sf upload-gnu
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
upload-ssh : $(SRC_DIST1) force
for h in $(SSHUP) ; do scp $(UPLOAD) $${h}; done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SF_USER = `whoami`
upload-sf : $(SRC_DIST1) force
scp $(UPLOAD) $(SF_USER),clisp@frs.sf.net:/home/frs/project/c/cl/clisp/clisp/$(VER)/
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
upload-gnu : force # gnu-distrib -- do not re-sign everything
UP=""; for f in $(GNU_DIST); do \
UP=$${UP}" $$f $$f.sig $$f.directive.asc"; done; \
lftp ftp://ftp-upload.gnu.org/incoming/ftp -e "mput $${UP} $(GNU_SYM).asc; quit"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ------------------------------------------------------------------------------
tag-release : force
$(HG) tag clisp_$(subst .,_,$(VER))-$(REL) .
# ------------------------------------------------------------------------------
# ==============================================================================
force :
clisp-2.49.20170913/Makefile.in 0000664 0000000 0000000 00000001576 13156463772 0015563 0 ustar 00root root 0000000 0000000 # -*- Makefile -*- for the CLISP top-level directory
# This Makefile exists in order to support the standard GNU way of building:
# ./configure && make && make check
# -------------- Start of configurable section --------------------
# Programs used by "make":
RM = rm -f
@SET_MAKE@
# -------------- End of configurable section --------------------
SHELL = /bin/sh
all : force
cd src && $(MAKE) all
install : force
cd src && $(MAKE) install
installdirs : force
cd src && $(MAKE) installdirs
uninstall : force
cd src && $(MAKE) uninstall
check : force
cd src && $(MAKE) check
mostlyclean : force
cd src && $(MAKE) mostlyclean
clean : force
cd src && $(MAKE) clean
distclean : force
cd src && if test -f Makefile; then $(MAKE) distclean; fi
$(RM) Makefile
maintainer-clean : force
cd src && if test -f Makefile; then $(MAKE) maintainer-clean; fi
$(RM) Makefile
force :
clisp-2.49.20170913/SUMMARY 0000664 0000000 0000000 00000002101 13156463772 0014557 0 ustar 00root root 0000000 0000000 ANSI Common Lisp is a high-level, general-purpose programming language.
GNU CLISP is a Common Lisp implementation.
It conforms to the ANSI Common Lisp standard, and offers many extensions.
It runs on all desktop operating systems (GNU and Unix systems, macOS,
Windows) and is particularly memory-efficient.
It is Free Software and may be distributed under the terms of GNU GPL,
while it is possible to distribute commercial proprietary applications
compiled with GNU CLISP.
The user interface comes in English, German, French, Spanish, Dutch,
Russian and Danish, and can be changed during run time.
GNU CLISP includes an interpreter, a compiler, a debugger, CLOS, MOP,
a foreign language interface, a socket interface, i18n, fast bignums,
arbitrary precision floats and more.
An X11 interface is available through CLX, Garnet, CLUE/CLIO.
GNU CLISP runs Maxima, ACL2 and many other Common Lisp packages.
More information at = ,
and .
Sources are available at .
clisp-2.49.20170913/benchmarks/ 0000775 0000000 0000000 00000000000 13156463772 0015622 5 ustar 00root root 0000000 0000000 clisp-2.49.20170913/benchmarks/ChangeLog 0000664 0000000 0000000 00000002251 13156463772 0017374 0 ustar 00root root 0000000 0000000 2010-06-10 Sam Steingold
* run-all.lisp (*here*): add
(file, benchmarks-run): use it to allow running from outside of
the benchmarks directory
(benchmarks-run): save data in a pretty format
(with-file): save file name, not the whole file, in *CUR-STAT*
2002-08-14 Sam Steingold
* run-all.lisp (benchmarks): when *BENCHMARK-TYPE* is nil, read
and compare saved benchmarks
(read-file, benchmarks-run): extracted from BENCHMARKS
2002-08-14 Sam Steingold
* run-all.lisp (*scale*): use BOGOMIPS only with #+SYSCALLS
2002-08-11 Sam Steingold
compare benchmarks for different implementations
* run-all.lisp (*old-stat*): new parameter
(stamp, percent): new functions
(benchmarks): do the comparison and save stats readably
(comp-benchmarks, eval-benchmarks): subsumed into BENCHMARKS
* Makefile: modified accordingly
2002-08-11 Sam Steingold
* fft.lisp (fft): removed unused variable nm1
* tprint.lisp (tprint-test): accept optional argument repeat
and do output to a temp file (which is removed immediately)
2002-08-09 Sam Steingold
Initial check-in with the new interface
clisp-2.49.20170913/benchmarks/Makefile 0000664 0000000 0000000 00000001723 13156463772 0017265 0 ustar 00root root 0000000 0000000 # Makefile for Gabriel's Benchmarks
# CLISP
CLISP=../build/clisp -norc
# CMUCL
CMUCL=lisp -noinit
LOG=benchmarks.log
EVAL=no
SOURCES=acker bfib boyer browse ctak dderiv deriv destru div2 fac fft fprint \
fread frpoly puzzle stak stream tak takl takr tprint traverse triang
all:
@echo "chose your compiler and run 'make clisp' or 'make cmucl'"
%.fas: %.lisp
$(CLISP) -c $<
%.x86f: %.lisp
$(CMUCL) -eval '(progn (compile-file "$<") (quit 0))'
clisp: run-all.fas $(addsuffix .lisp ,$(SOURCES))
$(CLISP) -i $< -x '(benchmarks :compiled "$(LOG)")'
@if [ "$(EVAL)" = "yes" ]; then $(CLISP) -i $< -x '(benchmarks :interpreted "$(LOG)")'; fi
cmucl: run-all.x86f $(addsuffix .lisp ,$(SOURCES))
$(CMUCL) -load $< -eval '(progn (benchmarks :compiled "$(LOG)") (quit 0))'
@if [ "$(EVAL)" = "yes" ]; then $(CMUCL) -load $< -eval '(progn (benchmarks :interpreted "$(LOG)") (quit 0))'; fi
clean: force
rm -f *.fas *.lib *.tst *.x86f
distclean: force
rm -f *.log
force:
clisp-2.49.20170913/benchmarks/acker.lisp 0000664 0000000 0000000 00000000614 13156463772 0017601 0 ustar 00root root 0000000 0000000 ;; Benchmark for Common Lisp
;; Bruno Haible 1989
;; ACKER
(defun acker (x y)
(if (zerop x)
(1+ y)
(if (zerop y)
(acker (1- x) 1)
(acker (1- x) (acker x (1- y))))))
; (acker 0 y) = (+ y 1)
; (acker 1 y) = (+ y 2)
; (acker 2 y) = (+ (* 2 y) 3)
; (acker 3 y) = (- (expt 2 (+ y 3)) 3)
;(time (acker 3 3))
; (acker 3 3) ==> 61
;(time (acker 3 4))
; (acker 3 4) ==> 125
clisp-2.49.20170913/benchmarks/bfib.lisp 0000664 0000000 0000000 00000003112 13156463772 0017412 0 ustar 00root root 0000000 0000000 ;-*-mode:lisp-*-
; a fib benchmark that uses binary arithmetic.
; 16-DEC-92 George Carrette. GJC@MITECH.COM
; Wanted a benchmark that avoided built-in numbers
; and that did more work.
;
; Benchmark: (b->number (b-fib '(A A B A B))) => 6765
;
; Note: (b->number '(A A B A B)) => 20
;
; (C) Copyright 1992 George Carrette. As described in SLIB.C
(defun b-fib (x)
(if (b< x '(A B))
x
(b+ (b-fib (b- x '(B)))
(b-fib (b- x '(A B))))))
(defun number->b (n)
(if (zerop n)
'()
(cons (if (oddp n) 'B 'A)
(number->b (floor n 2)))))
(defun b->number (x)
(if (null x)
0
(+ (if (eq (car x) 'B) 1 0)
(* 2 (b->number (cdr x))))))
(defun b+ (x y)
(if (null x)
y
(if (null y)
x
(if (eq (car x) 'A)
(cons (car y) (b+ (cdr x) (cdr y)))
(if (eq (car y) 'A)
(cons 'B (b+ (cdr x) (cdr y)))
(cons 'A (b+ (b+ '(B) (cdr x)) (cdr y))))))))
(defun b- (x y)
(if (null y)
x
(if (null x)
(error "negative number")
(if (eq (car y) 'A)
(bA-cons (car x) (b- (cdr x) (cdr y)))
(if (eq (car x) 'B)
(bA-cons (if (eq (car y) 'B) 'A 'B) (b- (cdr x) (cdr y)))
(cons 'B (b- (b- (cdr x) '(B)) (cdr y))))))))
(defun bA-cons (x l)
(if (and (null l) (eq x 'A))
'()
(cons x l)))
(defun b< (x y)
(and (not (null y))
(or (null x)
(b< (cdr x) (cdr y))
(and (equal (cdr x) (cdr y))
(eq (car x) 'A)
(eq (car y) 'B)))))
(defun bfib-test ()
(b->number (b-fib '(A A B A B))))
clisp-2.49.20170913/benchmarks/boyer.lisp 0000664 0000000 0000000 00000046462 13156463772 0017647 0 ustar 00root root 0000000 0000000 ;;; BOYER -- Logic programming benchmark, originally written by Bob Boyer.
;;; Fairly CONS intensive.
(defvar **unify-subst**)
(defvar **temp-temp**)
(defun add-lemma (term)
(cond ((and (not (atom term))
(eq (car term)
(quote equal))
(not (atom (cadr term))))
(setf (get (car (cadr term)) (quote lemmas))
(cons term (get (car (cadr term)) (quote lemmas)))))
(t (error "~%ADD-LEMMA did not like term: ~a" term))))
(defun add-lemma-lst (lst)
(cond ((null lst)
t)
(t (add-lemma (car lst))
(add-lemma-lst (cdr lst)))))
(defun apply-subst (alist term)
(cond ((atom term)
(cond ((setq **temp-temp** (assq term alist))
(cdr **temp-temp**))
(t term)))
(t (cons (car term)
(apply-subst-lst alist (cdr term))))))
(defun apply-subst-lst (alist lst)
(cond ((null lst)
nil)
(t (cons (apply-subst alist (car lst))
(apply-subst-lst alist (cdr lst))))))
(defun falsep (x lst)
(or (equal x (quote (f)))
(member x lst)))
(defun one-way-unify (term1 term2)
(progn (setq **unify-subst** nil)
(one-way-unify1 term1 term2)))
(defun one-way-unify1 (term1 term2)
(cond ((atom term2)
(cond ((setq **temp-temp** (assq term2 **unify-subst**))
(equal term1 (cdr **temp-temp**)))
(t (setq **unify-subst** (cons (cons term2 term1)
**unify-subst**))
t)))
((atom term1)
nil)
((eq (car term1)
(car term2))
(one-way-unify1-&lst (cdr term1)
(cdr term2)))
(t nil)))
(defun one-way-unify1-&lst (lst1 lst2)
(cond ((null lst1)
t)
((one-way-unify1 (car lst1)
(car lst2))
(one-way-unify1-&lst (cdr lst1)
(cdr lst2)))
(t nil)))
(defun rewrite (term)
(cond ((atom term)
term)
(t (rewrite-with-lemmas (cons (car term)
(rewrite-args (cdr term)))
(get (car term)
(quote lemmas))))))
(defun rewrite-args (lst)
(cond ((null lst)
nil)
(t (cons (rewrite (car lst))
(rewrite-args (cdr lst))))))
(defun rewrite-with-lemmas (term lst)
(cond ((null lst)
term)
((one-way-unify term (cadr (car lst)))
(rewrite (apply-subst **unify-subst** (caddr (car lst)))))
(t (rewrite-with-lemmas term (cdr lst)))))
(defun boyer-setup ()
(add-lemma-lst
(quote ((equal (compile form)
(reverse (codegen (optimize form)
(nil))))
(equal (eqp x y)
(equal (fix x)
(fix y)))
(equal (greaterp x y)
(lessp y x))
(equal (lesseqp x y)
(not (lessp y x)))
(equal (greatereqp x y)
(not (lessp x y)))
(equal (boolean x)
(or (equal x (t))
(equal x (f))))
(equal (iff x y)
(and (implies x y)
(implies y x)))
(equal (even1 x)
(if (zerop x)
(t)
(odd (1- x))))
(equal (countps- l pred)
(countps-loop l pred (zero)))
(equal (fact- i)
(fact-loop i 1))
(equal (reverse- x)
(reverse-loop x (nil)))
(equal (divides x y)
(zerop (remainder y x)))
(equal (assume-true var alist)
(cons (cons var (t))
alist))
(equal (assume-false var alist)
(cons (cons var (f))
alist))
(equal (tautology-checker x)
(tautologyp (normalize x)
(nil)))
(equal (falsify x)
(falsify1 (normalize x)
(nil)))
(equal (prime x)
(and (not (zerop x))
(not (equal x (add1 (zero))))
(prime1 x (1- x))))
(equal (and p q)
(if p (if q (t)
(f))
(f)))
(equal (or p q)
(if p (t)
(if q (t)
(f))
(f)))
(equal (not p)
(if p (f)
(t)))
(equal (implies p q)
(if p (if q (t)
(f))
(t)))
(equal (fix x)
(if (numberp x)
x
(zero)))
(equal (if (if a b c)
d e)
(if a (if b d e)
(if c d e)))
(equal (zerop x)
(or (equal x (zero))
(not (numberp x))))
(equal (plus (plus x y)
z)
(plus x (plus y z)))
(equal (equal (plus a b)
(zero))
(and (zerop a)
(zerop b)))
(equal (difference x x)
(zero))
(equal (equal (plus a b)
(plus a c))
(equal (fix b)
(fix c)))
(equal (equal (zero)
(difference x y))
(not (lessp y x)))
(equal (equal x (difference x y))
(and (numberp x)
(or (equal x (zero))
(zerop y))))
(equal (meaning (plus-tree (append x y))
a)
(plus (meaning (plus-tree x)
a)
(meaning (plus-tree y)
a)))
(equal (meaning (plus-tree (plus-fringe x))
a)
(fix (meaning x a)))
(equal (append (append x y)
z)
(append x (append y z)))
(equal (reverse (append a b))
(append (reverse b)
(reverse a)))
(equal (times x (plus y z))
(plus (times x y)
(times x z)))
(equal (times (times x y)
z)
(times x (times y z)))
(equal (equal (times x y)
(zero))
(or (zerop x)
(zerop y)))
(equal (exec (append x y)
pds envrn)
(exec y (exec x pds envrn)
envrn))
(equal (mc-flatten x y)
(append (flatten x)
y))
(equal (member x (append a b))
(or (member x a)
(member x b)))
(equal (member x (reverse y))
(member x y))
(equal (length (reverse x))
(length x))
(equal (member a (intersect b c))
(and (member a b)
(member a c)))
(equal (nth (zero)
i)
(zero))
(equal (exp i (plus j k))
(times (exp i j)
(exp i k)))
(equal (exp i (times j k))
(exp (exp i j)
k))
(equal (reverse-loop x y)
(append (reverse x)
y))
(equal (reverse-loop x (nil))
(reverse x))
(equal (count-list z (sort-lp x y))
(plus (count-list z x)
(count-list z y)))
(equal (equal (append a b)
(append a c))
(equal b c))
(equal (plus (remainder x y)
(times y (quotient x y)))
(fix x))
(equal (power-eval (big-plus1 l i base)
base)
(plus (power-eval l base)
i))
(equal (power-eval (big-plus x y i base)
base)
(plus i (plus (power-eval x base)
(power-eval y base))))
(equal (remainder y 1)
(zero))
(equal (lessp (remainder x y)
y)
(not (zerop y)))
(equal (remainder x x)
(zero))
(equal (lessp (quotient i j)
i)
(and (not (zerop i))
(or (zerop j)
(not (equal j 1)))))
(equal (lessp (remainder x y)
x)
(and (not (zerop y))
(not (zerop x))
(not (lessp x y))))
(equal (power-eval (power-rep i base)
base)
(fix i))
(equal (power-eval (big-plus (power-rep i base)
(power-rep j base)
(zero)
base)
base)
(plus i j))
(equal (gcd x y)
(gcd y x))
(equal (nth (append a b)
i)
(append (nth a i)
(nth b (difference i (length a)))))
(equal (difference (plus x y)
x)
(fix y))
(equal (difference (plus y x)
x)
(fix y))
(equal (difference (plus x y)
(plus x z))
(difference y z))
(equal (times x (difference c w))
(difference (times c x)
(times w x)))
(equal (remainder (times x z)
z)
(zero))
(equal (difference (plus b (plus a c))
a)
(plus b c))
(equal (difference (add1 (plus y z))
z)
(add1 y))
(equal (lessp (plus x y)
(plus x z))
(lessp y z))
(equal (lessp (times x z)
(times y z))
(and (not (zerop z))
(lessp x y)))
(equal (lessp y (plus x y))
(not (zerop x)))
(equal (gcd (times x z)
(times y z))
(times z (gcd x y)))
(equal (value (normalize x)
a)
(value x a))
(equal (equal (flatten x)
(cons y (nil)))
(and (nlistp x)
(equal x y)))
(equal (listp (gopher x))
(listp x))
(equal (samefringe x y)
(equal (flatten x)
(flatten y)))
(equal (equal (greatest-factor x y)
(zero))
(and (or (zerop y)
(equal y 1))
(equal x (zero))))
(equal (equal (greatest-factor x y)
1)
(equal x 1))
(equal (numberp (greatest-factor x y))
(not (and (or (zerop y)
(equal y 1))
(not (numberp x)))))
(equal (times-list (append x y))
(times (times-list x)
(times-list y)))
(equal (prime-list (append x y))
(and (prime-list x)
(prime-list y)))
(equal (equal z (times w z))
(and (numberp z)
(or (equal z (zero))
(equal w 1))))
(equal (greatereqpr x y)
(not (lessp x y)))
(equal (equal x (times x y))
(or (equal x (zero))
(and (numberp x)
(equal y 1))))
(equal (remainder (times y x)
y)
(zero))
(equal (equal (times a b)
1)
(and (not (equal a (zero)))
(not (equal b (zero)))
(numberp a)
(numberp b)
(equal (1- a)
(zero))
(equal (1- b)
(zero))))
(equal (lessp (length (delete x l))
(length l))
(member x l))
(equal (sort2 (delete x l))
(delete x (sort2 l)))
(equal (dsort x)
(sort2 x))
(equal (length (cons x1
(cons x2
(cons x3 (cons x4
(cons x5
(cons x6 x7)))))))
(plus 6 (length x7)))
(equal (difference (add1 (add1 x))
2)
(fix x))
(equal (quotient (plus x (plus x y))
2)
(plus x (quotient y 2)))
(equal (sigma (zero)
i)
(quotient (times i (add1 i))
2))
(equal (plus x (add1 y))
(if (numberp y)
(add1 (plus x y))
(add1 x)))
(equal (equal (difference x y)
(difference z y))
(if (lessp x y)
(not (lessp y z))
(if (lessp z y)
(not (lessp y x))
(equal (fix x)
(fix z)))))
(equal (meaning (plus-tree (delete x y))
a)
(if (member x y)
(difference (meaning (plus-tree y)
a)
(meaning x a))
(meaning (plus-tree y)
a)))
(equal (times x (add1 y))
(if (numberp y)
(plus x (times x y))
(fix x)))
(equal (nth (nil)
i)
(if (zerop i)
(nil)
(zero)))
(equal (last (append a b))
(if (listp b)
(last b)
(if (listp a)
(cons (car (last a))
b)
b)))
(equal (equal (lessp x y)
z)
(if (lessp x y)
(equal t z)
(equal f z)))
(equal (assignment x (append a b))
(if (assignedp x a)
(assignment x a)
(assignment x b)))
(equal (car (gopher x))
(if (listp x)
(car (flatten x))
(zero)))
(equal (flatten (cdr (gopher x)))
(if (listp x)
(cdr (flatten x))
(cons (zero)
(nil))))
(equal (quotient (times y x)
y)
(if (zerop y)
(zero)
(fix x)))
(equal (get j (set i val mem))
(if (eqp j i)
val
(get j mem)))))))
(defun tautologyp (x true-lst false-lst)
(cond ((truep x true-lst)
t)
((falsep x false-lst)
nil)
((atom x)
nil)
((eq (car x)
(quote if))
(cond ((truep (cadr x)
true-lst)
(tautologyp (caddr x)
true-lst false-lst))
((falsep (cadr x)
false-lst)
(tautologyp (cadddr x)
true-lst false-lst))
(t (and (tautologyp (caddr x)
(cons (cadr x)
true-lst)
false-lst)
(tautologyp (cadddr x)
true-lst
(cons (cadr x)
false-lst))))))
(t nil)))
(defun tautp (x)
(tautologyp (rewrite x)
nil nil))
(defun boyer-test ()
(prog (ans term)
(setq term
(apply-subst
(quote ((x f (plus (plus a b)
(plus c (zero))))
(y f (times (times a b)
(plus c d)))
(z f (reverse (append (append a b)
(nil))))
(u equal (plus a b)
(difference x y))
(w lessp (remainder a b)
(member a (length b)))))
(quote (implies (and (implies x y)
(and (implies y z)
(and (implies z u)
(implies u w))))
(implies x w)))))
(setq ans (tautp term))))
#|
(defun trans-of-implies (n)
(list (quote implies)
(trans-of-implies1 n)
(list (quote implies)
0 n)))
(defun trans-of-implies1 (n)
(cond ((eql n 1)
(list (quote implies)
0 1))
(t (list (quote and)
(list (quote implies)
(1- n)
n)
(trans-of-implies1 (1- n))))))
|#
(defun truep (x lst)
(or (equal x (quote (t)))
(member x lst)))
;;;
;;;
;;; _jfb_ Mon Mar 30 10:16:09 PST 1987
;;;
;;; ASSQ was added so that all three Lucid, Franz and Kyoto could run
;;; the same function. Function was provided by Steve Gadol.
;;;
(defun assq (elt list)
(let ((x nil))
(tagbody
(go boyer-test)
loop
(setq x (car list))
(if (eq elt (car x))
(return-from assq x))
(setq list (cdr list))
boyer-test
(if (consp list) (go loop)))))
;;;
;;; _jfb_ end of addition
;;;
;(eval-when (load eval)
; (boyer-setup))
;;; make sure you've run (boyer-setup) then call: (boyer-test)
clisp-2.49.20170913/benchmarks/browse.lisp 0000664 0000000 0000000 00000012230 13156463772 0020012 0 ustar 00root root 0000000 0000000 ;;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: LUCID; Base: 10 -*-
;;; BROWSE -- Benchmark to create and browse through
;;; an AI-like data base of units.
;;; n is # of symbols
;;; m is maximum amount of stuff on the plist
;;; npats is the number of basic patterns on the unit
;;; ipats is the instantiated copies of the patterns
(eval-when (eval load compile)
(defvar *browse-rand* 21)
(proclaim '(type fixnum *browse-rand*))
(defconstant *browse-star* (code-char 42))
(defconstant *browse-questionmark* (code-char 63)))
#|
(defun assoc (x alist)
(dolist (elt alist nil)
(when (equal x (car elt))
(return elt))))
|#
(eval-when (eval compile)
;; maybe SYMBOL-NAME
(defmacro browse-char1 (x) `(schar (symbol-name ,x) 0)))
(defun browse-init (n m npats ipats)
(declare (type fixnum n m npats))
(setq *browse-rand* 21)
(let ((ipats (copy-tree ipats)))
(do ((p ipats (cdr p)))
((null (cdr p)) (rplacd p ipats)))
(do ((n n (the fixnum (1- n)))
(i m (cond ((= i 0) m)
(t (the fixnum (1- i)))))
(name (gentemp) (gentemp))
(a ()))
((= n 0) a)
(declare (type fixnum n i))
(push name a)
(do ((i i (the fixnum (1- i))))
((= i 0))
(declare (type fixnum i))
(setf (get name (gensym)) nil))
(setf (get name 'pattern)
(do ((i npats (the fixnum (1- i)))
(ipats ipats (cdr ipats))
(a ()))
((= i 0) a)
(declare (type fixnum i))
(push (car ipats) a)))
(do ((j (the fixnum (- m i)) (the fixnum (1- j))))
((= j 0))
(declare (type fixnum j))
(setf (get name (gensym)) nil)))))
(defun browse-random ()
(setq *browse-rand* (rem (the fixnum (* *browse-rand* 17)) 251)))
(defun browse-randomize (l)
(do ((a ()))
((null l) a)
(let ((n (rem (the fixnum (browse-random)) (the fixnum (length l)))))
(declare (type fixnum n))
(cond ((= n 0)
(push (car l) a)
(setq l (cdr l)))
(t
(do ((n n (the fixnum (1- n)))
(x l (cdr x)))
((= n 1)
(push (cadr x) a)
(rplacd x (cddr x)))
(declare (type fixnum n))))))))
(defun match (pat dat alist)
(cond ((null pat)
(null dat))
((null dat) ())
((or (eq (car pat) '?)
(eq (car pat)
(car dat)))
(match (cdr pat) (cdr dat) alist))
((eq (car pat) '*)
(or (match (cdr pat) dat alist)
(match (cdr pat) (cdr dat) alist)
(match pat (cdr dat) alist)))
(t (cond ((atom (car pat))
(cond ((eq (browse-char1 (car pat))
*browse-questionmark*)
(let ((val (assoc (car pat) alist)))
(cond (val (match (cons (cdr val)
(cdr pat))
dat alist))
(t (match (cdr pat)
(cdr dat)
(cons (cons (car pat)
(car dat))
alist))))))
((eq (browse-char1 (car pat)) *browse-star*)
(let ((val (assoc (car pat) alist)))
(cond (val (match (append (cdr val)
(cdr pat))
dat alist))
(t
(do ((l () (nconc l (cons (car d) nil)))
(e (cons () dat) (cdr e))
(d dat (cdr d)))
((null e) ())
(cond ((match (cdr pat) d
(cons (cons (car pat) l)
alist))
(return t))))))))))
(t (and
(not (atom (car dat)))
(match (car pat)
(car dat) alist)
(match (cdr pat)
(cdr dat) alist)))))))
(defun browse ()
(investigate (browse-randomize
(browse-init 100 10 4 '((a a a b b b b a a a a a b b a a a)
(a a b b b b a a
(a a)(b b))
(a a a b (b a) b a b a))))
'((*a ?b *b ?b a *a a *b *a)
(*a *b *b *a (*a) (*b))
(? ? * (b a) * ? ?))))
(defun investigate (units pats)
(do ((units units (cdr units)))
((null units))
(do ((pats pats (cdr pats)))
((null pats))
(do ((p (get (car units) 'pattern)
(cdr p)))
((null p))
(match (car pats) (car p) ())))))
;;; call: (browse)
clisp-2.49.20170913/benchmarks/ctak.lisp 0000664 0000000 0000000 00000001257 13156463772 0017442 0 ustar 00root root 0000000 0000000 ;;; CTAK -- A version of the TAKeuchi function
;;; that uses the CATCH/THROW facility.
(defun ctak (x y z)
(catch 'ctak (ctak-aux x y z)))
(defun ctak-aux (x y z)
(declare (fixnum x y z))
(cond ((not (< y x))
(throw 'ctak z))
(t (ctak-aux
(catch 'ctak
(ctak-aux (the fixnum (1- x))
y
z))
(catch 'ctak
(ctak-aux (the fixnum (1- y))
z
x))
(catch 'ctak
(ctak-aux (the fixnum (1- z))
x
y))))))
;;; call: (ctak 18. 12. 6.)
clisp-2.49.20170913/benchmarks/dderiv.lisp 0000664 0000000 0000000 00000004155 13156463772 0017775 0 ustar 00root root 0000000 0000000 ;;; DDERIV -- Symbolic derivative benchmark written by Vaughn Pratt.
;;; This benchmark is a variant of the simple symbolic derivative program
;;; (DERIV). The main change is that it is `table-driven.' Instead of using a
;;; large COND that branches on the CAR of the expression, this program finds
;;; the code that will take the derivative on the property list of the atom in
;;; the CAR position. So, when the expression is (+ . ), the code
;;; stored under the atom '+ with indicator DERIV will take and
;;; return the derivative for '+. The way that MacLisp does this is with the
;;; special form: (DEFUN (FOO BAR) ...). This is exactly like DEFUN with an
;;; atomic name in that it expects an argument list and the compiler compiles
;;; code, but the name of the function with that code is stored on the
;;; property list of FOO under the indicator BAR, in this case. You may have
;;; to do something like:
(defun dderiv-aux (a)
(list '// (dderiv a) a))
(defun +dderiv (a)
(cons '+ (mapcar 'dderiv a)))
(defun -dderiv (a)
(cons '- (mapcar 'dderiv a)))
(defun *dderiv (a)
(list '* (cons '* a)
(cons '+ (mapcar 'dderiv-aux a))))
(defun //dderiv (a)
(list '-
(list '//
(dderiv (car a))
(cadr a))
(list '//
(car a)
(list '*
(cadr a)
(cadr a)
(dderiv (cadr a))))))
(mapc #'(lambda (op fun) (setf (get op 'dderiv) (symbol-function fun)))
'(+ - * //)
'(+dderiv -dderiv *dderiv //dderiv))
(defun dderiv (a)
(cond
((atom a)
(cond ((eq a 'x) 1) (t 0)))
(t (let ((dderiv (get (car a) 'dderiv)))
(cond (dderiv (funcall dderiv (cdr a)))
(t 'error))))))
(defun dderiv-run ()
(do ((i 0 (the fixnum (1+ i))))
((= (the fixnum i) 1000.))
(declare (type fixnum i))
(dderiv '(+ (* 3 x x) (* a x x) (* b x) 5))
(dderiv '(+ (* 3 x x) (* a x x) (* b x) 5))
(dderiv '(+ (* 3 x x) (* a x x) (* b x) 5))
(dderiv '(+ (* 3 x x) (* a x x) (* b x) 5))
(dderiv '(+ (* 3 x x) (* a x x) (* b x) 5))))
;;; call: (dderiv-run)
clisp-2.49.20170913/benchmarks/deriv.lisp 0000664 0000000 0000000 00000002356 13156463772 0017632 0 ustar 00root root 0000000 0000000 ;;; DERIV -- Symbolic derivative benchmark written by Vaughn Pratt.
;;; It uses a simple subset of Lisp and does a lot of CONSing.
(defun deriv-aux (a) (list '// (deriv a) a))
(defun deriv (a)
(cond
((atom a)
(cond ((eq a 'x) 1) (t 0)))
((eq (car a) '+)
(cons '+ (mapcar #'deriv (cdr a))))
((eq (car a) '-)
(cons '- (mapcar #'deriv
(cdr a))))
((eq (car a) '*)
(list '*
a
(cons '+ (mapcar #'deriv-aux (cdr a)))))
((eq (car a) '//)
(list '-
(list '//
(deriv (cadr a))
(caddr a))
(list '//
(cadr a)
(list '*
(caddr a)
(caddr a)
(deriv (caddr a))))))
(t 'error)))
(defun deriv-run ()
(do ((i 0 (the fixnum (1+ i))))
((= (the fixnum i) 1000.)) ;runs it 5000 times
(declare (type fixnum i)) ;improves the code a little
(deriv '(+ (* 3 x x) (* a x x) (* b x) 5))
(deriv '(+ (* 3 x x) (* a x x) (* b x) 5))
(deriv '(+ (* 3 x x) (* a x x) (* b x) 5))
(deriv '(+ (* 3 x x) (* a x x) (* b x) 5))
(deriv '(+ (* 3 x x) (* a x x) (* b x) 5))))
;;; call: (deriv-run)
clisp-2.49.20170913/benchmarks/destru.lisp 0000664 0000000 0000000 00000003615 13156463772 0020026 0 ustar 00root root 0000000 0000000 ;;; DESTRU -- Destructive operation benchmark
;;; patch for length
;(defun length (x) (list-length x)) ??? cheating
(defun destructive (n m)
(declare (type fixnum n m))
(let ((l (do ((i 10. (the fixnum (1- i)))
(a () (push () a)))
((= (the fixnum i) 0) a)
(declare (type fixnum i)))))
(do ((i n (the fixnum (1- i))))
((= (the fixnum i) 0))
(declare (type fixnum i))
(cond ((null (car l))
(do ((l l (cdr l)))
((null l))
(or (car l)
(rplaca l (cons () ())))
(nconc (car l)
(do ((j m (the fixnum (1- j)))
(a () (push () a)))
((= (the fixnum j) 0) a)
(declare (type fixnum j))))))
(t
(do ((l1 l (cdr l1))
(l2 (cdr l) (cdr l2)))
((null l2))
(rplacd (do ((j (floor (the fixnum (length (car l2))) 2)
(the fixnum (1- j)))
(a (car l2) (cdr a)))
((zerop (the fixnum j)) a)
(declare (type fixnum j))
(rplaca a i))
(let ((n (floor (the fixnum (length (car l1))) 2)))
(cond ((= (the fixnum n) 0) (rplaca l1 ())
(car l1))
(t
(do ((j n (the fixnum (1- j)))
(a (car l1) (cdr a)))
((= (the fixnum j) 1)
(prog1 (cdr a)
(rplacd a ())))
(declare (type fixnum j))
(rplaca a i))))))))))))
;;; call: (destructive 600. 50.)
clisp-2.49.20170913/benchmarks/div2.lisp 0000664 0000000 0000000 00000001776 13156463772 0017372 0 ustar 00root root 0000000 0000000 ;;; DIV2 -- Benchmark which divides by 2 using lists of n ()'s.
;;; This file contains a recursive as well as an iterative test.
(defun create-n (n)
(declare (type fixnum n))
(do ((n n (the fixnum (1- n)))
(a () (push () a)))
((= (the fixnum n) 0) a)
(declare (type fixnum n))))
(defparameter **l** (create-n 200))
(defun iterative-div2 (l)
(do ((l l (cddr l))
(a () (push (car l) a)))
((null l) a)))
(defun recursive-div2 (l)
(cond ((null l) ())
(t (cons (car l) (recursive-div2 (cddr l))))))
(defun test-div2-iterative (&optional (l **l**))
(do ((i 300 (the fixnum (1- i))))
((= (the fixnum i) 0))
(declare (type fixnum i))
(iterative-div2 l)
(iterative-div2 l)
(iterative-div2 l)
(iterative-div2 l)))
(defun test-div2-recursive (&optional (l **l**))
(do ((i 300 (the fixnum (1- i))))
((= (the fixnum i) 0))
(declare (type fixnum i))
(recursive-div2 l)
(recursive-div2 l)
(recursive-div2 l)
(recursive-div2 l)))
clisp-2.49.20170913/benchmarks/fac.lisp 0000664 0000000 0000000 00000000216 13156463772 0017243 0 ustar 00root root 0000000 0000000 ;; Benchmark for Common Lisp: factorial
;; Bruno Haible 1989
(defun fac (n)
(do* ((i 0 (1+ i))
(f 1 (* f i)))
((= i n) f)))
clisp-2.49.20170913/benchmarks/fft.lisp 0000664 0000000 0000000 00000006352 13156463772 0017300 0 ustar 00root root 0000000 0000000 ;;; FFT -- This is an FFT benchmark written by Harry Barrow.
;;; It tests a variety of floating point operations,
;;; including array references.
(defvar **fft-re**
(make-array 1025. :element-type 'float :initial-element 0.0))
(defvar **fft-im**
(make-array 1025. :element-type 'float :initial-element 0.0))
(proclaim '(type (simple-array float (*)) **fft-re** **fft-im**))
;; fast fourier transform
(defun fft (areal #|real part|# aimag #|imaginary part|#)
(declare (type (simple-array float (*)) areal aimag))
(prog*
((ar areal) (ai aimag) (i 1) (j 0) (k 0) (m 0) ;compute m = log(n)
(n (1- (array-dimension areal 0))) (le 0) (le1 0) (ip 0)
(nv2 (the (values fixnum fixnum) (floor n 2)))
(ur 0.0) (ui 0.0) (wr 0.0) (wi 0.0) (tr 0.0) (ti 0.0))
(declare (type fixnum i j k n nv2 m le le1 ip))
(declare (type (simple-array float (*)) ar ai))
(declare (type float ur ui wr wi tr ti))
l1 (cond ((< i n)
(setq m (the fixnum (1+ m))
i (the fixnum (+ i i)))
(go l1)))
(cond ((not (equal n (the fixnum (expt 2 m))))
(princ "error ... array size not a power of two.")
(read)
(return (terpri))))
(setq j 1 ;interchange elements
i 1) ;in bit-reversed order
l3 (cond ((< i j)
(setq tr (aref ar j)
ti (aref ai j))
(setf (aref ar j) (aref ar i))
(setf (aref ai j) (aref ai i))
(setf (aref ar i) tr)
(setf (aref ai i) ti)))
(setq k nv2)
l6 (cond ((< k j)
(setq j (the fixnum (- j k))
k (the fixnum (/ k 2)))
(go l6)))
(setq j (the fixnum (+ j k))
i (the fixnum (1+ i)))
(cond ((< i n)
(go l3)))
(do ( (l 1 (the fixnum (1+ (the fixnum l)))))
((> (the fixnum l) m)) ;loop thru stages
(declare (type fixnum l))
(setq le (the fixnum (expt 2 l))
le1 (the (values fixnum fixnum) (floor le 2))
ur 1.0
ui 0.0
wr (cos (/ #.(float pi (float 1)) (float le1)))
wi (sin (/ #.(float pi (float 1)) (float le1))))
(do ((j 1 (the fixnum (1+ (the fixnum j)))))
((> (the fixnum j) le1)) ;loop thru butterflies
(declare (type fixnum j))
(do ( (i j (+ (the fixnum i) le)))
((> (the fixnum i) n)) ;do a butterfly
(declare (type fixnum i))
(setq ip (the fixnum (+ i le1))
tr (- (* (aref ar ip) ur)
(* (aref ai ip) ui))
ti (+ (* (aref ar ip) ui)
(* (aref ai ip) ur)))
(setf (aref ar ip) (- (aref ar i) tr))
(setf (aref ai ip) (- (aref ai i) ti))
(setf (aref ar i) (+ (aref ar i) tr))
(setf (aref ai i) (+ (aref ai i) ti))))
(setq tr (- (* ur wr) (* ui wi))
ti (+ (* ur wi) (* ui wr))
ur tr
ui ti))
(return t)))
;;; the timer which does 10 calls on fft
(defun fft-bench ()
(dotimes (i 10)
(fft **fft-re** **fft-im**)))
;;; call: (fft-bench)
clisp-2.49.20170913/benchmarks/fprint.lisp 0000664 0000000 0000000 00000002450 13156463772 0020016 0 ustar 00root root 0000000 0000000 ;;; FPRINT -- Benchmark to print to a file.
(defvar **fprint-test-atoms**
'(abcdef12 cdefgh23 efghij34 ghijkl45 ijklmn56
klmnop67 mnopqr78 opqrst89 qrstuv90 stuvwx01
uvwxyz12 wxyzab23 xyzabc34 123456ab 234567bc
345678cd 456789de 567890ef 678901fg 789012gh
890123hi))
(defun fprint-init-aux (m n atoms)
(declare (fixnum n m))
(cond ((= m 0) (pop atoms))
(t (do ((i n (the fixnum (- i 2)))
(a ()))
((< i 1) a)
(declare (fixnum i))
(push (pop atoms) a)
(push (fprint-init-aux (the fixnum (1- m)) n atoms) a)))))
(defun fprint-init (m n atoms)
(declare (fixnum n m))
(let ((atoms (subst () () atoms)))
(do ((a atoms (cdr a)))
((null (cdr a)) (rplacd a atoms)))
(fprint-init-aux m n atoms)))
(defvar **fprint-test-pattern** (fprint-init 6. 6. **fprint-test-atoms**))
(defun fprint ()
(if (probe-file "fprint.tst")
;; this seems a little wierd, subsequent calls to FPRINT will be slower
(delete-file "fprint.tst"))
(let((stream (open "fprint.tst" :direction :output)))
;; defaults to STRING-CHAR
(print **fprint-test-pattern** stream)
(close stream)))
(eval-when (compile load eval)
(if (probe-file "fprint.tst")
(delete-file "fprint.tst")))
;;; call: (fprint)
clisp-2.49.20170913/benchmarks/fread.lisp 0000664 0000000 0000000 00000000715 13156463772 0017577 0 ustar 00root root 0000000 0000000 ;;; FREAD -- Benchmark to read from a file.
;;; Pronounced "FRED". Requires the existence of FPRINT.TST which is created
;;; by FPRINT.
(defun fread ()
(let ((stream (open "fprint.tst" :direction :input)))
(read stream)
(close stream)))
(eval-when (compile load eval) ; Seems dumb to eval at compile and load time.
(if (not (probe-file "fprint.tst"))
(format t "~%Define FPRINT.TST by running the FPRINT benchmark!")))
;;; call: (fread))
clisp-2.49.20170913/benchmarks/frpoly.lisp 0000664 0000000 0000000 00000015413 13156463772 0020032 0 ustar 00root root 0000000 0000000 ;;;BEGIN
;;;FRPOLY
;;; Franz Lisp benchmark from Fateman
;; test from Berkeley based on polynomial arithmetic.
(defvar **v**)
(defvar ***x***)
(defvar **u***)
(defvar frpoly-r)
(defvar frpoly-r2)
(defvar frpoly-r3)
;;(declare (localf pcoefadd pcplus pcplus1 pplus ptimes ptimes1
;; ptimes2 ptimes3 psimp pctimes pctimes1
;; pplus1))
;; Franz uses maclisp hackery here; you can rewrite lots of ways.
(defmacro pointergp (x y) `(> (get ,x 'order)(get ,y 'order)))
(defmacro pcoefp (e) `(atom ,e))
(defmacro pzerop (x)
(let ( (var (gensym)) )
`(let ((,var ,x))
(if (numberp ,var) (zerop ,var)))));true for 0 or 0.0
(defmacro pzero () 0)
(defmacro cplus (x y) `(+ ,x ,y))
(defmacro ctimes (x y) `(* ,x ,y))
(defun pcoefadd (e c x) (cond ((pzerop c) x)
(t (cons e (cons c x)))))
(defun pcplus (c p) (cond ((pcoefp p) (cplus p c))
(t (psimp (car p) (pcplus1 c (cdr p))))))
(defun pcplus1 (c x)
(cond ((null x)
(cond ((pzerop c) nil) (t (cons 0 (cons c nil)))))
((pzerop (car x)) (pcoefadd 0 (pplus c (cadr x)) nil))
(t (cons (car x) (cons (cadr x) (pcplus1 c (cddr x)))))))
(defun pctimes (c p) (cond ((pcoefp p) (ctimes c p))
(t (psimp (car p) (pctimes1 c (cdr p))))))
(defun pctimes1 (c x)
(cond ((null x) nil)
(t (pcoefadd (car x)
(ptimes c (cadr x))
(pctimes1 c (cddr x))))))
(defun pplus (x y) (cond ((pcoefp x) (pcplus x y))
((pcoefp y) (pcplus y x))
((eq (car x) (car y))
(psimp (car x) (pplus1 (cdr y) (cdr x))))
((pointergp (car x) (car y))
(psimp (car x) (pcplus1 y (cdr x))))
(t (psimp (car y) (pcplus1 x (cdr y))))))
(defun pplus1 (x y)
(cond ((null x) y)
((null y) x)
((= (car x) (car y))
(pcoefadd (car x)
(pplus (cadr x) (cadr y))
(pplus1 (cddr x) (cddr y))))
((> (car x) (car y))
(cons (car x) (cons (cadr x) (pplus1 (cddr x) y))))
(t (cons (car y) (cons (cadr y) (pplus1 x (cddr y)))))))
(defun psimp (var x)
(cond ((null x) 0)
((atom x) x)
((zerop (car x)) (cadr x))
(t (cons var x))))
(defun ptimes (x y) (cond ((or (pzerop x) (pzerop y)) (pzero))
((pcoefp x) (pctimes x y))
((pcoefp y) (pctimes y x))
((eq (car x) (car y))
(psimp (car x) (ptimes1 (cdr x) (cdr y))))
((pointergp (car x) (car y))
(psimp (car x) (pctimes1 y (cdr x))))
(t (psimp (car y) (pctimes1 x (cdr y))))))
(defun ptimes1 (***x*** y) (prog (**u*** **v**)
(setq **v** (setq **u*** (ptimes2 y)))
a (setq ***x*** (cddr ***x***))
(cond ((null ***x***) (return **u***)))
(ptimes3 y)
(go a)))
(defun ptimes2 (y) (cond ((null y) nil)
(t (pcoefadd (+ (car ***x***) (car y))
(ptimes (cadr ***x***) (cadr y))
(ptimes2 (cddr y))))))
(defun ptimes3 (y)
(prog (e u c)
a1 (cond ((null y) (return nil)))
(setq e (+ (car ***x***) (car y)))
(setq c (ptimes (cadr y) (cadr ***x***) ))
(cond ((pzerop c) (setq y (cddr y)) (go a1))
((or (null **v**) (> e (car **v**)))
(setq **u*** (setq **v** (pplus1 **u*** (list e c))))
(setq y (cddr y)) (go a1))
((= e (car **v**))
(setq c (pplus c (cadr **v**)))
(cond ((pzerop c)
(setq **u***
(setq **v**
(pdiffer1 **u***
(list (car **v**) (cadr **v**))))))
(t (rplaca (cdr **v**) c)))
(setq y (cddr y))
(go a1)))
a (cond ((and (cddr **v**)
(> (caddr **v**) e))
(setq **v** (cddr **v**)) (go a)))
(setq u (cdr **v**))
b (cond ((or (null (cdr u)) (< (cadr u) e))
(rplacd u (cons e (cons c (cdr u)))) (go e)))
(cond ((pzerop (setq c (pplus (caddr u) c)))
(rplacd u (cdddr u)) (go d))
(t (rplaca (cddr u) c)))
e (setq u (cddr u))
d (setq y (cddr y))
(cond ((null y) (return nil)))
(setq e (+ (car ***x***) (car y)))
(setq c (ptimes (cadr y) (cadr ***x***)))
c (cond ((and (cdr u) (> (cadr u) e)) (setq u (cddr u)) (go c)))
(go b)))
(defun pexptsq (p n)
(do ((n (floor n 2) (floor n 2))
(s (cond ((oddp n) p) (t 1))))
;;((zerop n) s)
((zerop n) nil) ;;The results make a mess when printed!
(setq p (ptimes p p))
(and (oddp n) (setq s (ptimes s p))) ))
(eval-when (load eval)
(setf (get 'x 'order) 1)
(setf (get 'y 'order) 2)
(setf (get 'z 'order) 3)
(setq
;; frpoly-r= x+y+z+1
frpoly-r (pplus '(x 1 1 0 1) (pplus '(y 1 1) '(z 1 1)))
;; frpoly-r2 = 100000*r
frpoly-r2 (ptimes frpoly-r 100000)
;; frpoly-r3 = frpoly-r with floating point coefficients
frpoly-r3 (ptimes frpoly-r 1.0)))
;;; four sets of three tests, call:
;;; (pexptsq frpoly-r 2) (pexptsq frpoly-r2 2) (pexptsq frpoly-r3 2)
;;; (pexptsq frpoly-r 5) (pexptsq frpoly-r2 5) (pexptsq frpoly-r3 5)
;;; (pexptsq frpoly-r 10) (pexptsq frpoly-r2 10) (pexptsq frpoly-r3 10)
;;; (pexptsq frpoly-r 15) (pexptsq frpoly-r2 15) (pexptsq frpoly-r3 15)
#|
(defun setup nil
(putprop 'x 1 'order)
(putprop 'y 2 'order)
(putprop 'z 3 'order)
(setq r (pplus '(x 1 1 0 1) (pplus '(y 1 1) '(z 1 1)))) ; r= x+y+z+1
(setq r2 (ptimes r 100000)) ;r2 = 100000*r
(setq r3 (ptimes r 1.0))); r3 = r with floating point coefficients
;; time various computations of powers of polynomials, not counting
;;printing but including gc time ; provide account of g.c. time.
(include "timer.lsp")
(timer timit1
(pexptsq r n) n)
(timer timit2
(pexptsq r2 n) n)
(timer timit3
(pexptsq r3 n) n)
(defun bench (n)
(print 'test1)
(timit1 n)
(print 'test2)
(timit2 n)
(print 'test3)(timit3 n))
(setup)
; then (bench 2) ; this should be pretty fast.
; then (bench 5)
; then (bench 10)
; then (bench 15)
;...
;;;END
|#
;;This is a cross-compiler kludge, too. The names are stupid.
(defun pdiffer1 (stupidx stupidy)
(declare (ignore stupidx stupidy))
nil)
clisp-2.49.20170913/benchmarks/puzzle.lisp 0000664 0000000 0000000 00000015453 13156463772 0020054 0 ustar 00root root 0000000 0000000 ;;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: LUCID; Base: 10 -*-
;;; PUZZLE -- Forest Baskett's Puzzle benchmark, originally written in Pascal.
(eval-when (compile load eval)
(defconstant puzzle-size 511.)
(defconstant puzzle-classmax 3.)
(defconstant puzzle-typemax 12.))
(defvar **iii** 0)
(defvar **kount** 0)
(defvar puzzle-d 8.)
(proclaim '(type fixnum **iii** **kount** puzzle-d))
(defvar piececount (make-array (1+ puzzle-classmax) :initial-element 0))
(defvar puzzle-class (make-array (1+ puzzle-typemax) :initial-element 0))
(defvar piecemax (make-array (1+ puzzle-typemax) :initial-element 0))
(defvar puzzle (make-array (1+ puzzle-size)))
(defvar puzzle-p (make-array (list (1+ puzzle-typemax) (1+ puzzle-size))))
(proclaim '(type simple-vector
piececount puzzle-class piecemax puzzle))
(proclaim '(type (simple-array t (* *)) puzzle-p))
(defun fit (i j)
(declare (type fixnum i j))
(let ((end (aref piecemax i)))
(declare (type fixnum end))
(do ((k 0 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) end) t)
(declare (type fixnum k))
(cond ((aref puzzle-p i k)
(cond ((aref puzzle (the fixnum (+ j k)))
(return nil))))))))
(defun place (i j)
(declare (type fixnum i j))
(let ((end (aref piecemax i)))
(declare (type fixnum end))
(do ((k 0 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) end))
(declare (type fixnum k))
(cond ((aref puzzle-p i k)
(setf (aref puzzle (the fixnum (+ j k))) t))))
(setf (aref piececount (the fixnum (aref puzzle-class i)))
(the fixnum
(- (the fixnum
(aref piececount
(the fixnum (aref puzzle-class i)))) 1)))
(do ((k j (the fixnum(1+ (the fixnum k)))))
((> (the fixnum k) puzzle-size)
#| (terpri)
(princ "Puzzle filled")|#
0)
(declare (type fixnum k))
(cond ((not (aref puzzle k))
(return k))))))
(defun puzzle-remove (i j)
(declare (type fixnum i j))
(let ((end (aref piecemax i)))
(declare (type fixnum end))
(do ((k 0 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) end))
(declare (type fixnum k))
(cond ((aref puzzle-p i k)
(setf (aref puzzle (the fixnum (+ j k))) nil ))))
(setf (aref piececount (the fixnum (aref puzzle-class i)))
(the fixnum
(+ (the fixnum (aref piececount
(the fixnum (aref puzzle-class i)))) 1)))))
#|(defun puzzle-remove (i j)
(declare (type fixnum i j))
(let ((end (aref piecemax i)))
(declare (type fixnum end))
(do ((k 0 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) end))
(declare (type fixnum k))
(cond ((aref puzzle-p i k) (setf (aref puzzle (+ j k)) nil)))
(setf (aref piececount (the fixnum (aref puzzle-class i)))
(+ (aref piececount (the fixnum (aref puzzle-class i))) 1)))))|#
(defun trial (j)
(declare (type fixnum j))
(let ((k 0))
(declare (type fixnum k))
(do ((i 0 (the fixnum (1+ (the fixnum i)))))
((> (the fixnum i) puzzle-typemax)
(setq **kount** (the fixnum (1+ **kount**))) nil)
(declare (type fixnum i))
(cond ((not (= (the fixnum (aref piececount
(the fixnum (aref puzzle-class i)))) 0))
(cond ((fit i j)
(setq k (place i j))
(cond ((or (trial k)
(= k 0))
;;(format t "~%Piece ~4D at ~4D." (+ i 1) (+ k 1))
(setq **kount** (the fixnum (+ **kount** 1)))
(return t))
(t (puzzle-remove i j))))))))))
(defun definepiece (iclass ii jj kk)
(declare (type fixnum ii jj kk))
(let ((index 0))
(declare (type fixnum index))
(do ((i 0 (the fixnum (1+ (the fixnum i)))))
((> (the fixnum i) ii))
(declare (type fixnum i))
(do ((j 0 (the fixnum (1+ (the fixnum j)))))
((> (the fixnum j) jj))
(declare (type fixnum j))
(do ((k 0 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) kk))
(declare (type fixnum k))
(setq index
(+ i
(the fixnum
(* puzzle-d
(the fixnum
(+ j
(the fixnum
(* puzzle-d k))))))))
(setf (aref puzzle-p **iii** index) t))))
(setf (aref puzzle-class **iii**) iclass)
(setf (aref piecemax **iii**) index)
(cond ((not (= **iii** puzzle-typemax))
(setq **iii** (the fixnum (+ **iii** 1)))))))
(defun puzzle-start ()
(do ((m 0 (the fixnum (1+ (the fixnum m)))))
((> (the fixnum m) puzzle-size))
(declare (type fixnum m))
(setf (aref puzzle m) t))
(do ((i 1 (the fixnum (1+ (the fixnum i)))))
((> (the fixnum i) 5))
(declare (type fixnum i))
(do ((j 1 (the fixnum (1+ (the fixnum j)))))
((> (the fixnum j) 5))
(declare (type fixnum j))
(do ((k 1 (the fixnum (1+ (the fixnum k)))))
((> (the fixnum k) 5))
(declare (type fixnum k))
(setf (aref puzzle
(the fixnum (+ i
(the fixnum
(* puzzle-d
(the fixnum
(+ j
(the fixnum
(* puzzle-d k)))))))))
nil))))
(do ((i 0 (the fixnum (1+ (the fixnum i)))))
((> (the fixnum i) puzzle-typemax))
(declare (type fixnum i))
(do ((m 0 (the fixnum (1+ (the fixnum m)))))
((> (the fixnum m) puzzle-size))
(declare (type fixnum m))
(setf (aref puzzle-p i m) nil)))
(setq **iii** 0)
(definePiece 0 3 1 0)
(definePiece 0 1 0 3)
(definePiece 0 0 3 1)
(definePiece 0 1 3 0)
(definePiece 0 3 0 1)
(definePiece 0 0 1 3)
(definePiece 1 2 0 0)
(definePiece 1 0 2 0)
(definePiece 1 0 0 2)
(definePiece 2 1 1 0)
(definePiece 2 1 0 1)
(definePiece 2 0 1 1)
(definePiece 3 1 1 1)
(setf (aref pieceCount 0) 13.)
(setf (aref pieceCount 1) 3)
(setf (aref pieceCount 2) 1)
(setf (aref pieceCount 3) 1)
(let ((m (the fixnum
(+ 1 (the fixnum
(* puzzle-d (the fixnum
(+ 1 puzzle-d)))))))
(n 0)(**kount** 0))
(declare (type fixnum m n **kount**))
(cond ((fit 0 m) (setq n (place 0 m)))
(t (format t "~%Error.")))
(cond ((trial n)
(format t "~%Success in ~4D trials." **kount**))
(t (format t "~%Failure.")))))
;;; call: (puzzle-start)
clisp-2.49.20170913/benchmarks/run-all.lisp 0000664 0000000 0000000 00000020112 13156463772 0020061 0 ustar 00root root 0000000 0000000 ;;; Driver that runs benchmarks.
;;; This driver uses the following files:
;;; acker
;;; bfib
;;; boyer
;;; browse
;;; ctak
;;; dderiv
;;; deriv
;;; destru
;;; div2
;;; fac
;;; fft
;;; fprint
;;; fread
;;; frpoly
;;; puzzle
;;; stak
;;; stream
;;; tak
;;; takl
;;; takr
;;; tprint
;;; traverse
;;; triang
(in-package "USER")
(defparameter *source-type* "lisp")
(defparameter *compiled-type* (pathname-type (compile-file-pathname "foo")))
(defparameter *file-list*
'("acker" "bfib" "boyer" "browse" "ctak" "dderiv" "deriv" "destru" "div2"
"fac" "fft" "fprint" "fread" "frpoly" "puzzle" "stak" "stream"
"tak" "takl" "takr" "tprint" "traverse" "triang"))
(defparameter *cur-stat* nil)
(defparameter *old-stat* nil)
(defparameter *here*
(make-pathname :name nil :type nil :defaults *load-truename*))
;; put here your CPU speed in GHz
(defparameter *scale*
#+(and CLISP SYSCALLS) (/ (POSIX:BOGOMIPS) 1000)
#-(and CLISP SYSCALLS) 1d0)
(defvar *benchmark-type* nil)
;; Garbage collection before running a test:
#+KCL (defun gc () (gbc t))
#+CMU (eval-when (compile load eval) (setq ext:*gc-verbose* nil))
;; In POPLOG you must first do: lib storeutils
; Filename conversion
(defun file (filename)
(declare (string filename))
(merge-pathnames
(case *benchmark-type*
(:compiled (concatenate 'string filename "." *compiled-type*))
(:interpreted (concatenate 'string filename "." *source-type*))
(t filename))
*here*))
(defmacro with-file (filename &body body)
(let ((fi (gensym "WITH-FILE-")))
`(let ((,fi (file ,filename)))
(load ,fi :verbose nil)
(push (list (pathname-name ,fi) 0 0) *cur-stat*)
(format t "~& * file: ~s~%" ,filename)
,@body)))
;; Function for benchmarking...
(defun timer-thing (count retval name function &rest args)
(gc)
(format t "~& > form: (~a~{ ~s~})~%" name args)
(let ((start (get-internal-run-time)) elapsed elapsed-s ret)
(loop :repeat count :do (setq ret (apply function args)))
(setq elapsed (/ (- (get-internal-run-time) start)
(float internal-time-units-per-second 1d0))
elapsed-s (/ elapsed *scale*))
(when (car *cur-stat*)
(incf (second (car *cur-stat*)) elapsed)
(incf (third (car *cur-stat*)) elapsed-s))
(if (equalp retval ret)
(format t "correct: ~s~%" ret)
(if (eq retval 'none)
(format t "unchecked: ~s~%" ret)
(error "(~s~{ ~s~}) failed: ~s != ~s" name args ret retval)))
(format t "elapsed: ~f sec [scaled: ~f]~%"
elapsed elapsed-s)))
(defun stamp (out)
(multiple-value-bind (se mi ho da mo ye) (get-decoded-time)
(format out
" * ~s: ~4,'0d:~2,'0d:~2,'0d ~2,'0d:~2,'0d:~2,'0d~% * ~a [~a]~%"
*benchmark-type* ye mo da ho mi se
(lisp-implementation-type) (lisp-implementation-version))))
(defun percent (cur old) (/ (- cur old) old 1d-2))
(defun benchmarks-run () ; the actual run
(case *benchmark-type*
((:compiled)
(push (list "compilation" 0 0) *cur-stat*)
(timer-thing 1 'none "compile all files" #'mapc
(lambda (f) (compile-file (merge-pathnames f *here*)))
*file-list*)))
;; repeat counts are selected so that each test takes
;; approximately the same time
(with-file "fac"
(timer-thing 100 'none "fac" #'fac 1000))
(with-file "acker"
(timer-thing 17 253 "acker" #'acker 3 5)
(timer-thing 9 509 "acker" #'acker 3 6)
(timer-thing 3 1021 "acker" #'acker 3 7))
(with-file "bfib"
(timer-thing 20 6765 "bfib-test" #'bfib-test))
(with-file "ctak"
(timer-thing 60 7 "ctak" #'ctak 18 12 6))
(with-file "stak"
(timer-thing 60 7 "stak" #'stak 18 12 6))
(with-file "tak"
(timer-thing 90 7 "tak" #'tak 18 12 6))
(with-file "takl"
(timer-thing 15 '(7 6 5 4 3 2 1) "mas-bench" #'mas-bench))
(with-file "takr"
(timer-thing 80 7 "tak0" #'tak0 18 12 6))
(with-file "boyer"
(boyer-setup)
(timer-thing 5 nil "boyer-test" #'boyer-test))
(with-file "browse"
(timer-thing 5 nil "browse" #'browse))
(with-file "dderiv"
(timer-thing 25 nil "dderiv-run" #'dderiv-run))
(with-file "deriv"
(timer-thing 6 nil "deriv-run" #'deriv-run))
(with-file "destru"
(timer-thing 30 nil "destructive" #'destructive 600 50))
(with-file "div2"
(timer-thing 20 nil "test-div2-iterative" #'test-div2-iterative)
(timer-thing 20 nil "test-div2-recursive" #'test-div2-recursive))
(with-file "fft"
(timer-thing 6 nil "fft-bench" #'fft-bench))
(with-file "fprint"
(timer-thing 80 t "fprint" #'fprint))
(with-file "fread"
(timer-thing 250 t "fread" #'fread))
(with-file "frpoly" ; 4 sets of three tests
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r 2)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r2 2)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r3 2)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r 5)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r2 5)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r3 5)
(timer-thing 8 nil "pexptsq" #'pexptsq frpoly-r 10)
(timer-thing 6 nil "pexptsq" #'pexptsq frpoly-r2 10)
(timer-thing 6 nil "pexptsq" #'pexptsq frpoly-r3 10)
(timer-thing 6 nil "pexptsq" #'pexptsq frpoly-r 15)
(timer-thing 2 nil "pexptsq" #'pexptsq frpoly-r2 15)
(timer-thing 2 nil "pexptsq" #'pexptsq frpoly-r3 15))
(with-file "puzzle"
(timer-thing 4 nil "puzzle-start" #'puzzle-start))
(with-file "stream"
(timer-thing 2 229 "nth-prime" #'nth-prime 50)
(timer-thing 2 541 "nth-prime" #'nth-prime 100)
(timer-thing 1 863 "nth-prime" #'nth-prime 150))
(with-file "tprint"
(timer-thing 1 t "tprint-test" #'tprint-test 100))
(with-file "traverse"
(timer-thing 1 nil "init-traverse" #'init-traverse)
(timer-thing 1 nil "run-traverse" #'run-traverse))
(with-file "triang"
(timer-thing 1 nil "gogogo" #'gogogo 22))
(setq *cur-stat* (nreverse *cur-stat*)))
(defun read-file (fi)
(with-open-file (s fi :direction :input)
(with-standard-io-syntax (read s))))
(defun benchmarks (*benchmark-type* &optional (log "benchmarks.log") base save)
(setq *cur-stat* (list (stamp nil)))
(when base (setq *old-stat* (read-file base)))
(if *benchmark-type* (time (benchmarks-run))
;; if *BENCHMARK-TYPE* is NIL, read and report previously saved stats
(if save (setq *cur-stat* (read-file save))
(error "~s: at least one of ~s or ~s must not be ~s"
'benchmarks '*benchmark-type* 'save nil)))
(when log (dribble log))
(if *old-stat*
(loop :initially
(format t "~2%reference (~a):~%~acurrent~@[ (~a)~]:~%~a~%"
base (car *old-stat*) save (car *cur-stat*))
:for cur :in (cdr *cur-stat*) :and old :in (cdr *old-stat*)
:with c-tot = 0 :and c-tot-s = 0 :and o-tot = 0 :and o-tot-s = 0
:and fmt =
(formatter "~15a ~8,3f sec (~6,2@f%) ~40t ~10,5f scaled (~6,2@f%)~%")
:unless (string= (first cur) (first old))
:do (error "old/cur mismatch: ~s != ~s" (first cur) (first old)) :end
:do (format t fmt (first cur)
(second cur) (percent (second cur) (second old))
(third cur) (percent (third cur) (third old)))
(incf c-tot (second cur)) (incf c-tot-s (third cur))
(incf o-tot (second old)) (incf o-tot-s (third old))
:finally (format t fmt "total" c-tot (percent c-tot o-tot)
c-tot-s (percent c-tot-s o-tot-s)))
(format t "~a~:{~15a ~10,5f sec ~10,5f scaled~%~}~@
~15a ~10,5f sec ~10,5f scaled~2%"
(car *cur-stat*) (cdr *cur-stat*) "total"
(reduce #'+ (cdr *cur-stat*) :key #'second)
(reduce #'+ (cdr *cur-stat*) :key #'third)))
(when log (dribble))
(when save
(with-open-file (s save :direction :output)
(with-standard-io-syntax
(write *cur-stat* :stream s :pretty t)
(terpri s)))))
(format t "~& Running the benchmarks:~@
For running the compiled benchmarks, use (benchmarks :compiled)~@
For running the interpreted benchmarks, use (benchmarks :interpreted)~%")
clisp-2.49.20170913/benchmarks/stak.lisp 0000664 0000000 0000000 00000001574 13156463772 0017464 0 ustar 00root root 0000000 0000000 ;;; STAK -- The TAKeuchi function with special variables instead of
;;; parameter passing.
(defvar stak-x)
(defvar stak-y)
(defvar stak-z)
(proclaim '(fixnum stak-x stak-y stak-z))
(defun stak (stak-x stak-y stak-z)
(stak-aux))
(defun stak-aux ()
(if (not (< stak-y stak-x))
stak-z
(let ((stak-x (let ((stak-x (the fixnum (1- stak-x)))
(stak-y stak-y)
(stak-z stak-z))
(stak-aux)))
(stak-y (let ((stak-x (the fixnum (1- stak-y)))
(stak-y stak-z)
(stak-z stak-x))
(stak-aux)))
(stak-z (let ((stak-x (the fixnum (1- stak-z)))
(stak-y stak-x)
(stak-z stak-y))
(stak-aux))))
(stak-aux))))
;;; call: (stak 18. 12. 6.))
clisp-2.49.20170913/benchmarks/stream.lisp 0000664 0000000 0000000 00000002756 13156463772 0020020 0 ustar 00root root 0000000 0000000 ;; Benchmark for Common Lisp
;; Bernhard Degel, Bruno Haible 1989
;; "Stream" = NIL or List (x1 x2 ... xn . y),
;; with n>0 and y either NIL or a function,
;; which returns a stream (xn+1 ...).
;; first element of a non-empty stream:
(defun stream-head (s) (car s))
;; rest of a non-empty stream:
(defun stream-tail (s)
(if (listp (cdr s)) (cdr s) (setf (cdr s) (funcall (cdr s)))))
;; return non-empty stream with first element x and rest-list y,
(defmacro stream-cons (x y)
`(cons ,x #'(lambda () ,y)))
;; return a stream with elements from s that satisfy pred
(defun stream-filter (pred s)
(cond ((null s) nil)
((funcall pred (stream-head s))
(stream-cons (stream-head s) (stream-filter pred (stream-tail s))))
(t (stream-filter pred (stream-tail s)))))
;; return the n-th element (n>=0) of a stream.
(defun stream-nth (n s)
(if (zerop n)
(stream-head s)
(stream-nth (1- n) (stream-tail s))))
;; return the stream of all integers from n
(defun integers (n)
(stream-cons n (integers (1+ n))))
;; sieve out of a stream all elements that are divisible by the first element
(defun sieve (s)
(if (null s)
nil
(let ((p (stream-head s)))
(stream-cons
p
(stream-filter #'(lambda (n) (not (zerop (mod n p))))
(sieve (stream-tail s)))))))
;; return the n-th prime number (n>=1).
(defun nth-prime (n)
(stream-nth (1- n) (sieve (integers 2))))
;;(time (nth-prime 10))
;;(time (nth-prime 20))
;;(time (nth-prime 50))
clisp-2.49.20170913/benchmarks/tak.lisp 0000664 0000000 0000000 00000000660 13156463772 0017274 0 ustar 00root root 0000000 0000000 (defun tak (x y z)
(declare (fixnum x y z))
(cond ((not (< y x)) z)
(t
(tak
(tak (the fixnum (1- x)) y z)
(tak (the fixnum (1- y)) z x)
(tak (the fixnum (1- z)) x y)))))
(defun tak-test ()
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6)
(tak 18 12 6))
clisp-2.49.20170913/benchmarks/takl.lisp 0000664 0000000 0000000 00000000753 13156463772 0017453 0 ustar 00root root 0000000 0000000 ;;; TAKL benchmark
(defun listn (n)
(declare (type fixnum n))
(if (not (= 0 n))
(cons n (listn (the fixnum (1- n))))))
(defvar ll-18 (listn 18))
(defvar ll-12 (listn 12))
(defvar ll-6 (listn 6))
(defun mas (x y z)
(if (not (shorterp y x))
z
(mas (mas (cdr x) y z)
(mas (cdr y) z x)
(mas (cdr z) x y))))
(defun shorterp (x y)
(and y (or (null x)
(shorterp (cdr x) (cdr y)))))
(defun mas-bench () (mas ll-18 ll-12 ll-6))
clisp-2.49.20170913/benchmarks/takr.lisp 0000664 0000000 0000000 00000056027 13156463772 0017466 0 ustar 00root root 0000000 0000000 ;;; TAKR -- 100 function (count `em) version of TAK that tries to defeat cache
;;; memory effects. Results should be the same as for TAK on stack machines.
;;; Distribution of calls is not completely flat.
;;; call: (tak0 18. 12. 6.)
(defun tak0 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak1 (tak37 (the fixnum (1- x)) y z)
(tak11 (the fixnum (1- y)) z x)
(tak17 (the fixnum (1- z)) x y)))))
(defun tak1 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak2 (tak74 (the fixnum (1- x)) y z)
(tak22 (the fixnum (1- y)) z x)
(tak34 (the fixnum (1- z)) x y)))))
(defun tak2 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak3 (tak11 (the fixnum (1- x)) y z)
(tak33 (the fixnum (1- y)) z x)
(tak51 (the fixnum (1- z)) x y)))))
(defun tak3 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak4 (tak48 (the fixnum (1- x)) y z)
(tak44 (the fixnum (1- y)) z x)
(tak68 (the fixnum (1- z)) x y)))))
(defun tak4 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak5 (tak85 (the fixnum (1- x)) y z)
(tak55 (the fixnum (1- y)) z x)
(tak85 (the fixnum (1- z)) x y)))))
(defun tak5 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak6 (tak22 (the fixnum (1- x)) y z)
(tak66 (the fixnum (1- y)) z x)
(tak2 (the fixnum (1- z)) x y)))))
(defun tak6 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak7 (tak59 (the fixnum (1- x)) y z)
(tak77 (the fixnum (1- y)) z x)
(tak19 (the fixnum (1- z)) x y)))))
(defun tak7 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak8 (tak96 (the fixnum (1- x)) y z)
(tak88 (the fixnum (1- y)) z x)
(tak36 (the fixnum (1- z)) x y)))))
(defun tak8 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak9 (tak33 (the fixnum (1- x)) y z)
(tak99 (the fixnum (1- y)) z x)
(tak53 (the fixnum (1- z)) x y)))))
(defun tak9 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak10 (tak70 (the fixnum (1- x)) y z)
(tak10 (the fixnum (1- y)) z x)
(tak70 (the fixnum (1- z)) x y)))))
(defun tak10 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak11 (tak7 (the fixnum (1- x)) y z)
(tak21 (the fixnum (1- y)) z x)
(tak87 (the fixnum (1- z)) x y)))))
(defun tak11 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak12 (tak44 (the fixnum (1- x)) y z)
(tak32 (the fixnum (1- y)) z x)
(tak4 (the fixnum (1- z)) x y)))))
(defun tak12 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak13 (tak81 (the fixnum (1- x)) y z)
(tak43 (the fixnum (1- y)) z x)
(tak21 (the fixnum (1- z)) x y)))))
(defun tak13 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak14 (tak18 (the fixnum (1- x)) y z)
(tak54 (the fixnum (1- y)) z x)
(tak38 (the fixnum (1- z)) x y)))))
(defun tak14 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak15 (tak55 (the fixnum (1- x)) y z)
(tak65 (the fixnum (1- y)) z x)
(tak55 (the fixnum (1- z)) x y)))))
(defun tak15 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak16 (tak92 (the fixnum (1- x)) y z)
(tak76 (the fixnum (1- y)) z x)
(tak72 (the fixnum (1- z)) x y)))))
(defun tak16 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak17 (tak29 (the fixnum (1- x)) y z)
(tak87 (the fixnum (1- y)) z x)
(tak89 (the fixnum (1- z)) x y)))))
(defun tak17 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak18 (tak66 (the fixnum (1- x)) y z)
(tak98 (the fixnum (1- y)) z x)
(tak6 (the fixnum (1- z)) x y)))))
(defun tak18 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak19 (tak3 (the fixnum (1- x)) y z)
(tak9 (the fixnum (1- y)) z x)
(tak23 (the fixnum (1- z)) x y)))))
(defun tak19 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak20 (tak40 (the fixnum (1- x)) y z)
(tak20 (the fixnum (1- y)) z x)
(tak40 (the fixnum (1- z)) x y)))))
(defun tak20 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak21 (tak77 (the fixnum (1- x)) y z)
(tak31 (the fixnum (1- y)) z x)
(tak57 (the fixnum (1- z)) x y)))))
(defun tak21 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak22 (tak14 (the fixnum (1- x)) y z)
(tak42 (the fixnum (1- y)) z x)
(tak74 (the fixnum (1- z)) x y)))))
(defun tak22 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak23 (tak51 (the fixnum (1- x)) y z)
(tak53 (the fixnum (1- y)) z x)
(tak91 (the fixnum (1- z)) x y)))))
(defun tak23 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak24 (tak88 (the fixnum (1- x)) y z)
(tak64 (the fixnum (1- y)) z x)
(tak8 (the fixnum (1- z)) x y)))))
(defun tak24 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak25 (tak25 (the fixnum (1- x)) y z)
(tak75 (the fixnum (1- y)) z x)
(tak25 (the fixnum (1- z)) x y)))))
(defun tak25 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak26 (tak62 (the fixnum (1- x)) y z)
(tak86 (the fixnum (1- y)) z x)
(tak42 (the fixnum (1- z)) x y)))))
(defun tak26 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak27 (tak99 (the fixnum (1- x)) y z)
(tak97 (the fixnum (1- y)) z x)
(tak59 (the fixnum (1- z)) x y)))))
(defun tak27 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak28 (tak36 (the fixnum (1- x)) y z)
(tak8 (the fixnum (1- y)) z x)
(tak76 (the fixnum (1- z)) x y)))))
(defun tak28 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak29 (tak73 (the fixnum (1- x)) y z)
(tak19 (the fixnum (1- y)) z x)
(tak93 (the fixnum (1- z)) x y)))))
(defun tak29 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak30 (tak10 (the fixnum (1- x)) y z)
(tak30 (the fixnum (1- y)) z x)
(tak10 (the fixnum (1- z)) x y)))))
(defun tak30 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak31 (tak47 (the fixnum (1- x)) y z)
(tak41 (the fixnum (1- y)) z x)
(tak27 (the fixnum (1- z)) x y)))))
(defun tak31 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak32 (tak84 (the fixnum (1- x)) y z)
(tak52 (the fixnum (1- y)) z x)
(tak44 (the fixnum (1- z)) x y)))))
(defun tak32 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak33 (tak21 (the fixnum (1- x)) y z)
(tak63 (the fixnum (1- y)) z x)
(tak61 (the fixnum (1- z)) x y)))))
(defun tak33 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak34 (tak58 (the fixnum (1- x)) y z)
(tak74 (the fixnum (1- y)) z x)
(tak78 (the fixnum (1- z)) x y)))))
(defun tak34 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak35 (tak95 (the fixnum (1- x)) y z)
(tak85 (the fixnum (1- y)) z x)
(tak95 (the fixnum (1- z)) x y)))))
(defun tak35 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak36 (tak32 (the fixnum (1- x)) y z)
(tak96 (the fixnum (1- y)) z x)
(tak12 (the fixnum (1- z)) x y)))))
(defun tak36 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak37 (tak69 (the fixnum (1- x)) y z)
(tak7 (the fixnum (1- y)) z x)
(tak29 (the fixnum (1- z)) x y)))))
(defun tak37 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak38 (tak6 (the fixnum (1- x)) y z)
(tak18 (the fixnum (1- y)) z x)
(tak46 (the fixnum (1- z)) x y)))))
(defun tak38 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak39 (tak43 (the fixnum (1- x)) y z)
(tak29 (the fixnum (1- y)) z x)
(tak63 (the fixnum (1- z)) x y)))))
(defun tak39 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak40 (tak80 (the fixnum (1- x)) y z)
(tak40 (the fixnum (1- y)) z x)
(tak80 (the fixnum (1- z)) x y)))))
(defun tak40 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak41 (tak17 (the fixnum (1- x)) y z)
(tak51 (the fixnum (1- y)) z x)
(tak97 (the fixnum (1- z)) x y)))))
(defun tak41 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak42 (tak54 (the fixnum (1- x)) y z)
(tak62 (the fixnum (1- y)) z x)
(tak14 (the fixnum (1- z)) x y)))))
(defun tak42 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak43 (tak91 (the fixnum (1- x)) y z)
(tak73 (the fixnum (1- y)) z x)
(tak31 (the fixnum (1- z)) x y)))))
(defun tak43 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak44 (tak28 (the fixnum (1- x)) y z)
(tak84 (the fixnum (1- y)) z x)
(tak48 (the fixnum (1- z)) x y)))))
(defun tak44 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak45 (tak65 (the fixnum (1- x)) y z)
(tak95 (the fixnum (1- y)) z x)
(tak65 (the fixnum (1- z)) x y)))))
(defun tak45 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak46 (tak2 (the fixnum (1- x)) y z)
(tak6 (the fixnum (1- y)) z x)
(tak82 (the fixnum (1- z)) x y)))))
(defun tak46 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak47 (tak39 (the fixnum (1- x)) y z)
(tak17 (the fixnum (1- y)) z x)
(tak99 (the fixnum (1- z)) x y)))))
(defun tak47 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak48 (tak76 (the fixnum (1- x)) y z)
(tak28 (the fixnum (1- y)) z x)
(tak16 (the fixnum (1- z)) x y)))))
(defun tak48 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak49 (tak13 (the fixnum (1- x)) y z)
(tak39 (the fixnum (1- y)) z x)
(tak33 (the fixnum (1- z)) x y)))))
(defun tak49 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak50 (tak50 (the fixnum (1- x)) y z)
(tak50 (the fixnum (1- y)) z x)
(tak50 (the fixnum (1- z)) x y)))))
(defun tak50 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak51 (tak87 (the fixnum (1- x)) y z)
(tak61 (the fixnum (1- y)) z x)
(tak67 (the fixnum (1- z)) x y)))))
(defun tak51 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak52 (tak24 (the fixnum (1- x)) y z)
(tak72 (the fixnum (1- y)) z x)
(tak84 (the fixnum (1- z)) x y)))))
(defun tak52 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak53 (tak61 (the fixnum (1- x)) y z)
(tak83 (the fixnum (1- y)) z x)
(tak1 (the fixnum (1- z)) x y)))))
(defun tak53 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak54 (tak98 (the fixnum (1- x)) y z)
(tak94 (the fixnum (1- y)) z x)
(tak18 (the fixnum (1- z)) x y)))))
(defun tak54 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak55 (tak35 (the fixnum (1- x)) y z)
(tak5 (the fixnum (1- y)) z x)
(tak35 (the fixnum (1- z)) x y)))))
(defun tak55 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak56 (tak72 (the fixnum (1- x)) y z)
(tak16 (the fixnum (1- y)) z x)
(tak52 (the fixnum (1- z)) x y)))))
(defun tak56 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak57 (tak9 (the fixnum (1- x)) y z)
(tak27 (the fixnum (1- y)) z x)
(tak69 (the fixnum (1- z)) x y)))))
(defun tak57 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak58 (tak46 (the fixnum (1- x)) y z)
(tak38 (the fixnum (1- y)) z x)
(tak86 (the fixnum (1- z)) x y)))))
(defun tak58 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak59 (tak83 (the fixnum (1- x)) y z)
(tak49 (the fixnum (1- y)) z x)
(tak3 (the fixnum (1- z)) x y)))))
(defun tak59 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak60 (tak20 (the fixnum (1- x)) y z)
(tak60 (the fixnum (1- y)) z x)
(tak20 (the fixnum (1- z)) x y)))))
(defun tak60 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak61 (tak57 (the fixnum (1- x)) y z)
(tak71 (the fixnum (1- y)) z x)
(tak37 (the fixnum (1- z)) x y)))))
(defun tak61 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak62 (tak94 (the fixnum (1- x)) y z)
(tak82 (the fixnum (1- y)) z x)
(tak54 (the fixnum (1- z)) x y)))))
(defun tak62 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak63 (tak31 (the fixnum (1- x)) y z)
(tak93 (the fixnum (1- y)) z x)
(tak71 (the fixnum (1- z)) x y)))))
(defun tak63 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak64 (tak68 (the fixnum (1- x)) y z)
(tak4 (the fixnum (1- y)) z x)
(tak88 (the fixnum (1- z)) x y)))))
(defun tak64 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak65 (tak5 (the fixnum (1- x)) y z)
(tak15 (the fixnum (1- y)) z x)
(tak5 (the fixnum (1- z)) x y)))))
(defun tak65 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak66 (tak42 (the fixnum (1- x)) y z)
(tak26 (the fixnum (1- y)) z x)
(tak22 (the fixnum (1- z)) x y)))))
(defun tak66 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak67 (tak79 (the fixnum (1- x)) y z)
(tak37 (the fixnum (1- y)) z x)
(tak39 (the fixnum (1- z)) x y)))))
(defun tak67 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak68 (tak16 (the fixnum (1- x)) y z)
(tak48 (the fixnum (1- y)) z x)
(tak56 (the fixnum (1- z)) x y)))))
(defun tak68 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak69 (tak53 (the fixnum (1- x)) y z)
(tak59 (the fixnum (1- y)) z x)
(tak73 (the fixnum (1- z)) x y)))))
(defun tak69 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak70 (tak90 (the fixnum (1- x)) y z)
(tak70 (the fixnum (1- y)) z x)
(tak90 (the fixnum (1- z)) x y)))))
(defun tak70 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak71 (tak27 (the fixnum (1- x)) y z)
(tak81 (the fixnum (1- y)) z x)
(tak7 (the fixnum (1- z)) x y)))))
(defun tak71 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak72 (tak64 (the fixnum (1- x)) y z)
(tak92 (the fixnum (1- y)) z x)
(tak24 (the fixnum (1- z)) x y)))))
(defun tak72 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak73 (tak1 (the fixnum (1- x)) y z)
(tak3 (the fixnum (1- y)) z x)
(tak41 (the fixnum (1- z)) x y)))))
(defun tak73 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak74 (tak38 (the fixnum (1- x)) y z)
(tak14 (the fixnum (1- y)) z x)
(tak58 (the fixnum (1- z)) x y)))))
(defun tak74 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak75 (tak75 (the fixnum (1- x)) y z)
(tak25 (the fixnum (1- y)) z x)
(tak75 (the fixnum (1- z)) x y)))))
(defun tak75 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak76 (tak12 (the fixnum (1- x)) y z)
(tak36 (the fixnum (1- y)) z x)
(tak92 (the fixnum (1- z)) x y)))))
(defun tak76 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak77 (tak49 (the fixnum (1- x)) y z)
(tak47 (the fixnum (1- y)) z x)
(tak9 (the fixnum (1- z)) x y)))))
(defun tak77 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak78 (tak86 (the fixnum (1- x)) y z)
(tak58 (the fixnum (1- y)) z x)
(tak26 (the fixnum (1- z)) x y)))))
(defun tak78 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak79 (tak23 (the fixnum (1- x)) y z)
(tak69 (the fixnum (1- y)) z x)
(tak43 (the fixnum (1- z)) x y)))))
(defun tak79 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak80 (tak60 (the fixnum (1- x)) y z)
(tak80 (the fixnum (1- y)) z x)
(tak60 (the fixnum (1- z)) x y)))))
(defun tak80 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak81 (tak97 (the fixnum (1- x)) y z)
(tak91 (the fixnum (1- y)) z x)
(tak77 (the fixnum (1- z)) x y)))))
(defun tak81 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak82 (tak34 (the fixnum (1- x)) y z)
(tak2 (the fixnum (1- y)) z x)
(tak94 (the fixnum (1- z)) x y)))))
(defun tak82 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak83 (tak71 (the fixnum (1- x)) y z)
(tak13 (the fixnum (1- y)) z x)
(tak11 (the fixnum (1- z)) x y)))))
(defun tak83 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak84 (tak8 (the fixnum (1- x)) y z)
(tak24 (the fixnum (1- y)) z x)
(tak28 (the fixnum (1- z)) x y)))))
(defun tak84 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak85 (tak45 (the fixnum (1- x)) y z)
(tak35 (the fixnum (1- y)) z x)
(tak45 (the fixnum (1- z)) x y)))))
(defun tak85 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak86 (tak82 (the fixnum (1- x)) y z)
(tak46 (the fixnum (1- y)) z x)
(tak62 (the fixnum (1- z)) x y)))))
(defun tak86 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak87 (tak19 (the fixnum (1- x)) y z)
(tak57 (the fixnum (1- y)) z x)
(tak79 (the fixnum (1- z)) x y)))))
(defun tak87 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak88 (tak56 (the fixnum (1- x)) y z)
(tak68 (the fixnum (1- y)) z x)
(tak96 (the fixnum (1- z)) x y)))))
(defun tak88 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak89 (tak93 (the fixnum (1- x)) y z)
(tak79 (the fixnum (1- y)) z x)
(tak13 (the fixnum (1- z)) x y)))))
(defun tak89 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak90 (tak30 (the fixnum (1- x)) y z)
(tak90 (the fixnum (1- y)) z x)
(tak30 (the fixnum (1- z)) x y)))))
(defun tak90 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak91 (tak67 (the fixnum (1- x)) y z)
(tak1 (the fixnum (1- y)) z x)
(tak47 (the fixnum (1- z)) x y)))))
(defun tak91 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak92 (tak4 (the fixnum (1- x)) y z)
(tak12 (the fixnum (1- y)) z x)
(tak64 (the fixnum (1- z)) x y)))))
(defun tak92 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak93 (tak41 (the fixnum (1- x)) y z)
(tak23 (the fixnum (1- y)) z x)
(tak81 (the fixnum (1- z)) x y)))))
(defun tak93 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak94 (tak78 (the fixnum (1- x)) y z)
(tak34 (the fixnum (1- y)) z x)
(tak98 (the fixnum (1- z)) x y)))))
(defun tak94 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak95 (tak15 (the fixnum (1- x)) y z)
(tak45 (the fixnum (1- y)) z x)
(tak15 (the fixnum (1- z)) x y)))))
(defun tak95 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak96 (tak52 (the fixnum (1- x)) y z)
(tak56 (the fixnum (1- y)) z x)
(tak32 (the fixnum (1- z)) x y)))))
(defun tak96 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak97 (tak89 (the fixnum (1- x)) y z)
(tak67 (the fixnum (1- y)) z x)
(tak49 (the fixnum (1- z)) x y)))))
(defun tak97 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak98 (tak26 (the fixnum (1- x)) y z)
(tak78 (the fixnum (1- y)) z x)
(tak66 (the fixnum (1- z)) x y)))))
(defun tak98 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak99 (tak63 (the fixnum (1- x)) y z)
(tak89 (the fixnum (1- y)) z x)
(tak83 (the fixnum (1- z)) x y)))))
(defun tak99 (x y z)
(declare (type fixnum x y z))
(cond ((not (< y x)) z)
(t (tak0 (tak0 (the fixnum (1- x)) y z)
(tak0 (the fixnum (1- y)) z x)
(tak0 (the fixnum (1- z)) x y)))))
clisp-2.49.20170913/benchmarks/tprint.lisp 0000664 0000000 0000000 00000002360 13156463772 0020034 0 ustar 00root root 0000000 0000000 ;;; TPRINT -- Benchmark to print and read to the terminal.
(defvar tprint-test-atoms '(abc1 cde2 efg3 ghi4 ijk5 klm6 mno7 opq8 qrs9
stu0 uvw1 wxy2 \yz3 \123a \234b \345c \456d \567d
\678e \789f \890g))
(defun tprint-init (m n atoms)
(declare (fixnum m n))
(let ((atoms (subst () () atoms)))
(do ((a atoms (cdr a)))
((null (cdr a)) (rplacd a atoms)))
(tprint-init-aux m n atoms)))
(defun tprint-init-aux (m n atoms)
(declare (fixnum m n))
(cond ((= m 0) (pop atoms))
(t (do ((i n (the fixnum (- (the fixnum i) 2)))
(a ()))
((< (the fixnum i) 1) a)
(declare (fixnum i))
(push (pop atoms) a)
(push (tprint-init-aux (the fixnum (1- m))
n atoms) a)))))
(defvar tprint-test-pattern (tprint-init 6. 6. tprint-test-atoms))
;;; call: (print test-pattern)
;;; This will be slower (ha,ha) but won't return that awful
;;; thing that breaks the screen editors.
(defun tprint-test (&optional (repeat 1))
(let ((out "tprint-out.tmp"))
(with-open-file (s out :direction :output)
(loop :repeat repeat :do (print tprint-test-pattern s)))
(delete-file out)
t))
clisp-2.49.20170913/benchmarks/traverse.lisp 0000664 0000000 0000000 00000010335 13156463772 0020350 0 ustar 00root root 0000000 0000000 ;;; TRAVERSE -- Benchmark which creates and traverses a tree structure.
(eval-when (eval compile load)
(defstruct node
(parents ())
(sons ())
(sn (snb))
(entry1 ())
(entry2 ())
(entry3 ())
(entry4 ())
(entry5 ())
(entry6 ())
(mark ()))
)
(defvar traverse-sn 0)
(defvar traverse-rand 21.)
(defvar traverse-count 0)
(proclaim `(type fixnum traverse-sn traverse-rand traverse-count))
(defvar traverse-marker nil)
(defvar traverse-root)
(setq traverse-sn 0 traverse-rand 21 traverse-count 0 traverse-marker nil)
(defun snb ()
(setq traverse-sn (the fixnum (1+ traverse-sn))))
(defun traverse-seed ()
(setq traverse-rand 21.))
(defun traverse-random ()
(setq traverse-rand
(the fixnum (rem (the fixnum (* traverse-rand 17)) 251))))
(defun traverse-remove (n q)
(declare (type fixnum n))
(cond ((eq (cdr (car q)) (car q))
(prog2 () (caar q) (rplaca q ())))
((= n 0)
(prog2 () (caar q)
(do ((p (car q) (cdr p)))
((eq (cdr p) (car q))
(rplaca q
(rplacd p (cdr (car q))))))))
(t (do ((n n (the fixnum (1- n)))
(q (car q) (cdr q))
(p (cdr (car q)) (cdr p)))
((= n 0) (prog2 () (car q) (rplacd q p)))
(declare (type fixnum n))))))
(defun traverse-select (n q)
(declare (type fixnum n))
(do ((n n (the fixnum (1- n)))
(q (car q) (cdr q)))
((= n 0) (car q))
(declare (type fixnum n))))
(defun traverse-add (a q)
(cond ((null q)
`(,(let ((x `(,a)))
(rplacd x x) x)))
((null (car q))
(let ((x `(,a)))
(rplacd x x)
(rplaca q x)))
(t (rplaca q
(rplacd (car q) `(,a .,(cdr (car q))))))))
(defun traverse-create-structure (n)
(declare (type fixnum n))
(let ((a `(,(make-node))))
(do ((m (the fixnum (1- n)) (the fixnum (1- m)))
(p a))
((= m 0) (setq a `(,(rplacd p a)))
(do ((unused a)
(used (traverse-add (traverse-remove 0 a) ()))
(x) (y))
((null (car unused))
(find-root (traverse-select 0 used) n))
(setq x (traverse-remove
(the fixnum (rem (the fixnum (traverse-random)) n))
unused))
(setq y (traverse-select
(the fixnum (rem (the fixnum (traverse-random)) n))
used))
(traverse-add x used)
(setf (node-sons y) `(,x .,(node-sons y)))
(setf (node-parents x) `(,y .,(node-parents x))) ))
(declare (type fixnum m))
(push (make-node) a))))
(defun find-root (node n)
(declare (type fixnum n))
(do ((n n (the fixnum (1- n))))
((= n 0) node)
(declare (type fixnum n))
(cond ((null (node-parents node))
(return node))
(t (setq node (car (node-parents node)))))))
(defun travers (node mark)
(cond ((eq (node-mark node) mark) ())
(t (setf (node-mark node) mark)
(setq traverse-count (the fixnum (1+ traverse-count)))
(setf (node-entry1 node) (not (node-entry1 node)))
(setf (node-entry2 node) (not (node-entry2 node)))
(setf (node-entry3 node) (not (node-entry3 node)))
(setf (node-entry4 node) (not (node-entry4 node)))
(setf (node-entry5 node) (not (node-entry5 node)))
(setf (node-entry6 node) (not (node-entry6 node)))
(do ((sons (node-sons node) (cdr sons)))
((null sons) ())
(travers (car sons) mark)))))
(defun traverse (traverse-root)
(let ((traverse-count 0))
(declare (type fixnum traverse-count))
(travers traverse-root
(setq traverse-marker (not traverse-marker)))
traverse-count))
(defun init-traverse()
(setq traverse-root (traverse-create-structure 100.))
nil)
(defun run-traverse ()
(do ((i 50 (the fixnum (1- (the fixnum i)))))
((= (the fixnum i) 0))
(declare (type fixnum i))
(traverse traverse-root)
(traverse traverse-root)
(traverse traverse-root)
(traverse traverse-root)
(traverse traverse-root)))
;;; to initialize, call: (init-traverse)
;;; to run traverse, call: (run-traverse)
clisp-2.49.20170913/benchmarks/triang.lisp 0000664 0000000 0000000 00000005513 13156463772 0020003 0 ustar 00root root 0000000 0000000 ;;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: LUCID; Base: 10 -*- ;;;
;;;;TRIANG -- Board game benchmark.
(proclaim '(type simple-vector
triang-board triang-sequence triang-a triang-b triang-c))
(proclaim '(special triang-board triang-sequence triang-a triang-b triang-c
))
(setq triang-board (make-array 16. :initial-element 1))
(setq triang-sequence (make-array 14. :initial-element 0))
(setq triang-a
(make-array 37. :initial-contents '(1 2 4 3 5 6 1 3 6 2 5 4
11 12 13 7 8 4 4 7 11
8 12 13 6 10 15 9 14
13 13 14 15 9 10 6 6
)))
(setq triang-b
(make-array 37. :initial-contents '(2 4 7 5 8 9 3 6 10 5
9 8 12 13 14 8 9 5
2 4 7 5 8 9 3 6 10 5
9 8 12 13 14 8 9
5 5)))
(setq triang-c
(make-array 37. :initial-contents '(4 7 11 8 12 13 6 10
15 9 14 13 13 14
15 9 10 6 1 2 4 3 5 6
1 3 6 2 5 4 11 12 13
7 8 4 4)))
(defvar triang-answer)
(defvar triang-final)
(setf (aref triang-board 5) 0)
(defun triang-last-position ()
(do ((i 1 (1+ i)))
((= i 16.) 0)
(declare (fixnum i))
(if (= 1 (the fixnum (aref triang-board i)))
(return i))))
(defun triang-try (i depth)
(declare (type fixnum i depth))
(cond ((= depth 14)
(let ((lp (triang-last-position)))
(unless (member lp triang-final)
(push lp triang-final)))
(push (cdr (map 'list #'identity triang-sequence)) triang-answer) t)
((and (= 1 (the fixnum (aref triang-board (aref triang-a i))))
(= 1 (the fixnum (aref triang-board (aref triang-b i))))
(= 0 (the fixnum (aref triang-board (aref triang-c i)))))
(setf (aref triang-board (aref triang-a i)) 0)
(setf (aref triang-board (aref triang-b i)) 0)
(setf (aref triang-board (aref triang-c i)) 1)
(setf (aref triang-sequence depth) i)
(do ((j 0 (1+ j))
(depth (1+ depth)))
((or (= j 36.)
(triang-try j depth)) ())
(declare (type fixnum j)))
(setf (aref triang-board (aref triang-a i)) 1)
(setf (aref triang-board (aref triang-b i)) 1)
(setf (aref triang-board (aref triang-c i)) 0) ())))
(defun gogogo (i)
(declare (type fixnum i))
(let ((triang-answer ())
(triang-final ()))
(triang-try i 1)))
clisp-2.49.20170913/configure 0000775 0000000 0000000 00000071660 13156463772 0015426 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Usage: configure [options] [dirname [cc]]
# Examples:
# configure obj
# CC=gcc configure make.gcc
# CC=cc configure make.cc
# configure make.gcc gcc (deprecated)
# configure make.cc cc (deprecated)
# we source config.cache, therefore this file must be executed by the
# same shell as executes sub-configures.
# this is a real problem on such systems as Solaris if CONFIG_SHELL is
# bash whose config.cache cannot be loaded by /bin/sh
if test -z "${CONFIG_SHELL}" && test "`uname -s`" = SunOS; then
# On Solaris, /bin/sh is broken. We need bash.
if test -f /bin/bash; then
CONFIG_SHELL=/bin/bash
else
CONFIG_SHELL=`which bash`
fi
export CONFIG_SHELL
fi
if test -n "${CONFIG_SHELL}"; then
# ensure that CONFIG_SHELL is compatible with /bin/sh:
# if CONFIG_SHELL is bash, but /bin/sh is not, restart with bash
if test -n "`${CONFIG_SHELL} --version 2>/dev/null | grep bash 2>/dev/null`"
then # CONFIG_SHELL is bash
test -n "${BASH_VERSION}" || exec ${CONFIG_SHELL} $0 $*
fi
else
CONFIG_SHELL=/bin/sh
fi
# Download location of the newest libsigsegv release.
libsigsegv_url='https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.11.tar.gz'
fail () { echo "$*" >&2; exit 1; }
info_help () {
cat << \EOP
Usage: configure [options] [dirname]
dirname: Name of directory in which to build CLISP. This allows you to build
CLISP with different compilers on the same machine or for different
architectures in the same filesystem, sharing the same source.
Default is "src".
options: The following options are recognized:
--help print this message and exit
--version print the CLISP version and exit
--config unix/INSTALL step 3: configuration only
--cbc unix/INSTALL steps 3-8: Configure, Build, Check
The following options set installation parameters:
--srcdir=SRCDIR sets the source directory to SRCDIR
The following options are passed to subordinate `configure' scripts:
--quiet, --silent do not print `checking...' messages
Installation directories:
--prefix=PREFIX base directory for files to be installed
--exec-prefix=PREFIX base directory for architecture-dependent
files to be installed
--fsstnd=STYLE specify file system standard for installation
Fine tuning of the installation directories:
--bindir=DIR user executables
--libdir=DIR object code libraries
--includedir=DIR C header files
--datarootdir=DIR read-only arch.-independent data root
--datadir=DIR read-only architecture-independent data
--localedir=DIR locale-dependent data
--mandir=DIR man documentation
--infodir=DIR info documentation
--docdir=DIR documentation root
--htmldir=DIR html documentation
--dvidir=DIR TeX DVI documentation
--pdfdir=DIR PDF documentation
--psdir=DIR PostScript documentation
--elispdir=DIR Emacs Lisp files
--vimdir=DIR VIM files
--aclocaldir=DIR autoconf files
Enable and disable specific packages
--with-PACKAGE use PACKAGE
--without-PACKAGE do not use PACKAGE
PACKAGEs available (the default is the opposite of the following):
--without-ffcall do not support Foreign Function Interface
the default is to support it when available
--without-dynamic-modules no Dynamic Modules support
--without-unicode no Unicode support: character=8bit
--without-readline do not link with GNU readline
--with-threads=FLAVOR support multiple threads in one CLISP image
via OS threads [highly experimental - use at your own risk]
FLAVOR: POSIX_THREADS SOLARIS_THREADS WIN32_THREADS
--with-jitc=FLAVOR use a given Just-In-Time Compiler.
The only flavor at this time is lightning
(GNU lightning must be installed in the standard place).
--with-module=MODULE build with add-on MODULE
--help-modules list the modules included in the distribution
and information on building them
--hyperspec=URL the path to the Common Lisp HyperSpec (the default is
http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/
or the value of the environment variable CLHSROOT, if set)
--enable-portability favour portability over optimization: disable
optimizations that could lead to build failures
--with-gmalloc use the GNU malloc instead of of the libc one
(needed on HP-UX and OpenBSD)
--with-debug if you will need to debug the C sources
--edit-config edit config.lisp with ${EDITOR:-vi} before make
(useful with --cbc)
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
You can specify the location of dependencies using
EOP
`dirname $0`/src/configure --help | grep 'with.*prefix'
cat << \EOP
See also the --help-modules option.
Example:
configure --cbc built-with-gcc
su bin
cd built-with-gcc
make install
exit
Specifying the C compiler:
If you wish to specify the C compiler that will get used to build
CLISP, set the environment variables CC, CFLAGS, LIBS.
Put compiler flags that have to be passed to the preprocessor
into the CC variable, not the CFLAGS variable.
For example, if you want to use gcc in ANSI C mode,
execute the following before calling `configure':
setenv CC "gcc -ansi" if using csh
export CC="gcc -ansi" if using bash or ksh
CC="gcc -ansi"; export CC if using sh
If you have headers in a nonstandard directory
set CPPFLAGS to "-I"
If you have libraries in a nonstandard directory
set LDFLAGS to "-L"
Using GNU libiconv (only needed if you do not have GNU LIBC 2.2 or better):
If you want to use GNU libiconv which is not installed system-wide,
you may supply a --with-libiconv-prefix argument
(type './src/configure --help' for details).
The same goes for non-standard locations of libintl and libsigsegv.
EOP
}
# Abort in case something fails.
set -e
# Nuisances.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
srcdir=''
# http://www.gnu.org/software/autoconf/manual/html_node/Option-Checking.html
subdir_configure_args='--disable-option-checking'
have_explicit_libsigsegv_args=false
have_explicit_libffcall_args=false
makemake_args=''
do_config=''
do_cbc=''
argcount=0
edit_config=''
prev=''
passnext=''
do_ffi='default'
target=''
ignore_absence_of_libsigsegv=''
prefix="/usr/local"
exec_prefix=${prefix}
getarg(){ echo "$1" | sed 's,^[-_a-zA-Z0-9]*=,,'; }
all_modules=''
note_module(){
all_modules=${all_modules}" $1"
makemake_args=${makemake_args}" --with-module=$1"
}
explicit_prefix=''
note_prefix(){
explicit_prefix="$1"
}
for arg # in "$@"
do
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
# If the previous option needs an argument for subdir configures or
# makemake, pass it, otherwise set the variable
case "$passnext" in
configure)
subdir_configure_args="$subdir_configure_args $arg"
;;
makemake)
makemake_args="$makemake_args$arg"
;;
both)
makemake_args="$makemake_args$arg"
subdir_configure_args="$subdir_configure_args $arg"
if test "$prev" = prefix; then
note_prefix "$arg"
fi
;;
with-module)
note_module $arg
;;
*) eval "$prev=\$arg" ;;
esac
passnext=''
prev=''
else
case "$arg" in
--cbc | --cb)
do_config=1
do_cbc=1 ;;
--config | --confi | --conf | --con | --co)
do_config=1 ;;
--edit-config | --edit-confi | --edit-conf | --edit-con | --edit-co | \
--edit-c | --edit- | --edit | --edi | --ed)
edit_config=1 ;;
--help | --hel | --he)
info_help
exit 0 ;;
--version | --versio | --versi | --vers | --ver | --ve | --v)
./src/configure --version
exit 0 ;;
--help-modules | --help-module | --help-modul | --help-modu | --help-mod | --help-mo | --help-m)
set +e
MODDIR=modules
echo "module sets found in the directory '${MODDIR}':"
MODLIST=`find ${MODDIR} -name link.sh -o -name link.sh.in | sed -e 's,^${MODDIR}/,,' -e 's,/[^/]*$,,' | sort`
for m in ${MODLIST}; do echo " "${m}; done
echo "to specify the location of external software:"
for m in src ${MODLIST}; do
CFG=./${m}/configure
if [ -x ${CFG} ]; then
tmp=${CFG}.with
${CFG} --help | grep ' --with-[a-zA-Z0-8]*-prefix' > ${tmp}
if test -s ${tmp}; then
echo "* ${m} (try also '${CFG} --help')"
cat ${tmp}
fi
rm -f ${tmp}
fi
done
exit 0 ;;
--srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=`getarg "$arg"` ;;
--srcdir | --srcdi | --srcd | --src | --sr)
prev=srcdir
passnext=configure ;;
--prefix=* | --prefi=* | --pref=* | --pre=* | --pr=*)
subdir_configure_args="$subdir_configure_args $arg"
prefix=`getarg "$arg"`
note_prefix "${prefix}"
makemake_args="$makemake_args --prefix=${prefix}" ;;
--prefix | --prefi | --pref | --pre | --pr)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --prefix="
prev=prefix
passnext=both ;;
--exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | -exec=* | --exe=* | --ex=*)
subdir_configure_args="$subdir_configure_args $arg"
exec_prefix=`getarg "$arg"`
makemake_args="$makemake_args --exec-prefix="${exec_prefix} ;;
--exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | -exec | --exe | --ex)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --exec-prefix="
prev=exec_prefix
passnext=both ;;
--fsstnd=* | --fsstn=* | --fsst=* | --fss=* | --fs=* | --f=*)
makemake_args="$makemake_args --fsstnd="`getarg "$arg"` ;;
--bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --bindir="`getarg "$arg"` ;;
--bindir | --bindi | --bind | --bin | --bi)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --bindir="
prev=bindir
passnext=both ;;
--libdir=* | --libdi=* | --libd=* | --lib=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --libdir="`getarg "$arg"` ;;
--libdir | --libdi | --libd | --lib)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --libdir="
prev=libdir
passnext=both ;;
--includedir=* | --includedi=* | --included=* | --include=* | --includ=* | --inclu=* | --incl=* | --inc=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --includedir="`getarg "$arg"` ;;
--includedir | --includedi | --included | --include | --includ | --inclu | --incl | --inc)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --includedir="
prev=includedir
passnext=both ;;
--datarootdir=* | --datarootdi=* | --datarootd=* | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datarootdir="`getarg "$arg"` ;;
--datarootdir | --datarootdi | --datarootd | --dataroot | --dataroo | --dataro | --datar)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datarootdir="
prev=datarootdir
passnext=both ;;
--datadir=* | --datadi=* | --datad=* | --data=* | --dat=* | --da=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datadir="`getarg "$arg"` ;;
--datadir | --datadi | --datad | --data | --dat | --da)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datadir="
prev=datadir
passnext=both ;;
--localedir=* | --localedi=* | --localed=* | --locale=* | --local=* | --loca=* | --loc=* | --lo=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --localedir="`getarg "$arg"` ;;
--localedir | --localedi | --localed | --locale | --local | --loca | --loc | --lo)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --localedir="
prev=localedir
passnext=both ;;
--docdir=* | --docdi=* | --docd=* | --doc=* | --do=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --docdir="`getarg "$arg"` ;;
--docdir | --docdi | --docd | --doc | --do)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --docdir="
prev=docdir
passnext=both ;;
--mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --mandir="`getarg "$arg"` ;;
--mandir | --mandi | --mand | --man | --ma | --m)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --mandir="
prev=mandir
passnext=both ;;
--infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --infodir="`getarg "$arg"` ;;
--infodir | --infodi | --infod | --info | --inf)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --infodir="
prev=infodir
passnext=both ;;
--htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* | --ht=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --htmldir="`getarg "$arg"` ;;
--htmldir | --htmldi | --htmld | --html | --htm | --ht)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --htmldir="
prev=htmldir
passnext=both ;;
--dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --dvidir="`getarg "$arg"` ;;
--dvidir | --dvidi | --dvid | --dvi | --dv)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --dvidir="
prev=dvidir
passnext=both ;;
--psdir=* | --psdi=* | --psd=* | --ps=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --psdir="`getarg "$arg"` ;;
--psdir | --psdi | --psd | --ps)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --psdir="
prev=psdir
passnext=both ;;
--pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --pdfdir="`getarg "$arg"` ;;
--pdfdir | --pdfdi | --pdfd | --pdf | --pd)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --pdfdir="
prev=pdfdir
passnext=both ;;
--elispdir=* | --elispdi=* | --elispd=* | --elisp=* | --elis=* | --eli=* | --el=*)
makemake_args="$makemake_args --elispdir="`getarg "$arg"` ;;
--elispdir | --elispdi | --elispd | --elisp | --elis | --eli | --el)
makemake_args="$makemake_args --elispdir="
prev=elispdir
passnext=makemake ;;
--vimdir=* | --vimdi=* | --vimd=* | --vim=* | --vi=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --vimdir="`getarg "$arg"` ;;
--vimdir | --vimdi | --vimd | --vim | --vi)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --vimdir="
prev=vimdir
passnext=both ;;
--aclocaldir=* | --aclocaldi=* | --aclocald=* | --aclocal=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --aclocaldir="`getarg "$arg"` ;;
--aclocaldir | --aclocaldi | --aclocald | --aclocal)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --aclocaldir="
prev=aclocaldir
passnext=both ;;
--hyperspec=* | --hyperspe=* | --hypersp=* | --hypers=* | --hs=* | --hy=*)
makemake_args="$makemake_args --hyperspec="`getarg "$arg"` ;;
--quiet | --quie | --qui | --qu | --q | \
--silent | --silen | --sile | --sil | --si)
subdir_configure_args="$subdir_configure_args $arg" ;;
--host=* | --hos=* | --ho=*)
subdir_configure_args="$subdir_configure_args $arg" ;;
--host | --hos | --ho)
subdir_configure_args="$subdir_configure_args $arg"
prev=host
passnext=configure ;;
--build=* | --buil=* | --bui=* | --bu=*)
subdir_configure_args="$subdir_configure_args $arg" ;;
--build | --buil | --bui | --bu)
subdir_configure_args="$subdir_configure_args $arg"
prev=build
passnext=configure ;;
--with-debug)
makemake_args="--verbose=yes --with-debug $makemake_args" ;;
--without-ffcall | --with-ffcall=no | --with-no-ffcall)
subdir_configure_args="$subdir_configure_args $arg"
do_ffi="no" ;;
--with-ffcall | --with-ffcall=yes)
subdir_configure_args="$subdir_configure_args $arg"
do_ffi="yes" ;;
--without-dynamic-modules | --with-dynamic-modules=no)
makemake_args="--with-dynamic-modules=no ${makemake_args}" ;;
--with-mingw | --with-no-cygwin | --without-cygwin | --with-cygwin=no)
echo "$0: $arg is deprecated; use --build= or CC=... instead"
CC="${CC:-gcc} -mno-cygwin"; export CC;
makemake_args="$makemake_args --win32gcc" ;;
--with-module=*) note_module `getarg $arg` ;;
--with-module)
prev=with-module
passnext=with-module ;;
--with-* | --without-*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args $arg"
case "$arg" in
--with-libsigsegv-prefix* | --without-libsigsegv-prefix*) have_explicit_libsigsegv_args=true ;;
--with-libffcall-prefix* | --without-libffcall-prefix*) have_explicit_libffcall_args=true ;;
esac
;;
--enable-* | --disable-*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args $arg" ;;
--ignore-absence-of-libsigsegv)
ignore_absence_of_libsigsegv=yes ;;
-*)
fail "$0: invalid argument $arg
$0: Try \`$0 --help'" ;;
*=*) # set a variable
var=`echo $arg | sed 's/\([^=]*\)=.*/\1/'`
val=`echo $arg | sed 's/[^=]*=\(.*\)/\1/'`
eval "$var='$val'"
export $var ;;
*) # Everything else counts as a positional argument
argcount=`expr $argcount + 1`
eval "POSARG$argcount=\$arg" ;;
esac
fi
done
test -n "$prev" && fail "$0: missing argument to --$prev
$0: Try \`$0 --help'"
DIRNAME=$POSARG1
COMPILER=$POSARG2 # deprecated
if test -z "$do_config" -a -z "$do_cbc"; then
# Default is --config
do_config=1
fi
# Add an implicit --with-libsegsegv-prefix option, based on --prefix,
# if no such option was explicitly given.
$have_explicit_libsigsegv_args || {
if test -n "$explicit_prefix"; then
subdir_configure_args="$subdir_configure_args --with-libsigsegv-prefix=${explicit_prefix}"
fi
}
# Add an implicit --with-libffcall-prefix option, based on --prefix,
# if no such option was explicitly given.
$have_explicit_libffcall_args || {
if test -n "$explicit_prefix"; then
subdir_configure_args="$subdir_configure_args --with-libffcall-prefix=${explicit_prefix}"
fi
}
# checking how to copy files
echo "blabla" > conftest.x
err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1 ; exit 0"`
if test -z "$err"; then
CP='cp -p'
else
CP='cp'
fi
rm -f conftest*
# get the absolute pathname from a possibly relative one
abs_pwd () { cd "$1" > /dev/null; pwd; }
# link FILE1 FILE2 is like `ln', but chooses the cheapest alternative:
# hard link if FILE1 and FILE2 on the same disk, else symbolic link if the
# system supports that, else file copy.
link () {
rm -f "$2";
# Note: With some versions of "ln" this does not work if FILE2 is a symlink.
if ln "$1" "$2" 2>/dev/null; then
:
else
srcfile_dirname=`echo "$1" | sed -e 's,/[^/]*$,,'`
test -n "$srcfile_dirname" || srcfile_dirname='/'
srcfile_basename=`echo "$1" | sed -e 's,^.*/,,'`
srcfile_absdirname=`abs_pwd "$srcfile_dirname"`
if ln -s "$srcfile_absdirname/$srcfile_basename" "$2" 2>/dev/null; then
:
else
$CP "$1" "$2"
fi
fi
}
# Note that we would need to call `/bin/pwd` if we wanted to compare two
# directories for equality. But here we only need to get _some_ absolute
# pathnames, hence `pwd` is enough.
if test -f /bin/pwd ; then
ABSPATHPWD=/bin/pwd
else
ABSPATHPWD=pwd
fi
abs_path_pwd () { cd "$1" > /dev/null; ${ABSPATHPWD}; }
INPLACE=''
if test -n "$srcdir" ; then
test -d "$srcdir" || fail "$0: srcdir: ($srcdir) nonexistent"
ABS_SRCDIR=`abs_pwd "$srcdir"`;
if [ "$DIRNAME" = "" ] ; then
DIRNAME='.'
fi
mkdir -p "${DIRNAME}";
REL_SRCDIR="$ABS_SRCDIR"
else
if test -f ./ANNOUNCE -a -f ./SUMMARY; then
srcdir='.'
ABS_SRCDIR=`abs_pwd "$srcdir"`
if [ "$DIRNAME" = "" ] ; then
DIRNAME=src
fi
else
test -f ../ANNOUNCE -a -f ../SUMMARY || \
fail "$0: source directory not found, use --srcdir option"
srcdir='..'
ABS_SRCDIR=`abs_pwd "$srcdir"`
if [ "$DIRNAME" = "" ] ; then
DIRNAME='.'
fi
fi
mkdir -p "${DIRNAME}";
if test `abs_path_pwd "$DIRNAME"/..` = `abs_path_pwd "$srcdir"` ; then
REL_SRCDIR='..'
else
REL_SRCDIR="$ABS_SRCDIR"
fi
fi
ABS_DIRNAME="`abs_pwd "$DIRNAME"`";
if test "`abs_path_pwd "$DIRNAME"`" = "`abs_path_pwd "$srcdir"/src`" ; then
INPLACE=yes
fi
case "$REL_SRCDIR" in
/*) RREL_SRCDIR="$REL_SRCDIR";;
*) RREL_SRCDIR="../$REL_SRCDIR";;
esac
# srcdir top level source directory
# (i.e. this script is $srcdir/configure)
# ABS_SRCDIR absolute srcdir
# REL_SRCDIR srcdir, relative to $DIRNAME
# RREL_SRCDIR srcdir, relative to $DIRNAME/anysubdir
# DIRNAME directory in which to build
# ABS_DIRNAME absolute DIRNAME
# INPLACE set if DIRNAME is the source directory, hence no links needed
if test -n "$do_config"; then
cd "$ABS_SRCDIR"
if [ "$COMPILER" != "" ] ; then
CC="$COMPILER"
export CC
fi
if test -n "$CC"; then
# cygwin comes with a true cross-compiler, i.e. one does
# ./configure CC=i686-w64-mingw32-gcc ...
# instead of ./configure --with-mingw
CC_machine=`($CC -dumpmachine) 2>/dev/null` || :
case "$CC_machine" in
*mingw32* )
echo "cross-compiling for mingw"
subdir_configure_args="${subdir_configure_args} --build=$CC_machine" ;;
esac
fi
cd "${ABS_DIRNAME}"
echo "executing $REL_SRCDIR/src/configure $*"
if test -n "$do_cbc"; then
${CONFIG_SHELL} $REL_SRCDIR/src/configure $subdir_configure_args --cache-file=config.cache 2>&1 | tee cbcstep1.log
else
${CONFIG_SHELL} $REL_SRCDIR/src/configure $subdir_configure_args --cache-file=config.cache
fi
test -f "${ABS_DIRNAME}/intparam.h" || fail "error: configure could not generate intparam.h. Take a look at ${ABS_DIRNAME}/config.log."
test -f "${ABS_DIRNAME}/floatparam.h" || fail "error: configure could not generate floatparam.h. Take a look at ${ABS_DIRNAME}/config.log."
fi
. "${ABS_DIRNAME}/config.cache"
case ${ac_cv_host} in # mingw/msys
*mingw32*)
makemake_args="${makemake_args} --with-dynamic-modules=no --win32gcc" ;;
esac
test -n "${cl_cv_have_ffcall}" || cl_cv_have_ffcall=notchecked
cat < /dev/null 2>&1 && \
ffi_modules=${ffi_modules}" ${module}"
elif grep '.*\.c.*\.fas.*:\|.*\.fas.*\.c.*:' ${mdir}/Makefile > /dev/null 2>&1 ; then
ffi_modules=${ffi_modules}" ${module}"
elif grep ':use.*"FFI"' ${mdir}/*.lisp > /dev/null 2>&1; then
ffi_modules=${ffi_modules}" ${module}"
fi
done
if test -n "${ffi_modules}"; then
test ${do_ffi} = no && \
fail "$0: --without-ffcall is incompatible with requested module(s):${ffi_modules}"
test "${cl_cv_have_ffcall}" = yes || \
fail "$0: modules${ffi_modules} require FFI"
fi
if [ ${do_ffi} != no -a "${cl_cv_have_ffcall}" = yes ]; then
makemake_args="--with-dynamic-ffi ${makemake_args}"
fi
if [ "${gl_cv_lib_sigsegv}" != "yes" ]; then
if [ "${ignore_absence_of_libsigsegv}" = "yes" ]; then
echo "As you requested, we will proceed without libsigsegv..."
else
if [ "$ac_cv_build" = "$ac_cv_host" ]; then host_arg="";
else host_arg=" --host=$ac_cv_host --build=$ac_cv_build";
fi
cat <&2
$0: libsigsegv was not detected, thus some features, such as
generational garbage collection and
stack overflow detection in interpreted Lisp code
cannot be provided.
Please install libsigsegv like this:
EOF
if [ "${CC+set}" = "set" ]; then
echo " CC='$CC'; export CC" 1>&2
fi
libsigsegv_targz=`echo "$libsigsegv_url" | sed -e 's|^.*/||'`
libsigsegv_dirname=`echo "$libsigsegv_targz" | sed -e 's|\.tar\.gz$||'`
cat <&2
mkdir prerequisites; cd prerequisites; prefix=\$(pwd)/${ac_cv_host}
wget ${libsigsegv_url}
tar xfz ${libsigsegv_targz}
cd ${libsigsegv_dirname}
./configure${host_arg} --prefix=\${prefix} && make && make check && make install
cd ../..
rm -f ${DIRNAME}/config.cache
./configure --with-libsigsegv-prefix=\${prefix} $*
If you insist on building without libsigsegv, please pass
--ignore-absence-of-libsigsegv
to this script:
./configure --ignore-absence-of-libsigsegv $*
If you have installed libsigsegv, but clisp does not detect it,
you might have installed it incorrectly, see section 2 in in unix/INSTALL.
EOF
exit 1;
fi
fi
# CLISP needs a lot of stack space for bootstrapping,
# and insufficient stack space manifests itself via arbitrary GC errors.
# It was believed that 8192 is enough until power5 came along:
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=166347
# But this affects only the powerpc CPU, because it has lots of reserved space
# in its stack frame layout (see section 2.2.2 of
# "Power Architecture 64-Bit ELF V2 ABI Specification"
# https://members.openpowerfoundation.org/document/dl/576 ).
case ${ac_cv_host} in
*-*-rs6000 | *-*-rs6000-* | *-*-powerpc* | *-*-ppc*)
STACK_LIMIT=16384 ;;
*)
STACK_LIMIT=8192 ;;
esac
stacksizelimit=`ulimit -s 2>/dev/null || :` # cygwin /bin/sh ulimit is broken
# need 3 separate test calls because of "integer expression expected" errors
# when $stacksizelimit is "" or "unlimited" (no short-circuiting!)
set +e;
test -z "$stacksizelimit" || { test "$stacksizelimit" != unlimited && test "$stacksizelimit" -lt ${STACK_LIMIT}; }
STACK_TOO_SMALL=$? # 0=true => need to reset; 1=false => big enough
set -e
cd "$ABS_DIRNAME"
echo "./makemake $makemake_args > Makefile"
./makemake $makemake_args > Makefile
make config.lisp
if test -z "$do_cbc"; then
echo
echo "To continue building CLISP, the following commands are recommended"
echo " (cf. unix/INSTALL step 4 ff):"
if test "$DIRNAME" != "."; then
echo " cd $DIRNAME"
fi
echo " ${EDITOR:-vi} config.lisp"
if [ "${STACK_TOO_SMALL}" = 0 ]; then
cat </dev/null; set -e;
fi
make 2>&1 | tee cbcstep2.log
make check 2>&1 | tee cbcstep3.log
cat <