Re: [Rd] Assistance much appreciated

2015-12-18 Thread Michael Felt

On 2015-12-17 21:37, peter dalgaard wrote:

As you're dying in an else clause, a previous if () must contain the clue. 
Unfortunately not necessarily the matching one.

My guess is that your TRE library is broken. The line should have matched the RE 
"regline" defined as

tre_regcomp(®line, "^[^:]+:[[:blank:]]*", REG_EXTENDED);
...and used here:
 if(tre_regexecb(®line, line, 1, regmatch, 0) == 0) {

but apparently does not.

int
tre_regcomp(regex_t *preg, const char *regex, int cflags)
{
  return tre_regncomp(preg, regex, regex ? strlen(regex) : 0, cflags);
}

The code is a bit too 'string busy' for me to be comfortable - so I took 
a different approach to look for potential differences in how 32-bit 
versus 64-bit were viewing things. Again, it may not be that the root 
cause is here - but I hope looking at the diff -u of the .i files gives 
someone an good impression of how the data types are being swapped about.


For one example - I had a very old program that had a typedef for 
"typedef unsigned long long ulonglong_t;" that would not parse well. 
When I changed that to unit64_t (as defined in /usr/include/sys/stdint.h)


#ifndef _STD_UINT64_T
#ifdef  __64BIT__
typedef unsigned long   uint64_t;
#else   /* _ILP32 */
#if defined(_LONG_LONG)
typedef unsigned long long  uint64_t;
#endif
#endif
#endif /* _STD_UINT64_T */


All my compilers and os mix (gcc, xlc, AIX and linux) were happy!

So, I am hoping something triggers a thought in the following: (or the 
haystack gets smaller...)

root@x072:[/]diff -u /data/prj/cran/??/R-3.2.3/src/extra/tre/regcomp.i
--- /data/prj/cran/32/R-3.2.3/src/extra/tre/regcomp.i   2015-12-18 
08:10:25.0 +
+++ /data/prj/cran/64/R-3.2.3/src/extra/tre/regcomp.i   2015-12-18 
08:10:58.0 +

@@ -1,5 +1,5 @@
  # 1 "/data/prj/cran/R-3.2.3/src/extra/tre/regcomp.c"
- # 1 "/data/prj/cran/32/R-3.2.3/src/extra/tre//"
+ # 1 "/data/prj/cran/64/R-3.2.3/src/extra/tre//"
  # 1 ""
  # 1 "/data/prj/cran/R-3.2.3/src/extra/tre/regcomp.c"
  # 10 "/data/prj/cran/R-3.2.3/src/extra/tre/regcomp.c"
@@ -171,18 +171,11 @@
  typedef long int ptrdiff_t;
  # 119 
"/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/include-fixed/sys/types.h" 3 4

  typedef unsigned int wctype_t;
+ # 128 
"/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/include-fixed/sys/types.h" 3 4

+ typedef long fpos_t;



-
-
-
- typedef long long fpos_t;
-
-
-
-
-
  typedef long long fpos64_t;
  # 145 
"/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/include-fixed/sys/types.h" 3 4

  typedef int time_t;
@@ -258,9 +251,9 @@



- typedef long long off_t;


+ typedef long off_t;



@@ -2785,8 +2778,8 @@
  extern char *tmpnam(char *);
  extern int fclose(FILE *);
  extern int fflush(FILE *);
- extern FILE * fopen64(const char *restrict, const char *restrict);
- extern FILE * freopen64(const char *restrict, const char *restrict, 
FILE *restrict);

+ extern FILE * fopen(const char *restrict, const char *restrict);
+ extern FILE * freopen(const char *restrict, const char *restrict, FILE 
*restrict);

  extern void setbuf(FILE *restrict, char *restrict);
  extern int setvbuf(FILE *restrict, char *restrict, int, size_t);
  extern int fprintf(FILE *restrict, const char *restrict, ...);
@@ -2816,9 +2809,9 @@
  extern char *gets(char *);
  extern int puts(const char *);
  extern int ungetc(int, FILE *);
- extern int fgetpos64(FILE *restrict, fpos_t *restrict);
+ extern int fgetpos(FILE *restrict, fpos_t *restrict);
  extern int fseek(FILE *, long int, int);
- extern int fsetpos64(FILE *, const fpos_t *);
+ extern int fsetpos(FILE *, const fpos_t *);
  extern long ftell(FILE *);
  extern void rewind(FILE *);
  extern void perror(const char *);
@@ -2841,8 +2834,8 @@

  extern void flockfile(FILE *);
  extern void funlockfile(FILE *);
- extern int fseeko64(FILE *, off_t, int);
- extern off_t ftello64(FILE *);
+ extern int fseeko(FILE *, off_t, int);
+ extern off_t ftello(FILE *);
  extern int ftrylockfile(FILE *);
  extern void funlockfile(FILE *);
  # 470 
"/opt/lib/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/include-fixed/stdio.h" 3 4


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Assistance much appreciated

2015-12-18 Thread Michael Felt

On 2015-12-18 02:29, Simon Urbanek wrote:

Michael,

I got access to PDP AIX so I can try to replicate your problem. Can you, 
please, share exactly your setup - AIX version and well as how exactly you 
installed the compilers (=where from)? I can then try to replicate it. AFAICS 
there is no official binary for gfortran nor gcc 4.7 so it must be some 3rd 
party - which could also be a problem.

Thanks,
Simon
I built gcc and gfortran myself. Available via 
http://download.aixtools.net/test/aixtools.obj.gcc.4.7.4.0.aix537.I 
(still in the test directory because the fileset name should be 
aixtools.gnu.gcc) - other filesets and instructions are available at: 
http://download.aixtools.net/gnu/gcc/


Note, especially, I was not smart enough - then - to automatically run 
the mkheaders command (full command is either


 /opt/libexec/gcc/powerpc-ibm-aix5.3.7.0/4.7.4/install-tools/mkheaders or  
/opt/libexec/gcc/powerpc-ibm-aix5.3.0.0/4.7.4/install-tools/mkheaders
depending on the version of libtool I had installed when packaging (the latest 
also looks at the TL level, hence 5.3.7.0 rather that 5.3.0.0)


Only looking at the rte (runtime) filesets - this is what I have added: 
All are available via http:://www.aixtools.net (wiki interface) or 
http://download.aixtools.net (self-service).


The AIXTOOLBOX approach uses rpm for packaging - which I did not 
understand when I got started several years back. And I am not switching 
to rpm - following in the footsteps of Perzl because:
a) Michael Perzl does an excellent job of keeping the AIXTOOLBOX where 
it should be - no need to replicate that
b) I hate the RPM dependency nightmare (e.g., installing three rpm -dev 
packages  just to get 5 include files)
c) The RPM.spec files often (well occaisionally, but once is once too 
many for me) overwrite AIX/IBM installp files - so updates of one damage 
the other

