octgpr/0000755000175000001440000000000011424006530011350 5ustar hajekusersoctgpr/inst/0000755000175000001440000000000011424006530012325 5ustar hajekusersoctgpr/inst/demo_octgpr.m0000644000175000001440000001610211236472444015021 0ustar hajekusers% Copyright (C) 2008 VZLU Prague, a.s., Czech Republic % % Author: Jaroslav Hajek % % This file is part of OctGPR. % % OctGPR is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this software; see the file COPYING. If not, see % . % % -*- texinfo -*- % @deftypefn {Function File} demo_octgpr (1, nsamp = 150) % @deftypefnx {Function File} demo_octgpr (2, ncnt = 20, npt = 500) % @deftypefnx {Function File} demo_octgpr (3, ncnt = 50, nsamp = 500) % OctGPR package demo function. % First argument selects available demos: % % @itemize % @item 1. GPR regression demo @* % A function is sampled (with small noise), then reconstructed using GPR % regression. @var{nsamp} specifies the number of samples. % @seealso{gpr_train, gpr_predict} % @item 2. RBF centers selection demo @* % Radial basis centers are selected amongst random points. % @var{ncnt} specifies number of centers, @var{npt} number of points. % @item 2. PGP regression demo @* % A function is densely sampled (with small noise), % radial basis centers are selected, then the function is reconstructed % using PGP regression. @var{nsamp} specifies the number of samples, % @var{ncnt} specifies number of centers. % @end itemize % @end deftypefn function demo_octgpr (number, varargin) global prntfmt = ''; if (nargin < 1) print_usage (); elseif (ischar (number)) prntfmt = number; elseif (isscalar (number)) figure (); if (! isempty (prntfmt)) figure (gcf, "visible", "off"); endif switch (number) case 1 demo_octgpr1 (varargin{:}) case 2 demo_octgpr2 (varargin{:}) case 3 demo_octgpr3 (varargin{:}) otherwise error ("demo_octgpr: invalid demo number") endswitch else print_usage (); endif endfunction function demo_octgpr_pause (idemo, iplot) global prntfmt; if (isempty (prntfmt)) pause; else print (sprintf (prntfmt, idemo, iplot)); fflush (stdout); endif endfunction % define the test function (the well-known matlab "peaks" plus some sines) function z = testfun1 (x, y) z = 4 + 3 * (1-x).^2 .* exp(-(x.^2) - (y+1).^2) ... + 10 * (x/5 - x.^3 - y.^5) .* exp(-x.^2 - y.^2) ... - 1/3 * exp(-(x+1).^2 - y.^2) ... + 2*sin (x + y + 1e-1*x.*y); endfunction function demo_octgpr1 (nsamp = 150) global prntfmt; tit = "a peaked surface"; disp (tit); % create the mesh onto which to interpolate t = linspace (-3, 3, 50); [xi,yi] = meshgrid (t, t); % evaluate zi = testfun1 (xi, yi); zimax = max (vec (zi)); zimin = min (vec (zi)); subplot (2, 2, 1); mesh (xi, yi, zi); title (tit); subplot (2, 2, 3); contourf (xi, yi, zi, 20); demo_octgpr_pause (1, 1); tit = sprintf ("sampled at %d random points", nsamp); disp (tit); % create random samples xs = rand (nsamp,1); ys = rand (nsamp,1); xs = 6*xs-3; ys = 6*ys - 3; % evaluate at random samples zs = testfun1 (xs, ys); xys = [xs ys]; subplot (2, 2, 2); plot3 (xs, ys, zs, ".+"); title (tit); subplot (2, 2, 3); hold on plot (xs, ys, "+6"); hold off subplot (2, 2, 4); plot (xs, ys, ".+"); demo_octgpr_pause (1, 2); tit = "GPR model with heuristic hypers"; disp (tit); ths = 1 ./ std (xys); GPM = gpr_train (xys, zs, ths, 1e-5); zm = gpr_predict (GPM, [vec(xi) vec(yi)]); zm = reshape (zm, size(zi)); zm = min (zm, zimax); zm = max (zm, zimin); subplot (2, 2, 2); mesh (xi, yi, zm); title (tit); subplot(2, 2, 4); hold on contourf (xi, yi, zm, 20); plot (xs, ys, "+6"); hold off demo_octgpr_pause (1, 3); tit = "GPR model with MLE training"; disp (tit); fflush (stdout); GPM = gpr_train (xys, zs, ths, 1e-5, {"tol", 1e-5, "maxev", 400, "numin", 1e-8}); zm = gpr_predict (GPM, [vec(xi) vec(yi)]); zm = reshape (zm, size (zi)); zm = min (zm, zimax); zm = max (zm, zimin); subplot (2, 2, 2); mesh (xi, yi, zm); title (tit); subplot(2, 2, 4); hold on contourf (xi, yi, zm, 20); plot (xs, ys, "+6"); hold off demo_octgpr_pause (1, 4); close endfunction function demo_octgpr2 (ncnt = 50, npt = 500) global prntfmt; npt = ncnt*ceil (npt/ncnt); U = rand (ncnt, 2); cs = min (pdist2_mw (U, 2) + diag (Inf (ncnt, 1))); X = repmat (U, npt/ncnt, 1) + repmat (cs', npt/ncnt, 2) .* randn (npt, 2); disp ("slightly clustered random points") plot (X(:,1), X(:,2), "+"); demo_octgpr_pause (2, 1); [U, ur] = rbf_centers(X, ncnt); fi = linspace (0, 2*pi, 20); ncolors = rows (colormap); hold on for i = 1:rows (U) xc = U(i,1) + ur(i) * cos (fi); yc = U(i,2) + ur(i) * sin (fi); line (xc, yc); endfor hold off demo_octgpr_pause (2, 2); close endfunction function demo_octgpr3 (ncnt = 100, nsamp = 1000) global prntfmt; tit = "a peaked surface"; disp (tit); % create the mesh onto which to interpolate t = linspace (-3, 3, 50); [xi,yi] = meshgrid (t, t); % evaluate zi = testfun1 (xi, yi); zimax = max (vec (zi)); zimin = min (vec (zi)); subplot (2, 2, 1); mesh (xi, yi, zi); title (tit); subplot (2, 2, 3); contourf (xi, yi, zi, 20); demo_octgpr_pause (1, 1); tit = sprintf ("sampled at %d random points, selected %d centers", nsamp, ncnt); disp (tit); % create random samples xs = rand (nsamp,1); ys = rand (nsamp,1); xs = 6*xs-3; ys = 6*ys - 3; % evaluate at random samples zs = testfun1 (xs, ys); xys = [xs ys]; % select centers using k-means xyc = rbf_centers (xys, ncnt); xc = xyc(:,1); yc = xyc(:,2); subplot (2, 2, 2); plot3 (xs, ys, zs, ".+"); title (tit); subplot (2, 2, 3); hold on plot (xs, ys, "+6"); hold off subplot (2, 2, 4); hold on plot (xs, ys, "+"); plot (xc, yc, "o2"); hold off demo_octgpr_pause (1, 2); tit = "PGP model with heuristic hypers"; disp (tit); ths = 1 ./ std (xyc); GPM = pgp_train (xys, xyc, zs, ths, 1e-5); zm = pgp_predict (GPM, [vec(xi) vec(yi)]); zm = reshape (zm, size(zi)); zm = min (zm, zimax); zm = max (zm, zimin); subplot (2, 2, 2); mesh (xi, yi, zm); title (tit); subplot(2, 2, 4); hold on contourf (xi, yi, zm, 20); plot (xs, ys, "+6"); plot (xc, yc, "o5"); hold off demo_octgpr_pause (1, 3); tit = "PGP model with MLE training"; disp (tit); fflush (stdout); GPM = pgp_train (xys, xyc, zs, ths, 1e-3, {"tol", 1e-5, "maxev", 400}); zm = pgp_predict (GPM, [vec(xi) vec(yi)]); zm = reshape (zm, size (zi)); zm = min (zm, zimax); zm = max (zm, zimin); subplot (2, 2, 2); mesh (xi, yi, zm); title (tit); subplot(2, 2, 4); hold on contourf (xi, yi, zm, 20); plot (xs, ys, "+6"); plot (xc, yc, "o5"); hold off demo_octgpr_pause (1, 4); close endfunction octgpr/inst/rbf_centers.m0000644000175000001440000000435211236472444015017 0ustar hajekusers% Copyright (C) 2008 VZLU Prague, a.s., Czech Republic % % Author: Jaroslav Hajek % % This file is part of OctGPR. % % OctGPR is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 3 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this software; see the file COPYING. If not, see % . % % -*- texinfo -*- % @deftypefn {Function File} {[U, ur, iu]} = rbf_centers (@var{X}, @var{nu}, @var{theta}) % Selects a given number of RBF centers based on Lloyd's clustering algorithm. % % @end deftypefn function [U, ur, iu] = rbf_centers (X, nu, theta) if (nargin == 3) X *= diag (theta); elseif (nargin != 2) print_usage (); endif % the D^2 weighting initialization D = Inf; kk = 1:rows (X); cp = kk; for i = 1:nu jj = sum (rand() * cp(end) < cp); k(i) = kk(jj); kk(jj) = []; U = X(k(i),:); D = min (D, pdist2_mw(X, U, 'ssq')'); cp = cumsum (D(kk)); endfor % now perform the k-means algorithm U = X(k,:); D = pdist2_mw (U, X, 'ssq'); [xx, j] = min (D); it = 0; do for i = 1:columns (X) U(:,i) = accumarray (j.', X(:,i), [nu, 1]); endfor N = accumarray (j.', ones (1, length (j)), [nu, 1]); U = diag (N) \ U; i = find (all (U == 0, 2)); U(i,:) = X(ceil (rand (1, length (i)) * rows (X)), :); j1 = j; D = pdist2_mw (U, X, 'ssq'); [xx, j] = min (D); fprintf (stderr, "k-means iteration %d\r", ++it); until (all (j == j1)) fprintf (stderr, "\n"); if (nargout > 2) iu = j; endif if (nargout > 1) ur = zeros (nu, 1); for i = 1:nu ij = (j == i); ur(i) = sqrt (max (D(i,ij))); endfor endif if (nargin == 3) U = dmult (U, 1./theta); if (any(theta == 0)) U(:,theta == 0) = 0; endif endif endfunction octgpr/src/0000755000175000001440000000000011424006530012137 5ustar hajekusersoctgpr/src/dscrot.f0000644000175000001440000000343411236472444013624 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dscrot(trans,n,D,Z,x) c purpose: perform a "rotate and scale" transformation, i.e. c given a diagonal matrix D and orthogonal matrix c W, this subroutine computes c x = W*D*x if (trans == 'N' or 'n') c x = W'*D*x if (trans == 'T' or 't') c arguments: c trans (in) indicates transposition c n (in) dimension c D (in) scale matrix c Z (in) orthogonal matrix c x (io) the vector being transformed c wrk workspace >= n c character trans integer n double precision D(n),Z(n,n),x(n) double precision wrk(n) integer i logical lsame external lsame if (lsame(trans,'T')) then call dgemv(trans,n,n,1d0,Z,n,x,1,0d0,wrk,1) do i = 1,n x(i) = wrk(i)*D(i) end do else do i = 1,n wrk(i) = x(i)*D(i) end do call dgemv(trans,n,n,1d0,Z,n,wrk,1,0d0,x,1) end if end subroutine octgpr/src/forsubs.h0000644000175000001440000001607111236472444014014 0ustar hajekusers/* Copyright (C) 2008, 2009 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #ifndef _FORSUBS_H #define _FORSUBS_H #include typedef void (*corfptr) (const double *t, double *f, double *d); #ifdef __cplusplus extern "C" { #endif #define F77_corgau F77_FUNC(corgau,CORGAU) #define F77_corexp F77_FUNC(corexp,COREXP) #define F77_corimq F77_FUNC(corimq,CORIMQ) #define F77_cormt3 F77_FUNC(cormt3,CORMT3) #define F77_cormt5 F77_FUNC(cormt5,CORMT5) #define F77_nllgpr F77_FUNC(nllgpr,NLLGPR) #define F77_nldgpr F77_FUNC(nldgpr,NLDGPR) #define F77_nl0gpr F77_FUNC(nl0gpr,NL0GPR) #define F77_infgpr F77_FUNC(infgpr,INFGPR) #define F77_pakgpr F77_FUNC(pakgpr,PAKGPR) #define F77_nllpgp F77_FUNC(nllpgp,NLLPGP) #define F77_nldpgp F77_FUNC(nldpgp,NLDPGP) #define F77_nl0pgp F77_FUNC(nl0pgp,NL0PGP) #define F77_infpgp F77_FUNC(infpgp,INFPGP) #define F77_pakpgp F77_FUNC(pakpgp,PAKPGP) #define F77_stheta F77_FUNC(stheta,STHETA) #define F77_dtr2tp F77_FUNC(dtr2tp,DTR2TP) #define F77_optdrv F77_FUNC(optdrv,OPTDRV) void F77_corgau (const double *t, double *f, double *d); void F77_corexp (const double *t, double *f, double *d); void F77_corimq (const double *t, double *f, double *d); void F77_cormt3 (const double *t, double *f, double *d); void F77_cormt5 (const double *t, double *f, double *d); void F77_nllgpr (const int *ndim, const int *nx, const double x[], const double y[], const double theta[], const double *nu, double *var, const int *nlin, double mu[], double r[], double *nll, const corfptr corr, int *info ); void F77_nllpgp (const int *ndim, const int *nx, const int *nf, const double x[], const double f[], const double y[], const double theta[], const double *nu, double *var, const int *nlin, double mu[], double r[], double q[], double *nll, const corfptr corr, int *info); void F77_nldgpr (const int *ndim, const int *nx, const double x[], const double theta[], const double *nu, double *var, double r[], double dtheta[], double dnu[], int *info ); void F77_nldpgp (const int *ndim, const int *nx, const int *nf, const double x[], const double f[], const double theta[], const double *nu, double *var, double r[], double q[], double dtheta[], double *dnu, int *info ); void F77_nl0gpr (const int *nx, const double y[], const double *nu, double *nll0, double *nllinf ); void F77_nl0pgp (const int *nx, const int *nf, const double y[], const double *nu, double *nll0, double *nllinf ); void F77_infgpr (const int *ndim, const int *nx, const double x[], const double theta[], const double *nu, const double *var, const int *nlin, const double mu[], const double rp[], const corfptr corr, const double x0[], double *y0, double *sig0, const int *nder, double yd0[], double *w ); void F77_infpgp (const int *ndim, const int *nf, const double f[], const double theta[], const double *nu, const double *var, const int *nlin, const double mu[], const double qp[], const corfptr corr, const double x0[], double *y0, double *sig0, const int *nder, double yd0[], double *w ); void F77_stheta (const int *ndim, const int *nx, const double x[], double theta[] ); void F77_pakgpr (const int *nx, const int *nlin, const double mu[], const double r[], double mup[], double rp[] ); void F77_pakpgp (const int *nf, const int *nlin, const double mu[], const double r[], double mup[], double rp[] ); void F77_dtr2tp (const char *uplo, const char *diag, const int *n, const double a[], const int *lda, double ap[] ); void F77_optdrv (const int *ndim, double theta[], double *nu, double *nll, double dtheta[], double dnu[], double theta0[], double *nu0, double *nll0, double dtheta0[], double dnu0[], int *info, double scal[], const int *l2nu, double vm[], double cp[], int ic[] ); #ifdef __cplusplus } #endif #endif /* forsubs.h */ octgpr/src/nldgpr.f0000644000175000001440000000724511236472444013620 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nldgpr(ndim,nx,X,theta,nu,var,R, +dtheta,dnu,info) c purpose: calculate the negative log-likelihood derivatives c w.r.t. length scales and nu. It can be used after c nllgpr, to facilitate gradient-based MLE optimization c without finite-differencing. c arguments: c ndim (in) number of dimensions of input space c nx (in) number of training points c X (in) array of training input vectors c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var (in) MLE estimated global variance from nllgpr c R (inout) at least (nx)*(nx+1). The factorization details as c computed by nllgpr. R is destroyed. c dtheta (out) derivatives w.r.t. length scales c dnu (out) derivative and second derivative w.r.t. relative noise c info error code. Possible values are: c info = 0 no problem c info = 1 invalid correlation matrix from nllgpr (dtrtri c failure) integer ndim,nx,info real*8 X(ndim,nx),theta(ndim),nu,var real*8 R(nx,0:nx),dtheta(ndim),dnu(2) external dtrsv,dpotri,dsyr,xerbla integer i,j,k real*8 tmp,tmp2,m2 c argument checks info = 0 if (ndim < 0) then info = 1 else if (nx < 1) then info = 2 end if if (info /= 0) then call xerbla('nldgpr',info) return end if c form L' \ m = R \ ones(nx,1) call dtrsv('L','T','N',nx,R(1,1),nx,R(1,0),1) c turn the factorization into inversion call dpotri('L',nx,R(1,1),nx,info) if (info /= 0) goto 501 c compute sumsq(m) m2 = 0.d0 do i = 1,nx m2 = m2 + R(i,0)**2 end do c accumulate nu derivatives information dnu(1) = 0.d0 dnu(2) = 0 do j = 1,nx call dsdacc(nx-j,R(j+1,j),R(j+1,0),tmp2,tmp) tmp = 2*tmp + R(j,j)*R(j,0) tmp2 = tmp2 + 0.5d0*R(j,j)**2 dnu(1) = dnu(1) + R(j,j) dnu(2) = dnu(2) - tmp2 + R(j,0)*tmp/var end do c compute derivative w.r.t. nu**2 c compute second derivative w.r.t. nu**2/2 dnu(1) = 0.5d0*(dnu(1) - m2/var) dnu(2) = dnu(2) - m2**2 / var**2 * 0.5d0/nx c update to derivatives w.r.t. nu dnu(2) = 4*dnu(2)*nu**2 + 2*dnu(1) dnu(1) = 2*dnu(1)*nu c update to get element-wise sensitivities call dsyr('L',nx,-1.d0/var,R(1,0),1,R(1,1),nx) c compute derivatives w.r.t. length scales do k = 1,ndim dtheta(k) = 0.d0 end do do j=1,nx-1 do i=j+1,nx tmp = R(i,j)*R(i-j,nx+1-j) do k = 1,ndim dtheta(k) = dtheta(k) + tmp*(X(k,i)-X(k,j))**2 end do end do end do do k = 1,ndim dtheta(k) = 2*dtheta(k)*theta(k) end do c normal return info = 0 return c error returns 501 info = 1 return end subroutine octgpr/src/infgpr.f0000644000175000001440000001105211236472444013606 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine infgpr(ndim,nx,X,theta,nu,var,nlin,mu,RP,corr, +x0,y0,sig0,nder,yd0,work) c purpose: compute the prediction value, spatial derivatives c and prediction variance of the GPR regressor in c a single spatial point. Should be used after c nllgpr, but *NOT* after nldgpr (on the same data). c note: to facilitate better precision, the vector c R \ y~ is not fully formed for value prediction; c L \ y~ and L \ r are used instead. We use it for c derivatives, however, as the precision is less c important there (and the converse implies multiple c traversals through the matrix R and thus a speed c tradeoff). c arguments: c ndim (in) number of dimensions of input space c nx (in) number of training points c X (in) array of training input vectors c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var (in) MLE estimated global variance from nllgpr c nlin (in) number of linear trend variables c mu (in) at least nlin+1. Linear trend from nllgpr c RP (in) size at least 2*nx+nx*(nx+1)/2. Contains the factorization c details as computed by nllgpr, after packing the c triangular matrix L. c corr subroutine to calculate correlation value and its c derivative. Must be declared as follows: c subroutine corr(t,f,d) c double precision t,f,d c f = correlation c d = derivative c end subroutine c The correlation should satisfy f(0) = 1 and f(+inf) = 0. c t >= 0 is the scaled squared norm of input vectors c difference, i.e. sum(theta*(X(:,i)-X(:,j))**2) c x0 (in) the spatial point to predict in c y0 (out) the prediction values. c sig0 (out) the prediction sigmas (noise included). c nder(in) number of derivatives requested. 0 to omit derivatives. c yd0 (out) the prediction derivatives. if nder <= 0, yd0 is not c referenced. c work (out) workspace; size at least nx*(1+min(nder,1)) c integer ndim,nx,nlin,nder real*8 X(ndim,nx),theta(ndim),nu,var,x0(ndim) real*8 mu(0:nlin),RP(*),y0,sig0,yd0(*),work(nx,*) external corr external dwdis2,dsdacc,dtpsv,dcopy,xerbla real*8 tmp,dwdis2 integer i,k,info c argument checks info = 0 if (ndim < 0) then info = 1 else if (nx < 1) then info = 2 else if (nlin < 0 .or. nlin > ndim .or. nlin >= nx) then info = 7 end if if (info /= 0) then call xerbla('infgpr',info) return end if c calculate correlation vector r do i = 1,nx call corr(dwdis2(ndim,theta,X(1,i),x0),work(i,1),tmp) c only use last part of workspace if derivatives requested if (nder > 0) work(i,2) = tmp end do c form L \ r call dtpsv('L','N','N',nx,RP(2*nx+1),work(1,1),1) c accumulate sum((L\r).^2) and (L\y)'*(L\r) call dsdacc(nx,work(1,1),RP,sig0,tmp) c add linear trend tmp = tmp + mu(0) do k = 1,nlin tmp = tmp + x0(k)*mu(k) end do y0 = tmp c get deviation sig0 = sqrt((1+nu**2-sig0) * var) c calc derivatives only if necessary if (nder == 0) return do k = 1,nder yd0(k) = 0 end do do i = 1,nx c calculate the primary part tmp = RP(nx+i)*work(i,2) c apply chain rule do k = 1,nder yd0(k) = yd0(k) + tmp*(x0(k) - X(k,i)) end do end do c correction do k = 1,nder yd0(k) = yd0(k) * (2 * theta(k)**2) if (k <= nlin) yd0(k) = yd0(k) + mu(k) end do end subroutine octgpr/src/stheta.f0000644000175000001440000000364111236472444013616 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine stheta(ndim,nx,X,theta) c purpose: guess "typical" length scales for GPR regression c optimization purposes. These may either be used as c a starting guess, or as scaling factors. c this is currently very primitive: the reciprocal c of the standard deviation is calculated for each c dimension. May be replaced with something c c arguments: c ndim (in) number of dimensions c nx (in) number of observations c X (in) observations c theta (out) length scales c integer ndim,nx real*8 X(ndim,nx),theta(ndim) real*8 mX(ndim) integer i,k do k = 1,ndim mX(k) = 0 end do do i = 1,nx do k = 1,ndim mX(k) = mX(k) + X(k,i) end do end do do k = 1,ndim mX(k) = mX(k) / nx end do do k = 1,ndim theta(k) = 0 end do do i = 1,nx do k = 1,ndim theta(k) = theta(k) + (X(k,i) - mX(k))**2 end do end do do k = 1,ndim theta(k) = sqrt(nx / theta(k)) end do end subroutine octgpr/src/nldpgp.f0000644000175000001440000001162411236472444013612 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nldpgp(ndim,nx,nf,X,F,theta,nu,var,R,Q, +dtheta,dnu,info) c purpose: calculate the negative log-likelihood of a PGP c regressor, given a correlation function (along with c derivative), length scales and relative white noise c alongside estimates the constant or linear mean trend, c variance, and leaves data for possible subsequent use c of nldgpr to calculate derivatives. c arguments: c ndim (in) number of dimensions of input space c nx (in) number of training points c X (in) array of training input vectors c F (in) array of inducing input vectors c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var(out) MLE estimated global variance, multiplied by nu**2 c R (out) at least nx*(2*nf+1). The array contains useful factorization c details and is reused in nldpgp. c Q (out) at least nf*(2*nf+nlin+2). The array contains useful factorization c details and is reused in nldpgp and infpgp. c dtheta (out) derivatives w.r.t. length scales c dnu (out) derivative and second derivative w.r.t. relative noise c info error code. Possible values are: c info = 0 no problem c info < 0 illegal parameter value c info = 1 singular correlation matrix (increase nu) c info = 2 singular normal matrix (decrease nlin or c increase nx. integer ndim,nx,nf,info real*8 X(ndim,nx),F(ndim,nf),theta(ndim),nu,var real*8 R(nx,0:2*nf),Q(nf,2*nf+2) real*8 dtheta(ndim),dnu integer i,j,nl1,iA,iB,iz real*8 ddot,nu2,nu2i,elm,fac,dld,dvar external ddot,dtrsm,dtrsv,dpotri,dger,dsyr parameter (l2pi = 1.83787706640935d0) c argument checks info = 0 if (ndim < 0) then info = 1 else if (nx < 1) then info = 2 else if (nf < 1 .or. nf > nx) then info = 3 end if if (info /= 0) then call xerbla('nldpgp',info) return end if iA = nf + 1 iz = 2*nf + 2 c form ya = yy - RA * zz call dgemv('N',nx,nf,-1d0,R(1,1),nx,Q(1,iz),1,1d0,R(1,0),1) c update RA = R/A = RA / LA call dtrsm('R','L','N','N',nx,nf,1d0,Q(1,nf+1),nf,R(1,1),nx) c update z = A \ R'*y = LA' \ z call dtrsv('L','T','N',nf,Q(1,nf+1),nf,Q(1,iz),1) c turn LA into inv(A) call dpotri('L',nf,Q(1,nf+1),nf,info) if (info /= 0) goto 501 c turn LQ into inv(Q) call dpotri('L',nf,Q(1,1),nf,info) if (info /= 0) goto 502 nu2 = nu**2 nu2i = 1/nu2 c theta derivatives do k = 1,ndim dtheta(k) = 0d0 end do fac = -1d0/var call dsyr('L',nf,fac,Q(1,iz),1,Q(1,1),nf) c compute dld part do j = 1,nf-1 do i = j+1,nf elm = (nu2*Q(i,nf+j) - Q(i,j)) * Q(i-j,nf+1-j) do k = 1,ndim dtheta(k) = dtheta(k) + elm*(F(k,i)-F(k,j))**2 end do end do end do fac = -nu2i/var call dger(nx,nf,fac,R(1,0),1,Q(1,iz),1,R(1,1),nx) do j = 1,nf do i = 1,nx elm = R(i,j) * R(i,j+nf) do k = 1,ndim dtheta(k) = dtheta(k) + elm*(X(k,i)-F(k,j))**2 end do end do end do do k = 1,ndim dtheta(k) = 2*theta(k)*dtheta(k) end do c nu derivative c compute 1/2*trace(inv(A)*Q) dld = 0d0 do j = 1,nf dld = dld + .5d0 * Q(j,nf+j)*Q(1,iz-j) if (j < nf) then dld = dld + ddot(nf-j,Q(j+1,nf+j),1,Q(2,iz-j),1) end if end do c compute dld part dld = dld + .5d0 * (nx-nf)*nu**(-2) c compute 1/2*zz'*Q*zz dvar = 0d0 do j = 1,nf dvar = dvar + .5d0 * Q(1,iz-j)*Q(j,iz)**2 if (j < nf) then dvar = dvar + ddot(nf-j,Q(2,iz-j),1,Q(j+1,iz),1)*Q(j,iz) end if end do c compute dvar part dvar = -nu**(-2) * (.5d0*nx - dvar/var) c calc dnu dnu = 2*nu * (dld + dvar) c normal return info = 0 return c error returns 501 info = 1 return 502 info = 2 return end subroutine octgpr/src/pakgpr.f0000644000175000001440000000341611236472444013612 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine pakgpr(nx,nlin,mu,R,mup,RP) c purpose: packs the necessary data and other factorization details c as obtained by nllgpr. Used primarily to reduce stored c model size and save invariant computations in infgpr. c arguments: c nx (in) number of training points c nlin (in) number of linear trend variables c mu (in) as returned from nllgpr c mup (out) size at least nlin+1. Contains the mean. c R (in) dtto c RP (in) size at least 2*nx+nx*(nx+1)/2. Contains the factorization c details as computed by nllgpr, after packing the c triangular matrix L. c integer nx,nlin real*8 mu(nlin+1,*),R(nx,*),mup(*),RP(*) external dcopy,dtrsv,dtr2tp call dcopy(nlin+1,mu,1,mup,1) call dcopy(nx,R(1,1),1,RP(1),1) call dcopy(nx,R(1,1),1,RP(nx+1),1) call dtrsv('L','T','N',nx,R(1,2),nx,RP(nx+1),1) call dtr2tp('L','N',nx,R(1,2),nx,RP(2*nx+1)) end subroutine octgpr/src/Makefile.in0000644000175000001440000000452611251140403014207 0ustar hajekusers# Copyright (C) 2008 VZLU Prague, a.s., Czech Republic # # Author: Jaroslav Hajek # # This file is part of OctGPR. # # OctGPR is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this software; see the file COPYING. If not, see # . # F77=@F77@ MKOCTFILE=@MKOCTFILE@ FFLAGS=@FFLAGS@ @FPICFLAG@ CC=@CC@ @CPICFLAG@ CFLAGS=@CFLAGS@ -I. LIBS=@LIBS@ OBJS_GPR_TRAIN=dsdacc.o dwdis2.o dtr2tp.o corrf.o stheta.o \ nllgpr.o nldgpr.o nl0gpr.o pakgpr.o \ nllpgp.o nldpgp.o nl0pgp.o pakpgp.o \ dscrot.o dscsev.o dspmid.o dxnrm2.o \ dgesum.o dsumsq.o \ trstp.o sr1upd.o optdrv.o \ get_corrf.o train.o setup.o OBJS_GPR_PRED=dsdacc.o dwdis2.o dsumsq.o infgpr.o infpgp.o corrf.o \ get_corrf.o predict.o all: gpr_train.oct gpr_predict.oct pgp_train.oct pgp_predict.oct pdist2_mw.oct %.o: %.f $(F77) $(FFLAGS) -c $< %.o: %.c forsubs.h gprmod.h $(CC) $(CFLAGS) -c $< # C++ files are preferably compiled with mkoctfile directly gpr_train.o: gpr_train.cc gprmod.h forsubs.h $(MKOCTFILE) -c $< pgp_train.o: pgp_train.cc gprmod.h forsubs.h $(MKOCTFILE) -c $< gpr_predict.o: gpr_predict.cc gprmod.h forsubs.h $(MKOCTFILE) -c $< pgp_predict.o: pgp_predict.cc gprmod.h forsubs.h $(MKOCTFILE) -c $< gpr_train.oct: gpr_train.o $(OBJS_GPR_TRAIN) $(MKOCTFILE) -o $@ gpr_train.o $(OBJS_GPR_TRAIN) $(LIBS) gpr_predict.oct: gpr_predict.o $(OBJS_GPR_PRED) $(MKOCTFILE) -o $@ gpr_predict.o $(OBJS_GPR_PRED) $(LIBS) pgp_train.oct: pgp_train.o $(OBJS_GPR_TRAIN) $(MKOCTFILE) -o $@ pgp_train.o $(OBJS_GPR_TRAIN) $(LIBS) pgp_predict.oct: pgp_predict.o $(OBJS_GPR_PRED) $(MKOCTFILE) -o $@ pgp_predict.o $(OBJS_GPR_PRED) $(LIBS) pdist2_mw.oct: pdist2_mw.cc $(MKOCTFILE) -o $@ $< clean: rm -f *.o *.oct distclean: clean rm -f config.h Makefile config.log config.status octgpr/src/dgesum.f0000644000175000001440000000472711236472444013620 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dgesum(trans,m,n,A,lda,x,incx) c purpose: Return a column or row sum of an m-by-n matrix A. c arguments: c trans (in) If 'T', return row sum, otherwise if 'N' column sum. c m (in) Number of rows of the matrix A c n (in) Number of columns of the matrix A c A (in) The m-by-n matrix A c lda (in) The leading dimension of A. c x (out) The output vector. Should be at least 1+(k-1)*incx elements long, c where k = m if trans == 'T', else k = n. c incx (in) The stride for x (positive). c character*1 trans integer m,n,lda,incx real*8 A(lda,*),x(*) integer i,j,k real*8 sum logical lsame external lsame,xerbla c error checks if (lda <= 1 .or. lda < m) then call xerbla('dgesum',5) endif if (lsame(trans,'N')) then c code for column-wise summation k = 1 do j = 1,n sum = 0d0 do i = 1,m sum = sum + A(i,j) end do x(k) = sum k = k + incx end do else if (lsame(trans,'T')) then c code for row-wise summation if (incx == 1) then c specialization for unit stride do i = 1,m x(i) = 0 end do do j = 1,n do i = 1,m x(i) = x(i) + A(i,j) end do end do else c code for non-unit stride k = 1 do i = 1,m x(k) = 0 k = k + incx end do do j = 1,n k = 1 do i = 1,m x(k) = x(k) + A(i,j) k = k + incx end do end do end if end if end subroutine octgpr/src/nl0pgp.f0000644000175000001440000000356411236472444013532 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nl0pgp(nx,nf,y,nu,nll0,nllinf) c purpose: this function evaluates the negative log likelihood c of a PGP process regressor at boundaries: c nll0 is a common value for theta = 0 and c nllinf is a value for theta = infinity. c nx (in) number of training points c nf (in) number of inducing points c y (in) array of training input values c nu (in) relative white noise. nu = sqrt(var_white/var) c nll0 (out) the value of nllgpr for theta = 0 c nllinf (out) the limit of nllgpr at theta -> infinity. c integer nx double precision y(nx),nu,nll0,nllinf double precision mu,ssq parameter (l2pi = 1.83787706640935d0) integer i mu = 0 c calculate mean do i = 1,nx mu = mu + y(i) end do mu = mu / nx c calculate sigma estimate ssq = 0 do i = 1,nx ssq = ssq + (y(i)-mu)**2 end do c set values ssq = ssq / nx nllinf = 0.5d0 * nx * (log(ssq) + l2pi) nll0 = nllinf + 0.5d0 * log(1 + nx/nu**2) end subroutine octgpr/src/train.c0000644000175000001440000001346411236472444013444 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include #include "gprmod.h" #define DSIZE sizeof (double) int GPR_train (int ndim, int nx, const double *X, const double *y, double *theta, double *nu, double *nll, int nlin, corfptr corf, struct GPR_train_opts *opts) { double *wrk = malloc ((4*ndim+7)*DSIZE); double *scal = wrk; double *theta0 = scal + ndim; double *nu0 = theta0 + ndim; double *nll0 = nu0 + 1; double *var = nll0 + 1; double *dtheta = var + 1; double *dnu = dtheta + ndim; double *dtheta0 = dnu + 2; double *dnu0 = dtheta0 + ndim; double *VM = malloc (1+(ndim+1)*(3*ndim+2)/2*DSIZE); /* workspace for nllgpr, nldgpr */ double *R = malloc (nx*(nx+2+nlin)*DSIZE); double *mu = malloc ((nlin+1)*3*DSIZE); double CP[20]; double dummy; int IC[4]; int i, code, info, l2nu = 1; /* setup scale factors */ F77_stheta (&ndim, &nx, X, scal); info = 0; /* request default values */ for (i = 1; i < 20; i++) CP[i] = 0; CP[0] = opts->numin; CP[1] = (*nu > 1e-6) ? (*nu < 1e-1) ? *nu : 1e-1 : 1e-6; /* noise scale factor */ CP[2] = opts->tol; CP[11] = opts->ftol; /* setup the reference objective value */ F77_nl0gpr(&nx,y,nu,&dummy,&CP[10]); while (1) { /* call the optimization driver */ F77_optdrv (&ndim, theta, nu, nll, dtheta, dnu, theta0, nu0, nll0, dtheta0, dnu0, &info, scal, &l2nu, VM, CP, IC); if (info == 1 || info == 2) { code = TRAIN_CONV; break; } else if (info == 3) { code = TRAIN_PREM; break; } else if (info == -1) { code = TRAIN_FAIL; break; } /* evaluate objective */ F77_nllgpr (&ndim, &nx, X, y, theta, nu, var, &nlin, mu, R, nll, corf, &info); if (IC[0] > opts->maxev || (opts->monitor && (*opts->monitor) (opts->instance, IC[0], nll0) != 0)) { code = TRAIN_STOP; break; } if (!info) /* evaluate gradient */ F77_nldgpr (&ndim, &nx, X, theta, nu, var, R, dtheta, dnu, &info); /* mark whether the step was successful */ if (info) info = 2; else info = 1; } /* use last value. Change theta to have positive sign. */ for (i = 0; i < ndim; i++) theta[i] = fabs (theta0[i]); *nu = *nu0; *nll = *nll0; free (mu); free (R); free (VM); free (wrk); return code; } int PGP_train (int ndim, int nx, int nf, const double *X, const double *F, const double *y, double *theta, double *nu, double *nll, int nlin, corfptr corf, struct PGP_train_opts *opts) { double *wrk = malloc ((4*ndim+7)*DSIZE); double *scal = wrk; double *theta0 = scal + ndim; double *nu0 = theta0 + ndim; double *nll0 = nu0 + 1; double *var = nll0 + 1; double *dtheta = var + 1; double *dnu = dtheta + ndim; double *dtheta0 = dnu + 2; double *dnu0 = dtheta0 + ndim; double *VM = malloc (1+(ndim+1)*(3*ndim+2)/2*DSIZE); /* workspace for nllpgp, nldpgp */ double *R = malloc (nx*(2*nf+1)*DSIZE); double *Q = malloc (nf*(2*nf+nlin+3)*DSIZE); double *mu = malloc ((nlin+1)*3*DSIZE); double CP[20]; double dummy; int IC[4]; int i, code, info, l2nu = 1; /* setup scale factors */ F77_stheta (&ndim, &nx, X, scal); info = 0; /* request default values */ for (i = 1; i < 20; i++) CP[i] = 0; CP[0] = opts->numin; CP[1] = (*nu > 1e-6) ? (*nu < 1e-1) ? *nu : 1e-1 : 1e-6; /* noise scale factor */ CP[2] = opts->tol; CP[11] = opts->ftol; /* setup the reference objective value */ F77_nl0pgp(&nx,&nf,y,nu,&dummy,&CP[10]); while (1) { /* call the optimization driver */ F77_optdrv (&ndim, theta, nu, nll, dtheta, dnu, theta0, nu0, nll0, dtheta0, dnu0, &info, scal, &l2nu, VM, CP, IC); if (info == 1 || info == 2) { code = TRAIN_CONV; break; } else if (info == 3) { code = TRAIN_PREM; break; } else if (info == -1) { code = TRAIN_FAIL; break; } /* evaluate objective */ F77_nllpgp (&ndim, &nx, &nf, X, F, y, theta, nu, var, &nlin, mu, R, Q, nll, corf, &info); if (IC[0] > opts->maxev || (opts->monitor && (*opts->monitor) (opts->instance, IC[0], nll0) != 0)) { code = TRAIN_STOP; break; } if (!info) /* evaluate gradient */ F77_nldpgp (&ndim, &nx, &nf, X, F, theta, nu, var, R, Q, dtheta, dnu, &info); /* mark whether the step was successful */ if (info) info = 2; else info = 1; } /* use last value. Change theta to have positive sign. */ for (i = 0; i < ndim; i++) theta[i] = fabs (theta0[i]); *nu = *nu0; *nll = *nll0; free (mu); free (R); free (Q); free (VM); free (wrk); return code; } octgpr/src/corrf.f0000644000175000001440000000337211236472444013442 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine corgau(t,f,d) c the gaussian correlation exp(-x^2) double precision t,f,d f = exp(-t) d = -f end subroutine subroutine corexp(t,f,d) c the exponential correlation exp(-x) double precision t,f,d double precision r r = sqrt(t) f = exp(-r) d = -f / (2*r) end subroutine c inverse multiquadric subroutine corimq(t,f,d) double precision t,f,d f = 1 / sqrt(1+t**2) d = -2*t / f**3 end subroutine c Matern-3 covariance subroutine cormt3(t,f,d) double precision t,f,d double precision er,r r = sqrt(6d0*t) er = exp(-r) f = (1d0 + r) * er d = -3d0 * er end subroutine c Matern-5 covariance subroutine cormt5(t,f,d) double precision t,f,d double precision er,r,r53 r = sqrt(1d1*t) er = exp(-r) f = (1d0 + r + r**2/3d0) * er d = -(5d0/3d0) * (1d0 + r) * er end subroutine octgpr/src/nllpgp.f0000644000175000001440000001455611236472444013631 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nllpgp(ndim,nx,nf,X,F,y,theta,nu,var,nlin,mu,R,Q, +nll,corr,info) c purpose: calculate the negative log-likelihood of a PGP c regressor, given a correlation function (along with c derivative), length scales and relative white noise c alongside estimates the constant or linear mean trend, c variance, and leaves data for possible subsequent use c of nldgpr to calculate derivatives. c arguments: c ndim (in) number of dimensions of input space c nx (in) number of training vectors c nf (in) number of inducing vectors c X (in) array of training input vectors c F (in) array of inducing input vectors c y (in) array of training input values c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var (out) MLE estimated global variance c nlin (in) number of leading input variables to include in linear c mean trend. Set nlin = 0 to use a constant mean. c mu (out) at least (nlin+1)*(nlin+2). The first nlin+1 components c contain the components of the linear trend (constant c first). c R (out) at least nx*(2*nf+1). The array contains useful factorization c details and is reused in nldpgp. c Q (out) at least nf*(2*nf+nlin+3). The array contains useful factorization c details and is reused in nldpgp and infpgp. c nll (out) the negative log-likelihood c corr subroutine to calculate correlation value and its c derivative. Must be declared as follows: c subroutine corr(t,f,d) c double precision t,f,d c f = correlation c d = derivative c end subroutine c The correlation should satisfy f(0) = 1 and f(+inf) = 0. c t >= 0 is the scaled squared norm of input vectors c difference, i.e. sum(theta*(X(:,i)-X(:,j))**2) c info error code. Possible values are: c info = 0 no problem c info < 0 illegal parameter value c info = 1 singular correlation matrix (increase nu) c info = 2 singular inducing matrix (move away from region) c info = 3 singular normal matrix (decrease nlin or c increase nx. integer ndim,nx,nf,nlin,info real*8 X(ndim,nx),F(ndim,nf),y(nx),theta(ndim),nu,var real*8 mu(0:nlin,0:nlin+1),R(nx,0:2*nf),Q(nf,2*nf+nlin+3),nll external corr external dtrsm,dgemm,dgemv,dsyrk,xerbla,dlacpy,dpotrf, +dlamch,dposv,dwdis2,dgesum,dsumsq integer i,j,nl1,iA,iB,iz real*8 dlamch,dwdis2,dsumsq,sums,sum,l2pi,eps parameter (l2pi = 1.83787706640935d0) c argument checks info = 0 if (ndim < 0) then info = 1 else if (nx < 1) then info = 2 else if (nf < 1 .or. nf > nx) then info = 3 else if (nlin < 0 .or. nlin > ndim .or. nlin >= nx) then info = 10 end if if (info /= 0) then call xerbla('nllpgp',info) return end if do j = 1,nf do i = 1,nx sums = dwdis2(ndim,theta,X(1,i),F(1,j)) call corr(sums,R(i,j),R(i,nf+j)) end do end do do j = 1,nf Q(j,j) = 1 do i = j+1,nf sums = dwdis2(ndim,theta,F(1,i),F(1,j)) call corr(sums,Q(i,j),Q(i-j,nf+1-j)) end do end do iA = nf + 1 iz = 2*nf + 2 c save a copy of Q (columns reversed) do j = 1,nf call dcopy(nf+1-j,Q(j,j),1,Q(1,iz-j),1) end do c form & factorize A = (nu2*Q + R'*R) call dlacpy('L',nf,nf,Q(1,1),nf,Q(1,iA),nf) call dsyrk('L','T',nf,nx,1d0,R(1,1),nx,nu**2,Q(1,iA),nf) call dpotrf('L',nf,Q(1,iA),nf,info) if (info /= 0) goto 501 c factorize Q call dpotrf('L',nf,Q(1,1),nf,info) if (info /= 0) goto 502 nl1 = nlin + 1 c form RA = R / LA' call dtrsm('R','L','T','N',nx,nf,1d0,Q(1,iA),nf,R(1,1),nx) c form z = LA \ R'*y = RA'*y call dgemv('T',nx,nf,1d0,R(1,1),nx,y,1,0d0,Q(1,iz),1) c form B = LA \ R'*M = RA'*M iB = iz + 1 call dgesum('N',nx,nf,R(1,1),nx,Q(1,iB),1) call dgemm('T','T',nf,nlin,nx,1d0,R(1,1),nx,X,ndim, + 0d0,Q(1,iB+1),nf) c form E = M'*M - B'*B mu(0,1) = nx call dgesum('T',nlin,nx,X,ndim,mu(1,1),1) call dsyrk('L','N',nlin,nx,1d0,X,ndim,0d0,mu(1,2),nl1) call dsyrk('L','T',nl1,nf,-1d0,Q(1,iB),nf,1d0,mu(0,1),nl1) c form w = M'*y - M'*R/A*R'*y = M'*y - B'*z call dgesum('N',nx,1,y,nx,mu(0,0),1) call dgemv('N',nlin,nx,1d0,X,ndim,y,1,0d0,mu(1,0),1) call dgemv('T',nf,nl1,-1d0,Q(1,iB),nf,Q(1,iz),1,1d0,mu(0,0),1) c solve mu = E \ w call dposv('L',nl1,1,mu(0,1),nl1,mu(0,0),nl1,info) if (info /= 0) goto 503 c update zz = LA \ R' * (y - M*mu) = z - B*mu call dgemv('N',nf,nl1,-1d0,Q(1,iB),nf,mu,1,1d0,Q(1,iz),1) c form yy = y - M*mu do i = 1,nx R(i,0) = y(i) - mu(0,0) end do call dgemv('T',nlin,nx,-1d0,X,ndim,mu(1,0),1,1d0,R(1,0),1) var = dsumsq(nx,R(1,0),1) - dsumsq(nf,Q(1,iz),1) var = nu**(-2) * var / nx sum = log(nu)*(nx-nf) do i = 1,nf sum = sum - log(Q(i,i)) end do do i = 1,nf sum = sum + log(Q(i,nf+i)) end do c final negative log likelihood nll = sum + 0.5d0 * nx*(log(var) + l2pi) c normal return info = 0 return c error returns 501 info = 1 return 502 info = 2 return 503 info = 3 return end subroutine octgpr/src/dtr2tp.f0000644000175000001440000000474111236472444013547 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dtr2tp(uplo,diag,n,a,lda,ap) c purpose: converts a triangular matrix into BLAS packed form c arguments: c uplo 'L' or 'U'. lower/upper c diag 'N' or 'U'. if 'U', the diagonal elements of a are not c referenced, but assumed to be unity. c n order of matrix a c a the triangular matrix c lda leading dim of a c ap the packed form. Size must be at least n*(n+1)/2. c character uplo,diag integer n,lda double precision a(lda,*),ap(*) logical nounit,lsame external lsame,xerbla integer i,j,k,info info = 0 if (.not.lsame(uplo,'u') .and. .not.lsame(uplo,'l')) then info = 1 else if (.not.lsame(diag,'u') .and. .not.lsame(diag,'n')) then info = 2 else if (n < 0) then info = 3 else if (lda < 1) then info = 6 end if if (info /= 0) then call xerbla('dtr2tp',info) return end if nounit = lsame(diag,'N') if (lsame(uplo,'U')) then c code for upper triangular matrix k = 0 do j = 1,n do i = 1,j-1 k = k + 1 ap(k) = a(i,j) end do k = k + 1 if (nounit) then ap(k) = a(j,j) else ap(k) = 1.d0 end if end do else c code for lower triangular matrix k = 0 do j = 1,n k = k + 1 if (nounit) then ap(k) = a(j,j) else ap(k) = 1.d0 end if do i = j+1,n k = k + 1 ap(k) = a(i,j) end do end do end if return end subroutine octgpr/src/gpr_predict.cc0000644000175000001440000001043711236472444014771 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include "gprmod.h" octave_value getfield (const Octave_map& map, const char *field, bool& err) { const Cell c = map.contents (field); if (!c.is_empty ()) return c (0); else { err = true; return octave_value (); } } DEFUN_DLD (gpr_predict, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{y}}= gpr_predict (@var{GPM},@var{X})\n\ @deftypefnx {Loadable Function} {[@var{y},@var{sig}]}= gpr_predict (@var{GPM},@var{X})\n\ @deftypefnx {Loadable Function} {[@var{y},@var{sig},@var{dy}]}= gpr_predict (@var{GPM},@var{X})\n\ @cindex Gaussian Process Regression inference \n\ Uses the model @var{GPM} to predict values, standard deviations and model\n\ derivatives in spatial points. @var{X} is the matrix of independent variables. \n\ (The organization is determined by GPM.theta, as in @code{gpr_train}). \n\ \n\ @var{y} is set to the predicted dependent variable values. \n\ If @var{sig} is requested, it is set to the estimated prediction deviations. \n\ If @var{dy} is requested, it is populated with the prediction gradients. \n\ \n\ @seealso{gpr_train, gpr_setup}\n\ @end deftypefn") { octave_value_list retval; int nargin = args.length (); if (nargin != 2 || nargout > 3 || nargout < 1) { print_usage (); return retval; } octave_value arg; // extract the model info arg = args (0); if (!arg.is_map ()) { error ("the first argument must be a structure."); return retval; } Octave_map GPM (arg.map_value ()); // parse model structure bool err = false;; Matrix X (getfield (GPM, "X", err).matrix_value ()); int nx = X.cols (); Matrix theta (getfield (GPM, "theta", err).matrix_value ()); // determine row/col convention int ndim = theta.rows (); bool trans = ndim == 1; if (trans) ndim = theta.cols (); if (theta.rows () == 1) trans = true, ndim = theta.cols (); else if (theta.cols () == 1) trans = false, ndim = theta.rows (); else ndim = 0; double nu = getfield (GPM, "nu", err).scalar_value (); double var = getfield (GPM, "var", err).scalar_value (); ColumnVector mu (getfield (GPM, "mu", err).matrix_value ()); int nlin = mu.numel ()-1; ColumnVector RP (getfield (GPM, "RP", err).matrix_value ()); std::string corfs = getfield (GPM, "corf", err).string_value (); corfptr corf = get_corrf (corfs.c_str ()); if (!corf) error ("invalid correlation funspec: %s", corfs.c_str ()); if (err) { error ("the GPM structure is incomplete"); return retval; } arg = args (1); if (!arg.is_real_matrix ()) { error ("X must be a real matrix"); return retval; } Matrix X0 (arg.matrix_value ()); if (trans) X0 = X0.transpose (); if (X0.rows () != ndim) error ("dimension mismatch."); int nx0 = X0.cols (); // build return values Matrix y0 (trans?nx0:1, trans?1:nx0), sig0 (trans?nx0:1, trans?1:nx0), yd0; if (nargout > 2) yd0 = Matrix (ndim, nx0); // do the predictions if (nx0 > 0) GPR_predict (ndim, nx, X.data (), theta.data (), &nu, nlin, corf, &var, mu.data (), RP.data (), nx0, X0.data (), y0.fortran_vec (), sig0.fortran_vec (), (nargout > 2) ? yd0.fortran_vec () : 0); // build return list retval = octave_value_list (nargout, octave_value ()); retval (0) = y0; if (nargout > 1) retval (1) = sig0; if (nargout > 2) retval (2) = trans?yd0.transpose ():yd0; return retval; } octgpr/src/dspmid.f0000644000175000001440000000315311236472444013604 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dspmid(uplo,n,a,AP) c purpose: assistant subroutine. Sets a packed symmetric matrix c (upper storage) to a multiple of identity. c arguments: c uplo (in) indicates upper or lower BLAS packed storage c n (in) dimension of A c a (in) the multiple to set A to c AP (out) A in packed storage (upper triangle column after column) c character uplo integer n,i,j double precision a,AP(*) external lsame logical lsame if (lsame(uplo,'U')) then j = 0 do i = 0,n-1 do j = j+1,j+i AP(j) = 0 end do AP(j) = a end do else j = 1 do i = 0,n-1 AP(j) = a do j = j+1,j+i AP(j) = 0 end do end do end if end subroutine octgpr/src/configure.base0000644000175000001440000000564611321417264014775 0ustar hajekusers# Copyright (C) 2008 VZLU Prague, a.s., Czech Republic # # Author: Jaroslav Hajek # # This file is part of OctGPR. # # OctGPR is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this software; see the file COPYING. If not, see # . # # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.61) AC_INIT(OctGPR, 1.1.0, highegg@gmail.com) # check for mkoctfile AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) if test -z $MKOCTFILE ; then AC_MSG_ERROR("mkoctfile not found. Perhaps you do not have octave installed?") fi # get preferred compilers F77=`$MKOCTFILE -p F77` CC=`$MKOCTFILE -p CC` # get preferred flags FFLAGS=`$MKOCTFILE -p FFLAGS` CFLAGS=`$MKOCTFILE -p CFLAGS` # add -fPIC or equivalent flags FPICFLAG=`$MKOCTFILE -p FPICFLAG` CPICFLAG=`$MKOCTFILE -p CPICFLAG` FFLAGS="$FFLAGS $FPICFLAG" CFLAGS="$CFLAGS $CPICFLAG" AC_SUBST(FPICFLAG) AC_SUBST(CPICFLAG) # Checks for compilers. AC_PROG_F77([$F77 gfortran g77]) AC_PROG_CC([$CC gcc]) # Checks for libraries. # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h string.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST # Checks for library functions. AC_FUNC_ERROR_AT_LINE AC_FUNC_MALLOC AC_CHECK_FUNCS([fprintf fflush]) # enter Fortran section AC_LANG(Fortran 77) AC_F77_WRAPPERS # add some optimizations to GNU Fortran if test x$F77 = xgfortran -o x$F77 = xg77 ; then FFLAGS="$FFLAGS -O2 -funroll-loops" fi # if LAPACK libs are not specified try to use BLAS_LIBS from mkoctfile if test -z "$LAPACK_LIBS"; then echo -n "checking $MKOCTFILE for \$BLAS_LIBS... " LAPACK_LIBS=`$MKOCTFILE -p BLAS_LIBS` echo "$LAPACK_LIBS" else echo "user specified LAPACK libs: $LAPACK_LIBS" fi LIBS="$LIBS $LAPACK_LIBS" # check for external BLAS library routines AC_SEARCH_LIBS(dtpsv,goto atlas blas) AC_SEARCH_LIBS(dspr,goto atlas blas) # check for external LAPACK library routines # NOTE: BLAS should go first, so that it gets listed earlier. # many optimized blas libraries offer optimized xPOTRF AC_SEARCH_LIBS(dpotrf,goto atlas lapack) AC_SEARCH_LIBS(dgeqr2,goto atlas lapack) AC_SEARCH_LIBS(dorm2r,goto atlas lapack) AC_SEARCH_LIBS(dtrtrs,goto atlas lapack) AC_SEARCH_LIBS(dpotri,goto atlas lapack) AC_SEARCH_LIBS(dsyev,goto atlas lapack) AC_CONFIG_HEADER([config.h]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT octgpr/src/pgp_predict.cc0000644000175000001440000001043111236472444014761 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include "gprmod.h" octave_value getfield (const Octave_map& map, const char *field, bool& err) { const Cell c = map.contents (field); if (!c.is_empty ()) return c (0); else { err = true; return octave_value (); } } DEFUN_DLD (pgp_predict, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{y}}= pgp_predict (@var{GPM},@var{X})\n\ @deftypefnx {Loadable Function} {[@var{y},@var{sig}]}= pgp_predict (@var{GPM},@var{X})\n\ @deftypefnx {Loadable Function} {[@var{y},@var{sig},@var{dy}]}= pgp_predict (@var{GPM},@var{X})\n\ @cindex Gaussian Process Regression inference \n\ Uses the model @var{GPM} to predict values, standard deviations and model\n\ derivatives in spatial points. @var{X} is the matrix of independent variables. \n\ (The organization is determined by GPM.theta, as in @code{pgp_train}). \n\ \n\ @var{y} is set to the predicted dependent variable values. \n\ If @var{sig} is requested, it is set to the estimated prediction deviations. \n\ If @var{dy} is requested, it is populated with the prediction gradients. \n\ \n\ @seealso{pgp_train, pgp_setup}\n\ @end deftypefn") { octave_value_list retval; int nargin = args.length (); if (nargin != 2 || nargout > 3 || nargout < 1) { print_usage (); return retval; } octave_value arg; // extract the model info arg = args (0); if (!arg.is_map ()) { error ("the first argument must be a structure."); return retval; } Octave_map GPM (arg.map_value ()); // parse model structure bool err = false;; Matrix F (getfield (GPM, "F", err).matrix_value ()); int nf = F.cols (); Matrix theta (getfield (GPM, "theta", err).matrix_value ()); // determine row/col convention int ndim = theta.rows (); bool trans = ndim == 1; if (trans) ndim = theta.cols (); if (theta.rows () == 1) trans = true, ndim = theta.cols (); else if (theta.cols () == 1) trans = false, ndim = theta.rows (); else ndim = 0; double nu = getfield (GPM, "nu", err).scalar_value (); double var = getfield (GPM, "var", err).scalar_value (); ColumnVector mu (getfield (GPM, "mu", err).matrix_value ()); int nlin = mu.numel ()-1; Matrix QP (getfield (GPM, "QP", err).matrix_value ()); std::string corfs = getfield (GPM, "corf", err).string_value (); corfptr corf = get_corrf (corfs.c_str ()); if (!corf) error ("invalid correlation funspec: %s", corfs.c_str ()); if (err) { error ("the GPM structure is incomplete"); return retval; } arg = args (1); if (!arg.is_real_matrix ()) { error ("X must be a real matrix"); return retval; } Matrix X0 (arg.matrix_value ()); if (trans) X0 = X0.transpose (); if (X0.rows () != ndim) error ("dimension mismatch."); int nx0 = X0.cols (); // build return values Matrix y0 (trans?nx0:1, trans?1:nx0), sig0 (trans?nx0:1, trans?1:nx0), yd0; if (nargout > 2) yd0 = Matrix (ndim, nx0); // do the predictions if (nx0 > 0) PGP_predict (ndim, nf, F.data (), theta.data (), &nu, nlin, corf, &var, mu.data (), QP.data (), nx0, X0.data (), y0.fortran_vec (), sig0.fortran_vec (), (nargout > 2) ? yd0.fortran_vec () : 0); // build return list retval = octave_value_list (nargout, octave_value ()); retval (0) = y0; if (nargout > 1) retval (1) = sig0; if (nargout > 2) retval (2) = trans?yd0.transpose ():yd0; return retval; } octgpr/src/predict.c0000644000175000001440000000447611236472444013764 0ustar hajekusers/* Copyright (C) 2008, 2009 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include "gprmod.h" #define DSIZE sizeof (double) void GPR_predict (int ndim, int nx, const double *X, const double *theta, const double *nu, int nlin, corfptr corf, const double *var, const double *mu, const double *RP, int nx0, const double *X0, double *y0, double *sig0, double *yd0) { int nder = (yd0) ? ndim : 0; double *work = malloc (nx*(1+(nder)?1:0)*DSIZE); double dummy; for ( ;nx0; --nx0) { /* call infgpr */ F77_infgpr (&ndim, &nx, X, theta, nu, var, &nlin, mu, RP, corf, X0, y0, sig0, &nder, yd0?yd0:&dummy, work); /* increment pointers */ X0 += ndim; y0++; sig0++; if (yd0) yd0 += ndim; } free (work); } void PGP_predict (int ndim, int nf, const double *F, const double *theta, const double *nu, int nlin, corfptr corf, const double *var, const double *mu, const double *QP, int nx0, const double *X0, double *y0, double *sig0, double *yd0) { int nder = (yd0) ? ndim : 0; double *work = malloc (nf*(2+(nder ? nder : 1))*DSIZE); double dummy; for ( ;nx0; --nx0) { /* call infgpr */ F77_infpgp (&ndim, &nf, F, theta, nu, var, &nlin, mu, QP, corf, X0, y0, sig0, &nder, yd0?yd0:&dummy, work); /* increment pointers */ X0 += ndim; y0++; sig0++; if (yd0) yd0 += ndim; } free (work); } octgpr/src/dscsev.f0000644000175000001440000000312111236472444013606 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dscsev(n,B,D,W,Z,info) c purpose: given a symmetric matrix B in packed storage, form the c eigendecomposition of diag(D)*B*diag(D) c arguments: c n (in) dimension of B c B (in) matrix in upper BLAS packed storage c D (in) scaling diagonal matrix c W (out) eigenvalues (as output by DSYEV) c Z (out) eigenvectors (as output by DSYEV) c integer n,info double precision B(*),D(n),W(n),Z(n,n) double precision work(3*n) integer i,j,k c form the scaled matrix diag(D)*B*diag(D) k = 0 do j = 1,n do i = 1,j k = k + 1 Z(i,j) = B(k) * D(i)*D(j) end do end do c get the polar decomposition (use unblocked code) call dsyev('V','U',n,Z,n,W,work,3*n,info) end subroutine octgpr/src/config.h.in0000644000175000001440000000441310772366061014201 0ustar hajekusers/* config.h.in. Generated from configure.in by autoheader. */ /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #undef F77_DUMMY_MAIN /* Define to a macro mangling the given C identifier (in lower and upper case), which must not contain underscores, for linking with Fortran. */ #undef F77_FUNC /* As F77_FUNC, but for C identifiers containing underscores. */ #undef F77_FUNC_ /* Define if F77 and FC dummy `main' functions are identical. */ #undef FC_DUMMY_MAIN_EQ_F77 /* Define to 1 if you have the `fflush' function. */ #undef HAVE_FFLUSH /* Define to 1 if you have the `fprintf' function. */ #undef HAVE_FPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc octgpr/src/infpgp.f0000644000175000001440000001026611236472444013612 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine infpgp(ndim,nf,F,theta,nu,var,nlin,mu,QP,corr, +x0,y0,sig0,nder,yd0,work) c purpose: compute the prediction value, spatial derivatives c and prediction variance of the PGP regressor in c a single spatial point. Should be used after c nllpgp, but *NOT* after nldpgp (on the same data). c arguments: c ndim (in) number of dimensions of input space c nf (in) number of inducing vectors c F (in) array of inducing input vectors c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var (out) MLE estimated global variance c nlin (in) number of leading input variables to include in linear c mean trend. Set nlin = 0 to use a constant mean. c mu (out) at least (nlin+1)*(nlin+2). The first nlin+1 components c contain the components of the linear trend (constant c first). c QP (out) at least nf*(nf+3). The array contains packed factorization c details as returned from pakpgp c nll (out) the negative log-likelihood c corr subroutine to calculate correlation value and its c derivative. Must be declared as follows: c subroutine corr(t,f,d) c double precision t,f,d c f = correlation c d = derivative c end subroutine c The correlation should satisfy f(0) = 1 and f(+inf) = 0. c t >= 0 is the scaled squared norm of input vectors c difference, i.e. sum(theta*(X(:,i)-X(:,j))**2) c x0 (in) the spatial point to predict in c y0 (out) the prediction values. c sig0 (out) the prediction sigmas (noise included). c nder(in) number of derivatives requested. 0 to omit derivatives. c yd0 (out) the prediction derivatives. if nder <= 0, yd0 is not c referenced. c work (out) workspace; size at least nf*(2+min(nder,1)) c integer ndim,nf,nlin,info real*8 F(ndim,nf),theta(ndim),nu,var,x0(ndim) real*8 mu(0:nlin),QP(nf,*),y0,sig0,yd0(*),work(nf,*) external corr external dtrsv,dgemv,dwdis2,dsumsq,dsdacc integer i,j,iz real*8 dwdis2,dsumsq,sums,sum,l2pi,eps,tmp iz = nf+2 c calculate correlation vector r do i = 1,nf call corr(dwdis2(ndim,theta,F(1,i),x0),work(i,1),tmp) work(i,2) = work(i,1) c only use last part of workspace if derivatives requested if (nder > 0) work(i,3) = tmp end do c form LA \ r call dtrsv('U','T','N',nf,QP(1,2),nf,work(1,1),1) c accumulate sum((L\r).^2) and (L\y)'*(L\r) call dsdacc(nf,work(1,1),QP(1,iz),sig0,tmp) c add linear trend tmp = tmp + mu(0) do k = 1,nlin tmp = tmp + x0(k)*mu(k) end do y0 = tmp c form LQ \ r call dtrsv('L','N','N',nf,QP(1,1),nf,work(1,2),1) sig0 = 1 + nu**2*(1+sig0) - dsumsq(nf,work(1,2),1) c get deviation sig0 = sqrt(sig0 * var) c calc derivatives only if necessary if (nder == 0) return do k = 1,nder yd0(k) = 0 end do do i = 1,nf c calculate the primary part tmp = QP(i,iz+1)*work(i,3) c apply chain rule do k = 1,nder yd0(k) = yd0(k) + tmp*(x0(k) - F(k,i)) end do end do c correction do k = 1,nder yd0(k) = yd0(k) * (2 * theta(k)**2) if (k <= nlin) yd0(k) = yd0(k) + mu(k) end do end subroutine octgpr/src/nllgpr.f0000644000175000001440000001432711236472444013627 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nllgpr(ndim,nx,X,y,theta,nu,var,nlin,mu,R, +nll,corr,info) c purpose: calculate the negative log-likelihood of a GPR process c regressor, given a correlation function (along with c derivative), length scales and relative white noise c alongside estimates the constant or linear mean trend, c variance, and leaves data for possible subsequent use c of nldgpr to calculate derivatives. c arguments: c ndim (in) number of dimensions of input space c nx (in) number of training points c X (in) array of training input vectors c y (in) array of training input values c theta (in) length scales c nu (in) relative white noise. nu = sqrt(var_white/var) c var (out) MLE estimated global variance c nlin (in) number of leading input variables to include in linear c mean trend. Set nlin = 0 to use a constant mean. c mu (out) at least (nlin+1)*3. The first nlin+1 components c contain the components of the linear trend (constant c first). c R (out) at least (nx)*(nx+2+nlin). The first nx*(nx+1) components c contain useful factorization details and are reused in c nldgpr c nll (out) the negative log-likelihood c corr subroutine to calculate correlation value and its c derivative. Must be declared as follows: c subroutine corr(t,f,d) c double precision t,f,d c f = correlation c d = derivative c end subroutine c The correlation should satisfy f(0) = 1 and f(+inf) = 0. c t >= 0 is the scaled squared norm of input vectors c difference, i.e. sum(theta*(X(:,i)-X(:,j))**2) c info error code. Possible values are: c info = 0 no problem c info < 0 illegal parameter value c info = 1 singular correlation matrix (increase nu) c info = 2 singular normal matrix (decrease nlin or c increase nx. integer ndim,nx,nlin,info real*8 X(ndim,nx),y(nx),theta(ndim),nu,var real*8 mu(0:nlin,0:2),R(nx,0:nx+1+nlin),nll external corr external dwdis2,dcopy,daxpy,dscal,dtrsv,dtrsm,xerbla, +dpotrf,dtrtrs,dgeqr2,dorm2r integer i,j,nl1 real*8 sums,sum,dwdis2,l2pi parameter (l2pi = 1.83787706640935d0) c argument checks info = 0 if (ndim < 0) then info = 1 else if (nx < 1) then info = 2 else if (nlin < 0 .or. nlin > ndim .or. nlin >= nx) then info = 8 end if if (info /= 0) then call xerbla('nllgpr',info) return end if c corc should store the correlation to R(i,j), and its c derivative w.r.t. squared distance to R(j,i) c create the lower half of the symmetric correlation matrix do j = 1,nx R(j,j) = 1 + nu**2 do i = j+1,nx c accumulate theta-weighted distance sums = dwdis2(ndim,theta,X(1,i),X(1,j)) c call the supplied subroutine to calculate correlation and its c derivative. Note that the derivatives are stored. call corr(sums,R(i,j),R(i-j,nx+1-j)) end do end do c cholesky factorization of lower R triangle call dpotrf('L',nx,R(1,1),nx,info) if (info /= 0) goto 501 call dcopy(nx,y,1,R(1,0),1) c form M = ones(nx,1) do i = 1,nx R(i,nx+1) = 1.d0 end do if (nlin > 0) then c form M = [ones(nx,1) X'] do j = 1,nlin call dcopy(nx,X(j,1),ndim,R(1,nx+1+j),1) end do end if c form m = L \ y call dtrsv('L','N','N',nx,R(1,1),nx,R(1,0),1) if (nlin > 0) then nl1 = nlin + 1 c fit a linear model using QR decomposition c form L \ M call dtrsm('L','L','N','N',nx,nl1, + 1.d0,R(1,1),nx,R(1,nx+1),nx) c factorize (unblocked code) Q*R = L \ M call dgeqr2(nx,nl1,R(1,nx+1),nx,mu(0,1),mu(0,2),info) c form yy = Q' * (L \ y) call dorm2r('L','T',nx,1,nl1,R(1,nx+1),nx,mu(0,1), + R(1,0),nx,mu(0,2),info) c copy yy(1:nlin+1) call dcopy(nl1,R(1,0),1,mu(0,0),1) c set to zero to get residual yy(1:nlin+1) = 0 call dscal(nl1,0d0,R(1,0),1) c project to residual space: Q*Q' * yy call dorm2r('L','N',nx,1,nl1,R(1,nx+1),nx,mu(0,1), + R(1,0),nx,mu(0,2),info) c solve R \ yy(1:nlin+1) for linear trend call dtrtrs('U','N','N',nl1,1,R(1,nx+1),nx,mu(0,0), + nl1,info) if (info /= 0) goto 502 else c specialized for constant fitting - for speed (and clarity, as this was c the initial version c form L \ m call dtrsv('L','N','N',nx,R(1,1),nx,R(1,nx+1),1) c accumulate (m'*inv(R)*m) and (y'*inv(R)*m) call dsdacc(nx,R(1,nx+1),R(1,0),sums,sum) if (sums == 0d0) goto 502 c store the mean and matrix (1x1) mu(0,1) = sums mu(0,0) = sum / sums c remove the linear trend from L \ y call daxpy(nx,-mu(0,0),R(1,nx+1),1,R(1,0),1) end if c estimate variance sums = 0 do i = 1,nx sums = sums + R(i,0)**2 end do var = sums / nx c form trace sum = 0 do i = 1,nx sum = sum + log(R(i,i)) end do c final negative log likelihood nll = sum + 0.5d0 * nx*(log(var) + l2pi) c normal return info = 0 return c error returns 501 info = 1 return 502 info = 2 return end subroutine octgpr/src/get_corrf.c0000644000175000001440000000251611236472444014275 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include "gprmod.h" #include "forsubs.h" corfptr get_corrf (const char *name) { if (!strcmp (name, "gau") || !strcmp (name, "GAU")) return &F77_corgau; else if (!strcmp (name, "exp") || !strcmp (name, "EXP")) return &F77_corexp; else if (!strcmp (name, "imq") || !strcmp (name, "IMQ")) return &F77_corimq; else if (!strcmp (name, "mt3") || !strcmp (name, "MT3")) return &F77_cormt3; else if (!strcmp (name, "mt5") || !strcmp (name, "MT5")) return &F77_cormt5; else return NULL; } octgpr/src/pakpgp.f0000644000175000001440000000331011236472444013601 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine pakpgp(nf,nlin,mu,Q,mup,QP) c purpose: packs the necessary data and other factorization details c as obtained by nllpgp. Used primarily to reduce stored c model size and save invariant computations in infpgp. c arguments: c nf (in) number of inducing vectors c mu (in) as returned from nllpgp c Q (in) as returned from nllpgp c mup (out) the stripped down mu array c QP (out) the stripped down Q array integer nf,nlin real*8 mu(0:nlin,*),Q(nf,*),mup(*),QP(nf,*) external dcopy,dtrsv integer j call dcopy(nlin+1,mu,1,mup,1) do j = 1,nf call dcopy(nf+1-j,Q(j,j),1,QP(j,j),1) call dcopy(nf+1-j,Q(j,j+nf),1,QP(j,j+1),nf) end do call dcopy(nf,Q(1,2*nf+2),1,QP(1,nf+2),1) call dcopy(nf,Q(1,2*nf+2),1,QP(1,nf+3),1) call dtrsv('L','T','N',nf,Q(1,nf+1),nf,QP(1,nf+3),1) end subroutine octgpr/src/setup.c0000644000175000001440000000431011236472444013455 0ustar hajekusers/* Copyright (C) 2008, 2009 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include "gprmod.h" #define DSIZE sizeof (double) int GPR_setup (int ndim, int nx, const double *X, const double *y, const double *theta, const double *nu, int nlin, corfptr corf, double *var, double *mu, double *RP, double *nll) { /* allocate workspace */ double *R = malloc (nx*(nx+2+nlin)*DSIZE); double *mmu = malloc ((nlin+1)*3*DSIZE); int ierr; /* compute model via nllgpr */ F77_nllgpr (&ndim, &nx, X, y, theta, nu, var, &nlin, mmu, R, nll, corf, &ierr); /* pack model data */ F77_pakgpr (&nx, &nlin, mmu, R, mu, RP); /* free workspace */ free (R); free (mmu); return ierr; } int PGP_setup (int ndim, int nx, int nf, const double *X, const double *F, const double *y, const double *theta, const double *nu, int nlin, corfptr corf, double *var, double *mu, double *QP, double *nll) { /* allocate workspace */ double *R = malloc (nx*(2*nf+1)*DSIZE); double *Q = malloc (nf*(2*nf+nlin+3)*DSIZE); double *mmu = malloc ((nlin+1)*3*DSIZE); int ierr; /* compute model via nllgpr */ F77_nllpgp (&ndim, &nx, &nf, X, F, y, theta, nu, var, &nlin, mmu, R, Q, nll, corf, &ierr); /* pack model data */ F77_pakpgp (&nf, &nlin, mmu, Q, mu, QP); /* free workspace */ free (R); free (Q); free (mmu); return ierr; } octgpr/src/optdrv.f0000644000175000001440000001771311236472444013651 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine optdrv(ndim,theta,nu,nll,dtheta,dnu, + theta0,nu0,nll0,dtheta0,dnu0, + info,scal,l2nu,VM,CP,IC) c purpose: the optimization driver for training hyperparameters c via mixed-norm trust-region quasi-newton method. c arguments: c ndim (in) number of spatial dimensions. c theta (io) current spatial length scales c nu (io) current noise c nll (in) evaluated nll at theta c dtheta (in) derivatives w.r.t. theta c dnu (in) derivative(s) w.r.t. nu. (>=2 if l2nu is .true.) c theta0 stored best theta c nu0 (io) likewise c nll0 (in) likewise c dtheta0 (in) likewise c dnu0 (in) likewise c info (io): On input, signalizes: c 0: initial iterate c 1: successful step c 2: unsuccessful step c l2nu (in): indicates that exact 2nd derivatives are computed c and stored in dnu(2) and dnu0(2). c c scal (in) length scales c VM (in) stores the variable metric information. must be sized c at least 1+(ndim+1)*(3*ndim+2)/2 c CP (in) control parameters. c CP(1) minimum noise. at least sqrt(1d1*macheps) c CP(2) noise scale factor. default 1d-4 c CP(3) minimum TR radius (step tolerance) c CP(4) maximum TR radius (default 5d-1) c CP(5) decrease factor (default 0.7d0) c CP(6) increase factor (default 1.4d0) c CP(7) current TR radius (set on initial entry) c CP(8) last spatial step size c CP(9) last noise step size c CP(10) model-predicted reduction in last step c CP(11) the objective upper limit c CP(12) the objective reduction tolerance c CP(13) last relative reduction of objective c c IC (in) integer counters c IC(1) number of evaluations c IC(2) number of downhill steps c IC(3) last flags from trstp c IC(4) number of successive unsuccessful steps integer ndim,info,IC(5) double precision scal(ndim),theta(ndim),nu,nll, + dtheta(ndim),dnu(*), + theta0(ndim),nu0,nll0, + dtheta0(ndim),dnu0(*) logical l2nu double precision VM(*),CP(13) double precision stp(ndim+1),grd(ndim+1),Zg(ndim),Zba(ndim), +snlo,snup,eps,relr double precision dlamch,dnrm2,ddot external dlamch,dspmid,trstp,dnrm2,ddot integer iB,iba,iW,iZ,i c setup pointers into VM iB = 1 iba = iB + ndim*(ndim+1)/2 iW = iba + ndim+1 iZ = iW + ndim if (info /= 0) then c count unsuccessful (non-downhill) steps, exit if too many c TODO: it would be best if this check was never used, but it's c here just to prevent infinite loops. IC(4) = IC(4) + 1 if (IC(4) > 10) goto 97 end if if (info == 1) then c go directly to downhill if there is no last step if (IC(1) == 0) then c if the first objective is better than the limit value, c replace the limit value. CP(11) = min(CP(11),nll) goto 150 end if c compute the reduction success ratio CP(10) = (nll - nll0) / CP(10) if (CP(10) < 0.1d0) then CP(7) = CP(7)*CP(5) if (CP(7) < CP(3)) goto 95 else if (CP(10) > 0.7d0) then c if the last step was unconstrained, shrink step size if (IC(3) == 0) then CP(7) = max(CP(8),CP(9)) if (CP(7) < CP(3)) goto 95 else CP(7) = CP(7)*CP(6) end if end if goto 100 else if (info == 2) then if (IC(1) == 0) then c initial guess failed. This is really bad. info = -1 return end if CP(7) = CP(7) * CP(5)**1.5 goto 200 else goto 90 end if 90 continue c THE INITIAL ITERATION IC(1) = 0 IC(2) = 0 IC(4) = 0 c supply default values if necessary eps = sqrt(dlamch('E')) if (CP(1) < eps) CP(1) = eps if (CP(2) == 0d0) CP(2) = 1d-4 if (CP(3) < 0d0) CP(3) = 1d-6 if (CP(4) == 0d0) CP(4) = 1d+2 if (CP(5) == 0d0) CP(5) = 0.6d0 if (CP(6) == 0d0) CP(6) = 1.5d0 if (CP(7) == 0d0) CP(7) = max(dxnrm2(ndim,scal,theta),nu/CP(2)) if (CP(12) < 0d0) CP(12) = 1d-6 CP(13) = CP(12) c set VM matrix to a multiple of identity call dspmid('U',ndim+1,1d-2,VM(iB)) nll0 = dlamch('O') info = 0 return c SUCCESSFUL TERMINATION (step sizes) 95 continue info = 1 return c SUCCESSFUL TERMINATION (objective red) 96 continue info = 2 return c PREMATURE TERMINATION 97 continue info = 3 return 100 continue C UPDATE METRIC c recover step and compute gradient difference do i = 1,ndim stp(i) = theta(i)-theta0(i) grd(i) = dtheta(i)-dtheta0(i) end do stp(ndim+1) = nu - nu0 grd(ndim+1) = dnu(1) - dnu0(1) c update the VM matrix c TODO: could the SR1 update be modified to take advantage c of the known dnu(2)? call sr1upd('U',ndim+1,stp,grd,VM) 150 continue c HANDLE SUCCESSFUL STEP IC(1) = IC(1) + 1 c check downhill step if (nll < nll0) then c compute the relative progress if (nll0 < CP(11)) then relr = (nll - nll0) / (nll0 - CP(11)) else relr = 0d0 end if c process downhill step IC(2) = IC(2) + 1 IC(4) = 0 do i = 1,ndim theta0(i) = theta(i) dtheta0(i) = dtheta(i) end do nu0 = nu dnu0(1) = dnu(1) if (l2nu) dnu0(2) = dnu(2) nll0 = nll c check second termination criterion if (IC(2) > 1 .and. relr < CP(13) .and. CP(13) < CP(12)) goto 96 CP(13) = relr end if c overwrite the second derivative with the exact value if (l2nu) VM(iba+ndim) = dnu0(2) c scale and factorize the VM matrix call dscsev(ndim,VM(iB),scal,VM(iW),VM(iZ),i) c TODO: what to do if dscsev fails? 200 continue c GENERATE NEW TRIAL POINT c unscale and rotate call dcopy(ndim,dtheta0,1,Zg,1) call dscrot('N',ndim,scal,VM(iZ),Zg) call dcopy(ndim,VM(iba),1,Zba,1) call dscrot('N',ndim,scal,VM(iZ),Zba) c compute a trust-region step snup = CP(7)*CP(2) snlo = max(-snup,CP(1)-nu0) call trstp(ndim,VM(iW),Zba,VM(iba+ndim),Zg,dnu0(1), + stp(1),stp(ndim+1),CP(7),snlo,snup,IC(3)) c if nu is constrained from below, but forced by numin, indicate this c as unconstrained step. if (mod(IC(3),10) == 1 .and. -snlo < snup) IC(3) = IC(3)-1 c scale & rotate call dscrot('T',ndim,scal,VM(iZ),stp) c update step sizes CP(8) = dxnrm2(ndim,scal,stp) CP(9) = abs(stp(ndim+1)/CP(2)) c predict actual reduction call dcopy(ndim,dtheta0,1,grd,1) grd(ndim+1) = dnu0(1) call dspmv('U',ndim+1,.5d0,VM,stp,1,1d0,grd,1) CP(10) = ddot(ndim+1,grd,1,stp,1) c setup new trial point do i = 1,ndim theta(i) = theta0(i) + stp(i) end do nu = nu0 + stp(ndim+1) c normal return - ready for next evaluation info = 0 end subroutine octgpr/src/autogen.sh0000755000175000001440000000132211321416771014146 0ustar hajekusers#! /bin/sh ## Generate ./configure rm -f configure.in echo "dnl --- DO NOT EDIT --- Automatically generated by autogen.sh" > configure.in cat configure.base >> configure.in cat <> configure.in AC_OUTPUT(\$CONFIGURE_OUTPUTS) dnl XXX FIXME XXX chmod is not in autoconf's list of portable functions echo " " echo " \"\\\$prefix\" is \$prefix" echo " \"\\\$exec_prefix\" is \$exec_prefix" AC_MSG_RESULT([\$STATUS_MSG find . -name NOINSTALL -print # shows which toolboxes won't be installed ]) EOF autoconf configure.in > configure.tmp if [ diff configure.tmp configure > /dev/null 2>&1 ]; then rm -f configure.tmp; else mv -f configure.tmp configure chmod 0755 configure fi rm -f configure.in octgpr/src/trstp.f0000644000175000001440000001110411236472444013473 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine trstp(n,w,b,a,g,ga,s,sa,del,sal,sau,info) c purpose: solves the semidiagonalized mixed-norm trust region c subproblem: c minimize: 1/2*sum(w.*s.^2) + g'*s + c sa*b'*s + 1/2 a*sa^2 + ga*sa c subject to: norm(s) <= del, sal <= sa <= sau c arguments: c n (in) dimension of the problem c w,b,a (in) quadratic coefficients c g,ga (in) linear coefficients c s,sa (out) solution c del (in) euclidean-norm constraints c sal,sau (in) sa bound constrains. sal <= 0,sau >= 0. c info (out) type of solution: c info is a two-digit number in the form XY, denoting c that the solution is: c X = 0: unconstrained in s c X = 1: regular lagrange constr. in s c X = 2: singular lagrange constr. in s c Y = 0: unconstrained in sa c Y = 1: lower bound on sa active c Y = 2: upper bound on sa active c integer n,info double precision w(n),b(n),a,g(n),ga,s(n),sa,del,sal,sau double precision delu,dell,eps,dsa,laml,lamu,lam,dlam,ss double precision t1,t2,dt1,dt2 external dgemv,dlamch,dnrm2 double precision dlamch integer i,nit dell = del * 0.9d0 delu = del * 1.1d0 eps = dlamch('E') c calculate initial bracketing for lambda laml = max(0d0,eps*max(abs(W(1)),abs(W(n))) - W(1)) ss = 0 do i = 1,n t1 = max(abs(g(i)+sal*b(i)),abs(g(i)+sau*b(i))) ss = ss + t1**2 end do lamu = sqrt(ss) / del - W(1) lam = laml nit = 21 c begin main loop 10 continue c check for maximum iterations if (nit == 0) then info = -1 return end if nit = nit - 1 c calculate local sa coefficients t1 = 2*ga t2 = a do i = 1,n t1 = t1 - g(i)*b(i)/(w(i)+lam) t2 = t2 - b(i)**2 /(w(i)+lam) end do t1 = .5d0*t1 t2 = .5d0*t2 if (t2 <= 0) then c the concave case. pick from sal,sau if (t2*(sal+sau)+t1 > 0) then sa = sal else sa = sau end if else c the convex case. sa = min(sau,max(sal,-.5d0*t1/t2)) end if c calculate s step size ss = 0 do i = 1,n s(i) = -(g(i)+sa*b(i))/(w(i)+lam) ss = ss + s(i)**2 end do ss = sqrt(ss) if (ss < dell) then if (lam == laml) goto 11 lamu = lam else if (ss > delu) then laml = lam else c constrained solution info = 10 goto 20 end if c use halving interval each third step to protect against slow newton c progress if (mod(nit,3) == 0) goto 12 c newton step. if (sa > sal .and. sa < sau) then c derivative of sa dt1 = 0 dt2 = 0 do i = 1,n dt1 = dt1 + g(i)*b(i) / (w(i)+lam)**2 dt2 = dt2 + b(i)**2 / (w(i)+lam)**2 end do dt1 = .5d0*dt1 dt2 = .5d0*dt2 dsa = .5d0*(dt1/t2 - t1*dt2/t2**2) else dsa = 0 end if c derivative of ss**2 dlam = 0 do i = 1,n dlam = dlam - 2*s(i)*(s(i)+b(i)*dsa)/(w(i)+lam) end do c use newton step for 1/del - 1/ss dlam = ss**2*(ss-del) / dlam lam = lam + dlam if (lam >= laml .and. lam <= lamu) goto 10 c if newton step goes outside range, use interval midpoint 12 continue lam = .5d0 * (laml + lamu) c cycle main loop goto 10 11 continue if (lam == 0d0) then c the unconstrained solution info = 0 else c the "hard case" s(1) = sqrt(del**2 + s(1)**2 - ss**2) info = 20 end if 20 continue if (info < 0) return if (sa == sal) info = info + 1 if (sa == sau) info = info + 2 return end subroutine octgpr/src/pgp_train.cc0000644000175000001440000002347611236472444014461 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include #include #include #include #include "gprmod.h" int progress_monitor (void *instance, int num, double *nll) { fprintf (stdout, "\revals: %5d -log(lhood): %10.5le ", num, *nll); fflush (stdout); // interrupt if caught a signal return (int)octave_signal_caught; } DEFUN_DLD (pgp_train, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{GPM} =} pgp_train (@var{X}, @var{F}, @var{y}, @var{theta}, @var{opts})\n\ @deftypefnx {Loadable Function} {[@var{GPM}, @var{nll}]} = pgp_train (@var{X}, @var{F}, @var{y}, @var{theta},\ @var{nu}, @var{nlin}, @var{corf}, @var{opts})\n\ @cindex Gaussian Process Regression model training.\n\ If requested, estimates the hyperparameters for Gaussian Process Regression (inverse\n\ length scales and relative noise) via reduced maximum likelihood, and then\n\ sets up the model for inference (prediction), storing necessary information in\n\ the structure @var{GPM}, intended for use with @code{pgp_predict}.\n\ \n\ @var{X} is the matrix of independent variables of the observations,\n\ @var{F} is the matrix of inducing points (cluster centers),\n\ @var{y} is a vector containing the dependent variables,\n\ @var{theta} contains the (initial) inverse length scales for the regression model.\n\ If @var{theta} is a row vector, rows of @var{X} correspond to observations, columns to\n\ variables. Otherwise, it is the other way around.\n\ \n\ @var{nu} specifies the (initial) relative noise level. If not supplied, it defaults\n\ to 1e-5.\n\ @var{nlin} specifies the number of leading variables to include in linear\n\ underlying trend. If not supplied, it defaults to 0 (constant trend).\n\ \n\ @var{corf} specifies the decreasing function type for correlation function:\n\ @code{corr(x,y) = f(norm(theta.*(x-y)))}. Possible values:\n\ \n\ @table @option\n\ @item gau\n\ @code{f(t) = exp(-t^2)} (gaussian)\n\ @item exp\n\ @code{f(t) = exp(-t)} (exponential)\n\ @item imq\n\ @code{f(t) = 1/sqrt(1+t^2)} (inverse multiquadric)\n\ @item mt3\n\ @code{f(t) = (1+sqrt(6*t))*exp(-sqrt(6*t))} (Matern-3/2 covariance)\n\ @item mt5\n\ @code{f(t) = (1+sqrt(10*t)+10*t^2/3)*exp(-sqrt(10*t))} (Matern-5/2 covariance)\n\ @end table\n\ \n\ @var{opts} is a cell array in the form @{\"option name\",option value,...@}.\n\ Possible options:\n\ \n\ @table @option\n\ @item maxev\n\ maximum number of factorizations to be used during training. default 500.\n\ @item tol\n\ stopping tolerance (minimum trust-region radius). default 1e-6.\n\ the iteration terminates if the trust region gets below tol.\n\ @item ftol\n\ stopping tolerance (minimum objective reduction). default 1e-4.\n\ the iteration terminates if the relative reduction of two successive\n\ downhill steps gets below ftol and the second one is smaller.\n\ @item numin\n\ minimum allowable noise. Default is @code{sqrt(1e1*eps)}.\n\ @end table\n\ \n\ Training cell array @var{opts} is recognized even if other arguments are omitted.\n\ If it is not supplied (the last argument is not a cell array), training is skipped.\n\ \n\ On return the function creates the @var{GPM} structure,\n\ which can subsequently be used for predictions with @code{pgp_predict}.\n\ If @var{nll} is present, it is set to the resulting negative log likelihood.\n\ @seealso{pgp_predict}\n\ @end deftypefn") { octave_value_list retval; octave_value arg; int nargin = args.length (); if (nargin < 4 || nargin > 8 || nargout < 1) { print_usage (); return retval; } Cell opts; bool do_train; arg = args (nargin-1); if (arg.is_cell ()) { opts = arg.cell_value (); nargin -= 1; do_train = true; } else do_train = false; arg = args (0); if (!arg.is_real_matrix ()) { error ("X must be a real matrix"); return retval; } Matrix X (arg.matrix_value ()); arg = args (1); if (!arg.is_real_matrix ()) { error ("F must be a real matrix"); return retval; } Matrix F (arg.matrix_value ()); arg = args (2); if (!arg.is_real_matrix ()) { error ("y must be a real vector"); return retval; } ColumnVector y (arg.matrix_value ()); arg = args (3); if (!arg.is_real_matrix () && !arg.is_real_scalar ()) { error ("theta must be a real vector"); return retval; } Matrix theta (args (3).matrix_value ()); int ndim; bool trans; if ((ndim = theta.rows ()) == 1) { ndim = theta.cols (); trans = ndim > 1 || X.rows () != 1; } else trans = false; if (ndim == 0) { error ("theta must be a nonempty real vector"); return retval; } for (int i = 0; i < ndim; i++) theta.xelem (i) = fabs (theta.xelem (i)); // check matching dimensions if (trans) { X = X.transpose (); F = F.transpose (); } int nx = X.cols (), nf = F.cols (); if (X.rows () != ndim || y.numel () != nx || F.rows () != ndim) { error ("X,F,y,theta dimensions do not match"); return retval; } if (nx < 2) { error ("must have at least 2 observations."); return retval; } double nu = 1e-5; if (nargin > 4) { arg = args (4); if (!arg.is_real_scalar ()) { error ("nu must be a real scalar"); return retval; } nu = fabs (arg.scalar_value ()); } int nlin = (nargin > 5) ? args (5).int_value () : 0; if (nlin < 0 || nlin > ndim || nlin >= nx) { error ("nlin must be in 0:min (size(X,2),size(X,1)-1)"); return retval; } std::string corfs; corfptr corf; if (nargin > 6) { arg = args (6); if (!arg.is_string () || (corfs = arg.string_value (), corf = get_corrf (corfs.c_str ()), !corf)) { error ("invalid correlation function: %s", corfs.c_str ()); return retval; } } else { corfs = "gau"; corf = get_corrf (corfs.c_str ()); } double nll; if (do_train) { struct PGP_train_opts topts; // setup initial values topts.maxev = 500; topts.tol= 1e-5; topts.ftol= 1e-3; topts.numin = 5e-8; topts.monitor = &progress_monitor; topts.instance = 0; // parse options int iopt = 0; octave_value val; while (iopt < opts.length ()-1) { val = opts (iopt); if (!val.is_string ()) { error ("OPTS should consist of name,value pairs"); return retval; } std::string oname = val.string_value (); if (oname == "maxev") { topts.maxev = opts (++iopt).scalar_value (); } else if (oname == "tol") { topts.tol = opts (++iopt).scalar_value (); } else if (oname == "ftol") { topts.ftol = opts (++iopt).scalar_value (); } else if (oname == "numin") { topts.numin = opts (++iopt).scalar_value (); } else { error ("unrecognized option: %s", oname.c_str ()); return retval; } ++iopt; } if (topts.maxev > 0) { // run training int ierr = PGP_train (ndim, nx, nf, X.data (), F.data (), y.data (), theta.fortran_vec (), &nu, &nll, nlin, corf, &topts); fprintf (stdout, "\n"); if (octave_signal_caught) { octave_signal_caught = 0; // allow the optimization to be interrupted by Ctrl-C if (octave_interrupt_state > 0) octave_interrupt_state = 0; else octave_handle_signal (); } switch (ierr) { case TRAIN_CONV: std::cout << "converged." << '\n'; break; case TRAIN_PREM: std::cout << "terminated." << '\n'; break; case TRAIN_STOP: std::cout << "stopped." << '\n'; break; case TRAIN_FAIL: error ("failed. try different initial guess."); return retval; } } } // setup model for predictions double var; Matrix QP (nf, nf+3); // make mu follow the theta convention (given by trans) Matrix mu (trans?1:nlin+1, trans?nlin+1:1); PGP_setup (ndim, nx, nf, X.data (), F.data (), y.data (), theta.data (), &nu, nlin, corf, &var, mu.fortran_vec (), QP.fortran_vec (), &nll); // construct model structure Octave_map GPM; // store training data GPM.assign ("F", F); // hyperparameters GPM.assign ("theta", theta); GPM.assign ("nu", nu); // prediction and additional data GPM.assign ("var", var); GPM.assign ("QP", QP); GPM.assign ("mu", mu); GPM.assign ("corf", corfs); retval = octave_value_list (nargout, octave_value ()); retval (0) = GPM; if (nargout > 1) retval (1) = nll; return retval; } octgpr/src/dwdis2.f0000644000175000001440000000246411236472444013524 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c double precision function dwdis2(ndim,theta,x1,x2) c purpose: assistant function. Calculates the weighted squared c distance between spatial points x1 and x2 c arguments: c ndim (in) number of dimensions c theta (in) weights c x1,x2 (in) input spatial points c return value: weighted distance c integer ndim double precision theta(*),x1(*),x2(*) integer k dwdis2 = 0 do k = 1,ndim dwdis2 = dwdis2 + (theta(k)*(x1(k)-x2(k)))**2 end do end function octgpr/src/gprmod.h0000644000175000001440000000653211236472444013622 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #ifndef _MODTP_H #define _MODTP_H #include "forsubs.h" /* terminating conditions for training */ enum train_cond { TRAIN_CONV, TRAIN_STOP, TRAIN_PREM, TRAIN_FAIL }; /* training options for GPR */ struct GPR_train_opts { double numin, tol, ftol; int maxev; int (*monitor)(void *instance, int num, double *nll); void *instance; }; struct PGP_train_opts { double numin, tol, ftol; int maxev; int (*monitor)(void *instance, int num, double *nll); void *instance; }; #ifdef __cplusplus extern "C" { #endif /* parse correlation type name */ corfptr get_corrf (const char *name); /* train model hyperparameters */ int GPR_train (int ndim, int nx, const double *X, const double *y, double *theta, double *nu, double *nll, int nlin, const corfptr corf, struct GPR_train_opts *opts); /* given hypers, setup model for predictions */ int GPR_setup (int ndim, int nx, const double *X, const double *y, const double *theta, const double *nu, int nlin, const corfptr corf, double *var, double *mu, double *RP, double *nll); /* compute predictions */ void GPR_predict (int ndim, int nx, const double *X, const double *theta, const double *nu, int nlin, const corfptr corf, const double *var, const double *mu, const double *RP, int nx0, const double *X0, double *y0, double *sig0, double *yd0); /* train model hyperparameters */ int PGP_train (int ndim, int nx, int nf, const double *X, const double *F, const double *y, double *theta, double *nu, double *nll, int nlin, const corfptr corf, struct PGP_train_opts *opts); /* given hypers, setup model for predictions */ int PGP_setup (int ndim, int nx, int nf, const double *X, const double *F, const double *y, const double *theta, const double *nu, int nlin, const corfptr corf, double *var, double *mu, double *QP, double *nll); /* compute predictions */ void PGP_predict (int ndim, int nf, const double *F, const double *theta, const double *nu, int nlin, const corfptr corf, const double *var, const double *mu, const double *QP, int nx0, const double *X0, double *y0, double *sig0, double *yd0); #ifdef __cplusplus } #endif #endif /* modtp.h */ octgpr/src/dsumsq.f0000644000175000001440000000267411236472444013647 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c double precision function dsumsq(n,x,incx) c purpose: an assistant function. Computes a sum of squares c of the components of a vector x. This is separated c to allow possibly more precise computation in the c future. c arguments: c n (in) length of x c x (in) vectors in question c incx (in) increment integer n,incx real*8 x(*) integer i dsumsq = 0d0 if (incx == 1) then do i = 1,n dsumsq = dsumsq + x(i)**2 end do else do i = 1,n*incx,incx dsumsq = dsumsq + x(i)**2 end do end if end function octgpr/src/dxnrm2.f0000644000175000001440000000202611236472444013534 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c double precision function dxnrm2(n,d,x) integer n double precision d(*),x(*) integer k dxnrm2 = 0 do k = 1,n dxnrm2 = dxnrm2 + (x(k)/d(k))**2 end do dxnrm2 = sqrt(dxnrm2) end function octgpr/src/pdist2_mw.cc0000644000175000001440000001744511361277102014376 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include inline double abs2(double x) { return x*x; } inline double abs2(Complex x) { return abs2(x. real()) + abs2(x.imag ()); } /* distance functors */ template struct distfun_eu { double operator() (octave_idx_type dim, const T *x, const T* y) { double d = 1, scl = 0; for (octave_idx_type i = 0; i < dim; i++) { double t = std::abs (x[i]-y[i]); if (scl < t) { d *= abs2 (scl/t); d += 1; scl = t; } else if (t != 0) d += abs2 (t/scl); } return scl * std::sqrt (d); } }; template struct distfun_sqeu { double operator() (octave_idx_type dim, const T *x, const T* y) { double d = 0; for (octave_idx_type i = 0; i < dim; i++) d += abs2(x[i]-y[i]); return d; } }; template struct distfun_l1 { double operator() (octave_idx_type dim, const T *x, const T* y) { double d = 0; for (octave_idx_type i = 0; i < dim; i++) d += std::abs(x[i]-y[i]); return d; } }; template struct distfun_max { double operator() (octave_idx_type dim, const T *x, const T* y) { double d = 0; for (octave_idx_type i = 0; i < dim; i++) { double t = std::abs(x[i]-y[i]); if (t > d) d = t; } return d; } }; template struct distfun_mw { double p; distfun_mw (double _p) : p(_p) {} double operator() (octave_idx_type dim, const T *x, const T* y) { double d = 1, scl = 0; for (octave_idx_type i = 0; i < dim; i++) { double t = std::abs (x[i]-y[i]); if (scl < t) { d *= std::pow (scl/t, p); d += 1; scl = t; } else if (t != 0) d += std::pow (t/scl, p); } return scl * std::pow (d, 1/p); } }; template void fill_dist_matrix (octave_idx_type dim, octave_idx_type nx, octave_idx_type ny, const T *X, const T* Y, double *D, distfun df) { octave_idx_type i,j; for (j = 0; j < ny; j++) { const T *PX = X; for (i = 0; i < nx; i++) { *(D++) = df (dim, PX, Y); PX += dim; } Y += dim; } } template void fill_dist_matrix (octave_idx_type dim, octave_idx_type nx, const T *X, double *D, distfun df) { octave_idx_type i,j; for (j = 0; j < nx; j++) { D += j; for (i = -j; i < 0; i++) D[i] = *(D + i*nx); const T *PX = X; for (i = j; i < nx; i++) { *(D++) = df (dim, PX, X); PX += dim; } X += dim; } } template Matrix get_dist_matrix (const MArray& X, bool ssq, double p = 0) { Matrix D(X.rows (), X.rows ()); MArray XT = X.transpose (); if (ssq) fill_dist_matrix (XT.rows (), XT.cols (), XT.data (), D.fortran_vec (), distfun_sqeu ()); else if (p == 2) fill_dist_matrix (XT.rows (), XT.cols (), XT.data (), D.fortran_vec (), distfun_eu ()); else if (p == 1) fill_dist_matrix (XT.rows (), XT.cols (), XT.data (), D.fortran_vec (), distfun_l1 ()); else if (xisinf (p)) fill_dist_matrix (XT.rows (), XT.cols (), XT.data (), D.fortran_vec (), distfun_max ()); else fill_dist_matrix (XT.rows (), XT.cols (), XT.data (), D.fortran_vec (), distfun_mw (p)); return D; } template Matrix get_dist_matrix (const MArray& X, const MArray& Y, bool ssq, double p = 0) { Matrix D(X.rows (), Y.rows ()); MArray XT = X.transpose (), YT = Y.transpose (); if (ssq) fill_dist_matrix (XT.rows (), XT.cols (), YT.cols (), XT.data (), YT.data (), D.fortran_vec (), distfun_sqeu ()); else if (p == 2) fill_dist_matrix (XT.rows (), XT.cols (), YT.cols (), XT.data (), YT.data (), D.fortran_vec (), distfun_eu ()); else if (p == 1) fill_dist_matrix (XT.rows (), XT.cols (), YT.cols (), XT.data (), YT.data (), D.fortran_vec (), distfun_l1 ()); else if (xisinf (p)) fill_dist_matrix (XT.rows (), XT.cols (), YT.cols (), XT.data (), YT.data (), D.fortran_vec (), distfun_max ()); else fill_dist_matrix (XT.rows (), XT.cols (), YT.cols (), XT.data (), YT.data (), D.fortran_vec (), distfun_mw (p)); return D; } DEFUN_DLD(pdist2_mw,args,, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} @var{D} = pdist2_mw (@var{X}, @var{Y}, @var{p})\n\ @deftypefnx {Loadable Function} @var{D} = pdist2_mw (@var{X}, @var{p})\n\ Assembles a pairwise minkowski-distance matrix for two given sets of points.\n\ @var{X} and @var{Y} should be real or complex matrices with a point per row,\n\ so numbers of columns must match. The matrix contains the pairwise\n\ distances @code{D(i,j) = norm(X(i,:)-Y(j,:),P)}.\n\ @var{p} can also be the string \'ssq\' requesting squared euclidean distance.\n\ (not a metric, but often useful and faster than @code{@var{p}=2})\n\ If @var{Y} is not given, a symmetric distance matrix is calculated efficiently.\n\ @seealso{norm}\n\ @end deftypefn") { int nargin = args.length(); octave_value_list retval; if (nargin < 2 || nargin > 3) { print_usage (); return retval; } octave_value argx = args(0), argy, argp; bool sym = false; if (nargin > 2) argy = args(1); else { argy = argx; sym = true; } if (nargin > 2) argp = args(2); else argp = args(1); bool ssq = (argp.is_string () && argp.string_value () == "ssq"); if (argx.is_matrix_type () && argy.is_matrix_type () && (ssq || argp.is_real_scalar ())) { double p = ssq ? 0 : argp.scalar_value (); if (argx.columns () == argy.columns ()) { if (argx.is_real_matrix () && argy.is_real_matrix ()) { if (sym) retval(0) = get_dist_matrix (argx.matrix_value (), ssq, p); else retval(0) = get_dist_matrix (argx.matrix_value (), argy.matrix_value (), ssq, p); } else { if (sym) retval(0) = get_dist_matrix (argx.complex_matrix_value (), ssq, p); else retval(0) = get_dist_matrix (argx.complex_matrix_value (), argy.complex_matrix_value (), ssq, p); } } else error ("pdist2_mw: dimension mismatch"); } else error ("pdist2_mw: X and Y should be matrices, p a real scalar"); return retval; } octgpr/src/configure0000755000175000001440000070607311424006530014063 0ustar hajekusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for OctGPR 1.1.0. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='OctGPR' PACKAGE_TARNAME='octgpr' PACKAGE_VERSION='1.1.0' PACKAGE_STRING='OctGPR 1.1.0' PACKAGE_BUGREPORT='highegg@gmail.com' # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS FLIBS LIBOBJS EGREP GREP CPP ac_ct_CC CPPFLAGS CFLAGS CC OBJEXT EXEEXT ac_ct_F77 LDFLAGS FFLAGS F77 CPICFLAG FPICFLAG MKOCTFILE target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias F77 FFLAGS LDFLAGS LIBS CC CFLAGS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures OctGPR 1.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/octgpr] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of OctGPR 1.1.0:";; esac cat <<\_ACEOF Some influential environment variables: F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CC C compiler command CFLAGS C compiler flags CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF OctGPR configure 1.1.0 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by OctGPR $as_me 1.1.0, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # check for mkoctfile # Extract the first word of "mkoctfile", so it can be a program name with args. set dummy mkoctfile; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_MKOCTFILE+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$MKOCTFILE"; then ac_cv_prog_MKOCTFILE="$MKOCTFILE" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MKOCTFILE="mkoctfile" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MKOCTFILE=$ac_cv_prog_MKOCTFILE if test -n "$MKOCTFILE"; then { $as_echo "$as_me:$LINENO: result: $MKOCTFILE" >&5 $as_echo "$MKOCTFILE" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z $MKOCTFILE ; then { { $as_echo "$as_me:$LINENO: error: \"mkoctfile not found. Perhaps you do not have octave installed?\"" >&5 $as_echo "$as_me: error: \"mkoctfile not found. Perhaps you do not have octave installed?\"" >&2;} { (exit 1); exit 1; }; } fi # get preferred compilers F77=`$MKOCTFILE -p F77` CC=`$MKOCTFILE -p CC` # get preferred flags FFLAGS=`$MKOCTFILE -p FFLAGS` CFLAGS=`$MKOCTFILE -p CFLAGS` # add -fPIC or equivalent flags FPICFLAG=`$MKOCTFILE -p FPICFLAG` CPICFLAG=`$MKOCTFILE -p CPICFLAG` FFLAGS="$FFLAGS $FPICFLAG" CFLAGS="$CFLAGS $CPICFLAG" # Checks for compilers. ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $F77 gfortran g77 do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:$LINENO: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in $F77 gfortran g77 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -f a.out cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for Fortran 77 compiler default output file name" >&5 $as_echo_n "checking for Fortran 77 compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Fortran 77 compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: Fortran 77 compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the Fortran 77 compiler works" >&5 $as_echo_n "checking whether the Fortran 77 compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run Fortran 77 compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run Fortran 77 compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then $as_echo_n "(cached) " >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CC gcc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in $CC gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Checks for libraries. # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h string.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to highegg@gmail.com ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 $as_echo_n "checking for _Bool... " >&6; } if test "${ac_cv_type__Bool+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type__Bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((_Bool))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 $as_echo "$ac_cv_type__Bool" >&6; } if test "x$ac_cv_type__Bool" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi # Checks for library functions. { $as_echo "$as_me:$LINENO: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if test "${ac_cv_lib_error_at_line+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_error_at_line=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_error_at_line=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------- ## ## Report this to highegg@gmail.com ## ## -------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi for ac_func in fprintf fflush do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # enter Fortran section ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5 $as_echo_n "checking how to get verbose linking output from $F77... " >&6; } if test "${ac_cv_prog_f77_v+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" eval "set x $ac_link" shift $as_echo "$as_me:$LINENO: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # If we are using xlf then replace all the commas with spaces. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_f77_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_f77_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f77_v"; then { $as_echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5 $as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: WARNING: compilation failed" >&5 $as_echo "$as_me: WARNING: compilation failed" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5 $as_echo "$ac_cv_prog_f77_v" >&6; } { $as_echo "$as_me:$LINENO: checking for Fortran 77 libraries of $F77" >&5 $as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } if test "${ac_cv_f77_libs+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$FLIBS" != "x"; then ac_cv_f77_libs="$FLIBS" # Let the user override the test. else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" eval "set x $ac_link" shift $as_echo "$as_me:$LINENO: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:' | grep -v "^[_$as_cr_Letters][_$as_cr_alnum]*="` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # If we are using xlf then replace all the commas with spaces. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac ac_cv_f77_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_f77_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -LANG:=* | -LIST:* | -LNO:*) ;; -lkernel32) test x"$CYGWIN" != xyes && ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_arg="$ac_arg $ac_j" ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`$as_echo "$ac_f77_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { $as_echo "$as_me:$LINENO: result: $ac_cv_f77_libs" >&5 $as_echo "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_libs" ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { $as_echo "$as_me:$LINENO: checking for dummy main to link with Fortran 77 libraries" >&5 $as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; } if test "${ac_cv_f77_dummy_main+set}" = set; then $as_echo_n "(cached) " >&6 else ac_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" ac_fortran_dm_var=F77_DUMMY_MAIN ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # First, try linking without a dummy main: cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_fortran_dummy_main=none else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_fortran_dummy_main=unknown fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define $ac_fortran_dm_var $ac_func #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_fortran_dummy_main=$ac_func; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main rm -rf conftest* LIBS=$ac_f77_dm_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_f77_dummy_main" >&5 $as_echo "$ac_cv_f77_dummy_main" >&6; } F77_DUMMY_MAIN=$ac_cv_f77_dummy_main if test "$F77_DUMMY_MAIN" != unknown; then if test $F77_DUMMY_MAIN != none; then cat >>confdefs.h <<_ACEOF #define F77_DUMMY_MAIN $F77_DUMMY_MAIN _ACEOF if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then cat >>confdefs.h <<\_ACEOF #define FC_DUMMY_MAIN_EQ_F77 1 _ACEOF fi fi else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&5 $as_echo "$as_me: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { $as_echo "$as_me:$LINENO: checking for Fortran 77 name-mangling scheme" >&5 $as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; } if test "${ac_cv_f77_mangling+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_success=yes; break 2 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done done ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_success_extra=yes; break else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test "$ac_success_extra" = "yes"; then ac_cv_f77_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" fi else ac_cv_f77_mangling="unknown" fi else ac_cv_f77_mangling="unknown" fi LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compile a simple Fortran program See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compile a simple Fortran program See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_f77_mangling" >&5 $as_echo "$ac_cv_f77_mangling" >&6; } ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu case $ac_cv_f77_mangling in "lower case, no underscore, no extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) name _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) name _ACEOF ;; "lower case, no underscore, extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) name _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) name ## _ _ACEOF ;; "lower case, underscore, no extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) name ## _ _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) name ## _ _ACEOF ;; "lower case, underscore, extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) name ## _ _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) name ## __ _ACEOF ;; "upper case, no underscore, no extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) NAME _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) NAME _ACEOF ;; "upper case, no underscore, extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) NAME _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) NAME ## _ _ACEOF ;; "upper case, underscore, no extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) NAME ## _ _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) NAME ## _ _ACEOF ;; "upper case, underscore, extra underscore") cat >>confdefs.h <<\_ACEOF #define F77_FUNC(name,NAME) NAME ## _ _ACEOF cat >>confdefs.h <<\_ACEOF #define F77_FUNC_(name,NAME) NAME ## __ _ACEOF ;; *) { $as_echo "$as_me:$LINENO: WARNING: unknown Fortran name-mangling scheme" >&5 $as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu # add some optimizations to GNU Fortran if test x$F77 = xgfortran -o x$F77 = xg77 ; then FFLAGS="$FFLAGS -O2 -funroll-loops" fi # if LAPACK libs are not specified try to use BLAS_LIBS from mkoctfile if test -z "$LAPACK_LIBS"; then echo -n "checking $MKOCTFILE for \$BLAS_LIBS... " LAPACK_LIBS=`$MKOCTFILE -p BLAS_LIBS` echo "$LAPACK_LIBS" else echo "user specified LAPACK libs: $LAPACK_LIBS" fi LIBS="$LIBS $LAPACK_LIBS" # check for external BLAS library routines { $as_echo "$as_me:$LINENO: checking for library containing dtpsv" >&5 $as_echo_n "checking for library containing dtpsv... " >&6; } if test "${ac_cv_search_dtpsv+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dtpsv end _ACEOF for ac_lib in '' goto atlas blas; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dtpsv=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dtpsv+set}" = set; then break fi done if test "${ac_cv_search_dtpsv+set}" = set; then : else ac_cv_search_dtpsv=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dtpsv" >&5 $as_echo "$ac_cv_search_dtpsv" >&6; } ac_res=$ac_cv_search_dtpsv if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dspr" >&5 $as_echo_n "checking for library containing dspr... " >&6; } if test "${ac_cv_search_dspr+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dspr end _ACEOF for ac_lib in '' goto atlas blas; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dspr=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dspr+set}" = set; then break fi done if test "${ac_cv_search_dspr+set}" = set; then : else ac_cv_search_dspr=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dspr" >&5 $as_echo "$ac_cv_search_dspr" >&6; } ac_res=$ac_cv_search_dspr if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # check for external LAPACK library routines # NOTE: BLAS should go first, so that it gets listed earlier. # many optimized blas libraries offer optimized xPOTRF { $as_echo "$as_me:$LINENO: checking for library containing dpotrf" >&5 $as_echo_n "checking for library containing dpotrf... " >&6; } if test "${ac_cv_search_dpotrf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dpotrf end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dpotrf=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dpotrf+set}" = set; then break fi done if test "${ac_cv_search_dpotrf+set}" = set; then : else ac_cv_search_dpotrf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dpotrf" >&5 $as_echo "$ac_cv_search_dpotrf" >&6; } ac_res=$ac_cv_search_dpotrf if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dgeqr2" >&5 $as_echo_n "checking for library containing dgeqr2... " >&6; } if test "${ac_cv_search_dgeqr2+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dgeqr2 end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dgeqr2=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dgeqr2+set}" = set; then break fi done if test "${ac_cv_search_dgeqr2+set}" = set; then : else ac_cv_search_dgeqr2=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dgeqr2" >&5 $as_echo "$ac_cv_search_dgeqr2" >&6; } ac_res=$ac_cv_search_dgeqr2 if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dorm2r" >&5 $as_echo_n "checking for library containing dorm2r... " >&6; } if test "${ac_cv_search_dorm2r+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dorm2r end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dorm2r=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dorm2r+set}" = set; then break fi done if test "${ac_cv_search_dorm2r+set}" = set; then : else ac_cv_search_dorm2r=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dorm2r" >&5 $as_echo "$ac_cv_search_dorm2r" >&6; } ac_res=$ac_cv_search_dorm2r if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dtrtrs" >&5 $as_echo_n "checking for library containing dtrtrs... " >&6; } if test "${ac_cv_search_dtrtrs+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dtrtrs end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dtrtrs=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dtrtrs+set}" = set; then break fi done if test "${ac_cv_search_dtrtrs+set}" = set; then : else ac_cv_search_dtrtrs=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dtrtrs" >&5 $as_echo "$ac_cv_search_dtrtrs" >&6; } ac_res=$ac_cv_search_dtrtrs if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dpotri" >&5 $as_echo_n "checking for library containing dpotri... " >&6; } if test "${ac_cv_search_dpotri+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dpotri end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dpotri=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dpotri+set}" = set; then break fi done if test "${ac_cv_search_dpotri+set}" = set; then : else ac_cv_search_dpotri=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dpotri" >&5 $as_echo "$ac_cv_search_dpotri" >&6; } ac_res=$ac_cv_search_dpotri if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing dsyev" >&5 $as_echo_n "checking for library containing dsyev... " >&6; } if test "${ac_cv_search_dsyev+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF program main call dsyev end _ACEOF for ac_lib in '' goto atlas lapack; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_dsyev=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_dsyev+set}" = set; then break fi done if test "${ac_cv_search_dsyev+set}" = set; then : else ac_cv_search_dsyev=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_dsyev" >&5 $as_echo "$ac_cv_search_dsyev" >&6; } ac_res=$ac_cv_search_dsyev if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_config_headers="$ac_config_headers config.h" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by OctGPR $as_me 1.1.0, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ OctGPR config.status 1.1.0 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi ac_config_files="$ac_config_files $CONFIGURE_OUTPUTS" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by OctGPR $as_me 1.1.0, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ OctGPR config.status 1.1.0 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "$CONFIGURE_OUTPUTS") CONFIG_FILES="$CONFIG_FILES $CONFIGURE_OUTPUTS" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo " " echo " \"\$prefix\" is $prefix" echo " \"\$exec_prefix\" is $exec_prefix" { $as_echo "$as_me:$LINENO: result: $STATUS_MSG find . -name NOINSTALL -print # shows which toolboxes won't be installed " >&5 $as_echo "$STATUS_MSG find . -name NOINSTALL -print # shows which toolboxes won't be installed " >&6; } octgpr/src/sr1upd.f0000644000175000001440000000330411236472444013540 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine sr1upd(uplo,n,s,y,B) c purpose: update a variable metric matrix (in upper packed c storage) using the Powell's SR1 update. c c arguments: c uplo (in) whether B is in lower or upper storage c n (in) problem dimension c s (in) the step just taken c y (io) gradient difference c (overwritten by secant residual vector) c B (io) symmetric packed matrix c character uplo integer n double precision s(n),y(n),B(*) external dlamch,ddot,dspmv,dspr double precision dlamch,ddot,dnrm2,ry,eps c create residual vector call dspmv(uplo,n,-1d0,B,s,1,1d0,y,1) c calculate the denominator ry = ddot(n,y,1,s,1) c calculate safeguard eps = sqrt(dlamch('E')) eps = eps * dnrm2(n,s,1) * dnrm2(n,y,1) c update if (abs(ry) > eps) then call dspr(uplo,n,1/ry,y,1,B) end if end subroutine octgpr/src/nl0gpr.f0000644000175000001440000000350511236472444013527 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine nl0gpr(nx,y,nu,nll0,nllinf) c purpose: this function evaluates the negative log likelihood c of a GPR process regressor at boundaries: c nll0 is a common value for theta = 0 and c nllinf is a value for theta = infinity. c nx (in) number of training points c y (in) array of training input values c nu (in) relative white noise. nu = sqrt(var_white/var) c nll0 (out) the value of nllgpr for theta = 0 c nllinf (out) the limit of nllgpr at theta -> infinity. c integer nx double precision y(nx),nu,nll0,nllinf double precision mu,ssq parameter (l2pi = 1.83787706640935d0) integer i mu = 0 c calculate mean do i = 1,nx mu = mu + y(i) end do mu = mu / nx c calculate sigma estimate ssq = 0 do i = 1,nx ssq = ssq + (y(i)-mu)**2 end do c set values ssq = ssq / nx nllinf = 0.5d0 * nx * (log(ssq) + l2pi) nll0 = nllinf + 0.5d0 * log(1 + nx/nu**2) end subroutine octgpr/src/gpr_train.cc0000644000175000001440000002275311236472444014460 0ustar hajekusers/* Copyright (C) 2008 VZLU Prague, a.s., Czech Republic * * Author: Jaroslav Hajek * * This file is part of OctGPR. * * OctGPR is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, see * . */ #include #include #include #include #include #include #include "gprmod.h" int progress_monitor (void *instance, int num, double *nll) { fprintf (stdout, "\revals: %5d -log(lhood): %10.5le ", num, *nll); fflush (stdout); // interrupt if caught a signal return (int)octave_signal_caught; } DEFUN_DLD (gpr_train, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{GPM} =} gpr_train (@var{X}, @var{y}, @var{theta}, @var{opts})\n\ @deftypefnx {Loadable Function} {[@var{GPM}, @var{nll}]} = gpr_train (@var{X}, @var{y}, @var{theta},\ @var{nu}, @var{nlin}, @var{corf}, @var{opts})\n\ @cindex Gaussian Process Regression model training.\n\ If requested, estimates the hyperparameters for Gaussian Process Regression (inverse\n\ length scales and relative noise) via reduced maximum likelihood, and then\n\ sets up the model for inference (prediction), storing necessary information in\n\ the structure @var{GPM}, intended for use with @code{gpr_predict}.\n\ \n\ @var{X} is the matrix of independent variables of the observations,\n\ @var{y} is a vector containing the dependent variables,\n\ @var{theta} contains the (initial) inverse length scales for the regression model.\n\ If @var{theta} is a row vector, rows of @var{X} correspond to observations, columns to\n\ variables. Otherwise, it is the other way around.\n\ \n\ @var{nu} specifies the (initial) relative noise level. If not supplied, it defaults\n\ to 1e-5.\n\ @var{nlin} specifies the number of leading variables to include in linear\n\ underlying trend. If not supplied, it defaults to 0 (constant trend).\n\ \n\ @var{corf} specifies the decreasing function type for correlation function:\n\ @code{corr(x,y) = f(norm(theta.*(x-y)))}. Possible values:\n\ \n\ @table @option\n\ @item gau\n\ @code{f(t) = exp(-t^2)} (gaussian)\n\ @item exp\n\ @code{f(t) = exp(-t)} (exponential)\n\ @item imq\n\ @code{f(t) = 1/sqrt(1+t^2)} (inverse multiquadric)\n\ @item mt3\n\ @code{f(t) = (1+sqrt(6*t))*exp(-sqrt(6*t))} (Matern-3/2 covariance)\n\ @item mt5\n\ @code{f(t) = (1+sqrt(10*t)+10*t^2/3)*exp(-sqrt(10*t))} (Matern-5/2 covariance)\n\ @end table\n\ \n\ @var{opts} is a cell array in the form @{\"option name\",option value,...@}.\n\ Possible options:\n\ \n\ @table @option\n\ @item maxev\n\ maximum number of factorizations to be used during training. default 500.\n\ @item tol\n\ stopping tolerance (minimum trust-region radius). default 1e-6.\n\ the iteration terminates if the trust region gets below tol.\n\ @item ftol\n\ stopping tolerance (minimum objective reduction). default 1e-4.\n\ the iteration terminates if the relative reduction of two successive\n\ downhill steps gets below ftol and the second one is smaller.\n\ @item numin\n\ minimum allowable noise. Default is @code{sqrt(1e1*eps)}.\n\ @end table\n\ \n\ Training cell array @var{opts} is recognized even if other arguments are omitted.\n\ If it is not supplied (the last argument is not a cell array), training is skipped.\n\ \n\ On return the function creates the @var{GPM} structure,\n\ which can subsequently be used for predictions with @code{gpr_predict}.\n\ If @var{nll} is present, it is set to the resulting negative log likelihood.\n\ @seealso{gpr_predict}\n\ @end deftypefn") { octave_value_list retval; octave_value arg; int nargin = args.length (); if (nargin < 3 || nargin > 7 || nargout < 1) { print_usage (); return retval; } Cell opts; bool do_train; arg = args (nargin-1); if (arg.is_cell ()) { opts = arg.cell_value (); nargin -= 1; do_train = true; } else do_train = false; arg = args (0); if (!arg.is_real_matrix ()) { error ("X must be a real matrix"); return retval; } Matrix X (arg.matrix_value ()); arg = args (1); if (!arg.is_real_matrix ()) { error ("y must be a real vector"); return retval; } ColumnVector y (arg.matrix_value ()); arg = args (2); if (!arg.is_real_matrix () && !arg.is_real_scalar ()) { error ("theta must be a real vector"); return retval; } Matrix theta (args (2).matrix_value ()); int ndim; bool trans; if ((ndim = theta.rows ()) == 1) { ndim = theta.cols (); trans = ndim > 1 || X.rows () != 1; } else trans = false; if (ndim == 0) { error ("theta must be a nonempty real vector"); return retval; } for (int i = 0; i < ndim; i++) theta.xelem (i) = fabs (theta.xelem (i)); // check matching dimensions if (trans) X = X.transpose (); int nx = X.cols (); if (X.rows () != ndim || y.numel () != nx) { error ("X,y,theta dimensions do not match"); return retval; } if (nx < 2) { error ("must have at least 2 observations."); return retval; } double nu = 1e-5; if (nargin > 3) { arg = args (3); if (!arg.is_real_scalar ()) { error ("nu must be a real scalar"); return retval; } nu = fabs (arg.scalar_value ()); } int nlin = (nargin > 4) ? args (4).int_value () : 0; if (nlin < 0 || nlin > ndim || nlin >= nx) { error ("nlin must be in 0:min (size(X,2),size(X,1)-1)"); return retval; } std::string corfs; corfptr corf; if (nargin > 5) { arg = args (5); if (!arg.is_string () || (corfs = arg.string_value (), corf = get_corrf (corfs.c_str ()), !corf)) { error ("invalid correlation function: %s", corfs.c_str ()); return retval; } } else { corfs = "gau"; corf = get_corrf (corfs.c_str ()); } double nll; if (do_train) { struct GPR_train_opts topts; // setup initial values topts.maxev = 500; topts.tol= 1e-5; topts.ftol= 1e-3; topts.numin = 5e-8; topts.monitor = &progress_monitor; topts.instance = 0; // parse options int iopt = 0; octave_value val; while (iopt < opts.length ()-1) { val = opts (iopt); if (!val.is_string ()) { error ("OPTS should consist of name,value pairs"); return retval; } std::string oname = val.string_value (); if (oname == "maxev") { topts.maxev = opts (++iopt).scalar_value (); } else if (oname == "tol") { topts.tol = opts (++iopt).scalar_value (); } else if (oname == "ftol") { topts.ftol = opts (++iopt).scalar_value (); } else if (oname == "numin") { topts.numin = opts (++iopt).scalar_value (); } else { error ("unrecognized option: %s", oname.c_str ()); return retval; } ++iopt; } if (topts.maxev > 0) { // run training int ierr = GPR_train (ndim, nx, X.data (), y.data (), theta.fortran_vec (), &nu, &nll, nlin, corf, &topts); fprintf (stdout, "\n"); if (octave_signal_caught) { octave_signal_caught = 0; // allow the optimization to be interrupted by Ctrl-C if (octave_interrupt_state > 0) octave_interrupt_state = 0; else octave_handle_signal (); } switch (ierr) { case TRAIN_CONV: std::cout << "converged." << '\n'; break; case TRAIN_PREM: std::cout << "terminated." << '\n'; break; case TRAIN_STOP: std::cout << "stopped." << '\n'; break; case TRAIN_FAIL: error ("failed. try different initial guess."); return retval; } } } // setup model for predictions double var; ColumnVector RP (2*nx+nx*(nx+1)/2); // make mu follow the theta convention (given by trans) Matrix mu (trans?1:nlin+1, trans?nlin+1:1); GPR_setup (ndim, nx, X.data (), y.data (), theta.data (), &nu, nlin, corf, &var, mu.fortran_vec (), RP.fortran_vec (), &nll); // construct model structure Octave_map GPM; // store training data GPM.assign ("X", X); // hyperparameters GPM.assign ("theta", theta); GPM.assign ("nu", nu); // prediction and additional data GPM.assign ("var", var); GPM.assign ("RP", RP); GPM.assign ("mu", mu); GPM.assign ("corf", corfs); retval = octave_value_list (nargout, octave_value ()); retval (0) = GPM; if (nargout > 1) retval (1) = nll; return retval; } octgpr/src/dsdacc.f0000644000175000001440000000242011236472444013541 0ustar hajekusersc Copyright (C) 2008 VZLU Prague, a.s., Czech Republic c c Author: Jaroslav Hajek c c This file is part of OctGPR. c c OctGPR is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by c the Free Software Foundation; either version 3 of the License, or c (at your option) any later version. c c This program is distributed in the hope that it will be useful, c but WITHOUT ANY WARRANTY; without even the implied warranty of c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the c GNU General Public License for more details. c c You should have received a copy of the GNU General Public License c along with this software; see the file COPYING. If not, see c . c subroutine dsdacc(n,x,y,x2,xy) c purpose: an assistant subroutine. Accumulates the dot product c x'*y as well as sum of squares x'*x in one pass. c arguments: c n (in) length of x,y c x,y (in) vectors in question c x2 (out) x'*x c xy (out) x'*y c integer n double precision x(*),y(*),x2,xy integer i xy = 0 x2 = 0 do i = 1,n x2 = x2 + x(i)**2 xy = xy + x(i)*y(i) end do end subroutine octgpr/TODO0000644000175000001440000000016311002115145012033 0ustar hajekusersTODO list for OctGPR o add documentation where missing o add more demos o add sparse gaussian process regression octgpr/README0000644000175000001440000000206110752610125012233 0ustar hajekusersOctGPR -------------------------------------------------------------------------------- OctGPR is a package for using Gaussian Process Regression (GPR) in Octave. GPR is a Bayesian statistical method of inference of unknown spatial data from known samples. It is also know as Kriging in geostatistics field. The method assumes that the known sample data are a result of a uniform spatial Gaussian Process, with a constant or linear mean and constant variance. Several models for the correlation function may be selected - gaussian, exponential or inverse multiquadrics (more might be added in the future). The mean (mu) and variance (var) parameters are ML-estimated analytically, while the inverse spatial scales (theta) and white noise (nu) are ML-estimated using a custom mixed-norm trust-region optimization algorithm. Derivatives w.r.t. theta and *two* derivatives w.r.t. nu are calculated analytically, hoping for a rapid convergence (as nu is typically the most sensitive parameter). In the future, the package will be extended with RBF models trained via GCV. octgpr/INDEX0000644000175000001440000000016611424003265012147 0ustar hajekusersoctgpr >> OctGPR OctGPR gpr_train gpr_predict pgp_train pgp_predict pdist2_mw Examples demo_octgpr rbf_centers octgpr/Makefile0000644000175000001440000000023711321417043013013 0ustar hajekuserssinclude ../../Makeconf PKG_FILES = COPYING DESCRIPTION INDEX $(wildcard src/*) \ $(wildcard inst/*) $(wildcard doc/*) SUBDIRS = src/ .PHONY: $(SUBDIRS) octgpr/ChangeLog0000644000175000001440000001237711236472444013150 0ustar hajekusers2009-08-06 Jaroslav Hajek * all sources: Change GPL2 to GPL3. * DESCRIPTION: Make a major version. 2009-07-28 Jaroslav Hajek * src/nllpgp.f: New source. * src/nldpgp.f: New source. * src/nl0pgp.f: New source. * src/pakpgp.f: New source. * src/infpgp.f: New source. * src/dgesum.f: New source. * src/dsumsq.f: New source. * src/pgp_train.cc: New file. * src/pgp_predict.cc: New file. * src/setup.c: Support PGPR. * src/train.c: Ditto. * src/predict.c: Ditto. * src/gprmod.h: Ditto. * src/forsubs.h: Ditto. * src/Makefile.in: Ditto. * inst/rbf_centers.m: Improve. * inst/demo_octgpr.m: Add PGPR demo. 2009-04-15 Jaroslav Hajek * src/Makefile.in: Add FPICFLAG/CPICFLAG to Fortran/C flags. 2008-09-05 Jaroslav Hajek * src/gprmod.h: add TRAIN_PREM * src/train.c: map info == 3 to TRAIN_PERM * src/gpr_train.c: indicate "terminated" state. * src/optdrv.f: tweak some values, check for too many unsuccesful steps. 2008-09-02 Jaroslav Hajek * src/nllgpr.f: Fix invalid upper loop bound. * src/optdr.f: Fix work array size. * src/train.c: Use the new size. 2008-08-27 Jaroslav Hajek * src/Makefile.in: Add pakgpr into the build process. 2008-07-22 Jaroslav Hajek * src/nllgpr.f src/nldgpr.f: Modify the derivative info storage (upper R triangle) to operate on contiguous columns (for cache-coherency). 2008-07-21 Jaroslav Hajek * src/pakgpr.f: New subroutine. * src/forsubs.h: Declare its prototype. * src/infgpr.f: Omit work moved to pakgpr. * src/setup.c: Call pakgpr to pack data. * src/gpr_train.cc: Increase RP size. 2008-07-20 Jaroslav Hajek * src/optdrv.f: Only overwrite 2nd deriv w.r.t. nu in VM if l2nu = .true. 2008-07-03 Jaroslav Hajek * src/nllgpr.f: fix invalid parameter declaration 2008-06-19 Jaroslav Hajek * src/pdist2_mw.cc: add missing return statement. 2008-06-10 Jaroslav Hajek * src/configure.in: correct FC to F77 (inferred variable from mkoctfile). * src/configure: regenerate. 2008-06-03 Jaroslav Hajek * inst/demo_octgpr.m: display points also on bottom left subplot, cosmetic fixes. 2008-05-30 Jaroslav Hajek * src/nllgpr.f, src/nl0gpr.f: add normalizing constant to obtain the true negative log likelihood. 2008-05-15 Jaroslav Hajek * inst/demo_octgpr.m: add support for non-interactive running. 2008-04-17 Jaroslav Hajek * inst/demo_octgpr.m: refactor demo * inst/rbf_centers.m: use kmeans++ initialization due to Arthur & Vassilvitskii * src/Changelog -> ChangeLog: transform to package root dir 2008-04-15 Jaroslav Hajek * src/pdist2_mw.cc: new source. * inst/rbf_centers.m: new function. 2008-04-04 Jaroslav Hajek * src/nllgpr.f: use QR decomposition instead of normal equations for mean fitting. * src/train.c, src/setup.c: change workspace size for nllgpr * src/configure.in: update the LAPACK routines checked * src/configure: regenerate 2008-03-26 Jaroslav Hajek * src/config.log, src/config.status, src/config.h, src/Makefile: remove. * src/configure.in: add support for -fPIC flags. * src/configure, src/config.h.in: regenerate. * src/Makefile.in: add distclean target 2008-02-28 Jaroslav Hajek * src/corrf.f: added Matern-3/2 and Matern-5/2 correlation funcs * src/get_corrf.c, src/forsubs.h: included the new correlation funcs * src/gpr_train.cc: documentation for the new correlation funcs 2008-02-24 Jaroslav Hajek * src/optdrv.f: implement objective reduction stopping criterion * src/gprmod.h, src/train.c, src/gpr_train.cc: add support for the new feature * src/forsubs.h src/nl0gpr.f: correct subroutine name * src/train.c: correct CP array size 2008-02-19 Jaroslav Hajek * src/*.{h,c,cc}: adjusted C/C++ sources to meet GNU coding standards 2008-02-18 Jaroslav Hajek * src/forsubs.h src/gprmod.h src/predict.c src/train.c src/setup.c: added const modifiers where appropriate. * src/grp_train, src/gpr_predict: replaced Array::fortran_vec with Array::data where appropriate, to prevent unnecessary copying. 2008-02-15 Jaroslav Hajek * inst/demo_octgpr.m: improved demo. 2008-02-13 Jaroslav Hajek * src/train.c: correct allocation and copying result values. * src/nldgpr.f: compute 2nd derivative by a better formula. * src/gpr_train.cc: improved documentation * src/gpr_predict.cc: improved documentation 2008-02-12 Jaroslav Hajek * src/dscrot.f: correct the W*D*x and W'*D*x sequence. * src/optdrv.f: correct calls to dscrot.f 2008-02-08 Jaroslav Hajek * src/train.c: corrected C->Fortran calls in to use proper #defines from forsubs.h * src/vmfac.f vmcmp.f trstep.f: deleted (no use) * src/optdrv.f: cosmetic changes * inst/demo_octgpr.m: added copyright * TODO: modified 2008-02-07 Jaroslav Hajek * src/gpr_train.cc: corrected inline Texinfo documentation * src/ChangeLog: added this file octgpr/DESCRIPTION0000644000175000001440000000072411236472444013075 0ustar hajekusersName: OctGPR Version: 1.2.0 Date: 2009-08-06 Author: Jaroslav Hajek (highegg@gmail.com) Title: Package for full dense Gaussian Process Regression Maintainer: Jaroslav Hajek (highegg@gmail.com) Description: The package allows interpolating and smoothing scattered multidimensional data using Gaussian Process Regression (also known as Kriging). Projected Gaussian Process regression is also experimentally supported. License: GPL v3 Depends: octave (>= 3.2.0) octgpr/COPYING0000644000175000001440000004312710752610125012416 0ustar hajekusers GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.