David Kågedal <[EMAIL PROTECTED]> writes:
> Raphael Collet <[EMAIL PROTECTED]> writes:
>
>> Dear users,
>>
>> We are proud to announce the new release of Mozart, namely
>>
>> Mozart 1.4.0
>>
>> The main change with Mozart 1.3.2 is the new implementation of the
>> distribution layer, a per-entity configurable distribution behavior, and
>> a complete redesign of the Fault module. This release also contain a
>> bunch of bug fixes.
>
> The dss library casts pointers to int in many places
>
> pos += sprintf((buf+pos),"%d|%x ", a_fields[i].a_ft,
> reinterpret_cast<int>(a_fields[i].a_arg));
>
> int i = reinterpret_cast<int>(m_popVal());
>
> This is a horrible thing to do, and gcc (at least version 4.1.2 which
> I happened to use) rightfully refuses to compile such code.
>
> What was the compiler that anyone managed to compile this with?
I tried not to give up, but to persuade it to build a 32-bit version
on my 64-bit ubuntu system. This doesn't mean that the code isn't
horribly broken, but it should hopefully generate something
useful. I'm surprised that nobody seems to have built this on a 64-bit
x86 system running linux, since that must a very common configuration
these days.
There are numerous problems with the build system that worked against
me, most of them stemming from that the DSS library's build system
isn't integrated with the rest. For instance most of the configure.in
files require autoconf 2.13, but the DSS configure.ac requires
2.57. It didn't even work with 2.61 without a patch, so I assume it
requires 2.57.
If you apply the attached patch, you should be able to come as far in
the compilation that it has built a dss library at least.
After applying the patch, go to platform/dss and run "autoconf -I
/path/to/mozart/src/" using a modern autoconf to recreate the
configure subdir.
This is the build rule I'm using in a makefile that tries to rebuild
mozart from scratch:
cd $(MOZART_BUILDDIR) && \
CFLAGS=-m32 CXXFLAGS=-m32 CPPFLAGS=-m32 LDFLAGS=-m32 \
$(MOZART_SRCDIR)/configure \
--prefix=$(BUILDDIR)/mozart \
--with-stdlib=$(MOZART_SRCDIR)-std \
--with-gmp=$(BUILDDIR)/lib \
--disable-wish \
--disable-contrib-gdbm
cd $(MOZART_BUILDDIR)/platform/emulator && \
sed 's/oztool_ld="ld -m32"/oztool_ld="gcc -m32 -shared"/' <
oztool.sh > oztool-fixed.sh && \
cp oztool-fixed.sh oztool.sh
Note that I patch the generated oztool.sh since it doesn't work as
is. It tries to use "ld" directly as the linker instead of "gcc", which
rarely is a good idea.
Unfortunately, it still doesn't work. It seems to be some confusion
regarding statically linked modules. For some reason, something in the
build system decided that it should link things statically in
emulator. These lines appear in the generated emulator/Makefile:
STATIC_MODULES= $(MODULE_NAMES) DSS
DYNAMIC_MODULES=
But since it only built a dynamic libDSS.so, it will fail miserably.
Anyway, here's the patch that tries to make building of libDSS
possible, at least. Some comments:
* AC_CONFIG_AUX_DIR was needed to make it find config.sub
* The GMP stuff was copied from another file. I have a 32-bit libgmp
at a nonstandard directory, and use --with-gmp= to point it out.
* My gcc doesn't know anything about -mtune=x86_64 or -march=x86_64,
so I simply removed those.
diff -ur mozart-1.4.0-20080702/platform/dss/configure.ac
mozart-1.4.0-20080702.fix/platform/dss/configure.ac
--- mozart-1.4.0-20080702/platform/dss/configure.ac 2008-07-02
10:01:31.000000000 +0200
+++ mozart-1.4.0-20080702.fix/platform/dss/configure.ac 2008-07-04
10:44:45.000000000 +0200
@@ -28,8 +28,10 @@
AC_PREREQ(2.57)
AC_INIT(DSS, 0.9, "[EMAIL PROTECTED]")
AC_CONFIG_SRCDIR([src/dssBase.hh])
+AC_CONFIG_AUX_DIR([../..])
AC_LANG(C++)
+OZ_INIT
# Check what kind of system we are on
AC_CANONICAL_HOST
@@ -45,7 +47,7 @@
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h gmp.h pthread.h)
+AC_CHECK_HEADERS(arpa/inet.h fcntl.h limits.h pthread.h)
AC_HEADER_STDBOOL
AC_C_CONST
@@ -57,6 +59,20 @@
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([sqrt])
+dnl *****************************************************************
+dnl *** GMP
+dnl *****************************************************************
+
+: ${oz_inc_path="/usr/local/include"}
+: ${oz_lib_path="/usr/local/lib"}
+
+OZ_LIB_GMP
+if test "$OZ_GMP_MAJOR" -gt 3 || \
+ (test "$OZ_GMP_MAJOR" -eq 3 && test "$OZ_GMP_MINOR" -gt 1); then
+ AC_DEFINE_UNQUOTED(GMP_NEEDS_CPLUSPLUS)
+fi
+
+
dnl If installation does not work, use ordinary copy
# INSTALL="cp"
AC_PROG_INSTALL(INSTALL)
@@ -99,12 +115,12 @@
case "$enable_opt" in
debug)
AC_MSG_RESULT(compile to debug mode)
- CXXFLAGS="-fno-inline -fno-default-inline -fno-inline-functions
-DDEBUG_CHECK -DDSS_LOG -DINTERFACE -g3 -ggdb $CXX_BASE"
+ CXXFLAGS="$CXXFLAGS -fno-inline -fno-default-inline
-fno-inline-functions -DDEBUG_CHECK -DDSS_LOG -DINTERFACE -g3 -ggdb $CXX_BASE"
WARNINGS="-pedantic-errors"
;;
*)
AC_MSG_RESULT(compile optimized mode)
- CXXFLAGS="-O3 -fomit-frame-pointer $CXX_BASE"
+ CXXFLAGS="$CXXFLAGS -O3 -fomit-frame-pointer $CXX_BASE"
WARNINGS="-Weffc++ $WARNINGS"
;;
esac
@@ -207,7 +223,7 @@
AC_MSG_CHECKING(environment)
AC_MSG_RESULT(found $host_os)
dnl Check for special cygwin environment
-DYNLD="\$(CXX) -shared -Wl,-soname,\$@"
+DYNLD="\$(CXX) \$(CXXFLAGS) -shared -Wl,-soname,\$@"
case "$host_os" in
*cygwin)
AC_MSG_RESULT(-- adding cygwin environment --)
@@ -242,9 +258,9 @@
*)
AC_MSG_RESULT($host_cpu architecture)
if test "$VERSION" = ABOVE3; then
- CPU_FLAGS="-march=$host_cpu -mtune=$host_cpu"
+ CPU_FLAGS=""
else
- CPU_FLAGS="-march=$host_cpu -mcpu=$host_cpu"
+ CPU_FLAGS=""
fi
;;
esac
diff -ur mozart-1.4.0-20080702/platform/dss/Makefile.in
mozart-1.4.0-20080702.fix/platform/dss/Makefile.in
--- mozart-1.4.0-20080702/platform/dss/Makefile.in 2008-07-02
10:01:31.000000000 +0200
+++ mozart-1.4.0-20080702.fix/platform/dss/Makefile.in 2008-07-04
10:51:21.000000000 +0200
@@ -44,7 +44,7 @@
@EXAMPLES@
[EMAIL PROTECTED]@.so: $([EMAIL PROTECTED]@)
- @DYNLD@ -o $@ $([EMAIL PROTECTED]@) $(LIBS)
+ @DYNLD@ -o $@ $([EMAIL PROTECTED]@) $(LDFLAGS) $(LIBS)
[EMAIL PROTECTED]@.a: $([EMAIL PROTECTED]@)
$(AR) -rc $@ $([EMAIL PROTECTED]@) && $(RANLIB) $@
Only in mozart-1.4.0-20080702.fix/platform/dss: Makefile.in~
diff -ur mozart-1.4.0-20080702/platform/dss/Makefile.vars.in
mozart-1.4.0-20080702.fix/platform/dss/Makefile.vars.in
--- mozart-1.4.0-20080702/platform/dss/Makefile.vars.in 2008-06-26
15:39:31.000000000 +0200
+++ mozart-1.4.0-20080702.fix/platform/dss/Makefile.vars.in 2008-07-04
10:53:00.000000000 +0200
@@ -7,6 +7,7 @@
RANLIB = @RANLIB@
CXX = @CXX@
CXXFLAGS= @CXXFLAGS@
+LDFLAGS = @LDFLAGS@
DEPEND = $(CXX) -MM $(CXXFLAGS)
INSTDIR = @prefix@
Only in mozart-1.4.0-20080702.fix/platform/dss: Makefile.vars.in~
Only in mozart-1.4.0-20080702.fix: .unpack-stamp
--
David Kågedal
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users