d) RPM and NIM did not work as well as NIM and INSTALLP

Almost end of soapbox --- In AIX 5.2 IBM included a tool called 
mkinstallp. I have a tool around that - that I call buildaix - that 
largely automates packaging OSS/FOSS, especially when the packaging 
follows GNU build guidelines.


root@x065:[/data/prj/cran/R-3.2.3/src/extra/tre] aixtools | grep rte <
  aixtools.32.R.rte  3.1.3.0C F1548 1130 1457
  aixtools.bison.rte 3.0.4.0C Fbison 1504 0125 1445
  aixtools.buildaix.rte  2.0.3.1C F1540 1007 2004
  aixtools.bzip2.rte 1.0.6.0C F1543 1030 1351
  aixtools.curl.rte 7.45.0.0C F1544 1106 1841
  aixtools.gmp.rte   5.0.5.0C Fgmp version 5.0.5 
for powerpc

  aixtools.gnu.bash.rte 4.3.42.0C F1537 0913 1505
  aixtools.gnu.gettext.rte  0.19.5.0C F1531 0807 
  aixtools.gnu.gzip.rte  1.6.0.0C F1550 1216 1405
  aixtools.gnu.gzip.rte.64   1.6.0.0C F1550 1216 1417
  aixtools.gnu.m4.rte   1.4.17.0C F1523 0613 1221
  aixtools.gnu.make.rte  4.1.0.0C F1523 0613 1158
  aixtools.libiconv.rte 1.14.0.0C Flibiconv 1447 1127 1728
  aixtools.libjpeg.rte   6.2.0.0C Flibjpeg version 
