In addition to building on Windows/MinGW, I am also trying to get this going on Mac OSX. I have had problems with Apple's early releases of GCC, so I am using a local build of GCC-3.3.1. I believe that the binary utilities are mostly GNU with Apple's linker. (as reports 1.38 as its version). I am building CLN against GMP 4.1.2. ( I said 4.2.1 earlier, but I really installed 4.1.2). CLN was configured with CC=gcc-3.3 CXX=g++-3.3 CXXFLAGS="-O2 -finline-functions" CFFLAGS="-Dunix -D__unix" (-D__unix was needed for a random number constructor) ./configure --with-gmp The build fails with cascading syntax errors in modinteger/cl_MI.cc and several other files. Thank you for any insight you may have on this problem, -Jonathan Brandmeyer g++-3.3 -v: Reading specs from /usr/local/lib/gcc-lib/powerpc-apple-darwin6.8/3.3.1/specs Configured with: ../gcc-3.3.1/configure --enable-languages=c,c++ --enable-threads=posix --program-suffix=-3.3 Thread model: posix gcc version 3.3.1 The build fails in the modinteger directory with this error: make SUBDIR=modinteger /bin/sh ../libtool --mode=compile g++-3.3 -O2 -finline-functions -Dunix -D__unix -I../include -I../include -I./integer/hash -I./integer -I./base/hash -I./base/digitseq -I./base/digit -Ibase -I./base -c ./modinteger/cl_MI.cc rm -f .libs/cl_MI.lo g++-3.3 -O2 -finline-functions -Dunix -D__unix -I../include -I../include -I./integer/hash -I./integer -I./base/hash -I./base/digitseq -I./base/digit -Ibase -I./base -c ./modinteger/cl_MI.cc -fno-common -DPIC -o .libs/cl_MI.lo In file included from modinteger/cl_MI.cc:80: modinteger/cl_MI_pow2.h:16: error: parse error before numeric constant modinteger/cl_MI_pow2.h: In function `const cln::cl_I cln::pow2_reduce_modulo(...)': modinteger/cl_MI_pow2.h:19: error: `x' undeclared (first use this function) modinteger/cl_MI_pow2.h:19: error: (Each undeclared identifier is reported only once for each function it appears in.) modinteger/cl_MI_pow2.h: In function `const cln::_cl_MI cln::pow2_canonhom(cln::cl_heap_modint_ring*, const cln::cl_I&)': modinteger/cl_MI_pow2.h:24: warning: cannot pass objects of non-POD type `const class cln::cl_I' through `...'; call will abort at runtime modinteger/cl_MI_pow2.h: At global scope: modinteger/cl_MI_pow2.h:27: error: parse error before numeric constant modinteger/cl_MI_pow2.h: In function `const cln::_cl_MI cln::pow2_plus(...)': modinteger/cl_MI_pow2.h:30: error: `y' undeclared (first use this function) modinteger/cl_MI_pow2.h: At global scope: modinteger/cl_MI_pow2.h:34: error: parse error before numeric constant modinteger/cl_MI_pow2.h:41: error: parse error before numeric constant modinteger/cl_MI_pow2.h:48: error: parse error before numeric constant modinteger/cl_MI_pow2.h:54: error: parse error before numeric constant modinteger/cl_MI_pow2.h:61: error: parse error before numeric constant modinteger/cl_MI_pow2.h:80: error: parse error before numeric constant modinteger/cl_MI_pow2.h:105: error: parse error before numeric constant modinteger/cl_MI_pow2.h:126: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:126: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:126: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::cl_MI_x (*)(...)' to `const cln::cl_MI_x (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::cl_MI_x (*)(...)' to `const cln::cl_MI_x (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2.h:138: error: invalid conversion from `const cln::cl_I (*)(...)' to `const cln::cl_I (*)(cln::cl_heap_modint_ring*, const cln::cl_I&)' In file included from modinteger/cl_MI.cc:81: modinteger/cl_MI_pow2m1.h:16: error: parse error before numeric constant modinteger/cl_MI_pow2m1.h: In function `const cln::_cl_MI cln::pow2m1_canonhom(cln::cl_heap_modint_ring*, const cln::cl_I&)': modinteger/cl_MI_pow2m1.h:46: warning: cannot pass objects of non-POD type ` const class cln::cl_I' through `...'; call will abort at runtime modinteger/cl_MI_pow2m1.h: At global scope: modinteger/cl_MI_pow2m1.h:49: error: parse error before numeric constant modinteger/cl_MI_pow2m1.h:58: error: parse error before numeric constant modinteger/cl_MI_pow2m1.h:79: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2m1.h:79: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_pow2m1.h:79: error: invalid conversion from `const cln::cl_I (*)(...)' to `const cln::cl_I (*)(cln::cl_heap_modint_ring*, const cln::cl_I&)' In file included from modinteger/cl_MI.cc:82: modinteger/cl_MI_pow2p1.h:16: error: parse error before numeric constant modinteger/cl_MI_pow2p1.h: In function `const cln::_cl_MI cln::pow2p1_canonhom(cln::cl_heap_modint_ring*, const cln::cl_I&)': modinteger/cl_MI_pow2p1.h:53: warning: cannot pass objects of non-POD type ` const class cln::cl_I' through `...'; call will abort at runtime modinteger/cl_MI_pow2p1.h: At global scope: modinteger/cl_MI_pow2p1.h:56: error: parse error before numeric constant modinteger/cl_MI_pow2p1.h:67: error: parse error before numeric constant modinteger/cl_MI_pow2p1.h:90: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_pow2p1.h:90: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_pow2p1.h:90: error: invalid conversion from `const cln::cl_I (*)(...)' to `const cln::cl_I (*)(cln::cl_heap_modint_ring*, const cln::cl_I&)' In file included from modinteger/cl_MI.cc:83: modinteger/cl_MI_montgom.h:87: error: parse error before numeric constant modinteger/cl_MI_montgom.h:93: error: parse error before numeric constant modinteger/cl_MI_montgom.h:99: error: parse error before numeric constant modinteger/cl_MI_montgom.h:106: error: parse error before numeric constant modinteger/cl_MI_montgom.h:112: error: parse error before numeric constant modinteger/cl_MI_montgom.h:118: error: parse error before numeric constant modinteger/cl_MI_montgom.h:132: error: parse error before numeric constant modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::cl_I&)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::_cl_MI (*)(...)' to `const cln::_cl_MI (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::cl_MI_x (*)(...)' to `const cln::cl_MI_x (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::cl_MI_x (*)(...)' to `const cln::cl_MI_x (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&, const cln::_cl_MI&)' modinteger/cl_MI_montgom.h:158: error: invalid conversion from `const cln::cl_I (*)(...)' to `const cln::cl_I (*)(cln::cl_heap_modint_ring*, const cln::_cl_MI&)' make[2]: *** [cl_MI.lo] Error 1
Hi! On Fri, 31 Oct 2003, Jonathan Brandmeyer wrote:
In addition to building on Windows/MinGW, I am also trying to get this going on Mac OSX. I have had problems with Apple's early releases of GCC, so I am using a local build of GCC-3.3.1. I believe that the binary utilities are mostly GNU with Apple's linker. (as reports 1.38 as its version).
I am building CLN against GMP 4.1.2. ( I said 4.2.1 earlier, but I really installed 4.1.2). CLN was configured with CC=gcc-3.3 CXX=g++-3.3 CXXFLAGS="-O2 -finline-functions" CFFLAGS="-Dunix -D__unix" (-D__unix was needed for a random number constructor) ./configure --with-gmp
The build fails with cascading syntax errors in modinteger/cl_MI.cc and several other files.
Again, I am without access to this platform. But there were some patches by Mac users. Here is how the current tree diffs against CLN-1.1.5, at least the sections relevant to you: --- cln-1.1.5/src/modinteger/cl_MI.cc 2000-08-29 00:08:21.000000000 +0200 +++ cln/src/modinteger/cl_MI.cc 2003-06-29 13:58:15.000000000 +0200 @@ -21,6 +21,10 @@ #include "cln/abort.h" #include "cl_alloca.h" +// MacOS X does "#define _R 0x00040000L" +// Grr... +#undef _R + namespace cln { cl_heap_modint_ring::cl_heap_modint_ring (cl_I m, cl_modint_setops* setopv, cl_modint_addops* addopv, cl_modint_mulops* mulopv) --- cln-1.1.5/src/numtheory/cl_nt_sqrtmodp.cc 2001-12-14 19:49:19.000000000 +0100 +++ cln/src/numtheory/cl_nt_sqrtmodp.cc 2003-08-06 21:45:26.000000000 +0200 @@ -16,6 +16,9 @@ #include <cmath> #define floor cln_floor +// MacOS X does "#define _R 0x00040000L". Grr... +#undef _R + namespace cln { // Algorithm 1 (for very small p only): --- cln-1.1.5/src/base/random/cl_random_from.cc 2001-03-26 20:03:27.000000000 +0200 +++ cln/src/base/random/cl_random_from.cc 2003-04-03 17:04:03.000000000 +0200 @@ -12,7 +12,7 @@ #include "cl_base_config.h" #include "cl_low.h" -#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) +#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) #include <sys/types.h> #include <unistd.h> // declares getpid() @@ -80,7 +80,7 @@ { var uint32 seed_hi; var uint32 seed_lo; -#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) +#if defined(unix) || defined(__unix) || defined(_AIX) || defined(sinix) || (defined(__MACH__) && defined(__APPLE__)) || (defined(_WIN32) && defined(__GNUC__)) || defined(__BEOS__) seed_lo = ::get_seed(); seed_hi = (rand() // zufällige 31 Bit (bei UNIX_BSD) bzw. 16 Bit (bei UNIX_SYSV) << 8) ^ (uintL)(getpid()); // ca. 8 Bit von der Process ID I hope I haven't forgotten anything. Could you please tell us how it goes? Also, please note that you have -finline-functions turned on which might cause trouble later. If you have some spare time, could you please find out if that option does produce link failures on Mac OSX, too? Regards -richy. -- Richard B. Kreckel <Richard.Kreckel@GiNaC.DE> <http://www.ginac.de/~kreckel/>
On Sat, 2003-11-01 at 09:10, Richard B. Kreckel wrote:
Hi!
I hope I haven't forgotten anything. Could you please tell us how it goes?
Also, please note that you have -finline-functions turned on which might cause trouble later. If you have some spare time, could you please find out if that option does produce link failures on Mac OSX, too?
Regards -richy.
Thank you for the patch. I will try it out Monday and let you know how it went. -Jonathan Brandmeyer
On Sat, 2003-11-01 at 09:10, Richard B. Kreckel wrote:
Again, I am without access to this platform. But there were some patches by Mac users. Here is how the current tree diffs against CLN-1.1.5, at least the sections relevant to you:
--snipped patch--
I hope I haven't forgotten anything. Could you please tell us how it goes?
Your patch fixed the syntax errors.
Also, please note that you have -finline-functions turned on which might cause trouble later. If you have some spare time, could you please find out if that option does produce link failures on Mac OSX, too?
Unfortunately, I did have linker errors. The error was identical regardless of specifying -finline-functions: /usr/bin/libtool: internal link edit command failed ld: for architecture ppc ld: cl_prin_globals.lo has external relocation entries in non-writable section (__TEXT,__text) for symbols: cl_module__cl_prin_globals__dtorend cl_module__cl_prin_globals__ctorend Don't let the 'libtool' name fool you. It is not GNU libtool, but is a system linker driver closer in nature to 'collect' than to GNU Libtool. When I find out what exactly those errors signify, I will let you know. Thanks, Jonathan Brandmeyer
participants (2)
-
Jonathan Brandmeyer
-
Richard B. Kreckel