Dave
4:22 AM (4 hours ago)
On 9/26/2016 12:34 PM, Don Porter wrote:
The Mpexpr Tcl package from Tom Poindexter is a library for multiple
precision math - arbitrarily large numbers. It's been around for ages,
and a new refreshed release brings it up to compatibility with Tcl 8.6
(while still supporting 7.5, it is believed), and corrects a few bugs
on 64-bit systems.Old fans and new curiosity seekers are encouraged to download and use
the new release found at
Sourceforge won't let me create a ticket so I'll put this here for
whoever is interested.
I managed to get it to compile with Msys2 for 64-bit win7. It passes all
the tests.
Tcl stubs had to be used because the preprocessor stuff for dllexport
gets messed up. It's better to use Tcl stubs anyway.
Had to apply:
--- generic/mpiface.c.orig 2016-09-20 14:40:51.000000000 -0500
+++ generic/mpiface.c 2016-09-26 19:44:36.917548600 -0500
@@ -72,6 +72,10 @@
static int initialized = 0;
TCL_DECLARE_MUTEX(mpMutex)
+#if USE_TCL_STUBS
+ Tcl_InitStubs( interp, TCL_VERSION, 0 );
+#endif
+
if (!initialized) {
Tcl_MutexLock(&mpMutex);
if (!initialized) {
and build with this script:
#
# Build for windows 7 64-bit under Msys2
#
set -x
if [ "$1" == "clean" ]
then
cd unix
make -f file1 distclean
rm -f file1 endian.h
exit 0
fi
PREFIX=`pwd`/PREFIX
if [ ! -d $PREFIX ]
then
mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/man/mann
fi
cd unix
if [ ! -f config.status ]
then
./configure \
--prefix=$PREFIX \
--exec-prefix=$PREFIX \
--with-tcl=/C/Progra~1/Tcl \
--enable-shared
# This fails completely but builds a couple of helper programs
make 2>/dev/null
# Fix Makefile
sed '/^TCL_DEFS/s/$/ -DUSE_TCL_STUBS/' Makefile >file1
# Generate a correct header
./endian.exe >calcendian.h
# Fix pkgIndex.tcl
sed 's/\.\. //;s/"load/[list load/;s/"/]/' pkgIndex.tcl >file2
mv file2 pkgIndex.tcl
fi
# The compile will work but the link will now fail
make -f file1
# Do the correct link
gcc -shared -o libMpexpr12.dll shared/*.o -L/C/Progra~1/Tcl/lib -ltclstub86
strip libMpexpr12.dll
# Install
make -f file1 install
cd ../PREFIX/man/mann
groff -man -Tpdf mpexpr.n >../../lib/Mpexpr12/mpexpr.pdf
cd ../../lib
mv libMpexpr12.dll Mpexpr12
# For a real install just copy PREFIX/lib/Mpexpr12 to [info library]/..
# and make a shortcut to the PDF documentation wherever you put your TCL
# docs
Copied this from comp.lang.tcl, a reaction by dave on the announcement of mpexpr 1.2