6.2.0 for
  aixtools.libpng.rte   1.5.12.0C Flibpng version 
1.5.12 for
  aixtools.mpc.rte   1.0.2.0C Fmpc 2014.Oct.31 
15.44 CUT
  aixtools.mpfr.rte  2.4.2.0C Fmpfr 2014.Oct.31 
15.19 CUT

  aixtools.obj.gcc.rte   4.7.4.0C F1515 0416 2134
  aixtools.pcre.rte 8.37.0.0C F1544 1106 1445
  aixtools.pkgconfig.gcc.rte
  aixtools.tiff.rte  4.0.6.0C F1542 1024 2144
  aixtools.xz.rte5.0.8.0C F1522 0602 0809
  aixtools.zlib.rte  1.2.8.1C Fzlib 1505 0203 1627

In closing, I made the mistake of thinking people know installp as well 
as they know rpm (at command-line). If you do not know installp at the 
command line level

a) run rm -f /where/you/download/to/.toc after everytime you add a file
b) use "smit install" to install filesets

If you are comfortable with installp cli interface the standard commands 
to remember are:

a) inutoc /where/you/download/to
b) installp -d /where/you/download/to -L # to list filesets
c) installp -d /where/you/download/to -agX  | 
"all"


Part II

a) I download R-project files to /data/prj/cran/downloads
b) cd /data/prj/cran
gzip -dc downloads/R-3.2.3.tar.gz | tar xf -
cp -rp R-3.2.3 R-3.2.3.dist
c) ls -l 32/*.env 64/*.env

sdiff -w ??/aix.env
cat bin/my_shared.ksh

d) slibclean; rm -rf 32/R-3.2.3; rm -rf 64/R-3.2.3
mkdir 32/R-3.2.3
mkdir 64/R-3.2.3

e) note current diffs between R-3.2.3 and R-3.2.3.dist
root@x072:[/data/prj/cran]diff -ru R-3.2.3.dist R-3.2.3
diff -ru R-3.2.3.dist/configure R-3.2.3/configure
--- R-3.2.3.dist/configure  2015-12-02 23:16:46.0 +
+++ R-3.2.3/configure   2015-12-16 10:52:15.0 +
@@ -26339,11 +26339,11 @@
  ##ADD: Howe

Re: [Rd] Assistance much appreciated

2015-12-18 Thread Michael Felt

On 2015-12-18 10:58, Michael Felt wrote:

c) ls -l 32/*.env 64/*.env

sdiff -w ??/aix.env
cat bin/my_shared.ksh 

Forgot this part:

2015-12-18 10:00   32 and 64 bit aix 
environments   Page 1



export OBJECT_MODE=32export OBJECT_MODE=64
export CC="gcc -maix32 -mcpu=power5" export AR="ar -X64"
export CXX="g++ -maix32 -mcpu=power5"export CC="gcc -maix64 
-mcpu=power5"
export F77="gfortran -maix32 -mcpu=power5"   export CXX="g++ -maix64 
-mcpu=power5"
export FC="gfortran -maix32 -mcpu=power5"export F77="gfortran 
-maix64 -mcpu=power5"
export LDFLAGS="-L/opt/lib"  export FC="gfortran -maix64 
-mcpu=power5"

 export LDFLAGS="-L/opt/lib"


2015-12-16 11:26bin/my_shared.ksh Page 1


#!/usr/bin/ksh
# my_config_test
#   --with-cairo=no --with-libpng=no --with-jpeglib=no 
--with-libtiff=no \
#   --with-cairo=no --with-libpng=yes --with-jpeglib=yes 
--with-libtiff=yes \

#   --with-libpth-prefix=/opt \
#   --with-aix-soname=aix
HOST=$1
RELEASE=$2

. ../${HOST}.env || exit -1

/data/prj/cran/${RELEASE}/configure --disable-lto --prefix=/opt \
--enable-R-shlib \
--with-cairo=no --with-libpng=no --with-jpeglib=no 
--with-libtiff=no \

--with-readline=no --with-x=no

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Assistance much appreciated

2015-12-18 Thread Michael Felt

On 2015-12-18 02:29, Simon Urbanek wrote:

Michael,

I got access to PDP AIX so I can try to replicate your problem. Can you, 
please, share exactly your setup - AIX version and well as how exactly you 
installed the compilers (=where from)? I can then try to replicate it. AFAICS 
there is no official binary for gfortran nor gcc 4.7 so it must be some 3rd 
party - which could also be a problem.

Thanks,
Simon

I installed a fresh system - AIX 6.1 TL5 this time, and built the system 
from scratch.


It is a long read, and I also made some discoveries about the contents 
of some of my newer packaging.
However, it you go through it you will see what is needed to make it all 
work.


The starting point are these filesets - available via my aixtools.net site:

root@x069:[/data/prj/cran/32/R-aix-3.2.3]ls -l /tmp/download
total 622400
-rw-r--r--1 root system27482 Dec 18 12:34 .toc
-rwxrwxr--1 199  33   828928 Sep 17 2012  
aixtools.gmp.5.0.5.0.I
-rw-r--r--1 root system  2102784 Jul 30 07:04 
aixtools.gnu.autoconf.2.69.0.0.aix537.I
-rw-r--r--1 root system  1461248 Jul 30 07:56 
aixtools.gnu.automake.1.15.0.0.aix537.I
-rw-r--r--1 root system  5321728 Sep 13 15:10 
aixtools.gnu.bash.4.3.42.0.aix537.I
-rw-r--r--1 root system 11640832 Aug 07 00:02 
aixtools.gnu.gettext.0.19.5.0.aix537.I
-rw-r--r--1 root system  1702912 Jul 30 08:08 
aixtools.gnu.libtool.2.4.6.0.aix537.I
-rw-r--r--1 root system   541184 Jun 13 2015  
aixtools.gnu.m4.1.4.17.0.aix537.I
-rw-r--r--1 root system  1229824 Jun 13 2015  
aixtools.gnu.make.4.1.0.0.aix537.I
-rw-r--r--1 root system  1348096 Nov 27 2014  
aixtools.libiconv.1.14.0.0.aix537.I
-rw-r--r--1 199  33   265216 Oct 31 2014  
aixtools.mpc.1.0.2.0.I
-rw-r--r--1 199  33   576512 Oct 31 2014  
aixtools.mpfr.2.4.2.0.I
-rw-r--r--1 199  1954  290915328 Apr 16 2015  
aixtools.obj.gcc.4.7.4.0.aix537.I
-rw-r--r--1 root system   679424 Jun 02 2015  
aixtools.xz.5.0.8.0.aix537.I



Note: the aixtools.xz (lzma support) was a surprise, as the internal one 
did not link properly, for some reason (all in the file,
not included here, but available at: 
http://download.aixtools.net/test/R/build-freshstart.text (Trying to not 
overfill lots of mail boxes).


Also note, in the file there is a segmentation fault, core dump, but 
does not halt the build. Maybe this has been around on my previous 
builds on AIX 5.3 and 7.1 - but not noticed.


I did struggle for a few days with a buggy bos.adt.libm on AIX 7.1 
(installing an older version made my problem go away).


Segmentation error text:

 *** caught segfault ***
address 55544300, cause 'memory not mapped'

Traceback:
 1: format.POSIXlt(as.POSIXlt(x, tz), format, usetz, ...)
 2: structure(format.POSIXlt(as.POSIXlt(x, tz), format, usetz, 
...), names = names(x))

 3: format.POSIXct(Sys.time(), "%Y-%m-%d at %H:%M:%S")
 4: format(Sys.time(), "%Y-%m-%d at %H:%M:%S")
 5: eval(expr, envir, enclos)
 6: eval(expr, env)
 7: withVisible(eval(expr, env))
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(withVisible(eval(expr, env)), error = function(e) e)
12: evalWithOpt(ce, options, env)
13: processRdChunk(block, stage, options, env, macros = macros)
14: recurse(block[[i]])
15: recurse(block[[i]])
16: recurse(block[[i]])
17: recurse(block)
18: getDynamicFlags(block)
19: recurse(block)
20: expandDynamicFlags(recurse(block), options)
21: processRdSexprs(Rd, stage, options, macros = attr(Rd, "macros"))
22: prepare_Rd(f, encoding = encoding, defines = os, stages = 
stages, warningCalls = FALSE, stage2 = step > 1L, stage3 = step 
> 2L, macros = macros)

23: FUN(X[[i]], ...)
24: lapply(files, .fetch_Rd_object)
25: .build_Rd_db(dir, manfiles, db_file = db_file, encoding = 
encoding, built_file = built_file)
26: 
tools:::.install_package_Rd_objects("/data/prj/cran/R-3.2.3/src/library/tools", 
"../../library/tools")

aborting ...
/bin/sh[3]: 4915208 Segmentation fault(coredump)
Makefile:73: recipe for target 'tools.Rdts' failed
make[3]: *** [tools.Rdts] Error 1
make[3]: Leaving directory '/data/prj/cran/32/R-aix-3.2.3/src/library'
Makefile:79: recipe for target 'Rdobjects' failed
make[2]: *** [Rdobjects] Error 2
make[2]: Leaving directory '/data/prj/cran/32/R-aix-3.2.3/src/library'
Makefile:62: recipe for target 'docs' failed
make[1]: *** [docs] Error 2
make[1]: Leaving directory '/data/prj/cran/32/R-aix-3.2.3/src/library'
Makefile:72: recipe for target 'docs' failed
make: [docs] Error 2 (ignored)
make[1]: Entering directory 
'/data/prj/cran/32/R-aix-3.2.3/src/library/Recommended'
make[2]: Entering directory 
'/data/prj/cran/32/R-aix-3.2.3/src/library/Recommended'

begin installing recommended package MASS
* installing *source* package 'MASS' ...
*

Re: [Rd] Assistance much appreciated

2015-12-18 Thread Michael Felt

On 2015-12-18 14:21, Michael Felt wrote:

root@x069:[/data/prj/cran/32/R-aix-3.2.3]ls -l /tmp/download
total 622400
-rw-r--r--1 root system27482 Dec 18 12:34 .toc
-rwxrwxr--1 199  33   828928 Sep 17 2012  
aixtools.gmp.5.0.5.0.I
-rw-r--r--1 root system  2102784 Jul 30 07:04 
aixtools.gnu.autoconf.2.69.0.0.aix537.I
-rw-r--r--1 root system  1461248 Jul 30 07:56 
aixtools.gnu.automake.1.15.0.0.aix537.I
-rw-r--r--1 root system  5321728 Sep 13 15:10 
aixtools.gnu.bash.4.3.42.0.aix537.I
-rw-r--r--1 root system 11640832 Aug 07 00:02 
aixtools.gnu.gettext.0.19.5.0.aix537.I
-rw-r--r--1 root system  1702912 Jul 30 08:08 
aixtools.gnu.libtool.2.4.6.0.aix537.I
-rw-r--r--1 root system   541184 Jun 13 2015  
aixtools.gnu.m4.1.4.17.0.aix537.I
-rw-r--r--1 root system  1229824 Jun 13 2015  
aixtools.gnu.make.4.1.0.0.aix537.I
-rw-r--r--1 root system  1348096 Nov 27 2014  
aixtools.libiconv.1.14.0.0.aix537.I
-rw-r--r--1 199  33   265216 Oct 31 2014  
aixtools.mpc.1.0.2.0.I
-rw-r--r--1 199  33   576512 Oct 31 2014  
aixtools.mpfr.2.4.2.0.I
-rw-r--r--1 199  1954  290915328 Apr 16 2015  
aixtools.obj.gcc.4.7.4.0.aix537.I
-rw-r--r--1 root system   679424 Jun 02 2015  
aixtools.xz.5.0.8.0.aix537.I 
To simplify this, I put this is a compressed archive at: 
http://download.aixtools.net/test/R/download-aixtools.tar.bz2


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel