[tlbuild] Problems with asy-1.96 on FreeBSD: no log(2), needs explicit "#include <cstdio>"

Nikola Lečić nikola.lecic at anthesphoria.net
Wed Jun 9 18:47:51 CEST 2010


Hello,

I've just built asy-1.96 with gcc-4.4 on FreeBSD, but I had to apply
this against the sources (the actual errors are given below). Is this
log2() definition suitable for asy?

---------------------------------- >8 ----------------------------------
Index: Build/source/utils/asymptote/interact.cc
===================================================================
--- Build/source/utils/asymptote/interact.cc	(revision 18840)
+++ Build/source/utils/asymptote/interact.cc	(working copy)
@@ -12,6 +12,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #include <csignal>
+#include <cstdio>
 
 #include "interact.h"
 #include "runhistory.h"
Index: Build/source/utils/asymptote/prc/writePRC.cc
===================================================================
--- Build/source/utils/asymptote/prc/writePRC.cc	(revision 18840)
+++ Build/source/utils/asymptote/prc/writePRC.cc	(working copy)
@@ -29,6 +29,10 @@
 #include <fstream>
 #include <sstream>
 
+#if defined(__FreeBSD__)
+  #define log2(value) log((double)value)/log(2.0)
+#endif
+
 using namespace std;
 
 double PRCVector3d::Length()
---------------------------------- >8 ----------------------------------

Errors:
./configure --prefix=/tmp/asyinst --enable-texlive-build --disable-gsl \
  --disable-fftw --enable-gl --disable-gc \
  CC=/usr/local/bin/gcc44 \
  CXX=/usr/local/bin/g++44 \
  CFLAGS="-Wno-deprecated -Wl,-rpath=/usr/local/lib/gcc44" \
  LDFLAGS="-Wno-deprecated -Wl,-rpath=/usr/local/lib/gcc44"
[...]
/usr/local/bin/g++45 -Wall -ansi -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64  -DPRESYM -Wno-deprecated -Wl,-rpath=/usr/local/lib/gcc45 -I .  -o interact.o -c interact.cc
In file included from /usr/include/readline/readline.h:38:0,
                 from interact.cc:20:
/usr/include/readline/rltypedefs.h:65:28: error: typedef 'rl_getc_func_t' is initialized (use decltype instead)
/usr/include/readline/rltypedefs.h:65:28: error: 'FILE' was not declared in this scope
/usr/include/readline/rltypedefs.h:65:28: error: expected primary-expression before ')' token
In file included from interact.cc:20:0:
/usr/include/readline/readline.h:417:20: error: 'FILE' was not declared in this scope
/usr/include/readline/readline.h:417:20: error: expected primary-expression before ')' token
/usr/include/readline/readline.h:533:8: error: 'FILE' does not name a type
/usr/include/readline/readline.h:534:8: error: 'FILE' does not name a type
/usr/include/readline/readline.h:556:8: error: 'rl_getc_func_t' does not name a type
/usr/include/readline/readline.h:828:3: error: 'FILE' does not name a type
/usr/include/readline/readline.h:829:3: error: 'FILE' does not name a type
gmake: *** [interact.o] Error 1
[root at 7stable64:/root/TL-Work-18840/asymptote]#

... and then:

/usr/local/bin/g++45 -Wall -ansi -DHAVE_CONFIG_H -D_FILE_OFFSET_BITS=64  -DPRESYM -Wno-deprecated -Wl,-rpath=/usr/local/lib/gcc45 -I .  -o writePRC.o -c prc/writePRC.cc
prc/writePRC.cc: In member function 'void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream&, double)':
prc/writePRC.cc:1208:68: error: 'log2' was not declared in this scope
gmake: *** [writePRC.o] Error 1
[root at 7stable64:/root/TL-Work-18840/asymptote]#

The math(3) says:

BUGS
     The log2() function is missing, and many functions are not available in
     their long double variants.

System: FreeBSD-7.2/amd64.

Best wishes,
-- 
Nikola Lečić = Никола Лечић
fingerprint : FEF3 66AF C90E EDC3 D878  7CDC 956D F4AB A377 1C9B
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 314 bytes
Desc: not available
URL: <http://tug.org/pipermail/tlbuild/attachments/20100609/937aa1aa/attachment.bin>


More information about the tlbuild mailing list