mpb-1.4.2/0002755000175400001440000000000007631010734006040 5mpb-1.4.2/doc/0002755000175400001440000000000007631010727006607 5mpb-1.4.2/doc/acknowledgments.html0000644000175400001440000000436707374654650012627 Acknowledgments Go to the next, previous, or main section.

Acknowledgments

This work was supported in part by the Materials Research Science and Engineering Center program of the National Science Foundation under Grant No. DMR-9400334, the U.S. Army Research Office under contract/grant DAAG55-97-1-0366, a National Defense Science and Engineering Fellowship, and an MIT Karl Taylor Compton Fellowship.

Clarendon Photonics, Inc., deserves special mention for funding development of the parallel version of MPB.

This project is also deeply indebted to the free software community for many invaluable tools and libraries, especially the GNU project (for Guile, gcc, autoconf, and other software, as well as its courageous leadership), the GNU/Linux operating system, the National Center for Supercomputing Applications at the University of Illinois (for HDF), and the LAPACK/BLAS developers.

S. G. Johnson thanks Dr. Matteo Frigo for his friendship, inspiration, and definition of "legacy code" as "any program written by a physicist." Dr. Shanhui Fan and Dr. Pierre R. Villeneuve endured endless interruptions by their group-mate and were generous with their patience and enthusiasm. Thanks to Dr. Douglas C. Allan of Corning for pestering (and bribing) me to bring the program to a usable state, and his colleague Karl Koch for being the first beta tester.

Robert D. Meade deserves credit for writing a predecessor to this program that was used in our group for many years. Although it does not share any code with MPB, his software blazed our algorithmic path and formed an invaluable baseline for testing.

This project would not exist without the tireless guidance, support, and encouragement of Prof. J. D. Joannopoulos of MIT. Thanks for letting me do things my way, John!


Go to the next, previous, or main section. mpb-1.4.2/doc/analysis-tutorial.html0000644000175400001440000005156407442767513013126 Data Analysis Tutorial Go to the next, previous, or main section.

Data Analysis Tutorial

In the previous section, we focused on how to perform a calculation in MPB. Now, we'll give a brief tutorial on what you might do with the results of the calculations, and in particular how you might visualize the results. We'll focus on two systems, one two-dimensional and one three-dimensional.

Triangular Lattice of Rods

First, we'll return to the two-dimensional triangular lattice of rods in air from the tutorial. The control file for this calculation, which can also be found in mpb-ctl/examples/tri-rods.ctl, will consist of:

The tri-rods.ctl control file

(set! num-bands 8)

(set! geometry-lattice (make lattice (size 1 1 no-size)
                         (basis1 (/ (sqrt 3) 2) 0.5)
                         (basis2 (/ (sqrt 3) 2) -0.5)))
(set! geometry (list (make cylinder
                       (center 0 0 0) (radius 0.2) (height infinity)
                       (material (make dielectric (epsilon 12))))))

(set! k-points (list (vector3 0 0 0)          ; Gamma
                     (vector3 0 0.5 0)        ; M
                     (vector3 (/ -3) (/ 3) 0) ; K
                     (vector3 0 0 0)))        ; Gamma
(set! k-points (interpolate 4 k-points))

(set! resolution 32)

(run-tm (output-at-kpoint (vector3 (/ -3) (/ 3) 0)
                          fix-efield-phase output-efield-z))
(run-te)

Notice that we're computing both TM and TE bands (where we expect a gap in the TM bands), and are outputting the z component of the electric field for the TM bands at the K point. (The fix-efield-phase will be explained below.)

Now, run the calculation, directing the output to a file, by entering the following command at the Unix prompt:

unix% mpb tri-rods.ctl >& tri-rods.out

It should finish after a minute or two.

The tri-rods dielectric function

In most cases, the first thing we'll want to do is to look at the dielectric function, to make sure that we specified the correct geometry. We can do this by looking at the epsilon.h5 output file.

The first thing that might come to mind would be to examine epsilon.h5 directly, say by converting it to a PNG image with h5topng (from my free h5utils package), magnifying it by 3:

unix% h5topng -S 3 epsilon.h5

epsilon unit cellThe resulting image (epsilon.png) is shown at right, and it initially seems wrong! Why is the rod oval-shaped and not circular? Actually, the dielectric function is correct, but the image is distorted because the primitive cell of our lattice is a rhombus (with 60-degree acute angles). Since the output grid of MPB is defined over the non-orthogonal unit cell, while the image produced by h5topng (and most other plotting programs) is square, the image is skewed.

We can fix the image in a variety of ways, but the best way is probably to use the mpb-data utility included (and installed) with MPB. mpb-data allows us to rearrange the data into a rectangular cell (-r) with the same area/volume, expand the data to include multiple periods (-m periods), and change the resolution per unit distance in each direction to a fixed value (-n resolution). man mpb-data or run mpb-data -h for more options. In this case, we'll rectify the cell, expand it to three periods in each direction, and fix the resolution to 32 pixels per a:

unix% mpb-data -r -m 3 -n 32 epsilon.h5

It's important to use -n when you use -r, as otherwise the non-square unit cell output by -r will have a different density of grid points in each direction, and appear distorted. The output of mpb-data is by default an additional dataset within the input file, as we can see by running h5ls:

unix% h5ls epsilon.h5 
data                     Dataset {32, 32}
data-new                 Dataset {96, 83}
description              Dataset {SCALAR}
lattice\ copies          Dataset {3}
lattice\ vectors         Dataset {3, 3}

epsilon 3x3 cell, rectifiedHere, the new dataset output by mpb-data is the one called data-new. We can examine it by running h5topng again, this time explicitly specifying the name of the dataset (and no longer magnifying):

unix% h5topng epsilon.h5:data-new

The new epsilon.png output image is shown at right. As you can see, the rods are now circular as desired, and they clearly form a triangular lattice.

Gaps and and band diagram for tri-rods

At this point, let's check for band gaps by picking out lines with the word "Gap" in them:

unix% grep Gap tri-rods.out
Gap from band 1 (0.275065617068082) to band 2 (0.446289918847647), 47.4729292989213%
Gap from band 3 (0.563582903703468) to band 4 (0.593059066215511), 5.0968516236891%
Gap from band 4 (0.791161222813268) to band 5 (0.792042731370125), 0.111357548663006%
Gap from band 5 (0.838730315053238) to band 6 (0.840305955160638), 0.187683867865441%
Gap from band 6 (0.869285340346465) to band 7 (0.873496724070656), 0.483294361375001%
Gap from band 4 (0.821658212109559) to band 5 (0.864454087942874), 5.07627823271133%

The first five gaps are for the TM bands (which we ran first), and the last gap is for the TE bands. Note, however that the < 1% gaps are probably false positives due to band crossings, as described in the user tutorial. There are no complete (overlapping TE/TM) gaps, and the largest gap is the 47% TM gap as expected. (To be absolutely sure of this and other band gaps, we would also check k-points within the interior of the Brillouin zone, but we'll omit that step here.)

Next, let's plot out the band structure. To do this, we'll first extract the TM and TE bands as comma-delimited text, which can then be imported and plotted in our favorite spreadsheet/plotting program.

unix% grep tmfreqs tri-rods.out > tri-rods.tm.dat
unix% grep tefreqs tri-rods.out > tri-rods.te.dat

The TM and TE bands are both plotted below against the "k index" column of the data, with the special k-points labelled. TM bands are shown in blue (filled circles) with the gaps shaded light blue, while TE bands are shown in red (hollow circles) with the gaps shaded light red.

tri-rods band diagram

Note that we truncated the upper frequencies at a cutoff of 1.0 c/a. Although some of our bands go above that frequency, we didn't compute enough bands to fill in all of the states in that range. Besides, we only really care about the states around the gap(s), in most cases.

The source of the TM gap: examining the modes

Now, let's actually examine the electric-field distributions for some of the bands (which were saved at the K point, remember). Besides looking neat, the field patterns will tell us about the characters of the modes and provide some hints regarding the origin of the band gap.

As before, we'll run mpb-data on the field output files (named e.k11.b*.z.tm.h5), and then run h5topng to view the results:

unix% mpb-data -r -m 3 -n 32 e.k11.b*.z.tm.h5
unix% h5topng -C epsilon.h5:data-new -c bluered -Z -d z.r-new e.k11.b*.z.tm.h5

Here, we've used the -C option to superimpose (crude) black contours of the dielectric function over the fields, -c bluered to use a blue-white-red color table, -Z to center the color scale at zero (white), and -d to specify the dataset name for all of the files at once. man h5topng for more information. (There are plenty of data-visualization programs available if you want more sophisticated plotting capabilities than what h5topng offers, of course; you can use h5totxt to convert the data to a format suitable for import into e.g. spreadsheets.)

Note that the dataset name is z.r-new, which is the real part of the z component of the output of mpb-data. (Since these are TM fields, the z component is the only non-zero part of the electric field.) The real and imaginary parts of the fields correspond to what the fields look like at half-period intervals in time, and in general they are different. However, at K they are redundant, due to the inversion symmetry of that k-point (proof left as an exercise for the reader). Usually, looking at the real parts alone gives you a pretty good picture of the state, especially if you use fix-efield-phase (see below), which chooses the phase to maximize the field energy in the real part. Sometimes, though, you have to be careful: if the real part happens to be zero, what you'll see is essentially numerical noise and you should switch to the imaginary part.

The resulting field images are shown below:

TM band 1 TM band 2 TM band 3 TM band 4 TM band 5 TM band 6 TM band 7 TM band 8

Your images should look the same as the ones above. If we hadn't included fix-efield-phase before output-efield-z in the ctl file, on the other hand, yours would have differed slightly (e.g. by a sign or a lattice shift), because by default the phase is random.

When we look at the real parts of the fields, we are really looking at the fields of the modes at a particular instant in time (and the imaginary part is half a period later). The point in time (relative to the periodic oscillation of the state) is determined by the phase of the eigenstate. The fix-efield-phase band function picks a canonical phase for the eigenstate, giving us a deterministic picture.

We can see several things from these plots:

First, the origin of the band gap is apparent. The lowest band is concentrated within the dielectric rods in order to minimize its frequency. The next bands, in order to be orthogonal, are forced to have a node within the rods, imposing a large "kinetic energy" (and/or "potential energy") cost and hence a gap. Successive bands have more and more complex nodal structures in order to maintain orthogonality. (The contrasting absence of a large TE gap has to do with boundary conditions. The perpendicular component of the displacement field must be continuous across the dielectric boundary, but the parallel component need not be.)

We can also see the deep impact of symmetry on the states. The K point has C3v symmetry (not quite the full C6v symmetry of the dielectric structure). This symmetry group has only one two-dimensional representation--that is what gives rise to the degenerate pairs of states (2/3, 4/5, and 7/8), all of which fall into this "p-like" category (where the states transform like two orthogonal dipole field patterns, essentially). The other two bands, 1 and 6, transform under the trivial "s-like" representation (with band 6 just a higher-order version of 1).

Diamond Lattice of Spheres

"Then were the entrances of this world made narrow, full of sorrow and travail: they are but few and evil, full of perils, and very painful." (Ezra 4:7)

Now, let us turn to a three-dimensional structure, a diamond lattice of dielectric spheres in air. The basic techniques to compute and analyze the modes of this structure are the same as in two dimensions, but of course, everything becomes more complicated in 3d. It's harder to find a structure with a complete gap, the modes are no longer polarized, the computations are far bigger, and visualization is much more difficult, for starters.

(The band gap of the diamond structure was first identified in: K. M. Ho, C. T. Chan, and C. M. Soukoulis, "Existence of a photonic gap in periodic dielectric structures," Phys. Rev. Lett. 65, 3152 (1990).)

The control file for this calculation, which can also be found in mpb-ctl/examples/diamond.ctl, consists of:

Diamond control file

(set! geometry-lattice (make lattice
                         (basis-size (sqrt 0.5) (sqrt 0.5) (sqrt 0.5))
                         (basis1 0 1 1)
                         (basis2 1 0 1)
                         (basis3 1 1 0)))

; Corners of the irreducible Brillouin zone for the fcc lattice,
; in a canonical order:
(set! k-points (interpolate 4 (list
                               (vector3 0 0.5 0.5)            ; X
                               (vector3 0 0.625 0.375)        ; U
                               (vector3 0 0.5 0)              ; L
                               (vector3 0 0 0)                ; Gamma
                               (vector3 0 0.5 0.5)            ; X
                               (vector3 0.25 0.75 0.5)        ; W
                               (vector3 0.375 0.75 0.375))))  ; K

; define a couple of parameters (which we can set from the command-line)
(define-param eps 11.56) ; the dielectric constant of the spheres
(define-param r 0.25)    ; the radius of the spheres

(define diel (make dielectric (epsilon eps)))

; A diamond lattice has two "atoms" per unit cell:
(set! geometry (list (make sphere (center 0.125 0.125 0.125) (radius r)
                           (material diel))
                     (make sphere (center -0.125 -0.125 -0.125) (radius r)
                           (material diel))))

; (A simple fcc lattice would have only one sphere/object at the origin.)

(set-param! resolution 16) ; use a 16x16x16 grid
(set-param! mesh-size 5)
(set-param! num-bands 5)

; run calculation, outputting electric-field energy density at the U point:
(run (output-at-kpoint (vector3 0 0.625 0.375) output-dpwr))

As before, run the calculation, directing the output to a file. This will take a few minutes (2 minutes on our Pentium-II); we'll put it in the background with nohup so that it will finish even if we log out:

unix% nohup mpb diamond.ctl >& diamond.out &

Note that, because we used define-param and set-param! to define/set some variables (see the libctl manual), we can change them from the command line. For example, to use a radius of 0.3 and a resolution of 20, we can just type mpb r=0.3 resolution=20 diamond.ctl. This is an extremely useful feature, because it allows you to use one generic control file for many variations on the same structure.

Important note on units for the diamond/fcc lattice

As usual, all distances are in the "dimensionless" units determined by the length of the lattice vectors. We refer to these units as a, and frequencies are given in units of c/a. By default, the lattice/basis vectors are unit vectors, but in the case of fcc lattices this conflicts with the convention in the literature. In particular, the canonical a for fcc is the edge-length of a cubic supercell containing the lattice.

In order to follow this convention, we set the length of our basis vectors appropriately using the basis-size property of geometry-lattice. (The lattice vectors default to the same length as the basis vectors.) If the cubic supercell edge has unit length (a), then the fcc lattice vectors have length sqrt(0.5), or (sqrt 0.5) in Scheme.

Gaps and and band diagram for the diamond lattice

The diamond lattice has a complete band gap:

unix% grep Gap diamond.out
Gap from band 2 (0.396348703007373) to band 3 (0.440813418580596), 10.6227251392791%

We can also plot its band diagram, much as for the tri-rods case except that now we can't classify the bands by polarization.

unix% grep freqs diamond.out > diamond.dat

The resulting band diagram, with the complete band gap shaded yellow, is shown below. Note that we only computed 5 bands, so in reality the upper portion of the plot would contain a lot more bands (which are of less interest than the bands adjoining the gap).

diamond band diagram

Visualizing the diamond lattice structure and bands

Visualizing fields in a useful way for general three-dimensional structures is fairly difficult, but we'll show you what we can with the help of the free Vis5D volumetric-visualization program, and the h5tov5d conversion program from h5utils.

First, of course, we've got to rectangularize the unit cell using mpb-data, as before. We'll also expand it to two periods in each direction.

unix% mpb-data -m 2 -r -n 32 epsilon.h5 dpwr.k06.b*.h5

Then, we'll use h5tov5d to convert the resulting datasets to Vis5D format, joining all the datasets into a single file (diamond.v5d) so that we can view them simultaneously if we want to:

unix% h5tov5d -o diamond.v5d -d data-new epsilon.h5 dpwr.k06.b*.h5

Note that all of the datasets are named data-new (from the original datasets called data) since we are looking at scalar data (the time-averaged electric-field energy density). No messy field components or real and imaginary parts this time; we have enough to deal with already.

Now we can open the file with Vis5D and play around with various plots of the data:

unix% vis5d diamond.v5d &

If you stare at the dielectric function long enough from various angles, you can convince yourself that it is a diamond lattice:

diamond epsilon plot

The lowest two bands have their fields concentrated within the spheres as you might expect, flowing along more-or-less linear paths. The second band differs from the first mainly by the orientation of its field paths. The fields for the first band at U are depicted below, with the strongest fields (highest energy density) shown as the most opaque, blue pixels. Next to it is the same plot but with an isosurface at the boundary of the dielectric superimposed, so you can see that the energy is concentrated inside the dielectric.

diamond band 1 plot diamond band 1 plot, epsilon superimposed

The first band above the gap is band 3. Its field energy densities are depicted below in the same manner as above. The field patterns are considerably harder to make out than for the lower band, but they seem to be more diffuse and "clumpy," the latter likely indicating the expected field oscillations for orthogonality with the lower bands.

diamond band 3 plot diamond band 3 plot, epsilon superimposed


Go to the next, previous, or main section. mpb-1.4.2/doc/developer.html0000644000175400001440000003271207443525546011420 Developer Information Go to the next, previous, or main section.

Developer Information

Here, we begin with a brief overview of what the program is computing, and then describe how the program and computation are broken up into different portions of the code.

Forgive the primitive math typography below; this will be rectified when MathML is supported in a decent browser.

The Mathematics of MPB

This section provides a whirlwind tour of the mathematics of photonic band structure calculations and the algorithms that we employ. For more detailed information, see:

The MIT Photonic-Bands Package takes a periodic dielectric structure and computes the eigenmodes of that structure, which are the electromagnetic waves that can propagate through the structure with a definite frequency. This corresponds to solving an eigenvalue problem M h = (w/c)^2 h, where h is the magnetic field, w is the frequency, and M is the Maxwell operator curl 1/epsilon curl. We also have an additional constraint, that div h be zero (the magnetic field must be "transverse").

Since the structure is periodic, we can also invoke Bloch's theorem to write the states in the form exp(i k*x) times a periodic function, where k is the Bloch wavevector. So, at each k-point (Bloch wavevector), we need to solve for a discrete set of eigenstates, the photonic bands of the structure.

To solve for the eigenstates on a computer, we must expand the magnetic field in some basis, where we truncate the basis to some finite number of points to discretize the problem. For example, we could use a traditional finite-element basis in which the field is taken on a finite number of mesh points and linearly interpolated in between. However, it is expensive to enforce the transversality constraint in this basis. Instead, we use a Fourier (spectral) basis, expanding the periodic part of the field in terms of exp(i G*x) planewaves. In this basis, the transversality constraint is easy to maintain, as it merely implies that the planewave amplitudes must be orthogonal to k + G.

In order to find the eigenfunctions, we could compute the elements of M explicitly in our basis, and then call LAPACK or some similar code to find the eigenvectors and eigenvalues. For a three-dimensional calculation, this could mean finding the eigenvectors of a matrix with hundreds of thousands of elements on a side--daunting merely to store, much less compute. Fortunately, we only want to know a few eigenvectors, not hundreds of thousands, so we can use much less expensive iterative methods that don't require us to store M explicitly.

Iterative eigensolvers require only that one supply a routine to operate M on a vector (function). Starting with an initial guess for the eigenvector, they then converge quickly to the actual eigenvector, stopping when the desired tolerance is achieved. There are many iterative eigensolver methods; we use a preconditioned block minimization of the Rayleigh quotient which is further described in the file src/matrices/eigensolver.c. In the Fourier basis, applying M to a function is relatively easy: the curls become cross products with i (k + G); the multiplication by 1/epsilon is performed by using an FFT to transform to the spatial domain, multiplying, and then transforming back with an inverse FFT. For more information and references on iterative eigensolvers, see the paper cited above.

We also support a "targeted" eigensolver. A typical iterative eigensolver finds the p lowest eigenvalues and eigenvectors. Instead, we can find the p eigenvalues closest to a given frequency w0 by solving for the eigenvalues of (M - (w0/c)^2)^2 instead of M. This new operator has the same eigenvectors as M, but its eigenvalues have been shifted to make those closest to w0 the smallest.

The eigensolver we use is preconditioned, which means that convergence can be greatly improved by suppling a good preconditioner matrix. Finding a good preconditioner involves making an approximate inverse of M, and is something of a black art with lots of trial and error.

Dielectric Function Computation

The initialization of the dielectric function deserves some additional discussion, both because it is crucial for good convergence, and because we use somewhat complicated algorithms for performance reasons.

To ameliorate the convergence problems caused in a planewave basis by a discontinuous dielectric function, the dielectric function is smoothed (averaged) at the resolution of the grid. Another way of thinking about it is that this brings the average dielectric constant (over the grid) closer to its true value. Since different polarizations of the field prefer different averaging methods, one has to construct an effective dielectric tensor at the boundaries between dielectrics, as described by the paper referenced above.

This averaging has two components. First, at each grid point the dielectric constant (epsilon) and its inverse are averaged over a uniform mesh extending halfway to the neighboring grid points. (The mesh resolution is controlled by the mesh-size user input variable.) Second, for grid points on the boundary between two dielectrics, we compute the vector normal to the dielectric interface; this is done by averaging the "dipole moment" of the dielectric function over a spherically-symmetric distribution of points. The normal vector and the two averages of epsilon are then combined into an effective dielectric tensor for the grid point.

All of this averaging is handled by a subroutine in src/maxwell/ (see below) that takes as input a function epsilon(r), which returns the dielectric constant for a given position r. This epsilon function must be as efficient as possible, because it is evaluated a large number of times: the size of the grid multiplied by mesh-size3 (in three dimensions).

To specify the geometry, the user provides a list of geometric objects (blocks, spheres, cylinders and so on). These are parsed into an efficient data structure and are used to to provide the epsilon function described above. (All of this is handled by the libctlgeom component of libctl, described below.) At the heart of the epsilon function is a routine to return the geometric object enclosing a given point, taking into account the fact that the objects are periodic in the lattice vectors. Our first algorithm for doing this was a simple linear search through the list of objects and their translations by the lattice vectors, but this proved to be too slow, especially in supercell calculations where there are many objects. We addressed the performance problem in two ways. First, for each object we construct a bounding box, with which point inclusion can be tested rapidly. Second, we build a hierarchical tree of bounding boxes, recursively partitioning the set of objects in the cell. This allows us to search for the object containing a point in a time logarithmic in the number of objects (instead of linear as before).

Code Organization

The code is organized to keep the core computation independent of the user interface, and to keep the eigensolver routines independent of the operator they are computing the eigenvector of. The computational code is located in the src/ directory, with a few major subdirectories, described below. The Guile-based user interface is completely contained within the mpb-ctl/ directory.

src/matrices/

This directory contains the eigensolver, in eigensolver.c, to which you pass an operator and it returns the eigenvectors. Eigenvectors are stored using the evectmatrix data structure, which holds p eigenvectors of length n, potentially distributed over n in MPI. See src/matrices/README for more information about the data structures. In particular, you should use the supplied functions (create_evectmatrix, etcetera) to create and manipulate the data structures, where possible.

The type of the eigenvector elements is determined by scalar.h, which sets whether they are real or complex and single or double precision. This is, in turn, controlled by the --disable-complex and --enable-single parameters to the configure script at install-time. scalar.h contains macros to make it easier to support both real and complex numbers elsewhere in the code.

Also in this directory is blasglue.c, a set of wrapper routines to make it convienient to call BLAS and LAPACK routines from C instead of Fortran.

src/util/

As its name implies, this is simply a number of utility routines for use elsewhere in the code. Of particular note is check.h, which defines a CHECK(condition, error-message) macro that is used extensively in the code to improve robustness. There are also debugging versions of malloc/free (which perform lots of paranoia tests, enabled by --enable-debug-malloc in configure), and MPI glue routines that allow the program to operate without the MPI libraries.

src/matrixio

This section contains code to abstract I/O for eigenvectors and similar matrices, providing a simpler layer on top of the HDF5 interface. This could be modified to support HDF4 or other I/O formats.

src/maxwell/

The maxwell/ directory contains all knowledge of Maxwell's equations used by the program. It implements functions to apply the Maxwell operator to a vector (in maxwell_op.c) and compute a good preconditioner (in maxwell_pre.c). These functions operate upon a representation of the fields in a transverse Fourier basis.

In order to use these functions, one must first initialize a maxwell_data structure with create_maxwell_data (defined in maxwell.c) and specify a k point with update_maxwell_data_k. One must also initialize the dielectric function using set_maxwell_dielectric by supplying a function that returns the dielectric constant for any given coordinate. You can also restrict yourself to TE or TM polarizations in two dimensions by calling set_maxwell_data_polarization.

This directory also contains functions maxwell_compute_dfield, etcetera, to compute the position-space fields from the Fourier-transform representation returned by the eigensolver.

mpb-ctl/

Here is the Guile-based user interface code for the eigensolver. Instead of using Guile directly, this code is built on top of the libctl library as described in previous sections. This means that the user-interface code (in mpb.c) is fairly short, consisting of a number of small functions that are callable by the user from Guile.

The core of the user interface is the file mpb.scm, the specifications file for libctl as described in the libctl manual. Actually, mpb.scm is generated by configure from mpb.scm.in (in order to substitute in parameters like the location of the libctl library); you should only edit mpb.scm.in directly. (You can regenerate mpb.scm simply by running ./config.status instead of re-running configure.)

The specifications file defines the data structures and subroutines that are visible to the Guile user. It also defines a number of Scheme subroutines for the user to call directly, like (run). It is often simpler and more flexible to define functions like this in Scheme rather than in C.

All of the code to handle the geometric objects resides in libctlgeom, a set of Scheme and C utility functions included with libctl (see the file utils/README in the libctl package). (These functions could also be useful in other programs, such as a time-domain Maxwell's equation simulator.)


Go to the next, previous, or main section. mpb-1.4.2/doc/diamond-b1-eps.gif0000644000175400001440000013522507044447552011734 GIF89a޽{{{{{9{{{{{{{{9{ZZZZZ{Z9Z9ZZ99{9{99999{޽{{{{99{{9{{{{{{{9{{Z{Z{Z9Z999999{{{{{{{޽{{{{{{{{{{{{{9{9{{{{{{{{9{9{{{{{{{{{{{{{9{Z{Z{Z{{Z{{Z9{Z9{99{99{9{{{{999999޽9޽9{9999{9{999999999{9{99999{9{9{9{9{{9{99{99Z9Z9Z9Z{9Z{9Z99Z9999999999999999999999޽޽{9{{99{{9{{{{{{{{{9{ZZZZ{Z{Z9Z9ZZ9999{999{{{99,@H*\ȰÇ#JHŋ3jȱǏ C `ɓ(S\ɲK43׍7&_ɳϟ9tX``@ M R֍ПXjݪ5BjɨI Vl¢X3W.;6Y !Og&4%is$Ӊ4>$I7uplvםvؕGwW5 j{Ը#}bOby㟌ôAc5àL""e]ơv"]cJfeQ6搣r+vBh#75uSI2,sI2mPF0$%g~M0s_2kchH5kH5HfEeRKwKvyxTI9嗬n4Fh%ՖR6x9kl{VN7$ g5g$_2j&c2qL&̱MnJ7d-hbe^ǝxUE6 /a/54lfY&|P7cE]pdeT[l1S=ƭ9![_AM|fc{2km h<'4PcG7vPDnE%{koV: f-8L"б7\{AlXfK4BMBoF9 {p`'9LS]4I9#M2Bokp7(Lƒ&-X(15ԔJ4W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,\}PJi$FF>9hb@:v)ȂN!_yH W6\IYxј [N/dU tx)Ȳ}r htCJa  pG6s N1,Np@LLE0.uQ$mTcFi@8#w%$ P1 {p S CPTIٞvNqDmpu2pt@CvꉪWYf,P;Hwrlq tx%,\L?FZ6Xr3 ʡ.z-jd&4/U|t3cZI:Z:cHjNڞ&(IO/ʠL`Z"jNWa/MJȦrj |sN]*xZF;mpb-1.4.2/doc/index.html0000644000175400001440000001730707537525035010542 MIT Photonic-Bands Documentation

MIT Photonic-Bands

Welcome to the manual for the MIT Photonic-Bands (MPB) package, a program for computing band structures (dispersion relations) of optical systems. Photonic-Bands was developed by Steven G. Johnson of the Joannopoulos Ab Initio Physics Group in the Condensed Matter Theory division of the MIT Physics Department.

Overview

This documentation is divided into the following sections:

Feedback

For professional consulting support of the MIT Photonic-Bands package, and photonic band-gap applications in general, contact Prof. John D. Joannopoulos of MIT (phone: (617) 253-4806, fax: (617) 253-2562).

If you have questions or problems regarding MIT Photonic-Bands, you are encouraged to join the mpb-discuss mailing list. This way, you can get help from other users of the software. In addition, this way other users can benefit from your experience by reading the mpb-discuss archives.

Alternatively, you may directly contact Steven G. Johnson at stevenj@alum.mit.edu. Complicated problems may be referred to consulting, above. mpb-1.4.2/doc/installation.html0000644000175400001440000005722507561013646012134 Installation Go to the next, previous, or main section.


Installation

In this section, we outline the procedure for installing the MIT Photonic-Bands package. Mainly, this consists of downloading and installing various prerequisites. As much as possible, we have attempted to take advantage of existing packages such as BLAS, LAPACK, FFTW, and GNU Guile, in order to make our code smaller, more robust, faster, and more flexible. Unfortunately, this may make the installation of MPB more complicated if you do not already have these packages.

You will also need an ANSI C compiler, of course (gcc is fine), and installation will be easiest on a UNIX-like system (Linux is fine). In the following list, some of the packages are dependent upon packages listed earlier, so you should install them in more-or-less the order given.

Note: Many of these libraries may be available in precompiled binary form, especially for GNU/Linux systems. Be aware, however, that library binary packages often come in two parts, library and library-dev, and both are required to compile programs using it.

Note: It is important that you use the same Fortran compiler to compile Fortran libraries (like LAPACK) and for configuring MPB. Different Fortran compilers often have incompatible linking schemes. (The Fortran compiler for MPB can be set via the F77 environment variable.)

Installation Paths

First, let's review some important information about installing software on Unix systems, especially in regards to installing software in non-standard locations. (None of these issues are specific to MPB, but they've caused a lot of confusion among our beloved users.)

Most of the software below, including MPB, installs under /usr/local by default; that is, libraries go in /usr/local/lib, programs in /usr/local/bin, etc. If you don't have root privileges on your machine, you may need to install somewhere else, e.g. under $HOME/install (the install/ subdirectory of your home directory). Most of the programs below use a GNU-style configure script, which means that all you would do to install there would be:

./configure --prefix=$HOME/install
when configuring the program; the directories $HOME/install/lib etc. are created automatically as needed.

Paths for Configuring

There are two further complications. First, if you install in a non-standard location (and /usr/local is considered non-standard by some proprietary compilers), you will need to tell the compilers where to find the libraries and header files that you dutifully installed. You do this by setting two environment variables:

setenv LDFLAGS "-L/usr/local/lib"
setenv CPPFLAGS "-I/usr/local/include"
Of course, substitute whatever installation directory you used. Do this before you run the configure scripts, etcetera. You may need to include multiple -L and -I flags (separated by spaces) if your machine has stuff installed in several non-standard locations. Bourne shell users (e.g. bash or ksh) should use the "export FOO=bar" syntax instead of csh's "setenv FOO bar", of course.

You might also need to update your PATH so that you can run the executables you installed (although /usr/local/bin is in the default PATH on many systems). e.g. if we installed in our home directory as described above, we would do:

setenv PATH "$HOME/install/bin:$PATH"

Paths for Running (Shared Libraries)

Second, many of the packages installed below (e.g. Guile) are installed as shared libraries. You need to make sure that your runtime linker knows where to find these shared libraries. The bad news is that every operating system does this in a slightly different way. The good news is that, when you run make install for the packages involving shared libraries, the output includes the necessary instructions specific to your system, so pay close attention! It will say something like "add LIBDIR to the foobar environment variable," where LIBDIR will be your library installation directory (e.g. /usr/local/lib) and foobar is some environment variable specific to your system (e.g. LD_LIBRARY_PATH on some systems, including Linux). For example, you might do:

setenv foobar "/usr/local/lib:$foobar"
Note that we just add to the library path variable, and don't replace it in case it contains stuff already. If you use Linux and have root privileges, you can instead simply run /sbin/ldconfig, first making sure that a line "/usr/local/lib" (or whatever) is in /etc/ld.so.conf.

If you don't want to type these commands every time you log in, you can put them in your ~/.cshrc file (or ~/.profile, or ~/.bash_profile, depending on your shell).

Fun with Fortran

MPB, and many of the libraries it calls, are written in C, but it also calls libraries such as BLAS and LAPACK (see below) that are usually compiled from Fortran. This can cause some added difficulty because of the various linking schemes used by Fortran compilers. MPB's configure script attempts to detect the Fortran linking scheme automatically, but in order for this to work you must use the same Fortran compiler and options with MPB as were used to compile BLAS/LAPACK.

By default, MPB looks for a vendor Fortran compiler first (f77, xlf, etcetera) and then looks for GNU g77. In order to manually specify a Fortran compiler foobar you would configure MPB with './configure F77=foobar ...'.

If, when you compiled BLAS/LAPACK, you used compiler options that alter the linking scheme (e.g. g77's -fcase-upper or -fno-underscoring), you will need to pass the same flags to MPB via './configure FFLAGS="...flags..." ...'.

One final note: you may run into trouble if you use a C compiler by a different vendor than your Fortran compiler, due to incompatible libraries. By default, MPB looks for a vendor C compiler (cc) first, but you can specify a different C compiler with './configure CC=foobar ...'.

BLAS

The first thing you must have on your system is a BLAS implementation. "BLAS" stands for "Basic Linear Algebra Subroutines," and is a standard interface for operations like matrix multiplication. It is designed as a building-block for other linear-algebra applications, and is used both directly by our code and in LAPACK (see below). By using it, we can take advantage of many highly-optimized implementations of these operations that have been written to the BLAS interface. (Note that you will need implementations of BLAS levels 1-3.)

You can find more BLAS information, as well as a basic implementation, on the BLAS Homepage. Once you get things working with the basic BLAS implementation, it might be a good idea to try and find a more optimized BLAS code for your hardware. Vendor-optimized BLAS implementations are available as part of the Compaq CXML, IBM ESSL, SGI sgimath, and other libraries. Recently, there has also been work on self-optimizing BLAS implementations that can achieve performance competitive with vendor-tuned codes; see the ATLAS homepage (and also PhiPACK). Links to more BLAS implementations can be found on SAL. I recommend ATLAS, but it does take some time to compile.

Note that the generic BLAS does not come with a Makefile; compile it with something like:

mkdir blas && cd blas # the BLAS archive does not create its own directory
get http://www.netlib.org/blas/blas.tgz
gunzip blas.tgz
tar xf blas.tar
f77 -c -O3 *.f   # compile all of the .f files to produce .o files
ar rv libblas.a *.o    #  combine the .o files into a library
su -c "cp libblas.a /usr/local/lib"   # switch to root and install

(Replace -O3 with your favorite optimization options. On Linux, I use g77 -O3 -fomit-frame-pointer -funroll-loops, with -malign-double -mcpu=i686 on a Pentium II.) Note that MPB looks for the standard BLAS library with -lblas, so the library file should be called libblas.a and reside in a standard directory like /usr/local/lib. (See also below for the --with-blas=lib option to MPB's configure script, to manually specify a library location.)

LAPACK

LAPACK, the Linear Algebra PACKage, is a standard collection of routines, built on BLAS, for more-complicated (dense) linear algebra operations like matrix inversion and diagonalization. You can download LAPACK from the LAPACK Home Page. More LAPACK links can be found on SAL.

Note that MPB looks for LAPACK by linking with -llapack. This means that the library must be called liblapack.a and be installed in a standard directory like /usr/local/lib (alternatively, you can specify another directory via the LDFLAGS environment variable as described earlier). (See also below for the --with-lapack=lib option to MPB's configure script, to manually specify a library location.)

MPI (optional)

Optionally, MPB is able to run on a distributed-memory parallel machine, and to do this we use the standard MPI message-passing interface. You can learn about MPI from the MPI Home Page. Most commercial supercomputers already have an MPI implementation installed; two free MPI implementations that you can install yourself are MPICH and LAM. MPI is not required to compile the ordinary, uniprocessor version of MPB.

In order for the MPI version of MPB to run successfully, we have a slightly nonstandard requirement: each process must be able to read from the disk. (This way, Guile can boot for each process and they can all read your control file in parallel.) Many (most?) commercial supercomputers, Linux Beowulf clusters, etcetera, satisfy this requirement.

Also, in order to get good performance, you'll need fast interconnect hardware such as Myrinet; 100Mbps Ethernet probably won't cut it. The speed bottleneck comes from the FFT, which requires most of the communications in MPB. FFTW's MPI transforms (see below) come with benchmark programs that will give you a good idea of whether you can get speedups on your system. Of course, even with slow communications, you can still benefit from the memory savings per CPU for large problems.

As described below, when you configure MPB with MPI support (--with-mpi), it installs itself as mpb-mpi. See also the user reference section for information on using MPB on parallel machines.

MPI support in MPB is thanks to generous support from Clarendon Photonics.

HDF5 (optional, strongly advised)

We require a portable, standard binary format for outputting the electromagnetic fields and similar volumetric data, and for this we use HDF. (If you don't have HDF5, you can still compile MPB, but you won't be able to output the fields or the dielectric function.)

HDF is a widely-used, free, portable library and file format for multi-dimensional scientific data, developed in the National Center for Supercomputing Applications (NCSA) at the University of Illinois (UIUC, home of the Fighting Illini and alma mater to many of this author's fine relatives).

There are two incompatible versions of HDF, HDF4 and HDF5 (no, not HDF1 and HDF2). We require the newer version, HDF5. Many visualization and data-analysis tools still use HDF4, but HDF5 includes an h5toh4 conversion program that you can use if you need HDF4 files.

HDF5 includes parallel I/O support under MPI, which can be enabled by configuring it with --enable-parallel. (You may also have to set the CC environment variable to mpicc. The resulting HDF5 library, however, may not work with the serial MPB.) This is not required to use the parallel version of MPB. MPB includes optional code to support this feature, and it may result in faster file I/O in the parallel MPB, but it is currently untested. (Let me know if you try it out; the worst that can happen is that MPB crashes or outputs garbage fields.)

You can get HDF and learn about it on the HDF Home Page. We have also collected some links to useful HDF software.

FFTW

FFTW is a self-optimizing, portable, high-performance FFT implementation, including both serial and parallel FFTs. You can download FFTW and find out more about it from the FFTW Home Page.

If you want to use MPB on a parallel machine with MPI, you will also need to install the MPI FFTW libraries (this just means including --enable-mpi in the FFTW configure flags).

GNU Readline (optional)

GNU Readline is a library to provide command-line history, tab-completion, emacs keybindings, and other shell-like niceties to command-line programs. This is an optional package, but one that can be used by Guile (see below) if it is installed; we recommend getting it. You can download Readline from the GNU ftp site. (Readline is typically preinstalled on GNU/Linux systems).

GNU Guile

GNU Guile is an extension/scripting language implementation based on Scheme, and we use it to provide a rich, fully-programmable user interface with minimal effort. It's free, of course, and you can download it from the Guile Home Page. (Guile is typically included with GNU/Linux systems.)

Important: If you are using an RPM-based Linux system with Guile pre-installed, please note that you must also install the guile-devel RPM (which should be on your CD, but is not installed by default).

GNU Autoconf (optional)

If you want to be a developer of the MPB package (as opposed to merely a user), you will also need the GNU Autoconf program. Autoconf is a portability tool that generates configure scripts to automatically detect the capabilities of a system and configure a package accordingly. You can find out more at the Autoconf Home Page (autoconf is typically installed by default on Linux systems). In order to install Autoconf, you will also need the GNU m4 program if you do not already have it (see the GNU m4 Home Page).

libctl

Instead of using Guile directly, we separated much of the user interface code into a package called libctl, in the hope that this might be more generally useful. libctl automatically handles the communication between the program and Guile, converting complicated data structures and so on, to make it even easier to use Guile to control scientific applications. Download libctl from the libctl home site, unpack it, and run the usual configure, make, make install sequence. You'll also want to browse its manual, as this will give you a general overview of what the user interface will be like.

If you are not the system administrator of your machine, and/or want to install libctl somewhere else (like your home directory), you can do so with the standard --prefix=dir option to configure (the default prefix is /usr/local). In this case, however, you'll need to specify the location of the libctl shared files for the MPB package, using the --with-libctl=dir/share/libctl option to the MPB configure script.

MIT Photonic-Bands

Okay, if you've made it all the way here, you're ready to install the MPB package and start cranking out eigenmodes. (You can download the latest version and read this manual at the MIT Photonic-Bands Homepage.) Once you've unpacked it, just run:

./configure
make

to configure and compile the package (see below to install). Hopefully, the configure script will correctly detect the BLAS, FFTW, etcetera libraries that you've dutifully installed, as well as the C compiler and so on, and the make compilation will proceed without a hitch. If not, it's a Simple Matter of Programming to correct the problem. configure accepts several flags to help control its behavior. Some of these are standard, like --prefix=dir to specify and installation directory prefix, and some of them are specific to the MPB package (./configure --help for more info). The configure flags specific to MPB are:

--with-inv-symmetry
Assume inversion symmetry in the dielectric function, allowing us to use real fields (in Fourier space) instead of complex fields. This gives a factor of 2 benefit in speed and memory. In this case, the MPB program will be installed as mpbi instead of mpb, so that you can have versions both with and without inversion symmetry installed at the same time. To install both mpb and mpbi, you should do:
./configure
make
su -c "make install"
make distclean
./configure --with-inv-symmetry
make
su -c "make install"

--with-hermitian-eps
Support the use of complex-hermitian dielectric tensors (corresponding to magnetic materials, which break inversion symmetry).

--enable-single
Use single precision (C float) instead of the default double precision (C double) for computations. (Not recommended.)

--without-hdf5
Don't use the HDF5 library for field and dielectric function output. (In which case, no field output is possible.)

--with-mpi
Attempt to compile a parallel version of MPB using MPI; the resulting program will be installed as mpb-mpi. Requires MPI and MPI FFTW libraries to be installed, as described above.

Does not compile the serial MPB, or mpb-data; if you want those, you should make distclean and compile/install them separately.

--with-mpi can be used along with --with-inv-symmetry, in which case the program is installed as mpbi-mpi (try typing that five times quickly).

--with-libctl=dir
If libctl was installed in a nonstandard location (i.e. neither /usr nor /usr/local), you need to specify the location of the libctl directory, dir. This is either prefix/share/libctl, where prefix is the installation prefix of libctl, or the original libctl source code directory.

--with-blas=lib
The configure script automatically attempts to detect accelerated BLAS libraries, like DXML (DEC/Alpha), SCSL and SGIMATH (SGI/MIPS), ESSL (IBM/PowerPC), ATLAS, and PHiPACK. You can, however, force a specific library name to try via --with-blas=lib.

--with-lapack=lib
Cause the configure script to look for a LAPACK library called lib (the default is to use -llapack).

--disable-checks
Disable runtime checks. (Not recommended; the disabled checks shouldn't take up a significant amount of time anyway.)

--enable-prof
Compile for performance profiling.

--enable-debug
Compile for debugging, adding extra runtime checks and so on.

--enable-debug-malloc
Use special memory-allocation routines for extra debugging (to check for array overwrites, memory leaks, etcetera).

--with-efence
More debugging: use the Electric Fence library, if available, for extra runtime array bounds-checking.

You can further control configure by setting various environment variables, such as:

  • CC: the C compiler command
  • CFLAGS: the C compiler flags (defaults to -O3).
  • CPPFLAGS: -Idir flags to tell the C compiler additional places to look for header files.
  • LDFLAGS: -Ldir flags to tell the linker additional places to look for libraries.
  • LIBS: additional libraries to link against.

Once compiled, the main program (as opposed to various test programs) resides in the mpb-ctl/ subdirectory, and is called mpb. You can install this program under /usr/local (or elsewhere, if you used the --prefix flag for configure), by running:

su -c "make install"

The "su" command is to switch to root for installation into system directories. You can just do make install if you are installing into your home directory instead.

If you make a mistake (e.g. you forget to specify a needed -Ldir flag) or in general want to start over from a clean slate, you can restore MPB to a pristine state by running:

make distclean

Go to the next, previous, or main section. mpb-1.4.2/doc/introduction.html0000644000175400001440000003463307374654650012162 Introduction Go to the next or main section.

Introduction

MIT Photonic-Bands is a software package to compute definite-frequency eigenstates of Maxwell's equations in periodic dielectric structures. Its primary intended application is the study of photonic crystals: periodic dielectric structures exhibiting a band gap in their optical modes, prohibiting propagation of light in that frequency range. However, it could also be easily applied to compute other optical dispersion relations and eigenstates (e.g. for conventional waveguides such as fiber-optic cables).

This manual assumes that the reader is familiar with concepts from solid-state physics such as eigenstates, band structures, and Bloch's theorem. We also do not attempt (much) to instruct the reader on photonic crystals or other optical applications for which this code might be useful. For an excellent introduction to all of these topics in the context of photonic crystals, see the book Photonic Crystals: Molding the Flow of Light, by J. D. Joannopoulos, R. D. Meade, and J. N. Winn (Princeton, 1995).

Some of the main design goals we were thinking about when we developed this package were the following (see also the feature list at the MPB home page):

  • Fully vectorial, three-dimensional calculations for arbitrary Bloch wavevectors. (The only approximation is the spatial discretization, or equivalently the planewave cutoff.)

  • Flexible interface. Readable, extensible, scriptable...see also the libctl design goals.

  • Parallel. (Can run on a single-processor machine, but is also supports parallel machines with MPI.)

  • "Targeted" eigensolver: find modes nearest to a specified frequency, not just the lowest-frequency bands. (For defect calculations.)

  • Leverage existing software (LAPACK, BLAS, FFTW, HDF, MPI, GUILE...).

  • Modularity. The eigensolver, Maxwell's equations, user interface, and so on, should be oblivious to each other as much as possible. This way, they can be debugged separately, combined in various ways, replaced, used in other programs...all the usual benefits of modular design.

  • Take advantage of inversion symmetry in the dielectric function, but don't require it. (This means that we have to handle both real and complex fields.)

Frequency-Domain vs. Time-Domain

There are two common computational approaches to studying dielectric structures such as photonic crystals: frequency-domain and time-domain. We feel that each has its own place in a researcher's toolbox, and each has unique advantages and disadvantages. MPB is frequency-domain; that is, it does a direct computation of the eigenstates and eigenvalues of Maxwell's equations (using a planewave basis). Each field computed has a definite frequency. In contrast, time-domain techniques iterate Maxwell's equations in time; the computed fields have a definite time (at each time step) but not a definite frequency per se. It seems worthwhile to say a few words about each method, and to explain why we want a frequency-domain code. (Our group has both time-domain and frequency-domain software, and we use both techniques extensively.)

Time-domain methods are well-suited to computing things that involve evolution of the fields, such as transmission and resonance decay-time calculations. They can also be used to calculate band structures and for finding resonant modes, by looking for peaks in the Fourier transform of the system response to some input. The main advantage of this is that you get all the frequencies (peaks) at once from a calculation involving propagation of a single field. There are several disadvantages to this technique, however. First, it is hard to be confident that you have found all of the states--you may have coupled weakly to some state by accident, or two states may be close in frequency and appear as a single peak; this is especially problematic in higher-order resonant-cavity and waveguide calculations. Second, in the Fourier transform, the frequency resolution is inversely related to the simulation time; to get 10 times the resolution you must run your simulation 10 times as long. Third, the time-step size must be proportional to the spatial-grid size for numerical stability; thus, if you double the spatial resolution, you must double the number of time steps (the length of your simulation), even if you are looking at states with the same frequency as before. Fourth, you only get the frequencies of the states; to get the eigenstates themselves (so that you can see what the modes look like and do calculations with them), you must run the simulation again, once for each state that you want, and for a time inversely proportional to the frequency-spacing between adjacent states (i.e. a long time for closely-spaced states).

In contrast, frequency-domain methods like those in MPB are in many ways better-suited to calculating band structures and eigenstates. (Here, we consider the case of an iterative eigensolver like the one in MPB, which iteratively improves approximate eigenstates. Dense solvers, which factorize the matrix directly, are impractical for large problems because of the huge size of the matrix, and because they compute many more eigenvectors than are desired. In iterative methods, the operator is only applied to individual vectors and is never itself computed explicitly.) First, you don't have to worry about missing states--even closely-spaced modes will appear as two eigenvalues in the result. Second, the error in the frequency in an iterative eigensolver typically decays exponentially with the number of iterations, so the number of iterations is logarithmic in the desired tolerance. Third, the number of iterations typically remains almost constant even as you increase the resolution (the work for each iteration increases, of course, but that happens in time-domain too). Fourth, you get both the frequencies and the eigenstates at the same time, so you can look at the modes immediately (even closely-spaced ones).

A traditional disadvantage of frequency-domain methods was that you had to compute all of the lowest eigenstates, up to the desired one, even if you didn't care about the lower ones. This was especially problematic in defect calculations, in which a large supercell is used, because in that case the lower bands are "folded" many times in the Brillouin zone. Thus, you often had to compute a large number of bands in order to get to the one you wanted (incurring large costs both in time and in storage). These disadvantages largely disappear in MPB, however, with the advent of its "targeted" eigensolver--with it, you can solve directly for the localized defect states (i.e the states in the band gap) without computing the lower bands.

History

In order to shed some light on the past development and design decisions of the Photonic-Bands package, I thought I'd write a few paragraphs about its history. Read on to enjoy my narcissist ramblings.

Many different people have written codes to compute the modes of periodic dielectric materials (although we don't know of any others that have been freely released). I have had experience with several programs written within our group, and this experience has guided the design of MIT Photonic-Bands.

The first program of this sort that I came in contact with, and the code that was used in our group until the development of this package, was initially written around 1990 (in Fortran 77) by R. D. Meade. As this software grew organically over time, several problems became apparent. First, the input format was inflexible (difficult to add new features without breaking old simulations), sensitive to whitespace and other formatting, and required repeated entry of information that was often the same from file to file. Often, pre- and post-processing steps were required using additional scripts and tools. Second, the many parts of the program had become intertwined, lacking modularity or a clear flow of control; this made it difficult to follow or modify substantially. Parallelizing it, or removing constraints that it imposed like inversion symmetry, or even replacing the input format seemed impractical. Besides, even reading code with variables named gxgzco (in common block cabgv) (honest!) is a mind-altering experience.

After an initial experience in the Spring of 1996 at writing a code based on a wavelet, rather than a planewave, basis (which turned out not to be practical), I set out to write a replacement for our Fortran eigensolver. My main aims at this time (Fall 1996) were a more flexible and powerful input format and a code that would be amenable to parallelization. I succeeded in achieving a working code with similar convergence to the old code (after some pain), but I discovered several things. I had lots of fun learning to use lex and yacc (Yet Another Compiler-Compiler) to make a flexible, C-like input format with variables and other advanced features. Having input files that were almost, but not quite, like a programming language made me realize, however, that what I really wanted was a programming language--no matter how many features I added, I always wanted one more "simple" thing. As far as parallelization, I quickly realized that I had a problem: I needed a parallel FFT, and the only ones that were available were proprietary (non-portable), used incompatible data distribution formats, and were often designed to be called only from special languages like HPF. That, plus my dissatisfaction with the available free FFTs, led me to embark on a side project (with my friend Matteo Frigo of MIT's Laboratory for Computer Science) to develop a new, free FFT library, FFTW, that included portable parallel routines. Also, I decided that attempting to support too many models of parallel programming (threads, MPI, Cray shmem) in one program resulted in a mess; it was better to stick with MPI (supporting running only a single process too, of course). Another mistake I discovered was that I allowed the eigensolver to get too intertwined with the specific problem of Maxwell's equations--the eigensolver knew about the data structures for the fields, etcetera, making it difficult to plug in replacement eigensolvers, test things in isolation, or to implement features like the "targeted" eigensolver of Photonic-Bands (which diagonalizes a different operator). The whole program was too mired in complexity. Finally, in the interim I had learned about block eigensolver algorithms. Not only can such algorithms leverage prepackaged, highly-optimized routines like BLAS and LAPACK, but they also promised to be inherently more suited for parallelization (since they remove the serial process of solving for the bands one by one). All of these things convinced me that I needed to rewrite the code again from scratch.

So, I started work on the new package (in Spring 1998), this time determined to develop and debug each component (matrix operations, eigensolver, maxwell operator, user input) in isolation. At the same time, I was thinking about how I would implement the user control language, wanting to develop a general tool that could be applied to other problems and software in our research. It seemed clear that, in order to get other people to use it in their programs, as well as to avoid a lot of the manual labor that went into my previous effort, I wanted to automatically generate the user/program interface from an abstract specification. As for the control language, I briefly considered implementing my own, but was happily led to GNU Guile instead, which gave me a powerful language with little effort. So armed, I set out to write libctl (which generates the Guile interface from an abstract Scheme specification), partially as an experiment to see how hard it would be and what the result would look like. After a weekend of work, it was obvious that I had a powerful tool; I spent couple of weeks adding some finishing touches, writing documentation, and so on, and proudly showed it off to my groupmates in the hope that they could use it for their programs. Without a real example of a program using libctl, however, it was hard to convince them to plug a scripting language into their existing, working codes. So, I went back to puttering at my eigensolvers.

Of course, all this time I was allegedly doing real research, and long periods would go by with little progress on the Photonic-Bands package. The original, Fortran code was still working, and in time one learned to bear its quirks and limitations with stoicism, although we cringed every time we had to show it to anyone else. By the summer of 1999, I had a working block eigensolver (supporting several iteration-scheme variants), a Maxwell operator to plug into the eigensolver (including a "targeted" operator, whose convergence I was unhappy with), and a test program to do convergence experiments on bands of a Bragg mirror. I hadn't attached any general user interface, field output, or other necessary components. At this point, Dr. Doug Allan of Corning (a former student of Prof. Joannopoulos), heard about the new code--in particular, the targeted eigensolver--and began clamoring to try it out. Not put off by my excuses, he asked for a copy of my current code, regardless of its status, to play with. Not wanting to refuse, but aghast at the prospect of someone seeing my masterpiece only half-painted, I told him to give me a week...in which time I added the interface and discovered that I had a useful tool. Over the next week, I added many features, fixed bugs, and wrote documentation, drawing near to a release at last...


Go to the next or main section. mpb-1.4.2/doc/license.html0000644000175400001440000001060607443525546011053 License and Copyright Go to the previous or main sections.

License and Copyright

Omnis enim res, quae dando non deficit, dum habetur et non datur, nondum habetur, quomodo habenda est.

"For if a thing is not diminished by being shared with others, it is not rightly owned if it is only owned and not shared."
(Saint Augustine, De Doctrina Christiana, c. 396 AD.)

MIT Photonic-Bands is copyright © 1999, 2000, 2001, 2002, Massachusetts Institute of Technology.

MIT Photonic-Bands 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 library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. You can also find it on the GNU web site:

http://www.gnu.org/copyleft/gpl.html

The file "minpack2-linmin.c" was derived from the MINPACK-2 package. It is copyright © 1996 by Jorge J. Moré, who has graciously granted us permission to distribute it along with MPB under the GNU General Public License.

As a clarification, we should note that Scheme control (ctl) files, written by the user (i.e. not containing code distributed with MIT Photonic-Bands) and loaded at runtime by the MIT Photonic-Bands software, are not considered derived works of MIT Photonic-Bands and do not fall thereby under the restrictions of the GNU General Public License.

In addition, all of the example Scheme code in this manual, as well as the example ctl files in the mpb-ctl/examples/ directory, may be freely used, modified, and redistributed, without any restrictions. (The warranty disclaimer still applies, of course.)

Referencing

We kindly ask you to reference the MIT Photonic-Bands package and its authors in any publication for which you used MPB. (You are not legally required to do so; it is up to your common sense to decide whether you want to comply with this request or not.) The preferred citation is our paper on MPB and related topics:

Steven G. Johnson and J. D. Joannopoulos, "Block-iterative frequency-domain methods for Maxwell's equations in a planewave basis," Optics Express 8, no. 3, 173-190 (2001), http://www.opticsexpress.org/abstract.cfm?URI=OPEX-8-3-173

Or, in BibTeX format:

@Article{Johnson2001:mpb,
  author =       {Johnson, Steven~G. and Joannopoulos, J.~D.},
  title =        {Block-iterative frequency-domain methods for Maxwell's equations in a planewave basis},
  journal =      {Opt. Express},
  year =         2001,
  volume =       8,
  number =       3,
  pages =        {173--190},
  url =  {http://www.opticsexpress.org/abstract.cfm?URI=OPEX-8-3-173}
}

If you want a one-sentence description of the algorithm for inclusion in a publication, we recommend:

Fully-vectorial eigenmodes of Maxwell's equations with periodic boundary conditions were computed by preconditioned conjugate-gradient minimization of the block Rayleigh quotient in a planewave basis, using a freely available software package [ref].

Go to the previous or main sections. mpb-1.4.2/doc/tri-rods-bands.gif0000644000175400001440000002351507044447553012063 GIF89a,@0I8ͻ`(di(jᾰk ikB+I6}OPܔC:^FrC@߰z8e<0&x[}%Gd]8$%{hoyv"D7NQ&: ;XtK6 9`$ϼdiw'qj1〟ٜ +,Nr~~QtNɶ2!R#JHŋ3jcp CǓ(S\Uxj͛+$Ο@b, ѣA"]ԣɏ=:dh?^:A@CN:h Vc#7U20 n"nZ2fip- 8Fw޾46'*aY0ƈ-}[oc: ֩Nt`} 6E-sQ[k f G2As}ymV;8_{$f=:WAj~t9^1Xo颁CС5F؜AAr$dqX݉16_eDiH&L6PF)eLiXf4hY%[)d:A`Jp)'_ix*?F.ˇ~yWBl=Ԉ=bP neb/@B~TFq+"#iZy@@ A cC3f4Zdځhm:Z}8[abIY^GUZml*A_. +êk/$+dVpO̫u5 عHjVlm6Ywlqf[ PB ,) ,18٢"`Zf@='~l4HFˏ֐L7*$2D2i E>VFkMA&K8J})xb(۸J,gIK.jPB/Ib<&.f& $],-X)=%D8d} ~dfXTEDxhpS;@eABp(v)}aNd N%l ~U^Ɯ*BC(dJzV %x$Q@Tь'/pR>3Tih+yFi4oPN>La SwMaS&59AZ׊>IGV)YW=_ֹհf+]wGg*MYx)vIEܓU5T:P.LuWF*-ec)VQ Ohk:Lоr5:l'wvL‹Ն3lH pyV#Yѝ$ ~ZEBXPW@ȽǦ:0->MZfc.Lv֏do XK覷$()W  @u C{َ6$KS{{Y̋xo$Ts;r"1$N3cFu\]4h긇ͅ{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Go to the next, previous, or main section.

User Reference

Here, we document the features exposed to the user by the MIT Photonic-Bands package. We do not document the Scheme language or the functions provided by libctl (see also the user reference section of the libctl manual).

Input Variables

These are global variables that you can set to control various parameters of the Photonic-Bands computation. They are also listed (along with their current values) by the (help) command. In brackets after each variable is the type of value that it should hold. (The classes, complex datatypes like geometric-object, are described in a later subsection. The basic datatypes, like integer, boolean, cnumber, and vector3, are defined by libctl.)

geometry [list of geometric-object class]
Specifies the geometric objects making up the structure being simulated. When objects overlap, later objects in the list take precedence. Defaults to no objects (empty list).

default-material [material-type class]
Holds the default material that is used for points not in any object of the geometry list. Defaults to air (epsilon of 1). See also epsilon-input-file, below.

ensure-periodicity [boolean]
If true (the default), then geometric objects are treated as if they were shifted by all possible lattice vectors; i.e. they are made periodic in the lattice.

geometry-lattice [lattice class]
Specifies the basis vectors and lattice size of the computational cell (which is centered on the origin of the coordinate system). These vectors form the basis for all other 3-vectors in the geometry, and the lattice size determines the size of the primitive cell. If any dimension of the lattice size is the special value no-size, then the dimension of the lattice is reduced (i.e. it becomes two- or one-dimensional). (That is, the dielectric function becomes two-dimensional; it is still, in principle, a three dimensional system, and the k-point vectors can be three-dimensional.) Generally, you should make any no-size dimension(s) perpendicular to the others. Defaults to the orthogonal x-y-z vectors of unit length (i.e. a square/cubic lattice).

resolution [number or vector3]
Specifies the computational grid resolution, in pixels per lattice unit (a lattice unit is one basis vector in a given direction). If resolution is a vector3, then specifies a different resolution for each direction; otherwise the resolution is uniform. (The grid size is then the product of the lattice size and the resolution, rounded up to the next positive integer.) Defaults to 10.

grid-size [vector3]
Specifies the size of the discrete computational grid along each of the lattice directions. Deprecated: the preferred method is to use the resolution variable, above, in which case the grid-size defaults to false. To get the grid size you should instead use the (get-grid-size) function.

mesh-size [integer]
At each grid point, the dielectric constant is averaged over a "mesh" of points to find an effective dielectric tensor. This mesh is a grid with mesh-size points on a side. Defaults to 3. Increasing mesh-size makes the the average dielectric constant sensitive to smaller structural variations without increasing the grid size, but also means that computing the dielectric function will take longer. (Using a mesh-size of 1 turns off dielectric function averaging and the creation of an effective dielectric tensor at interfaces. Be sure you know what you're doing before you worsen convergence in this way.)

dimensions [integer]
Explicitly specifies the dimensionality of the simulation; if the value is less than 3, the sizes of the extra dimensions in grid-size are ignored (assumed to be one). Defaults to 3. Deprecated: the preferred method is to set geometry-lattice to have size no-size in any unwanted dimensions.

k-points [list of vector3]
List of Bloch wavevectors to compute the bands at, expressed in the basis of the reciprocal lattice vectors. The reciprocal lattice vectors are defined as follows: Given the lattice vectors Ri (not the basis vectors), the reciprocal lattice vector Gj satisfies Ri * Gj = 2*Pi*deltai,j, where deltai,j is the Kronecker delta (1 for i = j and 0 otherwise). (Ri for any no-size dimensions is taken to be the corresponding basis vector.) Normally, the wavevectors should be in the first Brillouin zone (see below). k-points defaults to none (empty list).

num-bands [integer]
Number of bands (eigenvectors) to compute at each k point. Defaults to 1.

target-freq [number]
If zero, the lowest-frequency num-bands states are solved for at each k point (ordinary eigenproblem). If non-zero, solve for the num-bands states whose frequencies are have the smallest absolute difference with target-freq (special, "targeted" eigenproblem). Beware that the targeted solver converges more slowly than the ordinary eigensolver and may require a lower tolerance to get reliable results. Defaults to 0.

tolerance [number]
Specifies when convergence of the eigensolver is judged to have been reached (when the eigenvalues have a fractional change less than tolerance between iterations). Defaults to 1.0e-7.

filename-prefix [string]
A string prepended to all output filenames. Defaults to "" (no prefix).

epsilon-input-file [string]
If this string is not "" (the default), then it should be the name of an HDF5 file whose first/only dataset defines a dielectric function (over some discrete grid). This dielectric function is then used in place of default-material (i.e. where there are no geometry objects). The grid of the epsilon file dataset need not match grid-size; it is scaled and/or linearly interpolated as needed. The lattice vectors for the epsilon file are assumed to be the same as geometry-lattice. [ Note that, even if the grid sizes match and there are no geometric objects, the dielectric function used by MPB will not be exactly the dielectric function of the epsilon file, unless you also set mesh-size to 1 (see above). ]

eigensolver-block-size [integer]
The eigensolver uses a "block" algorithm, which means that it solves for several bands simultaneously at each k-point. eigensolver-block-size specifies this number of bands to solve for at a time; if it is zero or >= num-bands, then all the bands are solved for at once. If eigensolver-block-size is a negative number, -n, then MPB will try to use nearly-equal block-sizes close to n. Making the block size a small number can reduce the memory requirements of MPB, but block sizes > 1 are usually more efficient (there is typically some optimum size for any given problem). Defaults to -11 (i.e. solve for around 11 bands at a time).

simple-preconditioner? [boolean]
Whether or not to use a simplified preconditioner; defaults to false (this is fastest most of the time). (Turning this on increases the number of iterations, but decreases the time for each iteration.)

deterministic? [boolean]
Since the fields are initialized to random values at the start of each run, there are normally slight differences in the number of iterations, etcetera, between runs. Setting deterministic? to true makes things deterministic (the default is false).

eigensolver-flags [integer]
This variable is undocumented and reserved for use by Jedi Masters only.

Predefined Variables

Variables predefined for your convenience and amusement.

air, vacuum [material-type class]
Two aliases for a predefined material type with a dielectric constant of 1.
nothing [material-type class]
A material that, effectively, punches a hole through other objects to the background (default-material or epsilon-input-file).

infinity [number]
A big number (1.0e20) to use for "infinite" dimensions of objects.

Output Variables

Global variables whose values are set upon completion of the eigensolver.

freqs [list of number]
A list of the frequencies of each band computed for the last k point. Guaranteed to be sorted in increasing order. The frequency of band b can be retrieved via (list-ref freqs (- b 1)).

iterations [integer]
The number of iterations required for convergence of the last k point.

parity [string]
A string describing the current required parity/polarization ("te", "zeven", etcetera, or "" for none), useful for prefixing output lines for grepping.

Yet more global variables are set by the run function (and its variants), for use after run completes or by a band function (which is called for each band during the execution of run.

current-k [vector3]
The k point (from the k-points list) most recently solved.

gap-list [list of (percent freq-min freq-max) lists]
This is a list of the gaps found by the eigensolver, and is set by the run functions when two or more k-points are solved. (It is the empty list if no gaps are found.)

band-range-data [list of ((min . kpoint) . (max . kpoint)) pairs (of pairs)]
For each band, this list contains the minimum and maximum frequencies of the band, and the associated k points where the extrema are achieved. Note that the bands are defined by sorting the frequencies in increasing order, so this can be confused if two bands cross.

Classes

Classes are complex datatypes with various "properties" which may have default values. Classes can be "subclasses" of other classes; subclasses inherit all the properties of their superclass, and can be used any place the superclass is expected. An object of a class is constructed with:

(make class (prop1 val1) (prop2 val2) ...)

See also the libctl manual.

MIT Photonic-Bands defines several types of classes, the most numerous of which are the various geometric object classes. You can also get a list of the available classes, along with their property types and default values, at runtime with the (help) command.

lattice

The lattice class is normally used only for the geometry-lattice variable, and specifies the three lattice directions of the crystal and the lengths of the corresponding lattice vectors.

lattice
Properties:
basis1, basis2, basis3 [vector3]
The three lattice directions of the crystal, specified in the cartesian basis. The lengths of these vectors are ignored--only their directions matter. The lengths are determined by the basis-size property, below. These vectors are then used as a basis for all other 3-vectors in the ctl file. They default to the x, y, and z directions, respectively.
basis-size [vector3]
The components of basis-size are the lengths of the three basis vectors, respectively. They default ot unit lengths.
size [vector3]
The size of the lattice (i.e. the length of the lattice vectors Ri, in which the crystal is periodic) in units of the basis vectors. Thus, the actual lengths of the lattice vectors are given by the components of size multiplied by the components of basis-size. (Alternatively, you can think of size as the vector between opposite corners of the primitive cell, specified in the lattice basis.) Defaults to unit lengths.

If any dimension has the special size no-size, then the dimensionality of the problem is reduced by one; strictly speaking, the dielectric function is taken to be uniform along that dimension. (In this case, the no-size dimension should generally be orthogonal to the other dimensions.)

material-type

This class is used to specify the materials that geometric objects are made of. Currently, there are three subclasses, dielectric, dielectric-anisotropic, and material-function.

dielectric
A uniform, isotropic, linear dielectric material, with one property:
epsilon [number]
The dielectric constant (must be positive). No default value. You can also use (index n) as a synonym for (epsilon (* n n)).

dielectric-anisotropic
A uniform, possibly anisotropic, linear dielectric material. For this material type, you specify the (real-symmetric, or possibly complex-hermitian) dielectric tensor (relative to the cartesian xyz axes):
             a  u  v
epsilon =  ( u* b  w )
             v* w* c

This allows your dielectric to have different dielectric constants for fields polarized in different directions. The epsilon tensor must be positive-definite (have all positive eigenvalues); if it is not, MPB exits with an error. (This does not imply that all of the entries of the epsilon matrix need be positive.)

The components of the tensor are specified via three properties:

epsilon-diag [vector3]
The diagonal elements (a b c) of the dielectric tensor. No default value.
epsilon-offdiag [cvector3]
The off-diagonal elements (u v w) of the dielectric tensor. Defaults to zero. This is a cvector3, which simply means that the components may be complex numbers (e.g. 3+0.1i). If non-zero imaginary parts are specified, then the dielectric tensor is complex-hermitian. This is only supported when MPB is configured with the --with-hermitian-eps flag. This is not dissipative (the eigenvalues of epsilon are real), but rather breaks time-reversal symmetry, corresponding to a gyrotropic (magneto-optic) material. Note that inversion symmetry may not mean what you expect for complex-hermitian epsilon, so be cautious about using mpbi in this case.
epsilon-offdiag-imag [vector3]
Deprecated: The imaginary parts of the off-diagonal elements (u v w) of the dielectric tensor; defaults to zero. Setting the imaginary parts directly by specifying complex numbers in epsilon-offdiag is preferred.

For example, a material with a dielectric constant of 3.0 for TE fields (polarized in the xy plane) and 5.0 for TM fields (polarized in the z direction) would be specified via (make (dielectric-anisotropic (epsilon-diag 3 3 5))). Please be aware that not all 2d anisotropic dielectric structures will have TE and TM modes, however.

material-function
This material type allows you to specify the material as an arbitrary function of position. (For an example of this, see the bragg-sine.ctl file in the examples/ directory.) It has one property:
material-func [function]
A function of one argument, the position vector3 (in lattice coordinates), that returns the material at that point.

Note that the function you supply can return any material; wild and crazy users could even return another material-function object (which would then have its function invoked in turn).

Normally, the dielectric constant is required to be positive (or positive-definite, for a tensor). However, MPB does have a somewhat experimental feature allowing negative dielectrics (e.g. in a plasma). To use it, call the function (allow-negative-epsilon) before (run). In this case, it will output the (real) frequency squared in place of the (possibly imaginary) frequencies. (Convergence will be somewhat slower because the eigenoperator is not positive definite.)

geometric-object

This class, and its descendants, are used to specify the solid geometric objects that form the dielectric structure being simulated. The base class is:

geometric-object
Properties:
material [material-type class]
The material that the object is made of (usually some sort of dielectric). No default value (must be specified).
center [vector3]
Center point of the object. No default value.

One normally does not create objects of type geometric-object directly, however; instead, you use one of the following subclasses. Recall that subclasses inherit the properties of their superclass, so these subclasses automatically have the material and center properties (which must be specified, since they have no default values).

Recall that all 3-vectors, including the center of an object, its axes, and so on, are specified in the basis of the normalized lattice vectors normalized to basis-size. Note also that 3-vector properties can be specified by either (property (vector3 x y z)) or, equivalently, (property x y z).

In a two-dimensional calculation, only the intersections of the objects with the x-y plane are considered.

sphere
A sphere. Properties:
radius [number]
Radius of the sphere. No default value.

cylinder
A cylinder, with circular cross-section and finite height. Properties:
radius [number]
Radius of the cylinder's cross-section. No default value.
height [number]
Length of the cylinder along its axis. No default value.
axis [vector3]
Direction of the cylinder's axis; the length of this vector is ignored. Defaults to point parallel to the z axis.

cone
A cone, or possibly a truncated cone. This is actually a subclass of cylinder, and inherits all of the same properties, with one additional property. The radius of the base of the cone is given by the radius property inherited from cylinder, while the radius of the tip is given by the new property:
radius2 [number]
Radius of the tip of the cone (i.e. the end of the cone pointed to by the axis vector). Defaults to zero (a "sharp" cone).

block
A parallelepiped (i.e., a brick, possibly with non-orthogonal axes). Properties:
size [vector3]
The lengths of the block edges along each of its three axes. Not really a 3-vector (at least, not in the lattice basis), but it has three components, each of which should be nonzero. No default value.
e1, e2, e3 [vector3]
The directions of the axes of the block; the lengths of these vectors are ignored. Must be linearly independent. They default to the three lattice directions.

ellipsoid
An ellipsoid. This is actually a subclass of block, and inherits all the same properties, but defines an ellipsoid inscribed inside the block.

Here are some examples of geometric objects created using the above classes, assuming that the lattice directions (the basis) are just the ordinary unit axes, and m is some material we have defined:

; A cylinder of infinite radius and height 0.25 pointing along the x axis,
; centered at the origin:
(make cylinder (center 0 0 0) (material m) 
               (radius infinity) (height 0.25) (axis 1 0 0))


; An ellipsoid with its long axis pointing along (1,1,1), centered on
; the origin (the other two axes are orthogonal and have equal
; semi-axis lengths):
(make ellipsoid (center 0 0 0) (material m)
                (size 0.8 0.2 0.2)
		(e1 1 1 1)
		(e2 0 1 -1)
		(e3 -2 1 1))

; A unit cube of material m with a spherical air hole of radius 0.2 at
; its center, the whole thing centered at (1,2,3):
(set! geometry (list
		(make block (center 1 2 3) (material m) (size 1 1 1))
		(make sphere (center 1 2 3) (material air) (radius 0.2))))

Functions

Here, we describe the functions that are defined by the Photonic-Bands package. There are many types of functions defined, ranging from utility functions for duplicating geometric objects to run functions that start the computation.

See also the reference section of the libctl manual, which describes a number of useful functions defined by libctl.

Geometry utilities

Some utility functions are provided to help you manipulate geometric objects:

(shift-geometric-object obj shift-vector)
Translate obj by the 3-vector shift-vector.

(geometric-object-duplicates shift-vector min-multiple max-multiple obj)
Return a list of duplicates of obj, shifted by various multiples of shift-vector (from min-multiple to max-multiple, inclusive, in steps of 1).

(geometric-objects-duplicates shift-vector min-multiple max-multiple obj-list)
Same as geometric-object-duplicates, except operates on a list of objects, obj-list. If A appears before B in the input list, then all the duplicates of A appear before all the duplicates of B in the output list.

(geometric-objects-lattice-duplicates obj-list [ ux uy uz ])
Duplicates the objects in obj-list by multiples of the lattice basis vectors, making all possible shifts of the "primitive cell" (see below) that fit inside the lattice cell. (This is useful for supercell calculations; see the tutorial.) The primitive cell to duplicate is ux by uy by uz, in units of the basis vectors. These three parameters are optional; any that you do not specify are assumed to be 1.

(point-in-object? point obj)
Returns whether or not the given 3-vector point is inside the geometric object obj.

(point-in-periodic-object? point obj)
As point-in-object?, but also checks translations of the given object by the lattice vectors.

(display-geometric-object-info indent-by obj)
Outputs some information about the given obj, indented by indent-by spaces.

Coordinate conversion functions

The following functions allow you to easily convert back and forth between the lattice, cartesian, and reciprocal bases. (See also the note on units in the tutorial.)

(lattice->cartesian x), (cartesian->lattice x)
Convert x between the lattice basis (the basis of the lattice vectors normalized to basis-size) and the ordinary cartesian basis, where x is either a vector3 or a matrix3x3, returning the transformed vector/matrix. In the case of a matrix argument, the matrix is treated as an operator on vectors in the given basis, and is transformed into the same operator on vectors in the new basis.

(reciprocal->cartesian x), (cartesian->reciprocal x)
Like the above, except that they convert to/from reciprocal space (the basis of the reciprocal lattice vectors). Also, the cartesian vectors output/input are in units of 2 Pi.

(reciprocal->lattice x), (lattice->reciprocal x)
Convert between the reciprocal and lattice bases, where the conversion again leaves out the factor of 2 Pi (i.e. the lattice-basis vectors are assumed to be in units of 2 Pi).

Also, a couple of rotation functions are defined, for convenience, so that you don't have to explicitly convert to cartesian coordinates in order to use libctl's rotate-vector3 function (see the libctl reference):

(rotate-lattice-vector3 axis theta v), (rotate-reciprocal-vector3 axis theta v)
Like rotate-vector3 , except that axis and v are specified in the lattice/reciprocal bases.

Usually, k-points are specified in the first Brillouin zone, but sometimes it is convenient to specify an arbitrary k-point. However, the accuracy of MPB degrades as you move farther from the first Brillouin zone (due to the choice of a fixed planewave set for a basis). This is easily fixed: simply transform the k-point to a corresponding point in the first Brillouin zone, and a completely equivalent solution (identical frequency, fields, etcetera) is obtained with maximum accuracy. The following function accomplishes this:

(first-brillouin-zone k)
Given a k-point k (in the basis of the reciprocal lattice vectors, as usual), return an equivalent point in the first Brillouin zone of the current lattice (geometry-lattice).

Note that first-brillouin-zone can be applied to the entire k-points list with the Scheme expression: (map first-brillouin-zone k-points).

Run functions

These are functions to help you run and control the simulation. The ones you will most commonly use are the run function and its variants. The syntax of these functions, and one lower-level function, is:

(run band-func ...)
This runs the simulation described by the input parameters (see above), with no constraints on the polarization of the solution. That is, it reads the input parameters, initializes the simulation, and solves for the requested eigenstates of each k-point. The dielectric function is outputted to "epsilon.h5" before any eigenstates are computed. run takes as arguments zero or more "band functions" band-func. A band function should be a function of one integer argument, the band index, so that (band-func which-band) performs some operation on the band which-band (e.g. outputting fields). After every k-point, each band function is called for the indices of all the bands that were computed. Alternatively, a band function may be a "thunk" (function of zero arguments), in which case (band-func) is called exactly once per k-point.

(run-zeven band-func ...), (run-zodd band-func ...)
These are the same as the run function except that they constrain their solutions to have even and odd symmetry with respect to the z=0 plane. You should use these functions only for structures that are symmetric through the z=0 mirror plane, where the third basis vector is in the z direction (0,0,1) and is orthogonal to the other two basis vectors, and when the k vectors are in the xy plane. Under these conditions, the eigenmodes always have either even or odd symmetry. In two dimensions, even/odd parities are equivalent to TE/TM polarizations, respectively (and are often strongly analogous even in 3d). Such a symmetry classification is useful for structures such as waveguides and photonic-crystal slabs. (For example, see the paper by S. G. Johnson et al., "Guided modes in photonic crystal slabs," PRB 60, 5751, August 1999.)

(run-te band-func ...), (run-tm band-func ...)
These are the same as the run function except that they constrain their solutions to be TE- and TM-polarized, respectively, in two dimensions. The TE and TM polarizations are defined has having electric and magnetic fields in the xy plane, respectively. Equivalently, the H/E field of TE/TM light has only a z component (making it easier to visualize).

These functions are actually equivalent to calling run-zeven and run-zodd, respectively.

Note that for the modes to be segregated into TE and TM polarizations, the dielectric function must have mirror symmetry for reflections through the xy plane. If you use anisotropic dielectrics, you should be aware that they break this symmetry if the z direction is not one of the principle axes. If you use run-te or run-tm in such a case of broken symmetry, MPB will exit with an error.

(run-yeven band-func ...), (run-yodd band-func ...)
These functions are analogous to run-zeven and run-zodd, except that they constrain their solutions to have even and odd symmetry with respect to the y=0 plane. You should use these functions only for structures that are symmetric through the y=0 mirror plane, where the second basis vector is in the y direction (0,1,0) and is orthogonal to the other two basis vectors, and when the k vectors are in the xz plane.

run-yeven-zeven, run-yeven-zodd, run-yodd-zeven, run-yodd-zodd, run-te-yeven, run-te-yodd, run-tm-yeven, run-tm-yodd
These run-like functions combine the yeven/yodd constraints with zeven/zodd or te/tm. See also run-parity, below.

(run-parity p reset-fields band-func ...)
Like the run function, except that it takes two extra parameters, a parity p and a boolean (true/false) value reset-fields. p specifies a parity constraint, and should be one of the predefined variables:
  • NO-PARITY: equivalent to run
  • EVEN-Z (or TE): equivalent to run-zeven or run-te
  • ODD-Z (or TM): equivalent to run-zodd or run-tm
  • EVEN-Y (like EVEN-Z but for y=0 plane)
  • ODD-Y (like ODD-Z but for y=0 plane)

It is possible to specify more than one symmetry constraint simultaneously by adding them, e.g. (+ EVEN-Z ODD-Y) requires the fields to be even through z=0 and odd through y=0. It is an error to specify incompatible constraints (e.g. (+ EVEN-Z ODD-Z)). Important: if you specify the z/y parity, the dielectric structure (and the k vector) must be symmetric about the z/y=0 plane, respectively.

If reset-fields is false, the fields from any previous calculation will be reused as the starting point from this calculation, if possible; otherwise, the fields are reset to random values. The ordinary run functions use a default reset-fields oftrue. Alternatively, reset-fields may be a string, the name of an HDF5 file to load the initial fields from (as exported by save-eigenvectors, below).

(display-eigensolver-stats)
Display some statistics on the eigensolver convergence; this function is useful mainly for MPB developers in tuning the eigensolver.

Several band functions for outputting the eigenfields are defined for your convenience, and are described in the Band output functions section, below. You can also define your own band functions, and for this purpose the functions described in the section Field manipulation functions, below, are useful. A band function takes the form:

(define (my-band-func which-band)
  ...do stuff here with band index which-band...
)

Note that the output variable freqs may be used to retrieve the frequency of the band (see above). Also, a global variable current-k is defined holding the current k-point vector from the k-points list.

There are also some even lower-level functions that you can call, although you should not need to do most of the time:

(init-params p reset-fields?)
Read the input variables and initialize the simulation in preparation for computing the eigenvalues. The parameters are the same as the first two parameters of run-parity. This function must be called before any of the other simulation functions below. (Note, however, that the run functions all call init-params.)

(set-parity p)
After calling init-params, you can change the parity constraint without resetting the other parameters by calling this function. Beware that this does not randomize the fields (see below); you don't want to try to solve for, say, the TM eigenstates when the fields are initialized to TE states from a previous calculation.

(randomize-fields)
Initialize the fields to random values.

(solve-kpoint k)
Solve for the requested eigenstates at the Bloch wavevector k.

The inverse problem: k as a function of frequency

MPB's (run) function(s) and its underlying algorithms compute the frequency w as a function of wavevector k. Sometimes, however, it is desirable to solve the inverse problem, for k at a given frequency w. This is useful, for example, when studying coupling in a waveguide between different bands at the same frequency (frequency is conserved even when wavevector is not). One also uses k(w) to construct wavevector diagrams, which aid in understanding diffraction (e.g. negative-diffraction materials and super-prisms). To solve such problems, therefore, we provide the find-k function described below, which inverts w(k) via a few iterations of Newton's method (using the group velocity dw/dk). Because it employs a root-finding method, you need to specify bounds on k and a crude initial guess (order of magnitude is usually good enough).

(find-k p omega band-min band-max kdir tol kmag-guess kmag-min kmag-max [band-func...])
Find the wavevectors in the current geometry/structure for the bands from band-min to band-max at the frequency omega along the kdir direction in k-space. Returns a list of the wavevector magnitudes for each band; the actual wavevectors are (vector3-scale magnitude (unit-vector3 kdir)). The arguments of find-k are:
  • p: parity (same as first argument to run-parity, above).
  • omega: the frequency at which to find the bands
  • band-min, band-max: the range of bands to solve for the wavevectors of (inclusive).
  • kdir: the direction in k-space in which to find the wavevectors. (The magnitude of kdir is ignored.)
  • tol: the fractional tolerance with which to solve for the wavevector; 1e-4 is usually sufficient. (Like the tolerance input variable, this is only the tolerance of the numerical iteration...it does not have anything to do with e.g. the error from finite grid resolution.)
  • kmag-guess: an initial guess for the k magnitude (along kdir) of the wavevector at omega. Can either be a list (one guess for each band from band-min to band-max) or a single number (same guess for all bands, which is usually sufficient).
  • kmag-min, kmag-max: a range of k magnitudes to search; should be large enough to include the correct k values for all bands.
  • band-func: zero or more band functions, just as in (run), which are evaluated at the computed k points for each band.

The find-k routine also prints a line suitable for grepping:

kvals: omega, band-min, band-max, kdir-x, kdir-y, kdir-z, k magnitudes...

Band/output functions

All of these are functions that, given a band index, output the corresponding field or compute some function thereof (in the primitive cell of the lattice). They are designed to be passed as band functions to the run routines, although they can also be called directly. See also the section on field normalizations.

(output-hfield which-band)
(output-hfield-x which-band)
(output-hfield-y which-band)
(output-hfield-z which-band)
Output the magnetic (H) field for which-band; either all or one of the components, respectively.

(output-dfield which-band)
(output-dfield-x which-band)
(output-dfield-y which-band)
(output-dfield-z which-band)
Output the electric displacement (D) field for which-band; either all or one of the components, respectively.

(output-efield which-band)
(output-efield-x which-band)
(output-efield-y which-band)
(output-efield-z which-band)
Output the electric (E) field for which-band; either all or one of the components, respectively.

(output-hpwr which-band)
Output the time-averaged magnetic-field energy density (hpwr = |H|2) for which-band.

(output-dpwr which-band)
Output the time-averaged electric-field energy density (dpwr = epsilon*|E|2) for which-band.

(fix-hfield-phase which-band)
(fix-dfield-phase which-band)
(fix-efield-phase which-band)
Fix the phase of the given eigenstate in a canonical way based on the given spatial field (see also fix-field-phase, below). Otherwise, the phase is random; these functions also maximize the real part of the given field so that one can hopefully just visualize the real part. To fix the phase for output, pass one of these functions to run before the corresponding output function, e.g. (run-tm fix-dfield-phase output-dfield-z)

Although we try to maximize the "real-ness" of the field, this has a couple of limitations. First, the phase of the different field components cannot, of course, be chosen independently, so an individual field component may still be imaginary. Second, if you use mpbi to take advantage of inversion symmetry in your problem, the phase is mostly determined elsewhere in the program; fix-_field-phase in that case only determines the sign.

See also below for the output-poynting and output-tot-pwr functions to output the Poynting vector and the total electromagnetic energy density, respectively.

Sometimes, you only want to output certain bands. For example, here is a function that, given an band/output function like the ones above, returns a new output function that only calls the first function for bands with a large fraction of their energy in an object(s). (This is useful for picking out defect states in supercell calculations.)

(output-dpwr-in-objects band-func min-energy objects...)
Given a band function band-func, returns a new band function that only calls band-func for bands having a fraction of their electric-field energy greater than min-energy inside the given objects (zero or more geometric objects). Also, for each band, prints the fraction of their energy in the objects in the following form (suitable for grepping):
dpwr:, band-index, frequency, energy-in-objects

output-dpwr-in-objects only takes a single band function as a parameter, but if you want it to call several band functions, you can easily combine them into one with the following routine:

(combine-band-functions band-funcs...)
Given zero or more band functions, returns a new band function that calls all of them in sequence. (When passed zero parameters, returns a band function that does nothing.)

It is also often useful to output the fields only at a certain k-point, to let you look at typical field patterns for a given band while avoiding gratuitous numbers of output files. This can be accomplished via:

(output-at-kpoint k-point band-funcs...)
Given zero or more band functions, returns a new band function that calls all of them in sequence, but only at the specified k-point. For other k-points, does nothing.

Miscellaneous functions

(retrieve-gap lower-band)
Return the frequency gap from the band #lower-band to the band #(lower-band+1), as a percentage of mid-gap frequency. The "gap" may be negative if the maximum of the lower band is higher than the minimum of the upper band. (The gap is computed from the band-range-data of the previous run.)

Parity

Given a set of eigenstates at a k-point, MPB can compute their parities with respect to the z=0 or y=0 plane. The z/y parity of a state is defined as the expectation value (under the usual inner product) of the mirror-flip operation through z/y=0, respectively. For true even and odd eigenstates (see e.g. run-zeven and run-zodd), this will be +1 and -1, respectively; for other states it will be something in between.

This is useful e.g. when you have a nearly symmetric structure, such as a waveguide with a substrate underneath, and you want to tell which bands are even-like (parity > 0) and odd-like (parity < 0). Indeed, any state can be decomposed into purely even and odd functions, with absolute-value-squared amplitudes of (1+parity)/2 and (1-parity)/2, respectively.

display-zparities, display-yparities
These are band functions, designed to be passed to (run), which output all of the z/y parities, respectively, at each k-point (in comma-delimited format suitable for grepping).

(compute-zparities)
Returns a list of the parities about the z=0 plane, one number for each band computed at the last k-point.

(compute-yparities)
Returns a list of the parities about the y=0 plane, one number for each band computed at the last k-point.

(The reader should recall that the magnetic field is only a pseudo-vector, and is therefore multiplied by -1 under mirror-flip operations. For this reason, the magnetic field appears to have opposite symmetry from the electric field, but is really the same.)

Group velocities

Given a set of eigenstates at a given k-point, MPB can compute their group velocities (the derivative of frequency with respect to wavevector) using the Hellman-Feynmann theorem. Three functions are provided for this purpose, and we document them here from highest-level to lowest-level.

display-group-velocities
This is a band function, designed to be passed to (run), which outputs all of the group velocity vectors (in the Cartesian basis, in units of c) at each k-point.

(compute-group-velocities)
Returns a list of group-velocity vectors (in the Cartesian basis, units of c) for the bands at the last-computed k-point.

(compute-group-velocity-component direction)
Returns a list of the group-velocity components (units of c) in the given direction, one for each band at the last-computed k-point. direction is a vector in the reciprocal-lattice basis (like the k-points); its length is ignored. (This has the advantage of being three times faster than compute-group-velocities.)

Field manipulation

The Photonic-Bands package provides a number of ways to take the field of a band and manipulate, process, or output it. These methods usually work in two stages. First, one loads a field into memory (computing it in position space) by calling one of the get functions below. Then, other functions can be called to transform or manipulate the field.

The simplest class of operations involve only the currently-loaded field, which we describe in the second subsection below. To perform more sophisticated operations, involving more than one field, one must copy or transform the current field into a new field variable, and then call one of the functions that operate on multiple field variables (described in the third subsection).

Field normalization

In order to perform useful operations on the fields, it is important to understand how they are normalized. We normalize the fields in the way that is most convenient for perturbation and coupled-mode theory [c.f. SGJ et al., PRE 65, 066611 (2002)], so that their energy densities have unit integral. In particular, we normalize the electric (E), displacement (D = epsilon*E) and magnetic (H = -i/omega * curl E) fields, so that:

  • integral epsilon*|E|2 dxdydz = 1
  • integral |H|2 dxdydz = 1

where the integrals are over the computational cell. Note the volume element dxdydz (the volume of a grid pixel/voxel). If you simply sum |H|2 over all the grid points, therefore, you will get (# grid points) / (volume of cell).

Note that we have dropped the pesky factors of 1/2, pi, etcetera from the energy densities, since these do not appear in e.g. perturbation theory, and the fields have arbitrary units anyway. The functions to compute/output energy densities below similarly use epsilon*|E|2 and |H|2 without any prefactors.

Loading and manipulating the current field

In order to load a field into memory, call one of the get functions follow. They should only be called after the eigensolver has run (or after init-params, in the case of get-epsilon). One normally calls them after run, or in one of the band functions passed to run.

(get-hfield which-band)
Loads the magnetic (H) field for the band which-band.

(get-dfield which-band)
Loads the electric displacement (D) field for the band which-band.

(get-efield which-band)
Loads the electric (E) field for the band which-band. (This function actually calls get-dfield followed by get-efield-from-dfield, below.)

(get-epsilon)
Loads the dielectric function.

Once loaded, the field can be transformed into another field or a scalar field:

(get-efield-from-dfield)
Multiplies by the inverse dielectric tensor to compute the electric field from the displacement field. Only works if a D field has been loaded.

(fix-field-phase)
Fix the currently-loaded eigenstate's phase (which is normally random) in a canonical way, based on the spatial field (H, D, or E) that has currently been loaded. The phase is fixed to make the real part of the spatial field as big as possible (so that you can hopefully visualize just the real part of the field), and a canonical sign is chosen. See also the fix-*field-phase band functions, above, which are convenient wrappers around fix-field-phase

(compute-field-energy)
Given the H or D fields, computes the corresponding energy density function (normalized by the total energy in H or D, respectively). Also prints the fraction of the field in each of its cartesian components in the following form (suitable for grepping):
f-energy-components:, k-index, band-index, x-fraction, y-fraction, z-fraction

where f is either h or d. The return value of compute-field-energy is a list of 7 numbers: (U xr xi yr yi zr zi). U is the total, unnormalized energy, which is in arbitrary units deriving from the normalization of the eigenstate (e.g. the total energy for H is always 1.0). xr is the fraction of the energy in the real part of the field's x component, xi is the fraction in the imaginary part of the x component, etcetera (yr + yi = y-fraction, and so on).

Various integrals and other information about the eigenstate can be accessed by the following functions, useful e.g. for perturbation theory. Functions dealing with the field vectors require a field to be loaded, and functions dealing with the energy density require an energy density to be loaded via compute-field-energy.

(compute-energy-in-dielectric min-eps max-eps)
Returns the fraction of the energy that resides in dielectrics with epsilon in the range min-eps to max-eps.

(compute-energy-in-objects objects...)
Returns the fraction of the energy inside zero or more geometric objects.

(compute-energy-integral f)
f is a function (f u eps r) that returns a number given three parameters: u, the energy density at a point; eps, the dielectric constant at the same point; and r, the position vector (in lattice coordinates) of the point. compute-energy-integral returns the integral of f over the unit cell. (The integral is computed simply as the sum over the grid points times the volume of a grid pixel/voxel.) This can be useful e.g. for perturbation-theory calculations.

(compute-field-integral f)
Like compute-energy-integral, but f is a function (f F eps r) that returns a number (possibly complex) where F is the complex field vector at the given point.

(get-epsilon-point r)
Given a position vector r (in lattice coordinates), return the interpolated dielectric constant at that point. (Since MPB uses a an effective dielectric tensor internally, this actually returns the mean dielectric constant.)

(get-epsilon-inverse-tensor-point r)
Given a position vector r (in lattice coordinates), return the interpolated inverse dielectric tensor (a 3x3 matrix) at that point. (Near a dielectric interface, the effective dielectric constant is a tensor even if you input only scalar dielectrics; see the epsilon overview for more information.) The returned matrix may be complex-Hermetian if you are employing magnetic materials.

(get-energy-point r)
Given a position vector r (in lattice coordinates), return the interpolated energy density at that point.

(get-field-point r)
Given a position vector r (in lattice coordinates), return the interpolated (complex) field vector at that point.

(get-bloch-field-point r)
Given a position vector r (in lattice coordinates), return the interpolated (complex) Bloch field vector at that point (this is the field without the exp(ikx) envelope).

Finally, we have the following functions to output fields (either the vector fields, the scalar energy density, or epsilon), with the option of outputting several periods of the lattice.

(output-field [ nx [ ny [ nz ] ] ])
(output-field-x [ nx [ ny [ nz ] ] ])
(output-field-y [ nx [ ny [ nz ] ] ])
(output-field-z [ nx [ ny [ nz ] ] ])
Output the currently-loaded field. The optional (as indicated by the brackets) parameters nx, ny, and nz indicate the number of periods to be outputted along each of the three lattice directions. Omitted parameters are assumed to be 1. For vector fields, output-field outputs all of the components, while the other variants output only one component.

(output-epsilon [ nx [ ny [ nz ] ] ])
A shortcut for calling get-epsilon followed by output-field. Note that, because epsilon is a tensor, a number of datasets are outputted in "epsilon.h5":
  • "data": 3/trace(1/epsilon)
  • "epsilon.{xx,xy,xz,yy,yz,zz}": the components of the (symmetric) dielectric tensor.
  • "epsilon_inverse.{xx,xy,xz,yy,yz,zz}": the components of the (symmetric) inverse dielectric tensor.

Storing and combining multiple fields

In order to perform operations involving multiple fields, e.g. computing the Poynting vector ExH, they must be stored in field variables. Field variables come in two flavors, real-scalar (rscalar) fields, and complex-vector (cvector) fields. There is a pre-defined field variable cur-field representing the currently-loaded field (see above), and you can "clone" it to create more field variables with one of:

(field-make f)
Return a new field variable of the same type and size as the field variable f. Does not copy the field contents (see field-copy and field-set!, below).

(rscalar-field-make f)
(cvector-field-make f)
Like field-make, but return a real-scalar or complex-vector field variable, respectively, of the same size as f but ignoring f's type.

(field-set! fdest fsrc)
Set fdest to store the same field values as fsrc, which must be of the same size and type.

(field-copy f)
Return a new field variable that is exact copy of f; this is equivalent to calling field-make followed by field-set!.

(field-load f)
Loads the field f as the current field, at which point you can use all of the functions in the previous section to operate on it or output it.

Once you have stored the fields in variables, you probably want to compute something with them. This can be done in three ways: combining fields into new fields with field-map! (e.g. combine E and H to ExH), integrating some function of the fields with integrate-fields (e.g. to compute coupling integrals for perturbation theory), and getting the field values at arbitrary points with *-field-get-point (e.g. to do a line or surface integral). These three functions are described below:

(field-map! fdest func [f1 f2 ...])
Compute the new field fdest to be (func f1-val f2-val ...) at each point in the grid, where f1-val etcetera is the corresponding value of f1 etcetera. All the fields must be of the same size, and the argument and return types of func must match those of the f1... and fdest fields, respectively. fdest may be the same field as one of the f1... arguments. Note: all fields are without Bloch phase factors exp(ikx).

(integrate-fields func [f1 f2 ...])
Compute the integral of the function (func r [f1 f2 ...]) over the computational cell, where r is the position (in the usual lattice basis) and f1 etc. are fields (which must all be of the same size). (The integral is computed simply as the sum over the grid points times the volume of a grid pixel/voxel.) Note: all fields are without Bloch phase factors exp(ikx). See also the note below.

(cvector-field-get-point f r)
(cvector-field-get-point-bloch f r)
(rscalar-field-get-point f r)
Given a position vector r (in lattice coordinates), return the interpolated field cvector/rscalar from f at that point. cvector-field-get-point-bloch returns the field without the exp(ikx) Bloch wavevector, in analogue to get-bloch-field-point.

You may be wondering how to get rid of the field variables once you are done with them: you don't, since they are garbage collected automatically.

We also provide functions, in analogue to e.g get-efield and output-efield above, to "get" various useful functions as the current field and to output them to a file:

(get-poynting which-band)
Loads the Poynting vector E*xH for the band which-band, the flux density of electromagnetic energy flow, as the current field. 1/2 of the real part of this vector is the time-average flux density (which can be combined with the imaginary part to determine the amplitude and phase of the time-dependent flux).

(output-poynting which-band)
(output-poynting-x which-band)
(output-poynting-y which-band)
(output-poynting-z which-band)
Output the Poynting vector field for which-band; either all or one of the components, respectively.

(get-tot-pwr which-band)
Load the time-averaged electromgnetic-field energy density (|H|2 + epsilon*|E|2) for which-band. (If you multiply the real part of the Poynting vector by a factor of 1/2, above, you should multiply by a factor of 1/4 here for consistency.)

(output-tot-pwr which-band)
Output the time-averaged electromgnetic-field energy density (above) for which-band.

As an example, below is the Scheme source code for the get-poynting function, illustrating the use of the various field functions:

(define (get-poynting which-band)
  (get-efield which-band)                      ; put E in cur-field
  (let ((e (field-copy cur-field)))            ; ... and copy to local var.
    (get-hfield which-band)                    ; put H in cur-field
    (field-map! cur-field                      ; write ExH to cur-field
                (lambda (e h) (vector3-cross (vector3-conj e) h))
                e cur-field)
    (cvector-field-nonbloch! cur-field)))      ; see below

Stored fields and Bloch phases

Complex vector fields like E and H as computed by MPB are physically of the Bloch form: exp(ikx) times a periodic function. What MPB actually stores, however, is just the periodic function, the Bloch envelope, and only multiplies by exp(ikx) for when the fields are output or passed to the user (e.g. in integration functions). This is mostly transparent, with a few exceptions noted above for functions that do not include the exp(ikx) Bloch phase (it is somewhat faster to operate without including the phase).

On some occasions, however, when you create a field with field-map!, the resulting field should not have any Bloch phase. For example, for the Poynting vector E*xH, the exp(ikx) cancels because of the complex conjugation. After creating this sort of field, we must use the special function cvector-field-nonbloch! to tell MPB that the field is purely periodic:

(cvector-field-nonbloch! f)
Specify that the field f is not of the Bloch form, but rather that it is purely periodic.

Currently, all fields must be either Bloch or non-Bloch (i.e. periodic), which covers most physically meaningful possibilities.

There is another wrinkle: even for fields in Bloch form, the exp(ikx) phase currently always uses the current k-point, even if the field was computed from another k-point. So, if you are performing computations combining fields from different k-points, you should take care to always use the periodic envelope of the field, putting the Bloch phase in manually if necessary.

Manipulating the raw eigenvectors

MPB also includes a few low-level routines to manipulate the raw eigenvectors that it computes in a transverse planewave basis.

The most basic operations involve copying, saving, and restoring the current set of eigenvectors or some subset thereof:

(get-eigenvectors first-band num-bands)
Return an eigenvector object that is a copy of num-bands current eigenvectors starting at first-band. e.g. to get a copy of all of the eigenvectors, use (get-eigenvectors 1 num-bands).

(set-eigenvectors ev first-band)
Set the current eigenvectors, starting at first-band, to those in the ev eigenvector object (as returned by get-eigenvectors). (Does not work if the grid sizes don't match)

(load-eigenvectors filename)
(save-eigenvectors filename)
Read/write the current eigenvectors (raw planewave amplitudes) to/from an HDF5 file named filename. Instead of using load-eigenvectors directly, you can pass the filename as the reset-fields parameter of run-parity, above. (Loaded eigenvectors must be of the same size (same grid size and #bands) as the current settings.)

Currently, there's only one other interesting thing you can do with the raw eigenvectors, and that is to compute the dot-product matrix between a set of saved eigenvectors and the current eigenvectors. This can be used, e.g., to detect band crossings or to set phases consistently at different k points. The dot product is returned as a "sqmatrix" object, whose elements can be read with the sqmatrix-size and sqmatrix-ref routines.

(dot-eigenvectors ev first-band)
Returns a sqmatrix object containing the dot product of the saved eigenvectors ev with the current eigenvectors, starting at first-band. That is, the (i,j)th output matrix element contains the dot product of the (i+1)th vector of ev (conjugated) with the (first-band+j)th eigenvector. Note that the eigenvectors, when computed, are orthonormal, so the dot product of the eigenvectors with themselves is the identity matrix.

(sqmatrix-size sm)
Return the size n of an nxn sqmatrix sm.

(sqmatrix-ref sm i j)
Return the (i,j)th element of the nxn sqmatrix sm, where {i,j} range from 0..n-1.

Inversion Symmetry

If you configure MPB with the --with-inv-symmetry flag, then the program is configured to assume inversion symmetry in the dielectric function. This allows it to run at least twice as fast and use half as much memory as the more general case. This version of MPB is by default installed as mpbi, so that it can coexist with the usual mpb program.

Inversion symmetry means that if you transform (x,y,z) to (-x,-y,-z) in the coordinate system, the dielectric structure is not affected. Or, more technically, that:

epsilon(x,y,z) = epsilon(-x,-y,-z)*,

where the conjugation is significant for complex-hermitian dielectric tensors. This symmetry is very common; all of the examples in this manual have inversion symmetry, for example.

Note that inversion symmetry is defined with respect to a specific origin, so that you may "break" the symmetry if you define a given structure in the wrong way--this will prevent mpbi from working properly. For example, the diamond structure that we considered earlier would not have possessed inversion symmetry had we positioned one of the "atoms" to lie at the origin.

You might wonder what happens if you pass a structure lacking inversion symmetry to mpbi. As it turns out, mpbi only looks at half of the structure, and infers the other half by the inversion symmetry, so the resulting structure always has inversion symmetry, even if its original description did not. So, you should be careful, and look at the epsilon.h5 output to make sure it is what you expected.

Parallel MPB

We provide two methods by which you can parallelize MPB. The first, using MPI, is the most sophisticated and potentially provides the greatest and most general benefits. The second, which involves a simple script to split e.g. the k-points list among several processes, is less general but may be useful in many cases.

MPB with MPI parallelization

If you configure MPB with the --with-mpi flag, then the program is compiled to take advantage of distributed-memory parallel machines with MPI, and is installed as mpb-mpi. (See also the installation section.) This means that computations will (potentially) run more quickly and take up less memory per processor than for the serial code.

Using the parallel MPB is almost identical to using the serial version(s), with a couple of minor exceptions. The same ctl files should work for both. Running a program that uses MPI requires slightly different invocations on different systems, but will typically be something like:

unix% mpirun -np 4 mpb-mpi foo.ctl

to run on e.g. 4 processors. A second difference is that 1D systems are currently not supported in the MPI code, but the serial code should be fast enough for those anyway. A third difference is that the output HDF5 files (epsilon, fields, etcetera) from mpb-mpi have their first two dimensions (x and y) transposed; i.e. they are output as YxXxZ arrays. This doesn't prevent you from visualizing them, but the coordinate system is left-handed; to un-transpose the data, you can process it with mpb-data and the -T option (in addition to any other options).

In order to get optimal benefit (time and memory savings) from mpb-mpi, the first two dimensions (nx and ny) of your grid should both be divisible by the number of processes. If you violate this constraint, MPB will still work, but the load balance between processors will be uneven. At worst, e.g. if either nx or ny is smaller than the number of processes, then some of the processors will be idle for part (or all) of the computation. When using inversion symmetry (mpbi-mpi) for 2D grids, the optimal case is somewhat more complicated: nx and (ny/2 + 1), not ny, should both be divisible by the number of processes.

mpb-mpi divides each band at each k-point between the available processors. This means that, even if you have only a single k-point (e.g. in a defect calculation) and/or a single band, it can benefit from parallelization. Moreover, memory usage per processor is inversely proportional to the number of processors used. For sufficiently large problems, the speedup is also nearly linear.

MPI support in MPB is thanks to generous support from Clarendon Photonics.

Alternative parallelization: mpb-split

There is an alternative method of parallelization when you have multiple k points: do each k-point on a different processor. This does not provide any memory benefits, and does not allow one k-point to benefit by starting with the fields of the previous k-point, but is easy and may be the only effective way to parallelize calculations for small problems. This method also does not require MPI: it can utilize the unmodified serial mpb program. To make it even easier, we supply a simple script called mpb-split (or mpbi-split) to break the k-points list into chunks for you. Running:

unix% mpb-split num-split foo.ctl

will break the k-points list in foo.ctl into num-split more-or-less equal chunks, launch num-split processes of mpb in parallel to process each chunk, and output the results of each in order. (Each process is an ordinary mpb execution, except that it numbers its k-points depending upon which chunk it is in, so that output files will not overwrite one another and you can still grep for frequencies as usual.)

Of course, this will only benefit you on a system where different processes will run on different processors, such as an SMP or a cluster with automatic process migration (e.g. MOSIX). mpb-split is actually a trivial shell script, though, so you can easily modify it if you need to use a special command to launch processes on other processors/machines (e.g. via GNU Queue).

The general syntax for mpb-split is:

unix% mpb-split num-split mpb-arguments...

where all of the arguments following num-split are passed along to mpb. What mpb-split technically does is to set the MPB variable k-split-num to num-split and k-split-index to the index (starting with 0) of the chunk for each process. If you want, you can use these variables to divide the problem in some other way and then reset them to 1 and 0, respectively.


Go to the next, previous, or main section. mpb-1.4.2/doc/user-tutorial.html0000644000175400001440000011127407441566537012256 User Tutorial Go to the next, previous, or main section.

User Tutorial

In this section, we'll walk through the process of computing the band structure and outputting some fields for a two-dimensional photonic crystal using the MIT Photonic-Bands package. This should give you the basic idea of how it works and some of the things that are possible. Here, we tell you the truth, but not the whole truth. The User Reference section gives a more complete, but less colloquial, description of the features supported by Photonic-Bands. See also the data analysis tutorial in the next section for more examples, focused on analyzing and visualizing the results of MPB calculations.

The ctl File

The use of the Photonic-Bands package revolves around the control file, abbreviated "ctl" and typically called something like foo.ctl (although you can use any filename extension you wish). The ctl file specifies the geometry you wish to study, the number of eigenvectors to compute, what to output, and everything else specific to your calculation. Rather than a flat, inflexible file format, however, the ctl file is actually written in a scripting language. This means that it can be everything from a simple sequence of commands setting the geometry, etcetera, to a full-fledged program with user input, loops, and anything else that you might need.

Don't worry, though--simple things are simple (you don't need to be a Real Programmer), and even there you will appreciate the flexibility that a scripting language gives you. (e.g. you can input things in any order, without regard for whitespace, insert comments where you please, omit things when reasonable defaults are available...)

The ctl file is actually implemented on top of the libctl library, a set of utilities that are in turn built on top of the Scheme language. Thus, there are three sources of possible commands and syntax for a ctl file:

  • Scheme, a powerful and beautiful programming language developed at MIT, which has a particularly simple syntax: all statements are of the form (function arguments...). We run Scheme under the GNU Guile interpreter (designed to be plugged into programs as a scripting and extension language). You don't need to learn much Scheme for a basic ctl file, but it is always there if you need it; you can learn more about it from these Guile and Scheme links.

  • libctl, a library that we built on top of Guile to simplify communication between Scheme and scientific computation software. libctl sets the basic tone of the user interface and defines a number of useful functions. See the libctl home page.

  • The MIT Photonic-Bands package, which defines all the interface features that are specific to photonic band structure calculations. This manual is primarily focused on documenting these features.

It would be an excellent idea at this point for you to go read the libctl manual, particularly the Basic User Experience section, which will give you an overview of what the user interface is like, provide a crash course in the Scheme features that are most useful here, and describe some useful general features. We're not going to repeat this material (much), so learn it now!

Okay, let's continue with our tutorial. The MIT Photonic-Bands (MPB) program is normally invoked by running something like:

unix% mpb foo.ctl >& foo.out

which reads the ctl file foo.ctl and executes it, saving the output to the file foo.out. (Some sample ctl files are provided for you in the mpb-ctl/examples/ directory.) However, as you already know (since you obediently read the libctl manual, right?), if you invoke mpb with no arguments, you are dropped into an interactive mode in which you can type commands and see their results immediately. Why don't you do that right now, in your terminal window? Then, you can paste in the commands from the tutorial as you follow it and see what they do. Isn't this fun?

Our First Band Structure

As our beginning example, we'll compute the band structure of a two-dimensional square lattice of dielectric rods in air. In our control file, we'll first specify the parameters and geometry of the simulation, and then tell it to run and give us the output.

All of the parameters (each of which corresponds to a Scheme variable) have default setting, so we only need to specify the ones we need to change. (For a complete listing of the parameter variables and their current values, along with some other info, type (help) at the guile> prompt.) One of the parameters, num-bands, controls how many bands (eigenstates) are computed at each k point. If you type num-bands at the prompt, it will return the current value, 1--this is too small; let's set it to a larger value:

(set! num-bands 8)

This is how we change the value of variables in Scheme (if you type num-bands now, it will return 8). The next thing we want to set (although the order really doesn't matter), is the set of k points (Bloch wavevectors) we want to compute the bands at. This is controlled by the variable k-points, a list of 3-vectors (which is initially empty). We'll set it to the corners of the irreducible Brillouin zone of a square lattice, Gamma, X, M, and Gamma again:

(set! k-points (list (vector3 0 0 0)     ; Gamma
                     (vector3 0.5 0 0)   ; X
                     (vector3 0.5 0.5 0) ; M
                     (vector3 0 0 0)))   ; Gamma

Notice how we construct a list, and how we make 3-vectors; notice also how we can break things into multiple lines if we want, and that a semicolon (';') marks the start of a comment. Typically, we'll want to also compute the bands at a lot of intermediate k points, so that we see the continuous band structure. Instead of manually specifying all of these intermediate points, however, we can just call one of the functions provided by libctl to interpolate them for us:

(set! k-points (interpolate 4 k-points))

This takes the k-points and linearly interpolates four new points between each pair of consecutive points; if we type k-points now at the prompt, it will show us all 16 points in the new list:

(#(0 0 0) #(0.1 0.0 0.0) #(0.2 0.0 0.0) #(0.3 0.0 0.0) #(0.4 0.0 0.0) #(0.5 0 0) #(0.5 0.1 0.0) #(0.5 0.2 0.0) #(0.5 0.3 0.0) #(0.5 0.4 0.0) #(0.5 0.5 0) #(0.4 0.4 0.0) #(0.3 0.3 0.0) #(0.2 0.2 0.0) #(0.1 0.1 0.0) #(0 0 0))

As is described below, all spatial vectors in the program are specified in the basis of the lattice directions normalized to basis-size lengths (default is unit-normalized), while the k points are specified in the basis of the (unnormalized) reciprocal lattice vectors. In this case, we don't have to specify the lattice directions, because we are happy with the defaults--the lattice vectors default to the cartesian unit axes (i.e. the most common case, a square/cubic lattice). (The reciprocal lattice vectors in this case are also the unit axes.) We'll see how to change the lattice vectors in later subsections.

Now, we want to set the geometry of the system--we need to specify which objects are in the primitive cell of the lattice, centered on the origin. This is controlled by the variable geometry, which is a list of geometric objects. As you know from reading the libctl documentation, objects (more complicated, structured data types), are created by statements of the form (make type (property1 value1) (property2 value2) ...). There are various kinds (sub-classes) of geometric object: cylinders, spheres, blocks, ellipsoids, and perhaps others in the future. Right now, we want a square lattice of rods, so we put a single dielectric cylinder at the origin:

(set! geometry (list (make cylinder 
                       (center 0 0 0) (radius 0.2) (height infinity)
                       (material (make dielectric (epsilon 12))))))

Here, we've set several properties of the cylinder: the center is the origin, its radius is 0.2, and its height (the length along its axis) is infinity. Another property, the material, it itself an object--we made it a dielectric with the property that its epsilon is 12. There is another property of the cylinder that we can set, the direction of its axis, but we're happy with the default value of pointing in the z direction.

All of the geometric objects are ostensibly three-dimensional, but since we're doing a two-dimensional simulation the only thing that matters is their intersection with the xy plane (z=0). Speaking of which, let us set the dimensionality of the system. Normally, we do this when we define the size of the computational cell, controlled by the geometry-lattice variable, an object of the lattice class: we can set some of the dimensions to have a size no-size, which reduces the dimensionality of the system.

(set! geometry-lattice (make lattice (size 1 1 no-size)))

Here, we define a 1x1 two-dimensional cell (defaulting to square). This cell is discretized according to the resolution variable, which defaults to 10 (pixels/lattice-unit). That's on the small side, and this is only a 2d calculation, so let's increase the resolution:

(set! resolution 32)

This results in a 32x32 computational grid. For efficient calculation, it is best to make the grid sizes a power of two, or factorizable into powers of small primes (such as 2, 3, 5 and 7). As a rule of thumb, you should use a resolution of at least 8 in order to obtain reasonable accuracy.

Now, we're done setting the parameters--there are other parameters, but we're happy with their default values for now. At this point, we're ready to go ahead and compute the band structure. The simplest way to do this is to type (run). Since this is a two-dimensional calculation, however, we would like to split the bands up into TE- and TM-polarized modes, and we do this by invoking (run-te) and (run-tm).

These produce a lot of output, showing you exactly what the code is doing as it runs. Most of this is self-explanatory, but we should point out one output in particular. Among the output, you should see lines like:

tefreqs:, 13, 0.3, 0.3, 0, 0.424264, 0.372604, 0.540287, 0.644083, 0.81406, 0.828135, 0.890673, 1.01328, 1.1124

These lines are designed to allow you to easily extract the band-structure information and import it into a spreadsheet for graphing. They comprise the k point index, the k components and magnitude, and the frequencies of the bands, in comma-delimited format. Each line is prefixed by "tefreqs" for TE bands, "tmfreqs" for TM bands, and "freqs" for ordinary bands (produced by (run)), and using this prefix you can extract the data you want from the output by passing it through a program like grep. For example, if you had redirected the output to a file foo.out (as described earlier), you could extract the TM bands by running grep tmfreqs foo.out at the Unix prompt. Note that the output includes a header line, like:

tefreqs:, k index, kx, ky, kz, kmag/2pi, band 1, band 2, band 3, band 4, band 5, band 6, band 7, band 8

explaining each column of data. Another output of the run is the list of band gaps detected in the computed bands. For example the (run-tm) output includes the following gap output:

Gap from band 1 (0.282623311147724) to band 2 (0.419334798706834), 38.9514660888911%
Gap from band 4 (0.715673834754345) to band 5 (0.743682920649084), 3.8385522650349%

This data is also stored in the variable gap-list, which is a list of (gap-percent gap-min gap-max) lists. It is important to realize, however, that this band-gap data may include "false positives," from two possible sources:

  • If two bands cross, a false gap may result because the code computes the gap (connecting the dots in the band diagram) by assuming that bands never cross. Such false gaps are typically quite small (< 1%). To be sure of what's going on, you should either look at the symmetry of the modes involved or compute k points very close to the crossing (although even if the crossing occurs precisely at one of your k-points, there usually won't be an exact degeneracy for numerical reasons).
  • One typically computes band diagrams by considering k-points around the boundary of the irreducible Brillouin zone. It is possible (though rare) that the band edges may occur at points in the interior of the Brillouin zone. To be absolutely sure you have a band gap (and of its size), you should compute the frequencies for points inside the Brillouin zone, too.

You've computed the band structure, and extracted the eigenfrequencies for each k point. But what if you want to see what the fields look like, or check that the dielectric function is what you expect? To do this, you need to output HDF files for these functions (HDF is a binary format for multi-dimensional scientific data, and can be read by many visualization programs). (We output files in HDF5 format, where the filenames are suffixed by ".h5".)

When you invoke one of the run functions, the dielectric function in the unit cell is automatically written to the file "epsilon.h5". To output the fields or other information, you need to pass one or more arguments to the run function. For example:

(run-tm output-efield-z)
(run-te (output-at-kpoint (vector3 0.5 0 0) output-hfield-z output-dpwr))

This will output the electric (E) field z components for the TM bands at all k-points; and the magnetic (H) field z components and electric field energy densities (D power) for the TE bands at the X point only. The output filenames will be things like "e.k12.b03.z.te.h5", which stands for the z component (.z) of the TE (.te) electric field (e) for the third band (.b03) of the twelfth k point (.k12). Each HDF5 file can contain multiple datasets; in this case, it will contain the real and imaginary parts of the field (in datasets "z.r" and "z.i"), and in general it may include other data too (e.g. output-efield outputs all the components in one file). See also the Data Analysis tutorial.

There are several other output functions you can pass, described in the user reference section, like output-dfield, output-hpwr, and output-dpwr-in-objects. Actually, though, you can pass in arbitrary functions that can do much more than just output the fields--you can perform arbitrary analyses of the bands (using functions that we will describe later).

Instead of calling one of the run functions, it is also possible to call lower-level functions of the code directly, to have a finer control of the computation; such functions are described in the reference section.

A Few Words on Units

In principle, you can use any units you want with the Photonic-Bands package. You can input all of your distances and coordinates in furlongs, for example, as long as you set the size of the lattice basis accordingly (the basis-size property of geometry-lattice). We do not recommend this practice, however.

Maxwell's equations possess an important property--they are scale-invariant. If you multiply all of your sizes by 10, the solution scales are simply multiplied by 10 likewise (while the frequencies are divided by 10). So, you can solve a problem once and apply that solution to all length-scales. For this reason, we usually pick some fundamental lengthscale a of a structure, such as its lattice constant (unit of periodicity), and write all distances in terms of that. That is, we choose units so that a is unity. Then, to apply to any physical system, one simply scales all distances by a. This is what we have done in the preceding and following examples, and this is the default behavior of Photonic-Bands: the lattice constant is one, and all coordinates are scaled accordingly.

As has been mentioned already, (nearly) all 3-vectors in the program are specified in the basis of the lattice vectors normalized to lengths given by basis-size, defaulting to the unit-normalized lattice vectors. That is, each component is multiplied by the corresponding basis vector and summed to compute the corresponding cartesian vector. It is worth noting that a basis is not meaningful for scalar distances (such as the cylinder radius), however: these are just the ordinary cartesian distances in your chosen units of a.

Note also that the k-points, as mentioned above, are an exception: they are in the basis of the reciprocal lattice vectors. If a given dimension has size no-size, its reciprocal lattice vector is taken to be 2*pi/a.

We provide conversion functions to transform vectors between the various bases.

The frequency eigenvalues returned by the program are in units of c/a, where c is the speed of light and a is the unit of distance. (Thus, the corresponding vacuum wavelength is a over the frequency eigenvalue.)

Bands of a Triangular Lattice

As a second example, we'll compute the TM band structure of a triangular lattice of dielectric rods in air. To do this, we only need to change the lattice, controlled by the variable geometry-lattice. We'll set it so that the first two basis vectors (the properties basis1 and basis2) point 30 degrees above and below the x axis, instead of their default value of the x and y axes:

(set! geometry-lattice (make lattice (size 1 1 no-size)
			 (basis1 (/ (sqrt 3) 2) 0.5)
			 (basis2 (/ (sqrt 3) 2) -0.5)))

We don't specify basis3, keeping its default value of the z axis. Notice that Scheme supplies us all the ordinary arithmetic operators and functions, but they use prefix (Polish) notation, in Scheme fashion. The basis properties only specify the directions of the lattice basis vectors, and not their lengths--the lengths default to unity, which is fine here.

The irreducible Brillouin zone of a triangular lattice is different from that of a square lattice, so we'll need to modify the k-points list accordingly:

(set! k-points (list (vector3 0 0 0)          ; Gamma
                     (vector3 0 0.5 0)        ; M
                     (vector3 (/ -3) (/ 3) 0) ; K
                     (vector3 0 0 0)))        ; Gamma
(set! k-points (interpolate 4 k-points))

Note that these vectors are in the basis of the new reciprocal lattice vectors, which are different from before. (Notice also the Scheme shorthand (/ 3), which is the same as (/ 1 3) or 1/3.)

All of the other parameters (geometry, num-bands, and grid-size) can remain the same as in the previous subsection, so we can now call (run-tm) to compute the bands. As it turns out, this structure has an even larger TM gap than the square lattice:

Gap from band 1 (0.275065617068082) to band 2 (0.446289918847647), 47.4729292989213%

Maximizing the First TM Gap

Just for fun, we will now show you a more sophisticated example, utilizing the programming capabilities of Scheme: we will write a script to choose the cylinder radius that maximizes the first TM gap of the triangular lattice of rods from above. All of the Scheme syntax here won't be explained, but this should give you a flavor of what is possible.

First, we will write the function that want to maximize, a function that takes a dielectric constant and returns the size of the first TM gap. This function will change the geometry to reflect the new radius, run the calculation, and return the size of the first gap:

(define (first-tm-gap r)
  (set! geometry (list (make cylinder
			 (center 0 0 0) (radius r) (height infinity)
			 (material (make dielectric (epsilon 12))))))
  (run-tm)
  (retrieve-gap 1)) ; return the gap from TM band 1 to TM band 2

We'll leave most of the other parameters the same as in the previous example, but we'll also change num-bands to 2, since we only need to compute the first two bands:

(set! num-bands 2)

In order to distinguish small differences in radius during the optimization, it might seem that we have to increase the grid resolution, slowing down the computation. Instead, we can simply increase the mesh resolution. This is the size of the mesh over which the dielectric constant is averaged at each grid point, and increasing the mesh size means that the average index better reflects small changes in the structure.

(set! mesh-size 7) ; increase from default value of 3

Now, we're ready to maximize our function first-tm-gap. We could write a loop to do this ourselves, but libctl provides a built-in function (maximize function tolerance arg-min arg-max) to do it for us (using Brent's algorithm). So, we just tell it to find the maximum, searching in the range of radii from 0.1 to 0.5, with a tolerance of 0.1:

(define result (maximize first-tm-gap 0.1 0.1 0.5))
(print "radius at maximum: " (max-arg result) "\n")
(print "gap size at maximum: " (max-val result) "\n")

(print is a function defined by libctl to apply the built-in display function to zero or more arguments.) After five iterations, the output is:

radius at maximum: 0.176393202250021
gap size at maximum: 48.6252611051049

The tolerance of 0.1 that we specified means that the true maximum is within 0.1 * 0.176393202250021, or about 0.02, of the radius found here. It doesn't make much sense here to specify a lower tolerance, since the discretization of the grid means that the code can't accurately distinguish small differences in radius.

Before we continue, let's reset mesh-size to its default value:

(set! mesh-size 3) ; reset to default value of 3

A Complete 2D Gap with an Anisotropic Dielectric

As another example, one which does not require so much Scheme knowledge, let's construct a structure with a complete 2D gap (i.e., in both TE and TM polarizations), in a somewhat unusual way: using an anisotropic dielectric structure. An anisotropic dielectric presents a different dielectric constant depending upon the direction of the electric field, and can be used in this case to make the TE and TM polarizations "see" different structures.

We already know that the triangular lattice of rods has a gap for TM light, but not for TE light. The dual structure, a triangular lattice of holes, has a gap for TE light but not for TM light (at least for the small radii we will consider). Using an anisotropic dielectric, we can make both of these structures simultaneously, with each polarization seeing the structure that gives it a gap.

As before, our geometry will consist of a single cylinder, this time with a radius of 0.3, but now it will have an epsilon of 12 (dielectric rod) for TM light and 1 (air hole) for TE light:

(set! geometry (list (make cylinder
                       (center 0 0 0) (radius 0.3) (height infinity)
                       (material (make dielectric-anisotropic
                                   (epsilon-diag 1 1 12))))))

Here, epsilon-diag specifies the diagonal elements of the dielectric tensor. The off-diagonal elements (specified by epsilon-offdiag) default to zero and are only needed when the principal axes of the dielectric tensor are different from the cartesian xyz axes.

The background defaults to air, but we need to make it a dielectric (epsilon of 12) for the TE light, so that the cylinder forms a hole. This is controlled via the default-material variable:

(set! default-material (make dielectric-anisotropic (epsilon-diag 12 12 1)))

Finally, we'll increase the number of bands back to eight and run the computation:

(set! num-bands 8)
(run) ; just use run, instead of run-te or run-tm, to find the complete gap

The result, as expected, is a complete band gap:

Gap from band 2 (0.223977612336924) to band 3 (0.274704473679751), 20.3443687933601%

(If we had computed the TM and TE bands separately, we would have found that the lower edge of the complete gap in this case comes from the TM gap, and the upper edge comes from the TE gap.)

Finding a Point-defect State

Here, we consider the problem of finding a point-defect state in our square lattice of rods. This is a state that is localized in a small region by creating a point defect in the crystal--e.g., by removing a single rod. The resulting mode will have a frequency within, and be confined by, the gap.

To compute this, we need a supercell of bulk crystal, within which to put the defect--we will use a 5x5 cell of rods. To do this, we must first increase the size of the lattice by five, and then add all of the rods. We create the lattice by:

(set! geometry-lattice (make lattice (size 5 5 no-size)))

Here, we have used the default orthogonal basis, but have changed the size of the cell. To populate the cell, we could specify all 25 rods manually, but that would be tedious--and any time you find yourself doing something tedious in a programming language, you're making a mistake. A better approach would be to write a loop, but in fact this has already been done for you. Photonic-Bands provides a function, geometric-objects-lattice-duplicates, that duplicates a list of objects over the lattice:

(set! geometry (list (make cylinder
                       (center 0 0 0) (radius 0.2) (height infinity)
                       (material (make dielectric (epsilon 12))))))
(set! geometry (geometric-objects-lattice-duplicates geometry))

There, now the geometry list contains 25 rods--the originaly geometry list (which contained one rod, remember) duplicated over the 5x5 lattice.

To remove a rod, we'll just add another rod in the center of the cell with a dielectric constant of 1. When objects overlap, the later object in the list takes precedence, so we have to put the new rod at the end of geometry:

(set! geometry (append geometry 
		       (list (make cylinder (center 0 0 0) 
				   (radius 0.2) (height infinity)
				   (material air)))))

Here, we've used the Scheme append function to combine two lists, and have also snuck in the predefined material type air (which has an epsilon of 1).

We'll be frugal and only use only 16 points per lattice unit (resulting in an 80x80 grid) instead of the 32 from before:

(set! resolution 16)

Only a single k point is needed for a point-defect calculation (which, for an infinite supercell, would be independent of k):

(set! k-points (list (vector3 0.5 0.5 0)))

Unfortunately, for a supercell the original bands are folded many times over (in this case, 25 times), so we need to compute many more bands to reach the same frequencies:

(set! num-bands 50)

At this point, we can call (run-tm) to solve for the TM bands. It will take several minutes to compute, so be patient. Recall that the gap for this structure was for the frequency range 0.2812 to 0.4174. The bands of the solution include exactly one state in this frequency range: band 25, with a frequency of 0.378166. This is exactly what we should expect--the lowest band was folded 25 times into the supercell Brillouin zone, but one of these states was pushed up into the gap by the defect.

We haven't yet output any of the fields, but we don't have to repeat the run to do so. The fields from the last k-point computation remain in memory and can continue to be accessed and analyzed. For example, to output the electric field z component of band 25, we just do:

(output-efield-z 25)

That's right, the output functions that we passed to (run) in the first example are just functions of the band index that are called on each band. We can do other computations too, like compute the fraction of the electric field energy near the defect cylinder (within a radius 1.0 of the origin):

(get-dfield 25)  ; compute the D field for band 25
(compute-field-energy)  ; compute the energy density from D
(print
 "energy in cylinder: "
 (compute-energy-in-objects (make cylinder (center 0 0 0)
                                  (radius 1.0) (height infinity)
                                  (material air)))
 "\n")

The result is 0.624794702341156, or over 62% of the field energy in this localized region; the field decays exponentially into the bulk crystal. The full range of available functions is described in the reference section, but the typical sequence is to first load a field with a get- function and then to call other functions to perform computations and transformations on it.

Note that the compute-energy-in-objects returns the energy fraction, but does not itself print this value. This is fine when you are running interactively, in which case Guile always displays the result of the last expression, but when running as part of a script you need to explicitly print the result as we have done above with the print function. The "\n" string is newline character (like in C), to put subsequent output on a separate line.

Instead of computing all those bands, we can instead take advantage of a special feature of the MIT Photonic-Bands software that allows you to compute the bands closest to a "target" frequency, rather than the bands with the lowest frequencies. One uses this feature by setting the target-freq variable to something other than zero (e.g. the mid-gap frequency). In order to get accurate results, it's currently also recommended that you decrease the tolerance variable, which controls when convergence is judged to have occurred, from its default value of 1e-7:

(set! num-bands 1)  ; only need to compute a single band, now!
(set! target-freq (/ (+ 0.2812 0.4174) 2))
(set! tolerance 1e-8)

Now, we just call (run-tm) as before. Convergence requires more iterations this time, both because we've decreased the tolerance and because of the nature of the eigenproblem that is now being solved, but only by about 3-4 times in this case. Since we now have to compute only a single band, however, we arrive at an answer much more quickly than before. The result, of course, is again the defect band, with a frequency of 0.378166.

Tuning the Point-defect Mode

As another example utilizing the programming power of Scheme, we will write a script to "tune" the defect mode to a particular frequency. Instead of forming a defect by simply removing a rod, we can decrease the radius or the dielectric constant of the defect rod, thereby changing the corresponding mode frequency. In this case, we'll vary the dielectric constant, and try to find a mode with a frequency of, say, 0.314159 (a random number).

We could write a loop to search for this epsilon, but instead we'll use a root-finding function provided by libctl, (find-root function tolerance arg-min arg-max), that will solve the problem for us using a quadratically-convergent algorithm (Ridder's method). First, we need to define a function that takes an epsilon for the center rod and returns the mode frequency minus 0.314159; this is the function we'll be finding the root of:

(define old-geometry geometry) ; save the 5x5 grid with a missing rod
(define (rootfun eps)
  ; add the cylinder of epsilon = eps to the old geometry:
  (set! geometry (append old-geometry
			 (list (make cylinder (center 0 0 0)
				     (radius 0.2) (height infinity)
				     (material (make dielectric
						 (epsilon eps)))))))
  (run-tm)  ; solve for the mode (using the targeted solver)
  (print "epsilon = " eps " gives freq. = " (list-ref freqs 0) "\n")
  (- (list-ref freqs 0) 0.314159))  ; return 1st band freq. - 0.314159

Now, we can solve for epsilon (searching in the range 1 to 12, with a fractional tolerance of 0.01) by:

(define rooteps (find-root rootfun 0.01 1 12))
(print "root (value of epsilon) is at: " rooteps "\n")

The sequence of dielectric constants that it tries, along with the corresponding mode frequencies, is:
epsilon frequency
1 0.378165893321125
12 0.283987088221692
6.5 0.302998920718043
5.14623274327171 0.317371748739314
5.82311637163586 0.309702408341706
5.41898003340128 0.314169110036439
5.62104820251857 0.311893530112625

The final answer that it returns is an epsilon of 5.41986120170136 Interestingly enough, the algorithm doesn't actually evaluate the function at the final point; you have to do so yourself if you want to find out how close it is to the root. (Ridder's method successively reduces the interval bracketing the root by alternating bisection and interpolation steps. At the end, it does one last interpolation to give you its best guess for the root location within the current interval.) If we go ahead and evaluate the band frequency at this dielectric constant (calling (rootfun rooteps)), we find that it is 0.314159008193209, matching our desired frequency to nearly eight decimal places after seven function evaluations! (Of course, the computation isn't really this accurate anyway, due to the finite discretization.)

A slight improvement can be made to the calculation above. Ordinarily, each time you call the (run-tm) function, the fields are initialized to random values. It would speed convergence somewhat to use the fields of the previous calculation as the starting point for the next calculation. We can do this by instead calling a lower-level function, (run-parity TM false). (The first parameter is the polarization to solve for, and the second tells it not to reset the fields if possible.)

emacs and ctl

It is useful to have emacs use its scheme-mode for editing ctl files, so that hitting tab indents nicely, and so on. emacs does this automatically for files ending with ".scm"; to do it for files ending with ".ctl" as well, add the following lines to your ~/.emacs file:

(if (assoc "\\.ctl" auto-mode-alist)
    nil
  (nconc auto-mode-alist '(("\\.ctl" . scheme-mode))))

(Incidentally, emacs scripts are written in "elisp," a language closely related to Scheme.)


Go to the next, previous, or main section. mpb-1.4.2/AUTHORS0000644000175400001440000000007507442465756007052 MPB was written by Steven G. Johnson (stevenj@alum.mit.edu). mpb-1.4.2/COPYING0000644000175400001440000004310506762513334007024 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. mpb-1.4.2/COPYRIGHT0000644000175400001440000000144107441753311007255 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ mpb-1.4.2/ChangeLog0000644000175400001440000033577007631010661007546 2003-02-27 Steven G. Johnson * NEWS: tense * NEWS, ChangeLog: updated * mpb-ctl/mpb.scm.in: bug fix: kdir is in reciprocal coordinates. Thanks to Suxia (Susan) Yang for tracking down this bug. 2003-02-25 Steven G. Johnson * mpb-ctl/epsilon.c: fixed SunOS problem where guile 1/infinity and C 1/infinity give apparently different results...thanks to Benjamin Cowan for the bug report 2003-02-21 Steven G. Johnson * mpb-ctl/mpb.scm.in: change prompt to mpb> 2003-01-21 Steven G. Johnson * mpb-ctl/examples/sq-rods.ctl: whoops * mpb-ctl/examples/sq-rods.ctl: GaAs is n=11.56 2002-12-17 Steven G. Johnson * mpb-ctl/mpb.scm.in: fixed find-k for band-min != 0; thanks to M. Povinelli 2002-12-14 Steven G. Johnson * mpb-ctl/mpb.scm.in: fix find-k to work for thunk band functions 2002-12-03 Steven G. Johnson * mpb-ctl/examples/tri-holes.ctl: added k-interp 2002-12-02 Steven G. Johnson * mpb-ctl/examples/hole-slab.ctl: use k-interp param 2002-11-02 Steven G. Johnson * doc/installation.html: typo 2002-10-24 Steven G. Johnson * acx_mpi.m4: check for mpich lib 2002-09-26 Steven G. Johnson * acx_mpi.m4: added whitespace 2002-09-24 Steven G. Johnson * acx_mpi.m4: slight comment fix * acx_mpi.m4: fixed punctuation * acx_mpi.m4, configure.ac: use new acx_mpi.m4 2002-09-20 Steven G. Johnson * mpb-ctl/mpb.c: freqs: line should list headings as "k1, k2, k3" instead of "kx, ky, kz" since they are in reciprocal-lattice, not cartesian, coords. Thanks to Theis Peter Hanson for the suggestion. 2002-09-17 Steven G. Johnson * NEWS, mpb-ctl/epsilon.c: don't resize lattice basis for grid-size==1 unless no-size specified; thanks to Tairan Wang 2002-09-15 Steven G. Johnson * NEWS: updated * mpb-ctl/epsilon.c, mpb-ctl/field-smob.c, mpb-ctl/fields.c, mpb-ctl/mpb.c, mpb-ctl/mpb.h: whoops, take absolute value of Rm determinant for volume; thanks to Rumen Iliew for the bug report 2002-09-14 Steven G. Johnson * configure.ac, mpb-ctl/my-smob.h: improved smob compatibility...grrr, damn guile * mpb-ctl/Makefile.in, src/matrices/Makefile.in, src/matrixio/Makefile.in, src/maxwell/Makefile.in, src/util/Makefile.in, tests/Makefile.in, utils/Makefile.in: put my CPPFLAGS *first*; thanks to Cazimir G. Bostan for the bug report 2002-09-13 Steven G. Johnson * mpb-ctl/mpb.c: include field-smob.h * ChangeLog, NEWS: updated * mpb-ctl/field-smob.c: whoops * configure.ac, mpb-ctl/my-smob.h: guile-1.3.4 has scm_make_smob_type but not SCM_SMOB_PREDICATE (sigh) * mpb-ctl/field-smob.c, mpb-ctl/matrix-smob.c: whoops, fix guile 1.3 smob support * NEWS: dated release * mpb-ctl/mpb.scm.in: whoops 2002-09-11 Steven G. Johnson * doc/user-ref.html: whoops * doc/user-ref.html, mpb-ctl/field-smob.c, mpb-ctl/fields.c, mpb-ctl/mpb.scm.in: made Bloch phase handling more sane, maybe...maybe I should just bite the bullet and include the phase in the loaded fields, at some point? * mpb-ctl/fields.c: whoops, no kvector for c fields * mpb-ctl/mpb.scm.in, mpb-ctl/my-smob.h: whoops * configure.ac: bumped version * configure.ac, mpb-ctl/Makefile.in, mpb-ctl/field-smob.c, mpb-ctl/field-smob.h, mpb-ctl/matrix-smob.c, mpb-ctl/matrix-smob.h, mpb-ctl/my-smob.h, mpb-ctl/smob.h: use new Guile smob functions * mpb-ctl/mpb.scm.in: whoops * NEWS, TODO, doc/index.html, doc/user-ref.html, mpb-ctl/matrix-smob.c, mpb-ctl/mpb.scm.in: documented and cleaned up new interfaces 2002-09-10 Steven G. Johnson * src/matrixio/evectmatrixio.c: include SCALAR_NUMVALS in c dimension, not p dimension 2002-09-06 Steven G. Johnson * ChangeLog: updated 2002-08-27 Steven G. Johnson * mpb-ctl/examples/dos.scm: comment * mpb-ctl/examples/dos.scm: first arg to interpolate must be non-negative * mpb-ctl/examples/dos.scm: minor * mpb-ctl/examples/dos.scm: fixed hyphenation * mpb-ctl/examples/dos.scm: credit Doug * mpb-ctl/examples/dos.scm: some fixes * mpb-ctl/examples/dos.scm: remove debugging print * mpb-ctl/examples/dos.scm: include dos.scm in example doc * mpb-ctl/examples/dos.scm: added example density-of-states function 2002-06-19 Steven G. Johnson * mpb-ctl/mpb.scm.in: whoops, find-k was outputting in reverse order 2002-06-13 Steven G. Johnson * mpb-ctl/mpb.scm.in: added find-k routine to solve for k's at a given a frequency * mpb-ctl/mpb.c: don't print error if randomize-fields is called before init-params, so that we can ensure that fields are random when calling run-parity without knowing whether run was already called. 2002-06-12 Steven G. Johnson * configure.ac: print messages to remind when options like --with-inv-symmetry are set 2002-06-11 Steven G. Johnson * mpb-ctl/field-smob.c: fixed handling of curfield='-' 2002-06-10 Steven G. Johnson * mpb-ctl/fields.c: whoops, fixed field normalization for non-unit cells 2002-06-03 Steven G. Johnson * configure.ac: warn if zlib is not found (thanks to Kevin Hennessy for the bug report) 2002-04-30 Steven G. Johnson * mpb-ctl/fields.c: fixed floating-point error on Alphas for homogeneous structures, reported by F. Lopez-Tejeira 2002-04-17 Steven G. Johnson * configure.ac: make sure libctl is an appropriate version; thanks to Patricia Max for the suggestion 2002-04-03 Steven G. Johnson * mpb-ctl/epsilon.c: fixed error message (--with-hermitian-epsilon is not --with-hermitian-eps) * mpb-ctl/epsilon.c: fix check of real epsilon-offdiag for non-hermitian-eps (thanks to Doug Allan) 2002-03-24 Steven G. Johnson * mpb-ctl/field-smob.c: integrate-fields passes position vector 2002-03-23 Steven G. Johnson * mpb-ctl/field-smob.c, mpb-ctl/field-smob.h, mpb-ctl/fields.c, mpb-ctl/matrix-smob.c, mpb-ctl/matrix-smob.h: added assert_*_smob functions to replace SAFE_*, getting rid of many compiler warnings as well as CHECK statements * mpb-ctl/smob.h: use SCM2PTR, like Guile source, to be safe; still doesn't eliminate annoying warnings * mpb-ctl/field-smob.c, mpb-ctl/field-smob.h, mpb-ctl/fields.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in: fixed whoopses, added *-field-get-point (FIXME: handle arbitrary smobs) (FIXME: save k in smob?) * mpb-ctl/field-smob.c, mpb-ctl/fields.c: checked in fields.c (whoops) and RENORMALIZED FIELDS and INTEGRALS: all integrals are now integrals and not sums (i.e. we include the dV factor) and fields are properly unit-normalized 2002-03-22 Steven G. Johnson * mpb-ctl/field-smob.c: whoops * mpb-ctl/Makefile.in, mpb-ctl/field-smob.c, mpb-ctl/field-smob.h, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, src/util/check.h, src/util/debug_malloc.c: added field-smob 2002-03-21 Steven G. Johnson * mpb-ctl/matrix-smob.c: use CHK_MALLOC * mpb-ctl/matrix-smob.c: whoops * mpb-ctl/matrix-smob.c: allow very small imaginary part in scale_eigenvector for mpbi (since we can get this in the phase-fixing routines just by fp error) * mpb-ctl/mpb.scm.in: get rid of debugging print * mpb-ctl/matrix-smob.c: get rid of debugging printf * tests/blastest.c: whoops * mpb-ctl/Makefile.in, mpb-ctl/epsilon.c, mpb-ctl/matrix-smob.c, mpb-ctl/matrix-smob.h, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, mpb-ctl/smob.h, src/matrices/blasglue.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/evectmatrix.c, src/matrices/matrices.h, src/matrices/sqmatrix.c: added evectmatrix/sqmatrix smobs and several new functions, split mpb.c source files, mpb-split now uses full path... 2002-03-20 Steven G. Johnson * src/maxwell/maxwell_eps.c: fixed Stroud code URL 2002-03-19 Steven G. Johnson * mpb-ctl/mpb.scm.in: allow-negative-epsilon should use the targeted solver 2002-03-14 Steven G. Johnson * mpb-ctl/Makefile.in, mpb-ctl/mpb-split.1, mpb-ctl/mpb.1, utils/mpb-data.1: man page cleanups, added mpb-split man page 2002-03-13 Steven G. Johnson * mpb-ctl/Makefile.in: whoops, slight fix * mpb-ctl/Makefile.in: 'make install' (and in particular, installing mpb-split) should not write to the source directory. (This was biting me on NFS systems where root didn't have write access to my home directory.) * mpb-ctl/Makefile.in, utils/Makefile.in: use mandir * doc/developer.html, doc/license.html: fixed OE url, added bibtex 2002-03-11 Steven G. Johnson * NEWS: S. Lantz is at Cornell, not Corning. * doc/license.html: whoops, updated copyright year 2002-03-11 Steven G. Johnson * mpb-ctl/epsilon_file.c: included missing header * mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c: whoops, slight fix * NEWS: added release date 2002-03-10 Steven G. Johnson * doc/analysis-tutorial.html: fixed h5utils URL 2002-03-09 Steven G. Johnson * AUTHORS: added AUTHORS file to be GNU-ly correct 2002-03-08 Steven G. Johnson * mpb-ctl/mpb.c: use ctl_fix_path on epsilon_input_file in case user is running ctl file from another directory (thanks to Alexey Yamilov for bugging me) 2002-03-07 Steven G. Johnson * mpb-ctl/mpb.c: fix typo * doc/user-ref.html: noted no-size orthogonality * doc/user-ref.html: fixed typo * ChangeLog, NEWS, configure.ac: updated version * COPYRIGHT, mpb-ctl/epsilon_file.c, mpb-ctl/mpb.1, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, src/matrices/blasglue.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/matrices/eigensolver_davidson.c, src/matrices/eigensolver_utils.c, src/matrices/evectmatrix.c, src/matrices/linmin.c, src/matrices/linmin.h, src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/sqmatrix.c, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_constraints.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/util/check.h, src/util/debug_malloc.c, src/util/mpi_utils.c, src/util/mpi_utils.h, src/util/mpiglue.h, tests/blastest.c, tests/eigs_test.c, tests/malloctest.c, tests/maxwell_test.c, utils/mpb-data.1, utils/mpb-data.c: 2002 copyright year update * configure.ac, doc/user-ref.html, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: use Scheme complex numbers * mpb-ctl/mpb.scm.in: made usage of define-property consistent with latest rev. of libctl 2002-02-27 Steven G. Johnson * configure.ac: fixed bug in zdotc detection (thanks to Steve Lantz) * doc/installation.html: Added "Fun with Fortran" section (thanks to Steve Lantz for the suggestion). * src/maxwell/maxwell_eps.c: Fixed bug that would cause compile failure with Fortran compilers using upper case. (Thanks to Steve Lantz of Corning.) 2002-02-25 Steven G. Johnson * acx_lapack.m4: check for lapack_rs6k library name 2002-02-13 Steven G. Johnson * ChangeLog: updated 2002-02-12 Steven G. Johnson * mpb-ctl/mpb.c: fixed (I think) conjugation in field routines...E is multiplied by i, so it is conjugated along with H 2002-02-09 Steven G. Johnson * doc/license.html: don't recommend referencing the web site 2002-01-21 Steven G. Johnson * doc/user-ref.html: fixed typo (thanks, Mihai) 2002-01-19 Steven G. Johnson * mpb-ctl/mpb.c: reorganized get-*-point functions 2002-01-18 Steven G. Johnson * Makefile.in: make snapshot and make dist now run autoheader/autoconf in the same order * Makefile.in: make snapshot runs autoheader * Makefile.in: include install-sh, etc., in snapshot * Makefile.in: configure.in -> configure.ac * configure.ac, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: compute-energy-integral -> compute-field-integral (generalized) (thanks to Marin for suggestion) 2002-01-17 Steven G. Johnson * doc/user-ref.html: fixed bug in formatting * mpb-ctl/mpb.c, src/matrixio/fieldio.c: don't center exp(ikx)...it screws up vectorfield_otherhalf * mpb-ctl/mpb.c: fixed epsilon imag. part * mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in: added get-*-point functions * src/matrixio/fieldio.c: compute exp(ikx) phase such that the center of the cell is the origin, for more consistency with other parts of the code * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: allow user to specify resolution instead of grid size (requires new libctl) 2002-01-03 Steven G. Johnson * mpb-ctl/mpb.c: Got rid of NaN when computing (undefined) group velocity for zero-frequency states at the Gamma point; arbitrarily return zero here instead. Thanks to Dmitry N. Chigrin for reporting floating-point exceptions on Alphas. * doc/user-ref.html: improved run-parity docs 2001-12-15 Steven G. Johnson * TODO: additions 2001-12-12 Steven G. Johnson * acx_blas.m4: use FLIBS everywhere * doc/installation.html: added note on using a consistent f77 compiler 2001-12-08 Steven G. Johnson * NEWS, configure.ac, doc/installation.html, doc/user-ref.html: use AC_HELP_STRING, and shorten --with-hermitian-eps * doc/installation.html: noted new blas/lapack options * acx_blas.m4, acx_lapack.m4: check for *.so.* as well as *.so * acx_blas.m4, acx_lapack.m4, configure.ac: use new BLAS/LAPACK check macros 2001-12-07 Steven G. Johnson * src/maxwell/maxwell_constraints.c: fixed bug in y-parity constraint for 3d. Thanks to Rumen Iliew for the bug report. 2001-12-04 Steven G. Johnson * mpb-ctl/mpb.scm.in: added run-yeven-zeven, etcetera 2001-11-20 Steven G. Johnson * NEWS: noted replacement of run-polarization by run-parity, etcetera, in MPB 1.2; thanks to Karl Koch for pointing out this omission. * doc/user-ref.html: fixed missing
tag * ChangeLog: updated * NEWS, configure.ac: bumped version * Makefile.in, install-sh: autoconf file should not be in cvs * NEWS, src/util/debug_malloc.c: cleanups, allow malloc(0) * mpb-ctl/mpb.c: ugh, ugh, fixed memory overwrite due to mis-parenthesization; thanks to Karl Koch for the bug report. 2001-11-16 Steven G. Johnson * NEWS: correction * NEWS: slight fix * NEWS: added date * ChangeLog: updated 2001-11-15 Steven G. Johnson * ChangeLog, NEWS: updated * mpb-ctl/examples/line-defect.ctl: slight correction * mpb-ctl/examples/line-defect.ctl: switched to rods, not holes, and cleaned up a bit * doc/analysis-tutorial.html, doc/user-tutorial.html, doc/acknowledgments.html, doc/developer.html, doc/installation.html, doc/introduction.html, doc/license.html, doc/user-ref.html: make it easier to filter Go To lines * doc/index.html: indent contents for easy filtering 2001-11-14 Steven G. Johnson * configure.ac: fixed bash-ism * doc/installation.html: Note the necessity of installing guile-devel RPM (grr, FAQ). 2001-11-13 Steven G. Johnson * mpb-ctl/examples/line-defect.ctl: added triangular-lattice line-defect example 2001-10-22 Steven G. Johnson * mpb-ctl/examples/honey-rods.ctl: slightly more optimal rod-size parameter 2001-10-11 Steven G. Johnson * mpb-ctl/examples/diamond.ctl: use new basis-size property * Makefile.in: copy config.guess, config.sub to 'make dist' directory * config.guess, config.sub: removed non-owned files * configure.ac: bumped version * NEWS: updated * doc/analysis-tutorial.html, doc/user-ref.html, doc/user-tutorial.html: noted new basis-size property in libctl 2001-10-10 Steven G. Johnson * NEWS, doc/analysis-tutorial.html, mpb-ctl/examples/check.ctl, mpb-ctl/examples/diamond.ctl: rotated W and K points to be consist with the picture in John's book; thanks to Robert Sheldon for the suggestion * NEWS: some updates 2001-10-09 Steven G. Johnson * TODO: add more example files 2001-10-08 Steven G. Johnson * doc/user-ref.html: output-copies is no longer supported 2001-10-05 Steven G. Johnson * mpb-ctl/mpb.c, src/maxwell/maxwell.h, src/maxwell/maxwell_eps.c: return better scalar epsilon value 2001-09-30 Steven G. Johnson * doc/user-ref.html: slight improvement & fix * doc/user-ref.html: spiffed up parity discussion * doc/user-ref.html: another fix * doc/user-ref.html: whoops, another fix * doc/user-ref.html: slight fix * TODO, doc/user-ref.html, mpb-ctl/examples/hole-slab.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/maxwell/Makefile.in, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_constraints.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_pre.c, tests/maxwell_test.c: added y-parity, reorganized polarization constraints 2001-09-19 Steven G. Johnson * doc/installation.html: updated ATLAS link 2001-08-08 Steven G. Johnson * mpb-ctl/mpb.c: group-v computation blows away curfield; thanks to Marin for noting this 2001-07-24 Steven G. Johnson * mpb-ctl/mpb.c, src/maxwell/maxwell_op.c: use units for D that are consistent with H 2001-07-23 Steven G. Johnson * src/matrixio/matrixio.h, utils/mpb-data.c, doc/user-ref.html, mpb-ctl/mpb.c, src/matrixio/fieldio.c: added full epsilon tensor output (some problems still for hermitian epsilon with inversion symmetry) 2001-07-10 Steven G. Johnson * configure.ac: make sure guile is in PATH 2001-07-05 Steven G. Johnson * NEWS: updated * configure.ac, src/maxwell/maxwell.h: fixed for new config.h * configure.ac, config.guess, config.sub, configure.in, src/config.h.in, src/matrices/blasglue.c, src/util/fortranize.h: switched to autoconf 2.50 * doc/user-ref.html, doc/user-tutorial.html: lowered default tolerance to 1e-7 * NEWS: updated * mpb-ctl/mpb.scm.in: lowered default tolerance to 1e-7 2001-07-04 Steven G. Johnson * doc/index.html, doc/user-ref.html: fixed documentation cross-refs * doc/user-ref.html, doc/user-tutorial.html, mpb-ctl/examples/tutorial.ctl, mpb-ctl/mpb.scm.in: documented, fixed retrieve-gap function * ChangeLog, NEWS: updated * configure.in: bumped version to 1.1.1 * mpb-ctl/examples/bragg.ctl: generalized 2001-07-04 Steven G. Johnson * mpb-ctl/examples/bragg.ctl: generalized 2001-06-26 Steven G. Johnson * ChangeLog: updated * src/maxwell/maxwell_op.c: yikes, fixed bug in H output for cases lacking inversion symmetry 2001-06-21 Steven G. Johnson * configure.in: detect MPI compiler for AIX...this test needs to be split into a separate macro, really 2001-06-12 Steven G. Johnson * src/maxwell/maxwell_eps.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, src/matrices/eigensolver_davidson.c, mpb-ctl/mpb.c: Laid some groundwork for negative epsilon support, but need a new eigensolver algorithm before it can really work. More importantly, fixed bug in mpbi for 1d transforms (arrays were not written properly, and worse: array bounds were violated, causing random results). 2001-06-03 Steven G. Johnson * mpb-ctl/mpb.scm.in: added retrieve-gap function 2001-05-09 Steven G. Johnson * src/matrices/eigensolver.c: output malloc count when verbose * src/util/check.h, src/util/debug_malloc.c: add debug_output_malloc_count 2001-05-06 Steven G. Johnson * NEWS, ChangeLog: updated * doc/analysis-tutorial.html: K is C_{3v}, not C_{6v}. * /home/stevenj/Repository/mpb/doc/analysis-tutorial.html: K is C_{3v}, not C_{6v}. 2001-04-30 Steven G. Johnson * /home/stevenj/Repository/mpb/NEWS, /home/stevenj/Repository/mpb/configure.in, /home/stevenj/Repository/mpb/ChangeLog: updated & bumped version * /home/stevenj/Repository/mpb/mpb-ctl/mpb.c: Fixed bug in field output for kz != 0. Thanks to Jesper Riishede for the bug report. 2001-04-29 Steven G. Johnson * doc/user-ref.html: note limitations of fix-*field-phase 2001-04-26 Steven G. Johnson * doc/installation.html: updated LAM URL 2001-04-20 Steven G. Johnson * mpb-ctl/mpb-split.in: Use #! /bin/bash instead of #!/bin/bash for portability on some systems. * doc/user-ref.html, mpb-ctl/mpb.c: compute_energy_integral should also pass position to integrand 2001-04-14 Steven G. Johnson * mpb-ctl/mpb-split.in: Whoops, add first job (0th k-point chunk) to list of subprocesses, so that it gets killed properly if we kill the script. 2001-04-11 Steven G. Johnson * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, doc/user-ref.html: Added compute-energy-integral function, suggested by Marin Soljacic. 2001-04-03 Steven G. Johnson * doc/acknowledgments.html, doc/introduction.html: acknowledged Bob Meade 2001-03-07 Steven G. Johnson * mpb-ctl/mpb.scm.in: minor cleanup 2001-03-06 Steven G. Johnson * doc/user-ref.html: magnetic material -> gyrotropic (magneto-optic) material 2001-03-04 Steven G. Johnson * mpb-ctl/mpb.scm.in: display-eigensolver-stats outputs mean time per iteration * doc/installation.html: photonic-bands -> MPB * doc/installation.html: link to MPICH and LAM from MPI section * utils/mpb-data.c: check to make sure -n argument is > 0 (thanks to Niclas Carlsson for a bug report). 2001-03-02 Steven G. Johnson * doc/user-tutorial.html: linked to units section * doc/user-tutorial.html: ./mpb -> mpb (why did I have it this way?) 2001-02-24 Steven G. Johnson * doc/user-ref.html: fix hyphenation 2001-02-23 Steven G. Johnson * configure.in, src/config.h.in, src/matrixio/matrixio.c: H5Pset_mpi is now called H5Pset_fapl_mpio in HDF5 1.4.0 * configure.in: more warnings or errors if important things are not found 2001-02-22 Steven G. Johnson * tests/blastest.c, tests/blastest.complex.out, tests/blastest.real.out: pick deterministic phase for eigenvectors * configure.in: removed single quotes that confuse emacs coloring * configure.in: use nicer section separator 2001-02-20 Steven G. Johnson * mpb-ctl/Makefile.in: whoops...variable assignments in Makefiles don't carry over to the next line (I guess each line is executed in its own subshell). 2001-02-19 Steven G. Johnson * doc/analysis-tutorial.html: punctuation alteration * doc/analysis-tutorial.html: slight rewording * doc/analysis-tutorial.html: noted that the real part is sometimes zero * doc/analysis-tutorial.html: noted units for resolution in mpb-data * doc/analysis-tutorial.html: use -S 3 instead of -X 3 -Y 3 * doc/tri-rods-eps-2.gif, doc/tri-rods-ez1.gif, doc/tri-rods-ez2.gif, doc/tri-rods-ez3.gif, doc/tri-rods-ez4.gif, doc/tri-rods-ez5.gif, doc/tri-rods-ez6.gif, doc/tri-rods-ez7.gif, doc/tri-rods-ez8.gif: updated mode pictures (since mpb-data now centers its output at the origin) * config.guess, config.sub: updated to latest version * ChangeLog: updated * doc/analysis-tutorial.html, mpb-ctl/examples/diamond.ctl, mpb-ctl/mpb.scm.in, src/maxwell/maxwell_eps.c: a couple compilation fixes, and noted use of define-param in the manual * mpb-ctl/examples/check.ctl: whoops, got rid of premature exit * mpb-ctl/examples/check.ctl: improved accuracy in 1d tests...but there still seem to be occasional discrepancies. What is going on? * doc/user-ref.html: clarification * TODO: updated 2001-02-18 Steven G. Johnson * doc/installation.html: fixed autoconf URL * src/maxwell/maxwell.c: whoops, non-constant array initializers are not allowed 2001-02-17 Steven G. Johnson * doc/installation.html: mention parallel HDF5 * doc/installation.html: fixed typo * doc/user-ref.html, doc/installation.html: noted mpbi-mpi in manual * mpb-ctl/mpb.c: fixed counting statistics for mpbi-mpi * src/maxwell/maxwell_op.c: fixed field output for 2d mpbi-mpi * mpb-ctl/Makefile.in: fixed copyright year * src/matrixio/matrixio.c: don't call H5Dwrite at all for empty dataspaces (e.g. in leftover processes under MPI) * src/maxwell/maxwell_op.c: bug fixed for mpbi-mpi field output * mpb-ctl/examples/hole-slab.ctl: There sees to be some funny rounding problem on the Origin (at least) that causes it to get confused about whether x=0 and/or y=0 is inside the eps block. * doc/user-ref.html: fixed broken tag * mpb-ctl/mpb.c: undid erroneous cleanups (although they wouldn't have technically caused problems) * ChangeLog: updated 2001-02-16 Steven G. Johnson * NEWS: minor rewordings * NEWS: updated * utils/mpb-data.c: Fixed a problem with MODF_POSITIVE that caused mpb-data to crash on an Alpha; thanks to Dominique Caron for the bug report. 2001-02-14 Steven G. Johnson * doc/user-ref.html: note that MPB exits with an error if run-te/tm are used nonsensically, or if epsilon is not positive-definite. * NEWS: fixed hyphenation * configure.in: bumped version * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/matrices/scalar.h, src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, NEWS: Rewrote field output for inversion-symmetry case. We now write the field to the file in a few chunks, rather than trying to expand the half-complex rfftw output to the full array. This paves the way for a parallel mpbi. As a side effect, we also circumvent a bug in the old makefull routines that caused artifacts to appear in the output for 3d cells (reported by Michelle Povinelli). 2001-02-11 Steven G. Johnson * mpb-ctl/mpb.scm.in: Bug fix in combine-band-functions, etcetera, for when a thunk is encountered. Thanks to Michelle Povinelli for the bug report. 2001-02-09 Steven G. Johnson * mpb-ctl/mpb.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h: generalized fieldio function in preparation for rewritten mpbi output... * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, NEWS, src/matrixio/fieldio.c, src/matrixio/matrixio.h: eliminated output-copies in favor of mpb-data 2001-02-08 Steven G. Johnson * mpb-ctl/mpb.c: added geometry tree debugging code * doc/installation.html, doc/user-ref.html, NEWS: give (more) thanks to Clarendon * src/matrices/blasglue.c, src/matrixio/matrixio.c, src/maxwell/maxwell_op.c: fixed problems when an MPI process has no portion of the eigenmodes (which can happen for inconvenient # processes)...matrixio is still not quite right, though * src/matrices/blasglue.c: don't die if passed NULL arrays for zero sizes * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: added get/set kpoint-index functions * NEWS: updated * doc/index.html, doc/installation.html, doc/user-ref.html: documented mpb-mpi * mpb-ctl/examples/check.ctl: check-tolerance should be a param * src/maxwell/maxwell_pre.c: Fixed bug in zero-k constraint for parallel systems. 2001-02-07 Steven G. Johnson * doc/acknowledgments.html: thanks to Clarendon * utils/mpb-data.1, utils/mpb-data.c: added mpb-data -T option * configure.in, utils/Makefile.in: don't build/install mpb-data when linking to MPI * mpb-ctl/examples/check.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: expose more MPI info to Guile, and don't do 1d tests in check.ctl under MPI (where they are not supported) * mpb-ctl/mpb.c, src/matrices/eigensolver.c, src/matrices/eigensolver_davidson.c, src/matrices/eigensolver_utils.c, src/matrices/evectmatrix.c, src/matrices/matrices.h, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_pre.c, src/util/mpiglue.h, src/util/mpi_utils.c, src/util/mpi_utils.h, tests/eigs_test.c: yikes, Allreduce requires sendbuf != recvbuf (although this is not clear from the documentation) * src/maxwell/maxwell_eps.c: cleanups, fixed calculation of eps_inv_mean for MPI * src/maxwell/maxwell.c: fixed indenting * TODO: updates * mpb-ctl/Makefile.in: put check target at the end so that 'make' does 'make all' * src/matrixio/matrixio.c: fprintf -> mpi_one_fprintf * src/maxwell/maxwell_op.c: whoops, fixed stride/dist check to coincide with what fftwnd_mpi really supports * src/config.h.in: define HAVE_FFTW to something * configure.in, mpb-ctl/mpb.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/util/mpi_utils.c: fixed compilation whoopses under MPI * doc/user-ref.html: fix * ChangeLog, NEWS: updated 2001-02-06 Steven G. Johnson * mpb-ctl/mpb.scm.in: workaround for older versions of Guile where we can't get the number of arguments to a function (apparently) * configure.in: fixed gen-ctl-io check, removed AC_PROG_CC_STDC ifdef...there's something not working about ifdef that I don't understand * configure.in: call AC_PROG_CC_STDC if defined, in part so that autoconf 2.5 doesn't complain * configure.in: added MPI checks * src/util/mpi_utils.c: clarification * src/matrixio/matrixio.c: fixed misnamed function call * configure.in, src/config.h.in, src/matrixio/matrixio.c: support HDF5 file i/o without H5Pset_mpi 2001-02-05 Steven G. Johnson * src/util/mpiglue.h, src/util/mpi_utils.c, src/util/mpi_utils.h: added critical section utility, intended for mediating output file access 2001-02-04 Steven G. Johnson * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in: turn off printing unless we are the master process * doc/user-tutorial.html, mpb-ctl/examples/check.ctl, mpb-ctl/examples/tutorial.ctl, mpb-ctl/mpb.scm.in: display-many -> print * mpb-ctl/Makefile.in: make main() in new libctl call our hooks * mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/matrices/eigensolver.c, src/matrices/eigensolver_davidson.c, src/matrices/linmin.c, src/matrices/matrices.c, src/matrixio/fieldio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/util/mpiglue.h, src/util/mpi_utils.c, src/util/mpi_utils.h: many cleanups in preparation for MPI * mpb-ctl/mpb.c: give error if k-point is incompatible with the polarization * configure.in, tests/blastest.complex.out, tests/blastest.out, tests/blastest.real.out, tests/Makefile.in: fixed blastest 'make check' for complex scalars 2001-02-03 Steven G. Johnson * mpb-ctl/mpb.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell.h: checks to see if dielectric tensor is okay; return error if TE/TM is specified but impossible * doc/index.html: fixed typo 2001-01-30 Steven G. Johnson * configure.in: use vendor cc, too, so that Fortran and C are in sync (there may be linking problems, otherwise). * doc/developer.html, doc/license.html: noted MPB paper 2001-01-27 Steven G. Johnson * mpb-ctl/mpb.c: fixed compute_energy_in_object_list for non-orthogonal lattices 2001-01-26 Steven G. Johnson * mpb-ctl/mpb.scm.in: filename-prefix is once again a define-param variable 2001-01-24 Steven G. Johnson * NEWS: clarified the purpose of "nothing" * doc/user-tutorial.html, mpb-ctl/examples/tutorial.ctl, mpb-ctl/mpb.c: in compute-energy-in-objects, let 'nothing' material punch a hole 2001-01-23 Steven G. Johnson * doc/user-ref.html, doc/user-tutorial.html, mpb-ctl/examples/tutorial.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, NEWS: added 'nothing' material * doc/installation.html: clarified simultaneous installation of mpb and mpbi 2001-01-21 Steven G. Johnson * mpb-ctl/examples/check.ctl: collect error statistics * mpb-ctl/examples/check.ctl: Fix a bug (Bragg-sine not resetting default-material). Also raise tolerance slightly. * Makefile.in, tests/Makefile.in: print friendly message when (if?) make check passes * mpb-ctl/examples/check.ctl: added sinusoidal Bragg to make check * doc/user-ref.html: warn user about run-te and run-tm with anisotropic dielectrics * NEWS: give credit * doc/user-ref.html, mpb-ctl/examples/bragg-sine.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, NEWS: added material-function type * configure.in: don't check for ctl_get_list (not there anymore) * doc/installation.html, doc/user-ref.html, NEWS: let's not capitalize 'Hermitian' * tests/Makefile.in: whoops, fixed $ substitution * Makefile.in: changed subdir order in make check * Makefile.in, mpb-ctl/Makefile.in, tests/Makefile.in: added 'make check' * tests/maxwell_test.c: fix -E * tests/maxwell_test.c: use epsilon with inversion symmetry, so it works with mpbi * tests/blastest.out: added sample output * tests/maxwell_test.c: allow option to fail if error is too large * src/maxwell/maxwell.c: Earlier, we flipped the sign of the G vector in order to have a consistent sign of k for mpbi and mpbi--it is especially important to be careful about this when you have a complex-Hermitian dielectric tensor that breaks (k,-k) time-reversal symmetry. However, this made our planewave basis slightly different from before. It used to be that we had 1 more positive-G planewave than negative-G (for even grid sizes), but the above change reverses this situation. It doesn't matter in an absolute sense, since the planewave cutoff is still the same, but the difference was an annoyance--it caused check.ctl to fail because of microscopic changes in the results, and also made us inconsistent with the MPB paper. This change fixes that, restoring the +G/-G planewave balance to what it was before (although the basis elements are stored in a different order, with the -G waves first). * src/maxwell/maxwell.c, src/maxwell/maxwell_op.c: fixed G sign convention to be consistent for mpbi and mpb 2001-01-20 Steven G. Johnson * doc/developer.html, doc/user-ref.html, doc/user-tutorial.html: spelling correction * doc/developer.html, doc/introduction.html: link to barnesandnoble.com instead of Amazon to be GNU-ly correct * doc/user-tutorial.html: added link * doc/installation.html, doc/user-ref.html, NEWS: documented complex-Hermitian epsilon * src/maxwell/maxwell_op.c: slight change * configure.in, mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/config.h.in, src/matrices/scalar.h, src/maxwell/maxwell_eps.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, tests/maxwell_test.c: added --with-hermitian-epsilon 2001-01-11 Steven G. Johnson * mpb-ctl/mpb.scm.in: Modified band-range data functions so that they are tail recursive, lest stack overflow crashes occur when large numbers of bands (e.g. 600) are computed. Thanks to Mihai Ibanescu for the bug report. 2001-01-10 Steven G. Johnson * src/matrices/minpack2-linmin.c: use MIN, MAX, and ABS in case some header file defines these macros too (like AIX...grrr). Thanks to Angelo R. Rossi for the bug report. 2001-01-07 Steven G. Johnson * doc/analysis-tutorial.html: clarification * doc/analysis-tutorial.html: slight clarification * doc/user-ref.html: slight formatting fix * TODO: updated * ChangeLog, configure.in, NEWS: bumped version number, prepare for release 2001-01-06 Steven G. Johnson * doc/license.html: clarification * doc/analysis-tutorial.html: updated fcc units note * doc/analysis-tutorial.html, doc/diamond-bands.gif, mpb-ctl/examples/diamond.ctl: use standard units for fcc (diamond) * mpb-ctl/mpb.scm.in: bug fix in filename-prefix use (fixes bug introduced by previous change) * doc/analysis-tutorial.html, doc/index.html, doc/user-ref.html: expanded table of contents * doc/installation.html: clarification of efence * doc/installation.html: fixes * doc/installation.html: fixed missing link * doc/installation.html: slight change * doc/installation.html: emphasize HDF5 * doc/installation.html: noted more clearly that MPI is not yet used * doc/installation.html: fixed ref * doc/installation.html: recommend ATLAS * doc/installation.html: moved Bourne shell note up front. * doc/installation.html: grammar fix(?) * doc/installation.html: notes on binary packages for Linux * doc/license.html: clarification * doc/license.html: expanded and updated referencing suggestions * doc/license.html: comma goes outside of link * doc/license.html: fixed capitalization * src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/sqmatrix.c, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/util/check.h, src/util/debug_malloc.c, src/util/fortranize.h, src/util/mpiglue.h, src/util/mpi_utils.c, src/util/mpi_utils.h, tests/blastest.c, tests/eigs_test.c, tests/malloctest.c, tests/maxwell_test.c, utils/mpb-data.1, utils/mpb-data.c, COPYRIGHT, mpb-ctl/epsilon_file.c, mpb-ctl/mpb.1, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, src/matrices/blasglue.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/eigensolver_davidson.c, src/matrices/eigensolver.h, src/matrices/eigensolver_utils.c, src/matrices/evectmatrix.c, src/matrices/linmin.c, src/matrices/linmin.h: 2001 copyright year update * doc/license.html: fixed copyright year * doc/license.html: Added Latin quote and fixed reference. * doc/developer.html: fixed reference * ChangeLog: fixed email * ChangeLog: updated * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, NEWS: read filename-prefix on each output call 2001-01-03 Steven G. Johnson * /home/stevenj/Repository/mpb/NEWS, /home/stevenj/Repository/mpb/doc/user-ref.html: documented using thunks for band functions * /home/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: accept thunks as band functions * /home/stevenj/Repository/mpb/doc/user-ref.html, /home/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/stevenj/Repository/mpb/NEWS: compute-field-energy now returns the fraction of the energy in each field component. Also, fixed a bug in the group velocity calculation when eigensolver-block-size < num-bands. Thanks to Karl Koch for the suggestion and bug report. * /home/stevenj/Repository/mpb/src/matrices/blasglue.c: fixed calling real syev for complex scalars 2000-11-12 Steven G. Johnson * /home/stevenj/Repository/mpb/src/matrices/blasglue.c, /home/stevenj/Repository/mpb/src/matrices/blasglue.h: separate function for eigenvalues of real matrices, if we need them 2000-11-10 Steven G. Johnson * /home/stevenj/Repository/mpb/src/maxwell/maxwell_eps.c: comment 2000-11-07 Steven G. Johnson * /home/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/stevenj/Repository/mpb/src/matrices/matrices.h: changed flop count to double to avoid overflow * /home/stevenj/Repository/mpb/src/matrices/eigensolver_davidson.c: make trace output more closely match other eigensolver's * /home/stevenj/Repository/mpb/src/matrices/eigensolver.c: print more digits in eigensolver trace output * /home/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/stevenj/Repository/mpb/src/matrices/matrices.h: added flop count, nwork & davidson user control * /home/stevenj/Repository/mpb/doc/analysis-tutorial.html: noted reference for diamond 2000-11-06 Steven G. Johnson * /home/stevenj/Repository/mpb/src/matrices/eigensolver_davidson.c: added dead code for alternate computation method of computing AY... * /home/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/stevenj/Repository/mpb/src/maxwell/maxwell_op.c: added maxwell_target_operator1 * /home/stevenj/Repository/mpb/src/matrices/eigensolver.c: put constraint in a more logical place, after the preconditioner. 2000-11-04 Steven G. Johnson * /home/stevenj/Repository/mpb/src/matrices/eigensolver.c: reorder iteration output so it's a little less misleading (iteration 1 is now after the first eigenvector update, and the last iteration can be printed) 2000-10-30 Steven G. Johnson * /home/stevenj/Repository/mpb/tests/normal_vectors.c: use uniform directions on a sphere 2000-10-26 Steven G. Johnson * /home/stevenj/Repository/mpb/mpb-ctl/examples/check.ctl: use a slightly lower tolerance for the targeted eigensolver * /home/stevenj/Repository/mpb/mpb-ctl/examples/check.ctl: updated for new MPB...in particular, 3d numbers have changed because of the new spherical quadrature, and 2d numbers may have changed slightly because of the new handling of the Gamma points. Also fixed some bugs where some of the tests that I had blithely inserted conflicted with one another. * /home/stevenj/Repository/mpb/doc/user-ref.html, /home/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: changed default block size, made more flexible * /home/stevenj/Repository/mpb/mpb-ctl/mpb.c: print a message to remind the user when we're assuming inversion symmetry * /home/stevenj/Repository/mpb/mpb-ctl/mpb.c: fixed bug in integration (eps_mean, energy in object, etcetera) when using inversion symmetry. Because of the funny format output by real FFTs, the fields stored are slightly *over* half of the full "logical" arrays. One has to be careful not to overcount the boundary points. 2000-10-25 Steven G. Johnson * /home/stevenj/Repository/mpb/NEWS: updated * /home/stevenj/Repository/mpb/configure.in, /home/stevenj/Repository/mpb/doc/installation.html, /home/stevenj/Repository/mpb/doc/user-ref.html, /home/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/stevenj/Repository/mpb/src/maxwell/maxwell.c, /home/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/stevenj/Repository/mpb/src/maxwell/maxwell_eps.c, /home/stevenj/Repository/mpb/src/maxwell/maxwell_op.c, /home/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c: support inversion symmetry 2000-10-23 Steven G. Johnson * doc/user-ref.html, mpb-ctl/examples/bragg.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, NEWS, src/matrices/eigensolver.c, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/matrices.h, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_pre.c: added eigensolver-block-size and zero-k handling 2000-10-22 Steven G. Johnson * NEWS: added first-brillouin-zone function * doc/user-ref.html: documented first-brillouin-zone * mpb-ctl/mpb.scm.in: added first-brillouin-zone 2000-10-21 Steven G. Johnson * tests/normal_vectors.c: print more angle information 2000-09-21 Steven G. Johnson * doc/user-ref.html: clarification of compute-field-energy normalization 2000-08-10 Steven G. Johnson * utils/mpb-data.c: Re-mapping (rectangularizing, etcetera) now maps the center of the original primitive cell to the center of the output. Also, the -x, -y, and -z lattice multipliers now apply to the axes *after* the cell is rectangularized. 2000-08-06 Steven G. Johnson * configure.in: Fix test for sunperf...-xlic_lib only supported in Sun cc, not gcc. 2000-08-05 Steven G. Johnson * doc/installation.html: updated PHiPACK URL. 2000-07-18 Steven G. Johnson * doc/license.html: John likes to go by his initials. * doc/license.html: noted Meade reference 2000-07-12 Steven G. Johnson * tests/malloctest.c: added benchmark * src/maxwell/maxwell_eps.c, tests/Makefile.in, tests/normal_vectors.c, src/maxwell/maxwell.h: Added more sophisticated spherical quadrature algorithm for computing normal vectors (rather than just using the vertices of an icosahedron). 2000-07-10 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/check.ctl: Updated frequencies to account for changes due to new 12-point mesh for normal vectors in 2d. (This really only affects TE states.) We really need to do a more sophisticated quadrature in 3d, too; good algorithms are apparently available. 2000-07-09 Steven G. Johnson * /home/a/stevenj/Repository/mpb/tests/eigs_test.c: updated for new sqmatrix_invert arguments * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver_davidson.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver_utils.c, /home/a/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/sqmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/blasglue.c, /home/a/stevenj/Repository/mpb/src/matrices/blasglue.h: Added experimental EIGS_ORTHOGONAL_PRECONDITIONER code (doesn't seem to give any consistent benefit at this point). * /home/a/stevenj/Repository/mpb/doc/user-ref.html: fixed typo * /home/a/stevenj/Repository/mpb/ChangeLog, /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/configure.in: Updated. * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented group-velocity functions 2000-07-09 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/check.ctl, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: Added beginnings of a test suite. * /home/a/stevenj/Repository/mpb/utils/mpb-data.1, /home/a/stevenj/Repository/mpb/utils/mpb-data.c: added -e option to specify orientation 2000-07-04 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: fixed typo 2000-07-03 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_eps.c: Use finer mesh in 2d for normal vector computation (so as not to break 90-degree rotational symmetries). I also need to think about the 3d mesh, although it seems to be a hard problem there to come up with general spherically "symmetric" distributions of 3d points. Perhaps some sort of weighted quadrature? 2000-06-14 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c: Yikes! Fixed crashing bug! 2000-06-01 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver_davidson.c: added initial try at Davidson eigensolver 2000-05-31 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/installation.html: added sub-headings in installation section, to draw peoples attention to the two issues they need to consider. Thanks to Maksim for pointing out that this was easily missed. 2000-05-23 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: Added (index n) substitute for epsilon property of dielectrics. 2000-05-16 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h, /home/a/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/sqmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/Makefile.in, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: added experimental (unused) Davidson eigensolver * /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in: updated copyright year 2000-05-11 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: make sure linmin tolerance is no larger than eigensolver tolerance * /home/a/stevenj/Repository/mpb/doc/license.html: noted inclusion, with permission, of code from MINPACK-2 * /home/a/stevenj/Repository/mpb/configure.in, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: improved handling of optional Guile sort routine 2000-05-10 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h, /home/a/stevenj/Repository/mpb/src/matrices/linmin.c, /home/a/stevenj/Repository/mpb/src/matrices/linmin.h, /home/a/stevenj/Repository/mpb/src/matrices/minpack2-linmin.c, /home/a/stevenj/Repository/mpb/configure.in, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/src/config.h.in, /home/a/stevenj/Repository/mpb/src/matrices/Makefile.in: Many changes. Switched to line minimization routine from MINPACK-2, thanks to Jorge More. Added reorthogonalization option to eigensolver, and renormalization of D, to combat numerical problems. Added option (not on by default) to dynamically reset CG based on convergence history, and also another unused option to orthogonalize the first step. Checked to see if Guile provides a sort routine (new in 1.3.4, I think), before using it in mpb.scm.in. (Or should we do this dynamically?) 2000-05-03 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/analysis-tutorial.html: more clarification * /home/a/stevenj/Repository/mpb/doc/tri-rods-ez1.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez2.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez3.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez4.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez5.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez6.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez7.gif, /home/a/stevenj/Repository/mpb/doc/tri-rods-ez8.gif, /home/a/stevenj/Repository/mpb/doc/analysis-tutorial.html, /home/a/stevenj/Repository/mpb/mpb-ctl/examples/tri-rods.ctl: Use fix-efield-phase to get deterministic field pictures. * /home/a/stevenj/Repository/mpb/doc/user-ref.html: fixed typo * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented fix-*field-phase band functions * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: added fix-*field-phase band functions * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: invalidate curfield when eigenstates are recomputed. * /home/a/stevenj/Repository/mpb/doc/user-ref.html: clarification in fix-field-phase * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented fix-field-phase * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: fix scaling of energy total returned by compute-field-energy. * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/doc/user-ref.html: compute-field-energy returns total unnormalized energy 2000-05-02 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented new "cone" geometric object type. * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: Bug fix in epsilon creation for 2d systems: is now xy plane at z=0, rather than at z=-0.5. 2000-04-04 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/user-ref.html: clarified meaning of block size 2000-03-19 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c: increased min. denom., and used max(denom,min) instead of (denom + min). 2000-03-18 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/installation.html: minor updates * /home/a/stevenj/Repository/mpb/doc/license.html: slight translation tweak to restore parallel structure * /home/a/stevenj/Repository/mpb/tests/eigs_test.c: fixed bug 2000-03-17 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: added display-group-velocities band function * /home/a/stevenj/Repository/mpb/tests/eigs_test.c: handled case where eigenvals array passed to preconditioner is NULL. * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: added group velocity calc * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_op.c: added maxwell_ucross_op for group velocity calculation 2000-03-16 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_op.c: Separated H_from_e computation into its own subroutine, in preparation for group velocity computation. * /home/a/stevenj/Repository/mpb/doc/user-ref.html, /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: added cross-refs * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented coordinate conversion functions from libgeom in libctl-1.2 2000-03-15 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: slightly simpler phase-fixing algorithm (don't discriminate between components). * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: removed debugging printf * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: Added fix-field-phase function (currently undocumented), based on a suggestion by Doug Allan. 2000-03-14 Steven G. Johnson * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: be sure to do sums, etcetera, over all processors * /home/a/stevenj/Repository/mpb/utils/mpb-data.c: bug fix in outputing imag. part range (thanks to Doug Allan). 2000-03-08 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/license.html: clarification * /home/a/stevenj/Repository/mpb/doc/license.html: added suggested reference 2000-02-28 Steven G. Johnson * /home/a/stevenj/Repository/mpb/doc/analysis-tutorial.html: addressed FAQ on fcc lattice units 2000-02-22 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: got rid of debugging printf 2000-02-14 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: sum times over processors, and a couple of other cleanups * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: fixed comment * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: Corrected operation counts when projecting the preconditioning. Changed some flag names and orderings, and added EIGS_FORCE_APPROX_LINMIN. * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: added documentation for linmin * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: pass correct U to eigensolver_get_eigenvals_aux 2000-02-13 Steven G. Johnson * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: added adaptive algorithm choice * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: don't precondition when randomizing fields (it doesn't really seem to help). * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: Added approximate (2-point) line minimization. Disabled for now, until the runtime self-optimization code is added. * /home/a/stevenj/Repository/mpb/tests/eigs_test.c, /home/a/stevenj/Repository/mpb/tests/maxwell_test.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver_utils.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/scalar.h, /home/a/stevenj/Repository/mpb/src/matrices/sqmatrix.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_op.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/src/matrices/Makefile.in, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: rewritten eigensolver 2000-02-12 Steven G. Johnson * /home/a/stevenj/Repository/mpb/NEWS: noted change in mpb-data * /home/a/stevenj/Repository/mpb/ChangeLog, /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/configure.in: bumped version * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c: Yikes! Bug fix in zparity stuff for even nz!! 2000-02-12 stevenj * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c: Yikes! Bug fix in zparity stuff for even nz!! 2000-02-09 stevenj * /home/a/stevenj/Repository/mpb/doc/user-ref.html: documented band-range-data output var * /home/a/stevenj/Repository/mpb/ChangeLog: updated * /home/a/stevenj/Repository/mpb/NEWS: noted changes * /home/a/stevenj/Repository/mpb/NEWS: noted --without-hdf5 fix * /home/a/stevenj/Repository/mpb/configure.in: Warn user if -lhdf5 is found but hdf5.h is not (probably an error). * /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c, /home/a/stevenj/Repository/mpb/utils/mpb-data.c: fixed compilation --without-hdf5 Wed Feb 9 23:14:45 2000 Steven G. Johnson * NEWS: noted changes * NEWS: noted --without-hdf5 fix * configure.in: Warn user if -lhdf5 is found but hdf5.h is not (probably an error). * src/matrixio/matrixio.c, utils/mpb-data.c: fixed compilation --without-hdf5 Tue Feb 8 06:40:20 2000 Steven G. Johnson * doc/user-tutorial.html: slight clarifications Mon Feb 7 02:30:24 2000 Steven G. Johnson * doc/analysis-tutorial.html: updated run time for diamond lattice * doc/user-ref.html: slight clarification Sun Feb 6 02:43:38 2000 Steven G. Johnson * src/matrixio/matrixio.c, src/matrixio/matrixio.h, utils/mpb-data.c: creating a dataset deletes pre-existing ones Sat Feb 5 22:03:02 2000 Steven G. Johnson * configure.in: updated to check for ATLAS 3.0 libraries. Fri Feb 4 01:37:35 2000 Steven G. Johnson * doc/user-ref.html: document current-k variable Tue Feb 1 03:30:58 2000 Steven G. Johnson * doc/analysis-tutorial.html: fixed typo * doc/tri-rods-ez8.gif, doc/tri-rods-ez1.gif, doc/tri-rods-ez2.gif, doc/tri-rods-ez3.gif, doc/tri-rods-ez4.gif, doc/tri-rods-ez5.gif, doc/tri-rods-ez6.gif, doc/tri-rods-ez7.gif: updated to use h5topng 1.3.4 images (much nicer contour lines). * doc/analysis-tutorial.html: noted random phase Sat Jan 29 19:34:56 2000 Steven G. Johnson * mpb-ctl/mpb.scm.in: output band range data * utils/mpb-data.c: Fixed -d help in -h info. * mpb-ctl/mpb.1: small change Sat Jan 29 02:36:46 2000 Steven G. Johnson * doc/user-tutorial.html: mentioned data analysis tutorial * doc/analysis-tutorial.html: grammar fix * doc/analysis-tutorial.html: slight change * src/matrixio/matrixio.c, src/matrixio/matrixio.h, utils/mpb-data.c: Handle case of trying to create dataset where one already exists. * mpb-ctl/examples/diamond.ctl, mpb-ctl/examples/tri-rods.ctl: updated for data analysis tutorial * doc/user-tutorial.html, doc/tri-rods-eps-2.gif, doc/tri-rods-ez1.gif, doc/tri-rods-ez2.gif, doc/tri-rods-ez3.gif, doc/tri-rods-ez4.gif, doc/tri-rods-ez5.gif, doc/tri-rods-ez6.gif, doc/tri-rods-ez7.gif, doc/tri-rods-ez8.gif, doc/user-ref.html, doc/diamond-b3-eps.gif, doc/diamond-b3.gif, doc/diamond-bands.gif, doc/diamond-eps.gif, doc/index.html, doc/tri-rods-bands.gif, doc/tri-rods-eps-1.gif, doc/analysis-tutorial.html, doc/diamond-b1-eps.gif, doc/diamond-b1.gif: added data analysis tutorial Fri Jan 28 20:11:25 2000 Steven G. Johnson * doc/user-tutorial.html: minor change * doc/installation.html: noted that PATH may need to be updated, and some other small changes * doc/installation.html: noted make distclean * doc/installation.html: slight formatting fix * doc/installation.html: Added section reviewing how to set up installation paths, etcetera. * mpb-ctl/examples/diamond.ctl: added diamond (fcc) lattice example * mpb-ctl/mpb.scm.in: report elapsed time for initialization * mpb-ctl/mpb.scm.in: fixed display-eigensolver-stats for num-runs=0 * mpb-ctl/examples/tutorial.ctl, doc/user-tutorial.html: use output-at-kpoint in tutorial * doc/user-ref.html: Documented output-at-kpoint. Thu Jan 27 23:57:50 2000 Steven G. Johnson * mpb-ctl/examples/hole-slab.ctl, mpb-ctl/mpb.scm.in: Added output-at-kpoint function. * mpb-ctl/mpb.1, utils/mpb-data.1, mpb-ctl/Makefile.in: added mpb man page * mpb-ctl/mpb.c, src/matrixio/evectmatrixio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, utils/Makefile.in, utils/mpb-data.1, utils/mpb-data.c, Makefile.in, TODO, configure.in, mpb-ctl/epsilon_file.c: Added mpb-data utility, so we can finally unskew datasets (and more). * src/matrixio/matrixio.c: Suppress HDF5 error messages if we try to read a nonexistent dataset; just return NULL. * mpb-ctl/mpb.c: write out Bloch wavevector in reciprocal, not cartesian, basis. * mpb-ctl/Makefile.in, tests/Makefile.in, src/matrices/Makefile.in, src/matrixio/Makefile.in, src/maxwell/Makefile.in, src/util/Makefile.in: set SHELL * mpb-ctl/epsilon_file.c, src/matrixio/evectmatrixio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h: Added attribute-reading code, and made it possible to check at runtime if a dataset exists in a file (by returning an NULL instead of dying if the dataset doesn't exist when we try to read it). Wed Jan 26 17:40:56 2000 Steven G. Johnson * src/maxwell/maxwell_pre.c: zparity and run-even/odd now work correctly for 2d grids. zparity calculation is also now ready for use with MPI. * doc/user-ref.html: fixed typo * mpb-ctl/examples/tutorial.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/maxwell/maxwell.h, src/maxwell/maxwell_eps.c, tests/maxwell_test.c, doc/user-ref.html, doc/user-tutorial.html, mpb-ctl/epsilon_file.c: added anisotropic dielectrics Sat Jan 22 05:57:27 2000 Steven G. Johnson * mpb-ctl/mpb.scm.in: Fixed bug in output-dpwr-in-objects. Thanks to Mihai Ibanescu for the bug report. Fri Jan 21 02:18:28 2000 Steven G. Johnson * src/matrixio/matrixio.h, doc/user-tutorial.html, mpb-ctl/mpb.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c: output all components in one h5 file * doc/developer.html: fixed typo * src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, mpb-ctl/mpb.c: tag output datasets with k & R attributes Mon Jan 17 03:00:19 2000 Steven G. Johnson * doc/license.html: yet more felicitous translation * doc/license.html: more felicitous translation * doc/user-tutorial.html: fixed typo Fri Jan 14 21:33:21 2000 Steven G. Johnson * mpb-ctl/Makefile.in, src/matrices/Makefile.in, src/matrixio/Makefile.in, src/maxwell/Makefile.in, src/util/Makefile.in, tests/Makefile.in, Makefile.in, configure.in, doc/installation.html: INCLUDES -> CPPFLAGS Wed Jan 12 02:02:09 2000 Steven G. Johnson * mpb-ctl/Makefile.in: Added dependency rule to ensure ctl-io.h is created before main.o is built. Thanks to Christoph Becher for the bug report. * Makefile.in: Need to set the SHELL in the Makefile for non-GNU makes. Thanks to Christoph Becher for the bug report. Tue Jan 11 21:04:51 2000 Steven G. Johnson * doc/user-ref.html: user-ref.html Fri Jan 7 18:35:12 2000 Steven G. Johnson * configure.in, mpb-ctl/mpb.c, NEWS: 0.9.1 eigensolver bugfix (yikes!) Tue Jan 4 05:52:41 2000 Steven G. Johnson * mpb-ctl/mpb.c: noted units of reciprocal lattice vectors in output * NEWS: noted filename-prefix fix * mpb-ctl/mpb.c: bug fix...prefix goes *before* filename; thanks to Karl Koch. Sun Jan 2 17:29:20 2000 Steven G. Johnson * ChangeLog: updated * doc/user-tutorial.html: slight fix * NEWS: noted more changes * doc/user-tutorial.html: noted polarization (e.g. ".te") in the output filenames. * doc/user-tutorial.html: slight rewording * NEWS, configure.in: version-numbering scheme is now 0.8, 0.9, 0.10, ... * doc/introduction.html: small formatting fix * TODO: updated * NEWS: slight rewording * NEWS: added version number to NEWS * NEWS: removed inconsistent parens * mpb-ctl/mpb.scm.in, NEWS, doc/user-ref.html, mpb-ctl/mpb.c: added z-parity output var * src/maxwell/maxwell_pre.c: fixed counting bug in zparity computation * NEWS, configure.in: configure works without f77 compiler, hopefully Sat Jan 1 23:50:31 2000 Steven G. Johnson * tests/maxwell_test.c, src/util/check.h, src/util/debug_malloc.c, src/util/fortranize.h, src/util/mpi_utils.c, src/util/mpi_utils.h, src/util/mpiglue.h, tests/blastest.c, tests/eigs_test.c, tests/malloctest.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/sqmatrix.c, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, doc/license.html, mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, src/matrices/blasglue.c, COPYRIGHT: bumped copyright year * NEWS, configure.in: bumped version and went to 2-digit minor version numbers * mpb-ctl/examples/hole-slab.ctl, mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/maxwell_pre.c, NEWS, doc/user-ref.html: added run-even and run-odd Tue Dec 14 02:43:57 1999 Steven G. Johnson * doc/user-ref.html: defined reciprocal lattice * doc/license.html: slight wording change in quotation * doc/license.html: better translation Mon Dec 13 23:55:56 1999 Steven G. Johnson * doc/license.html: added St. Augustine quote Thu Dec 9 00:11:11 1999 Steven G. Johnson * doc/acknowledgments.html: slight fix Sun Dec 5 21:07:58 1999 Steven G. Johnson * doc/installation.html: various improvements Fri Dec 3 20:03:56 1999 Steven G. Johnson * mpb-ctl/examples/hole-slab.ctl: fixed substrate * mpb-ctl/examples/hole-slab.ctl: allow substrate * mpb-ctl/examples/tri-holes.ctl: Added 2d triangular lattice of holes example. Thu Dec 2 06:40:01 1999 Steven G. Johnson * doc/user-tutorial.html: warned of false-positives in band gaps * tests/maxwell_test.c, src/util/check.h, tests/eigs_test.c, tests/malloctest.c, src/matrixio/matrixio.c, src/maxwell/maxwell.c, src/matrices/matrices.c, src/matrices/sqmatrix.c, src/matrixio/fieldio.c, mpb-ctl/mpb.c, src/matrices/eigensolver.c, mpb-ctl/epsilon_file.c: Use CHK_MALLOC everywhere. For one thing, this prevents problems when we allocate 0 bytes on systems where malloc(0) returns NULL. * mpb-ctl/mpb.scm.in, mpb-ctl/mpb.c: handle num-bands = 0 Wed Dec 1 04:04:48 1999 Steven G. Johnson * src/matrices/eigensolver.h: enable delay-cg by default * src/matrices/eigensolver.c: print warning in verbose mode for large lambda * mpb-ctl/mpb.scm.in: fixed median bug for odd sizes * mpb-ctl/examples/hole-slab.ctl, mpb-ctl/examples/sq-rods.ctl, mpb-ctl/mpb.scm.in, doc/user-ref.html: added display-eigensolver-stats * src/matrices/eigensolver.c, src/matrices/eigensolver.h: added EIGS_DELAY_CG flag...don't enable by default until we do more tuning Tue Nov 30 23:47:35 1999 Steven G. Johnson * src/matrices/eigensolver.c: don't use cg with analytic multimin (multimin screws up cg) (because of this, multimin is probably not worth it) * tests/maxwell_test.c: got rid of gcc warning * mpb-ctl/mpb.c: randomize-fields now randomizes both the real and imaginary parts. Previously, it just set the imaginary parts to zero (which is fine for structures with inversion symmetry, but in general cases I don't see any justification for it). * src/matrices/eigensolver.c: verbose mode now prints out trace on every iteration. Mon Nov 29 22:00:23 1999 Steven G. Johnson * NEWS, ChangeLog: updated * mpb-ctl/Makefile.in: fixed trailing spaces in sed command; thanks to Ron Chase for the bug report. * mpb-ctl/Makefile.in, tests/Makefile.in, configure.in: incorporate FLIBS into LIBS * doc/installation.html: more explicit instructions for LAPACK and BLAS. Thu Nov 25 06:25:09 1999 Steven G. Johnson * mpb-ctl/epsilon_file.c: minor improvements, mostly to comments * src/matrices/eigensolver.c: get rid of warning * src/matrices/eigensolver.c: don't redeclare lambda (also gets rid of possiblity of prev_lambda being assigned to undefined variable) * Makefile.in: added 'make snapshot' * doc/user-ref.html: slight rewording * src/maxwell/maxwell_eps.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.h, mpb-ctl/mpb.h, mpb-ctl/mpb.scm.in, src/matrixio/evectmatrixio.c, mpb-ctl/Makefile.in, mpb-ctl/epsilon_file.c, mpb-ctl/mpb.c, doc/user-ref.html: added epsilon-input-file input var Wed Nov 24 05:05:48 1999 Steven G. Johnson * mpb-ctl/mpb.scm.in, configure.in, mpb-ctl/mpb.c: added eigensolver-flags input variable * src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h: Added EIGS_ANALYTIC_MULTIMIN, but don't enable by default until I can fix the convergence. (Maybe by implementing a generalized conjugacy condition for conjugate gradient?) * src/matrices/eigensolver.c: commented on non-storage of U and YtAYU; also changed iteration counter to be 1-based in verbose mode * src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/eigensolver.c: optimized when matrices are diagonal Mon Nov 22 05:12:35 1999 Steven G. Johnson * configure.in: bumped version * NEWS: noted (scheduled) 0.8.1 release. * doc/introduction.html: added comparison with time-domain Sun Nov 21 17:59:22 1999 Steven G. Johnson * mpb-ctl/examples/hole-slab.ctl, mpb-ctl/examples/tutorial.ctl, doc/user-tutorial.html, mpb-ctl/mpb.scm.in, doc/user-ref.html, NEWS: output-hfieldz, etc -> output-hfield-z; also use these functions in tutorial * NEWS: noted changes * src/matrixio/matrixio.c: speed up saving non-contiguous data * mpb-ctl/mpb.scm.in, doc/user-ref.html: added output-field[xyz] and friends * src/matrixio/matrixio.h, mpb-ctl/mpb.scm.in, src/matrixio/fieldio.c, mpb-ctl/mpb.c: Sped up phase calculations in field output (but to no avail, it seems), and set things up for outputting only a single component of a vector field. * NEWS: fixed typo * doc/user-ref.html, mpb-ctl/mpb.scm.in, NEWS: added output-copies variable 2000-01-02 stevenj * /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: slight fix * /home/a/stevenj/Repository/mpb/NEWS: noted more changes * /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: noted polarization (e.g. ".te") in the output filenames. * /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: slight rewording * /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/configure.in: version-numbering scheme is now 0.8, 0.9, 0.10, ... * /home/a/stevenj/Repository/mpb/doc/introduction.html: small formatting fix * /home/a/stevenj/Repository/mpb/TODO: updated * /home/a/stevenj/Repository/mpb/NEWS: slight rewording * /home/a/stevenj/Repository/mpb/NEWS: added version number to NEWS * /home/a/stevenj/Repository/mpb/NEWS: removed inconsistent parens * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/doc/user-ref.html, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: added z-parity output var * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c: fixed counting bug in zparity computation * /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/configure.in: configure works without f77 compiler, hopefully 2000-01-01 stevenj * /home/a/stevenj/Repository/mpb/tests/maxwell_test.c, /home/a/stevenj/Repository/mpb/src/util/check.h, /home/a/stevenj/Repository/mpb/src/util/debug_malloc.c, /home/a/stevenj/Repository/mpb/src/util/fortranize.h, /home/a/stevenj/Repository/mpb/src/util/mpi_utils.c, /home/a/stevenj/Repository/mpb/src/util/mpi_utils.h, /home/a/stevenj/Repository/mpb/src/util/mpiglue.h, /home/a/stevenj/Repository/mpb/tests/blastest.c, /home/a/stevenj/Repository/mpb/tests/eigs_test.c, /home/a/stevenj/Repository/mpb/tests/malloctest.c, /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c, /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_eps.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_op.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c, /home/a/stevenj/Repository/mpb/src/matrices/blasglue.h, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h, /home/a/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/scalar.h, /home/a/stevenj/Repository/mpb/src/matrices/sqmatrix.c, /home/a/stevenj/Repository/mpb/src/matrixio/evectmatrixio.c, /home/a/stevenj/Repository/mpb/src/matrixio/fieldio.c, /home/a/stevenj/Repository/mpb/doc/license.html, /home/a/stevenj/Repository/mpb/mpb-ctl/epsilon_file.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.h, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/src/matrices/blasglue.c, /home/a/stevenj/Repository/mpb/COPYRIGHT: bumped copyright year * /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/configure.in: bumped version and went to 2-digit minor version numbers * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/hole-slab.ctl, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_pre.c, /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/doc/user-ref.html: added run-even and run-odd 1999-12-14 stevenj * /home/a/stevenj/Repository/mpb/doc/user-ref.html: defined reciprocal lattice * /home/a/stevenj/Repository/mpb/doc/license.html: slight wording change in quotation * /home/a/stevenj/Repository/mpb/doc/license.html: better translation 1999-12-13 stevenj * /home/a/stevenj/Repository/mpb/doc/license.html: added St. Augustine quote 1999-12-09 stevenj * /home/a/stevenj/Repository/mpb/doc/acknowledgments.html: slight fix 1999-12-05 stevenj * /home/a/stevenj/Repository/mpb/doc/installation.html: various improvements 1999-12-03 stevenj * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/hole-slab.ctl: fixed substrate * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/hole-slab.ctl: allow substrate * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/tri-holes.ctl: Added 2d triangular lattice of holes example. 1999-12-02 stevenj * /home/a/stevenj/Repository/mpb/doc/user-tutorial.html: warned of false-positives in band gaps * /home/a/stevenj/Repository/mpb/tests/maxwell_test.c, /home/a/stevenj/Repository/mpb/src/util/check.h, /home/a/stevenj/Repository/mpb/tests/eigs_test.c, /home/a/stevenj/Repository/mpb/tests/malloctest.c, /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.c, /home/a/stevenj/Repository/mpb/src/matrices/sqmatrix.c, /home/a/stevenj/Repository/mpb/src/matrixio/fieldio.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/mpb-ctl/epsilon_file.c: Use CHK_MALLOC everywhere. For one thing, this prevents problems when we allocate 0 bytes on systems where malloc(0) returns NULL. * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: handle num-bands = 0 1999-12-01 stevenj * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: enable delay-cg by default * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: print warning in verbose mode for large lambda * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in: fixed median bug for odd sizes * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/hole-slab.ctl, /home/a/stevenj/Repository/mpb/mpb-ctl/examples/sq-rods.ctl, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/doc/user-ref.html: added display-eigensolver-stats * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: added EIGS_DELAY_CG flag...don't enable by default until we do more tuning 1999-11-30 stevenj * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: don't use cg with analytic multimin (multimin screws up cg) (because of this, multimin is probably not worth it) * /home/a/stevenj/Repository/mpb/tests/maxwell_test.c: got rid of gcc warning * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: randomize-fields now randomizes both the real and imaginary parts. Previously, it just set the imaginary parts to zero (which is fine for structures with inversion symmetry, but in general cases I don't see any justification for it). * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: verbose mode now prints out trace on every iteration. 1999-11-29 stevenj * /home/a/stevenj/Repository/mpb/NEWS, /home/a/stevenj/Repository/mpb/ChangeLog: updated * /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in: fixed trailing spaces in sed command; thanks to Ron Chase for the bug report. * /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in, /home/a/stevenj/Repository/mpb/tests/Makefile.in, /home/a/stevenj/Repository/mpb/configure.in: incorporate FLIBS into LIBS * /home/a/stevenj/Repository/mpb/doc/installation.html: more explicit instructions for LAPACK and BLAS. 1999-11-29 stevenj * /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in: fixed trailing spaces in sed command; thanks to Ron Chase for the bug report. * /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in, /home/a/stevenj/Repository/mpb/tests/Makefile.in, /home/a/stevenj/Repository/mpb/configure.in: incorporate FLIBS into LIBS * /home/a/stevenj/Repository/mpb/doc/installation.html: more explicit instructions for LAPACK and BLAS. 1999-11-25 stevenj * /home/a/stevenj/Repository/mpb/mpb-ctl/epsilon_file.c: minor improvements, mostly to comments * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: get rid of warning * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: don't redeclare lambda (also gets rid of possiblity of prev_lambda being assigned to undefined variable) * /home/a/stevenj/Repository/mpb/Makefile.in: added 'make snapshot' * /home/a/stevenj/Repository/mpb/doc/user-ref.html: slight rewording * /home/a/stevenj/Repository/mpb/src/maxwell/maxwell_eps.c, /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c, /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.h, /home/a/stevenj/Repository/mpb/src/maxwell/maxwell.h, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.h, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/src/matrixio/evectmatrixio.c, /home/a/stevenj/Repository/mpb/mpb-ctl/Makefile.in, /home/a/stevenj/Repository/mpb/mpb-ctl/epsilon_file.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c, /home/a/stevenj/Repository/mpb/doc/user-ref.html: added epsilon-input-file input var 1999-11-24 stevenj * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/configure.in, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: added eigensolver-flags input variable * /home/a/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.h: Added EIGS_ANALYTIC_MULTIMIN, but don't enable by default until I can fix the convergence. (Maybe by implementing a generalized conjugacy condition for conjugate gradient?) * /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: commented on non-storage of U and YtAYU; also changed iteration counter to be 1-based in verbose mode * /home/a/stevenj/Repository/mpb/src/matrices/matrices.h, /home/a/stevenj/Repository/mpb/src/matrices/scalar.h, /home/a/stevenj/Repository/mpb/src/matrices/evectmatrix.c, /home/a/stevenj/Repository/mpb/src/matrices/matrices.c, /home/a/stevenj/Repository/mpb/src/matrices/eigensolver.c: optimized when matrices are diagonal 1999-11-22 stevenj * /home/a/stevenj/Repository/mpb/configure.in: bumped version * /home/a/stevenj/Repository/mpb/NEWS: noted (scheduled) 0.8.1 release. * /home/a/stevenj/Repository/mpb/doc/introduction.html: added comparison with time-domain 1999-11-21 stevenj * /home/a/stevenj/Repository/mpb/mpb-ctl/examples/hole-slab.ctl, /home/a/stevenj/Repository/mpb/mpb-ctl/examples/tutorial.ctl, /home/a/stevenj/Repository/mpb/doc/user-tutorial.html, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/doc/user-ref.html, /home/a/stevenj/Repository/mpb/NEWS: output-hfieldz, etc -> output-hfield-z; also use these functions in tutorial * /home/a/stevenj/Repository/mpb/NEWS: noted changes * /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.c: speed up saving non-contiguous data * /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/doc/user-ref.html: added output-field[xyz] and friends * /home/a/stevenj/Repository/mpb/src/matrixio/matrixio.h, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/src/matrixio/fieldio.c, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.c: Sped up phase calculations in field output (but to no avail, it seems), and set things up for outputting only a single component of a vector field. * /home/a/stevenj/Repository/mpb/NEWS: fixed typo * /home/a/stevenj/Repository/mpb/doc/user-ref.html, /home/a/stevenj/Repository/mpb/mpb-ctl/mpb.scm.in, /home/a/stevenj/Repository/mpb/NEWS: added output-copies variable Fri Nov 19 00:45:13 1999 Steven G. Johnson * TODO: updated and cleaned up a bit * doc/license.html, doc/user-tutorial.html: noted example ctl files * mpb-ctl/examples/hole-slab.ctl: output hfield instead of dpwr. * mpb-ctl/examples/hole-slab.ctl: added hole-slab example Thu Nov 18 20:43:17 1999 Steven G. Johnson * configure.in: don't look in ../libctl and print error if libctl not found * src/matrices/eigensolver.c: flush iteration output * mpb-ctl/mpb.scm.in, doc/user-ref.html: added current-k global * mpb-ctl/mpb.c: print out geometry box tree in --verbose mode * mpb-ctl/examples/sq-rods.ctl: slight cleanup * mpb-ctl/examples/bragg.ctl, mpb-ctl/examples/sq-rods.ctl: updated examples * doc/user-tutorial.html: recommend using mpb foo.ctl >& foo.out so that foo.out catches errors. * Makefile.in: added 'make dist' target * mpb-ctl/mpb.c: explained that hack from 1.32 was to get good convergence. * mpb-ctl/mpb.c: hack: for some reason I don't comprehend, it is necessary to re-randomize the fields before doing a zero-k point, at least with the new "analytic" linmin in eigensolver.c. Hey, it works, and it can't do any harm. * configure.in: bumped beta version number * src/matrices/sqmatrix.c: Added explanatory comment to sqmatrix_AeBC, noting the probable relative efficiency of various operations. * src/matrices/eigensolver.c: tiny fix in comment * src/matrices/eigensolver.h, src/matrices/eigensolver.c: Added "analytic" line minimization based on exact minimization of rigorous expansion of the functional for small displacements (truly exact for p=1). Also cleaned up eigensolver code a bit, giving generic names to matrices UYtAYU and Usqrt that were being used for lots of random things. Wed Nov 17 23:56:34 1999 Steven G. Johnson * doc/user-ref.html: grammar fix * doc/introduction.html: link to feature list at MPB home page. * doc/index.html: slight wording change * doc/index.html, README: noted author * doc/license.html: gnu web page -> gnu web site * doc/user-tutorial.html, mpb-ctl/mpb.c: sumfrq -> freqs, etcetera * mpb-ctl/mpb.scm.in: interactive -> interactive? * src/maxwell/maxwell_pre.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, mpb-ctl/mpb.c: Put in special-case code for k ~ 0 lowest bands (constant fields), to fix problems with slow convergence. * src/matrices/eigensolver.c, src/matrices/eigensolver.h, mpb-ctl/mpb.c: Added constraint "chaining" utilities. Tue Nov 16 07:10:08 1999 Steven G. Johnson * src/matrices/eigensolver.c: renamed check variable (don't reuse E2--bad style) * doc/user-ref.html, doc/user-tutorial.html: noted that 2d grid does not mean k is 2d * doc/developer.html: -> , and fixed missing close tag (why have I been closing everything with ?) * mpb-ctl/mpb.c: added missing return statements in error code Mon Nov 15 23:51:42 1999 Steven G. Johnson * TODO: we can't add HDF4 support because the HDF4 license conflicts with the GPL * TODO: updated; we now restart CG every 100 iterations * mpb-ctl/mpb.c: Use EIGS_VERBOSE flag when run with --verbose. We should probably print even more output than we already do with this flag. * configure.in: Fixed version number. * mpb-ctl/mpb.c, mpb-ctl/mpb.scm.in, doc/user-ref.html: Added "deterministic?" and "iterations" input and output variables. * src/matrices/eigensolver.h, src/util/mpiglue.h, src/matrices/eigensolver.c: Periodically print feedback in eigensolver, even when EIGS_VERBOSE is not set, if the user is kept waiting more than a couple of seconds. Also, implement resetting of CG direction every 100 iters (determined by some experimentation with the 5x5 defect). Sun Nov 14 20:29:37 1999 Steven G. Johnson * tests/eigs_test.c, tests/malloctest.c, tests/maxwell_test.c, src/util/mpi_utils.h, src/util/mpiglue.h, tests/blastest.c, src/util/check.h, src/util/debug_malloc.c, src/util/fortranize.h, src/util/mpi_utils.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/sqmatrix.c, src/matrices/eigensolver.h, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/blasglue.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, COPYRIGHT, mpb-ctl/mpb.c: fixed indenting in COPYRIGHT * mpb-ctl/Makefile.in, mpb-ctl/mpb.c, doc/installation.html, doc/user-tutorial.html, configure.in, doc/developer.html, doc/index.html, README, TODO, Makefile.in: Great Renaming II: we are now MPB * doc/index.html: noted mpb-discuss mailing list. * configure.in: check for -lcxml in addition to -ldxml (name changed due to acquisition by Compaq). Fri Nov 12 20:46:38 1999 Steven G. Johnson * photon-ctl/photon.scm.in: Removed begin-time macro (moved it to libctl). * src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/config.h.in, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, TODO, configure.in: Added --without-hdf5 option (automatic when hdf5 libraries are not found). * TODO: added some items * TODO, configure.in: Fixed linking to ESSL on AIX. * src/util/fortranize.h: don't need to define NO_FORTRAN_FUNCTIONS here on AIX, since it's detected by configure. Thu Nov 11 03:01:28 1999 Steven G. Johnson * configure.in, doc/installation.html: Added --with-fastblas= to try linking with -l. * doc/developer.html, doc/introduction.html, doc/acknowledgments.html: Several updates. * tests/maxwell_test.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, tests/eigs_test.c, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/maxwell/maxwell.h, photon-ctl/photon.c, photon-ctl/photon.scm.in, TODO, doc/user-ref.html: Implemented fancy preconditioner. Also made different eigensolver iteration schemes into runtime flags (instead of preprocessor #ifdefs). Wed Nov 3 23:14:56 1999 Steven G. Johnson * photon-ctl/photon.scm.in: added elapsed time output Mon Nov 1 22:52:13 1999 Steven G. Johnson * TODO: updated to reflect recent improvements Tue Oct 26 00:54:42 1999 Steven G. Johnson * doc/developer.html: Fixed missing tags. * photon-ctl/examples/tutorial.ctl, doc/user-ref.html, doc/user-tutorial.html: Tutorial revisions, mainly to reflect new mesh size. * photon-ctl/photon.scm.in: Use default mesh of 3, like Fortran code. Mon Oct 25 21:06:14 1999 Steven G. Johnson * doc/developer.html: Wrote first-draft developer section. * doc/introduction.html: small change Thu Oct 21 22:06:28 1999 Steven G. Johnson * photon-ctl/photon.c: Use new geom_fix_objects and geom_box_tree routines...the latter greatly speed up dielectric function calculation!! Wed Oct 20 22:45:55 1999 Steven G. Johnson * photon-ctl/photon.scm.in, configure.in: Added code to activate readline in Guile 1.3.2+. Also shuffled around BLAS libraries somewhat. Try the atlas library, and stop checking for BLAS libraries after we find one. Tue Oct 19 00:30:28 1999 Steven G. Johnson * photon-ctl/examples/tutorial.ctl: added comments to output. Mon Oct 18 19:25:58 1999 Steven G. Johnson * photon-ctl/examples/tutorial.ctl: Added file of commands from the User Tutorial (in the manual). Wed Oct 13 23:11:28 1999 Steven G. Johnson * configure.in: Fixed bug when gcc and/or Guile are installed in non-standard directories. Fri Oct 1 19:44:34 1999 Steven G. Johnson * src/matrices/blasglue.c: herk routines take only *real* coefficients to multiply matrices by. Thu Sep 30 19:35:50 1999 Steven G. Johnson * photon-ctl/photon.c: Check NWORK size before using W[0], W[1]. Fri Sep 17 00:15:29 1999 Steven G. Johnson * tests/malloctest.c: DEBUG -> DEBUG_MALLOC * src/util/debug_malloc.c, configure.in, src/config.h.in, src/util/check.h: split --enable-debug-malloc into separate flag, added --with-efence, removed a couple of Fortran library checks (should be added automatically by AC_F77_LIBRARY_LDFLAGS), and moved ordering of Guile libs. Thu Sep 16 23:09:22 1999 Steven G. Johnson * tests/eigs_test.c, tests/malloctest.c, tests/maxwell_test.c, src/util/debug_malloc.c, src/util/mpi_utils.c, tests/blastest.c, src/maxwell/maxwell_eps.c, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/sqmatrix.c, src/maxwell/maxwell.c, src/matrices/blasglue.c, src/matrices/eigensolver.c, configure.in, photon-ctl/photon.c: Changed #include to #include "path/config.h", where path is the appropriate relative path. This way, we can compile on the @#$#@-ing Origin, which includes a file called config.h in one of its system header directories. * src/maxwell/maxwell_eps.c, tests/maxwell_test.c, src/maxwell/Makefile.in, src/maxwell/maxwell.c, src/maxwell/maxwell.h, photon-ctl/photon.c: Separated epsilon tensor calculation into maxwell_eps.c, and compute normal vectors using separate "moment mesh." * photon-ctl/Makefile.in: Rebuild program when libraries change. * photon-ctl/examples/sq-rods.ctl: run-tm, not run. Wed Sep 15 03:05:32 1999 Steven G. Johnson * configure.in: Fixed library detection for SGI. * configure.in: Added more warnings. * tests/blastest.c: Got rid of warning about unused main() params. Tue Sep 14 18:24:59 1999 Steven G. Johnson * tests/Makefile.in, tests/malloctest.c: Added malloctest. * src/util/debug_malloc.c: Noted provenance of debug_malloc and friends. Mon Sep 13 18:45:17 1999 Steven G. Johnson * doc/acknowledgments.html: Fixed ack's. Sun Sep 12 01:47:36 1999 Steven G. Johnson * configure.in: compress test program a little * configure.in: Replaced m4 "dnl" comments with sh "#" comments (this means that they get passed through to the configure script, but so what). Fri Sep 10 23:41:28 1999 Steven G. Johnson * src/matrices/blasglue.c: Reverted changes (which I hadn't meant to commit)--passing args as strings doesn't help things on the $*@#$ alpha. * photon-ctl/Makefile.in: added explanatory comment. * configure.in, photon-ctl/Makefile.in: --program-suffix, etcetera now work. * doc/installation.html: Documented new libctl & photon installation procedure. * configure.in: Added AC_PROG_INSTALL check. * install-sh, config.sub, config.guess: Updated versions of autoconf files. * tests/Makefile.in, src/matrixio/Makefile.in, src/maxwell/Makefile.in, src/util/Makefile.in, photon-ctl/photon.scm.in, src/matrices/Makefile.in, src/matrices/blasglue.c, photon-ctl/Attic/photon.scm, photon-ctl/Makefile.in, photon-ctl/photon.c, Makefile.in, TODO, configure.in: Mirrored changes in libctl (which is now installed in a central location). Also, separated CFLAGS from -I flags (so that CFLAGS can be overridden more easily). configure script now looks for Guile, libctl. Thu Sep 9 18:07:15 1999 Steven G. Johnson * README: Mentioned contact addresses in manual. * README: Refer readers to the manual. * doc/user-ref.html, doc/user-tutorial.html, doc/installation.html, doc/introduction.html, doc/license.html, doc/acknowledgments.html, doc/index.html: Made changes suggested by John. In particular, we are now the "MIT Photonic-Bands" package. * doc/user-tutorial.html: Discussed units. * doc/introduction.html: Made a stab at an introduction. Wed Sep 8 22:12:05 1999 Steven G. Johnson * TODO: Added a couple more items. * doc/acknowledgments.html, doc/developer.html, doc/index.html: Added acknowledgments section. * doc/user-ref.html: Wrote "Field manipulation functions" section. Tue Sep 7 23:28:42 1999 Steven G. Johnson * doc/user-ref.html: put types in font * doc/user-ref.html: Added output functions section. * photon-ctl/photon.scm: Added combine-band-functions. * photon-ctl/photon.scm: Set gap-list to '() if there are 1 or fewer k-points in the run function. * doc/user-ref.html: added more sections. Mon Sep 6 06:26:22 1999 Steven G. Johnson * doc/user-tutorial.html: bug fix * doc/user-tutorial.html: Fixed lie. * doc/user-tutorial.html: grammar fix * doc/user-ref.html: fixed another tag * doc/user-ref.html: fixed tag * doc/user-ref.html: added another link * doc/user-ref.html: small correction * doc/developer.html, doc/user-ref.html: More useful additions. Started on the reference section. * photon-ctl/photon.scm, photon-ctl/photon.c: Split randomize-fields into a separate function; less hackery this way. * photon-ctl/photon.scm, doc/user-tutorial.html, photon-ctl/photon.c: Made it easier to re-run without reinitializing fields. Sun Sep 5 23:48:29 1999 Steven G. Johnson * doc/user-tutorial.html: Added mode-tuning tutorial. * configure.in: Don't prefer vendor cc to gcc (since performance-critical code is in libs). * src/config.h.in, src/matrices/blasglue.c, configure.in: configure now checks to see if function return value from zdotc is okay. * photon-ctl/photon.c: Small fix: hdf output description now includes frequency of correct band. * photon-ctl/photon.c, photon-ctl/photon.scm, TODO: Implemented items on TODO list: dimensions < true_rank should make grid sizes 1 in extra dimensions. Prevent sumte/sumtm/sumfrq header lines from being output when not needed (put in solve-kpoint, when called with kpoint_index == 0, instead of in init_params). Add "filename-prefix" input variable for adding a prefix to all output filenames. Prepend "k" and "b" to k-point and band indices in output filenames. Start band indices with one. * doc/user-tutorial.html: another small change * doc/user-tutorial.html: another small fix * doc/user-tutorial.html: small change * doc/user-tutorial.html: Added point-defect example. * photon-ctl/photon.c: Perform center-shifting correctly now (I hope). * photon-ctl/photon.scm: Only output gaps if there is more than one k point. Sat Sep 4 23:25:59 1999 Steven G. Johnson * TODO, doc/user-tutorial.html, photon-ctl/photon.c: Fixed bug for non-square lattices (G was transposed). * src/util/mpiglue.h, tests/maxwell_test.c, src/matrixio/matrixio.c, src/matrixio/matrixio.h, src/maxwell/maxwell.c, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, configure.in, photon-ctl/Makefile.in, photon-ctl/photon.c: Turned on all gcc warnings and eliminated them whereever practical. * doc/user-tutorial.html: Added more subsections. * TODO: updated list * photon-ctl/photon.c: Shifted origin to the center of the grid (this does not affect inversion symmetry). * photon-ctl/photon.scm: Added gap-list computation. Fri Sep 3 05:30:10 1999 Steven G. Johnson * doc/installation.html, doc/user-tutorial.html, doc/index.html: Slowly building the manual... Thu Sep 2 22:50:20 1999 Steven G. Johnson * doc/user-tutorial.html, doc/installation.html, doc/introduction.html: Added more to the manual. * photon-ctl/examples/sq-rods.ctl, photon-ctl/examples/bragg.ctl, photon-ctl/photon.scm: Added alias, "dielectric", for "material-type". * doc/installation.html: Wrote installation section. Wed Sep 1 23:44:39 1999 Steven G. Johnson * doc/user-tutorial.html, doc/index.html, doc/installation.html, doc/introduction.html, doc/license.html, doc/user-ref.html, doc/developer.html: Added documentation outline. * photon-ctl/photon.scm: revamped (run) functions; they're actually useful now. * photon-ctl/photon.c: Moved display_object_info to libgeom. * photon-ctl/Makefile.in: Added dependency rule for geom.scm. * photon-ctl/photon.scm, photon-ctl/photon.c: Added compute-energy-in-objects, plus ability to let init-params not reinitialize the fields. * photon-ctl/photon.c: note breakage under mpi of field output. * src/matrixio/matrixio.h, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, src/matrixio/Makefile.in, src/matrixio/evectmatrixio.c, src/matrixio/fieldio.c, src/matrixio/matrixio.c, photon-ctl/Makefile.in, photon-ctl/photon.c, photon-ctl/photon.scm, Makefile.in, configure.in: Added matrixio (HDF5 output capability). Tue Aug 31 22:07:52 1999 Steven G. Johnson * src/maxwell/maxwell.h, src/maxwell/maxwell.c: k vector is passed to maxwell function in the basis of the reciprocal lattice vectors! * src/maxwell/maxwell_op.c: Compute transform with correct sign (makes a difference for field output in structures lacking inversion symmetry). * src/maxwell/maxwell_op.c: fixed comment. * src/maxwell/maxwell_op.c: Broke out E/H computations into subroutines, to prepare for HDF output and position-space calculations. * configure.in: Cleaned up a little, and fixed (I think?) order of linking BLAS libs. Mon Aug 30 20:31:20 1999 Steven G. Johnson * photon-ctl/examples/bragg.ctl, photon-ctl/examples/sq-rods.ctl: Added a couple of examples (very half-baked at this point). * configure.in: Added (untested) checks for BLAS in vendor-specific libraries (which, I *think*, include an optimized BLAS). * configure.in: Fixed --help output to reflect fact that --enable-complex is the default. * photon-ctl/photon.c: Print out radius for cylinders. * photon-ctl/photon.c, photon-ctl/photon.scm: Allow polarization of solution to be set. * photon-ctl/photon.c: removed newlines. * README, TODO: Updated info. * tests/maxwell_test.c, src/util/mpiglue.h, tests/blastest.c, tests/eigs_test.c, src/util/debug_malloc.c, src/util/fortranize.h, src/util/mpi_utils.c, src/util/mpi_utils.h, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/util/check.h, src/matrices/sqmatrix.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/matrices/evectmatrix.c, photon-ctl/photon.c, photon-ctl/photon.scm, src/matrices/blasglue.c, COPYING, COPYRIGHT: GPL-ed everything. * Makefile.in: 'make distclean' should remove config.status. * src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, tests/maxwell_test.c, photon-ctl/photon.c, photon-ctl/photon.scm, src/maxwell/maxwell.c, Makefile.in, configure.in, photon-ctl/Makefile.in: Added first pass at a user interface (photon-ctl). Sat Jul 17 17:58:07 1999 Steven G. Johnson * tests/maxwell_test.c, src/maxwell/maxwell.c, src/maxwell/maxwell_op.c: Implemented num_fft_bands != num_bands. Fri Jul 16 22:20:28 1999 Steven G. Johnson * tests/maxwell_test.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/maxwell/maxwell.c: Added in epsilon tensor initialization routine, and got rid of eps_inv_mean[band] mess from maxwell_op since it wasn't doing any good in the preconditioner. Thu Jun 10 22:04:23 1999 Steven G. Johnson * tests/maxwell_test.c: Fixed -h help string. * configure.in: Checked for ASCII project optimized Pentium Pro BLAS library (libblasppro1). Sat Jun 5 00:22:20 1999 Steven G. Johnson * tests/maxwell_test.c: Changed maxwell output format slightly; added tolerance parameter. * tests/maxwell_test.c: Whoops! TWOPI is a double, not (implicitly) and int! Fri Jun 4 23:14:43 1999 Steven G. Johnson * tests/maxwell_test.c: Default to quarter-wave stack. * tests/maxwell_test.c, src/maxwell/maxwell.h, src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/maxwell/maxwell.c: Added code to find maxwell eigenvals "targeted" around a particular frequency. The convergence is slower than I would like, though. * src/maxwell/maxwell_pre.c: For now, don't subtract eigenvals from the preconditioner, as least not until I understand the effects better. (Right now, seems to make convergence worse in many cases, and also seems to mess up the convergence criteria for the higher bands.) Tue Jun 1 19:59:38 1999 Steven G. Johnson * src/config.h.in, src/maxwell/maxwell.h, configure.in: Updated to work with [ds]?r?fftw libraries (aren't regular expressions wonderful?). * tests/maxwell_test.c, src/util/mpi_utils.c, src/util/mpi_utils.h, src/util/mpiglue.h, src/matrices/scalar.h: Misc. changes. * src/maxwell/maxwell_op.c, src/maxwell/maxwell_pre.c: Separated op and preconditioner into their own files. Thu Feb 4 02:51:19 1999 Steven G. Johnson * src/maxwell/maxwell.c, TODO: Check for k == 0 in when setting k vector. * TODO, src/matrices/eigensolver.c: Added stricter convergence (convergence of each eigenvalue separately). * tests/maxwell_test.c: Small fixes. * tests/eigs_test.c, tests/maxwell_test.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/maxwell/Makefile.in, Makefile.in, TODO, configure.in, src/config.h.in: Allowed discrimination between TE and TM modes. Wed Feb 3 22:55:15 1999 Steven G. Johnson * configure.in: Added profiling flags to existing flags, instead of replacing. * configure.in: Fixed ordering of checks... * src/config.h.in, tests/maxwell_test.c, configure.in: Added --enable-prof. * tests/maxwell_test.c, src/maxwell/maxwell.c, src/maxwell/maxwell.h, tests/eigs_test.c, src/matrices/eigensolver.h, src/matrices/eigensolver.c, TODO: Lots of changes to eigensolver routine and preconditioners, yielding dramatic improvements in convergence. The most important thing new is that we now diagonalize the subspace on each iteration of eigensolver. This makes the preconditioner much more sensible, and also allows us to subtract the eigenval from the preconditioner (a better approximation, hopefully, to the correct Hessian). Sun Jan 31 07:49:01 1999 Steven G. Johnson * src/maxwell/maxwell.c, src/maxwell/maxwell.h: No need to store k+G in k_data since we don't use this information. * tests/maxwell_test.c, TODO, src/maxwell/maxwell.c: Maxwell seems like it might be working! Sat Jan 30 22:17:11 1999 Steven G. Johnson * src/matrices/scalar.h, tests/eigs_test.c: Made complex eigenvector output in eigs_test more uniform. * tests/Makefile.in: Whoops! make clean should delete eigs_test.o. * src/matrices/eigensolver.c: Removed unused lines. * tests/maxwell_test.c, src/maxwell/maxwell.h, src/util/check.h, src/util/debug_malloc.c, tests/Makefile.in, src/matrices/eigensolver.c, src/maxwell/maxwell.c, Makefile.in, TODO, configure.in, src/config.h.in: Fixed uninitialized D bug in eigensolver.c (doh!). Added test for maxwell operator code, and got maxwell closer to working (I hope). Fri Jan 29 20:52:08 1999 Steven G. Johnson * tests/Attic/Makefile, tests/Makefile.in, tests/blastest.c, tests/eigs_test.c, src/util/Makefile.in, src/util/debug_malloc.c, src/util/mpi_utils.c, src/maxwell/Makefile.in, src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/matrices/eigensolver.c, src/matrices/evectmatrix.c, src/matrices/matrices.c, src/matrices/sqmatrix.c, src/config.h.in, src/matrices/Makefile.in, src/matrices/blasglue.c, config.guess, config.sub, configure.in, install-sh, Makefile.in: "Autoconfiscated" everything (i.e. adapted for use with GNU autoconf portability tools). * src/matrices/scalar.h: Separate scalar_complex type that is always defined. * src/maxwell/maxwell.c, src/maxwell/maxwell.h, src/maxwell/README: Initial version of Maxwell operator code. Mon Aug 10 23:32:35 1998 Steven G. Johnson * src/matrices/eigensolver.c: Noted that A and C are assumed to be linear. * tests/eigs_test.c, src/matrices/eigensolver.c, src/matrices/eigensolver.h: Added callback data pointer to eigensolver. Sat Aug 8 19:18:06 1998 Steven G. Johnson * tests/blastest.c, tests/eigs_test.c: Made sure that solving for complex eigenvectors works. (Hooray!) * src/util/fortranize.h, src/matrices/blasglue.c: Worked around problems accessing Fortran function return values on the RS/6000. * tests/eigs_test.c: For complex scalars, create complex matrix. * src/matrices/scalar.h: Bug fix in ASSIGN_SCALAR for complex. * src/matrices/README: Columns, not rows, of Y are the eigenvectors. * src/matrices/evectmatrix.c, src/matrices/matrices.h, src/matrices/sqmatrix.c, src/matrices/eigensolver.c: Some minor cleanup in function interfaces. * src/matrices/eigensolver.c: Changed confusing use of "X" in comment. * src/matrices/README: Noted eigensolver.c. * README: Updated to note eigensolvers. * src/util/fortranize.h: "Cray" is not an acronym. * src/util/fortranize.h, src/matrices/Attic/fortranize.h: Moved fortranize.h to util directory. * tests/Attic/Makefile: Makefile for test programs. This will probably get replaced by something autoconf'y later, but it will do for now. * tests/blastest.c: Check for memory leaks at end. * tests/eigs_test.c: Only print out A for n <= 10 instead of 20. * src/matrices/eigensolver.c: Increased iteration limit and included it in the failure message. * tests/eigs_test.c: Added comparison of multiple tests (w/o CG, w/o preconditioning, etcetera). * src/matrices/matrices.h, src/matrices/sqmatrix.c: Added sqmatrix_copy. * tests/eigs_test.c: Got things working. * src/util/check.h: Modified to enable debug_malloc/free when DEBUG is defined. Does it work? * src/matrices/eigensolver.c, src/matrices/sqmatrix.c: Eigensolver now computes correct eigenvectors/values at the end. Fixed problem with not enough memory being allocated for dense real eigensolver of small sizes (U.p < 3). Fri Aug 7 22:35:16 1998 Steven G. Johnson * src/util/mpi_utils.h: Fixed missing semicolon when not using gcc. * tests/eigs_test.c, tests/blastest.c, src/util/debug_malloc.c, src/util/mpi_utils.c, src/util/mpi_utils.h, src/util/mpiglue.h, src/util/check.h, src/matrices/Attic/fortranize.h, src/matrices/matrices.c, src/matrices/matrices.h, src/matrices/scalar.h, src/matrices/sqmatrix.c, src/matrices/blasglue.h, src/matrices/eigensolver.c, src/matrices/eigensolver.h, src/matrices/evectmatrix.c, src/matrices/README, src/matrices/blasglue.c: Added starting code. Wed May 20 01:18:50 1998 Steven G. Johnson * README: Created photonic-bands repository. * README: Initial revision mpb-1.4.2/Makefile.in0000644000175400001440000000644307422123471010033 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ package = mpb distdir = $(package)-@MPB_VERSION@ # Subdirectories to make in: LIBSUBDIRS = src/util src/matrices src/maxwell src/matrixio INSTALLSUBDIRS = mpb-ctl utils CHECKSUBDIRS = tests mpb-ctl SUBDIRS = $(LIBSUBDIRS) tests $(INSTALLSUBDIRS) all: all-recursive libs: libs-recursive check: check-recursive @echo "**********************************************************" @echo " MPB PASSED all tests." @echo "**********************************************************" install: install-recursive dist: cvs export -D now -d $(distdir) $(package) cp config.guess config.sub $(distdir) cp install-sh $(distdir) pushd $(distdir) && autoheader && autoconf && popd rm -f $(distdir).tar.gz GZIP="--best" tar chozf $(distdir).tar.gz $(distdir) rm -rf $(distdir) snapshot: ss_vers=`date +"%Y%m%d"` && \ ss_dir=$(package)-$$ss_vers && \ cvs export -D now -d $$ss_dir $(package) && \ cp config.guess config.sub $$ss_dir && \ cp install-sh $$ss_dir && \ (sed "s/VERSION=@MPB_VERSION@/VERSION=$$ss_vers/" $$ss_dir/configure.ac > $$ss_dir/configure.ac.ss) && \ mv -f $$ss_dir/configure.ac.ss $$ss_dir/configure.ac && \ pushd $$ss_dir && autoheader && autoconf && popd && \ rm -f $$ss_dir".tar.gz" && \ GZIP="--best" tar chozf $$ss_dir".tar.gz" $$ss_dir && \ rm -rf $$ss_dir clean: clean-recursive rm -f core distclean: clean @list='$(SUBDIRS)'; for subdir in $$list; do \ echo "rm -f $$subdir/Makefile"; rm -f $$subdir/Makefile; done rm -f config.cache Makefile src/config.h config.log config.status \ mpb-ctl/mpb.scm maintainer-clean: distclean rm -f configure # Recursive makes in subdirectories: # (borrowed from automake) all-recursive clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ list='$(SUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" libs-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ list='$(LIBSUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" check-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ list='$(CHECKSUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" install-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ list='$(INSTALLSUBDIRS)'; for subdir in $$list; do \ target=`echo $@ | sed s/-recursive//`; \ echo "Making $$target in $$subdir"; \ (cd $$subdir && $(MAKE) $$target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" mpb-1.4.2/NEWS0000644000175400001440000004271207631010661006462 MPB 1.4.2 (3/3/2003) * Interactive prompt is now "mpb>" not "guile>". * Output "freqs:" line lists headings as "k1, k2, k3" instead of "kx, ky, kz" since they are in reciprocal-lattice, not cartesian, coordinates. Thanks to Theis Peter Hanson for the suggestion. * Bug fix in find-k for non-orthogonal lattices; thanks to Suxia (Susan) Yang for tracking down this bug. * Fixed SunOS problem where k vectors along no-size dimensions failed; thanks to Benjamin Cowan for the bug report. * Fixed find-k to work for band-min > 1; thanks to M. Povinelli for the bug report. * Fixed find-k to work for thunk band functions (which take no arguments and are called only once instead of per-band). MPB 1.4.1 (9/16/2002) * Fixed NaN in field normalization when basis determinant was negative. Thanks to Rumen Iliew for the bug report. * Fixed compatibility problems with versions of Guile prior to 1.4. Thanks to Cazimir G. Bostan for bug reports. * Don't resize lattice basis for grid-size == 1 unless no-size was explicitly specified; thanks to Tairan Wang for the suggestion. MPB 1.4 (9/12/2002) * New find-k routine to find k as a function of frequency, instead of vice-versa. * The Great Field Renormalization: all fields are now normalized to have unit *integral* of their energy density (instead of unit sum over the grid points), which is much more useful e.g. for perturbation theory. (See field normalization section of manual.) * You can now save fields in Scheme variables to perform computations combining different fields. Example routines, e.g. to output the Poynting vector, are included. * Functions to export (and import) the raw eigenvectors (planewave amplitudes), as well as to compute dot products of eigenvectors from different k-points (e.g. for detecting band crossings). * allow-negative-epsilon function to enable negative-dielectric support. * Added examples/dos.scm to compute density of states via simple Gaussian histogram, suggested by Xavier Gonze and Doug Allan. * Bug fix: allow real offdiagonal epsilon elements without requiring --with-hermitian-eps. Thanks to Doug Allan for the bug report. * Eliminated floating-point error on Alpha for homogeneous structure. Thanks to F. Lopez-Tejeira for the bug report. * Added man page for mpb-split. * Minor installation fixes. MPB 1.3 (3/10/2002) * You can now specify the grid size via the resolution input variable, instead of via grid-size. In this case, you make e.g. a 2d simulation by creating a lattice with size no-size in one dimension. The old syntax is still supported, but the new style is encouraged (all examples have been updated to the new style). * New functions to retrieve fields, dielectric functions, etcetera at any point, interpolated from the grid if necessary; see the get-*-point functions in the reference section. * New compute-field-integral function, analogous to compute-energy-integral; thanks to Marin Soljacic for the suggestion. * Support Scheme complex numbers where appropriate (e.g. in epsilon-offdiag or in the new field integration functions). * Got rid of NaN when computing the (undefined) group velocity for zero-frequency states at the Gamma point; arbitrarily return zero here instead. Thanks to Dmitry N. Chigrin for reporting floating-point exceptions on Alphas. * Fixed compilation failure for Fortran compilers that use all upper case; thanks to Steve Lantz of Cornell. * Added "Fun with Fortran" section to installation manual describing common Fortran pitfalls; thanks to Steve Lantz for the suggestion. * Improved BLAS/LAPACK detection; new --with-blas and --with-lapack options to specify these libraries manually. * Shortened --with-hermitian-epsilon configure option to --with-hermitian-eps. * The data-analysis tutorial is now consistent with h5topng 1.7. * Use new API from libctl 2.0. MPB 1.2.2 (12/7/2001) * Fixed bug that caused erroneous/failed convergence when EVEN-Y/ODD-Y constraints were used in three dimensions. Thanks to Rumen Iliew for the bug report. * Added convenience functions run-yeven, run-yodd, run-yeven-zeven, ... MPB 1.2.1 (11/20/2001) * Fixed serious crashing bug in 1.2; thanks to Karl Koch for the bug report. MPB 1.2 (11/15/2001) * Added new y-parity computation and constraints. See the new run-parity function, which allows you to simultaneously specify the parity through the y=0 and z=0 planes, for symmetric structures. See also the display-yparities function. * z parity is no longer computed by default; see the new display-yparities and display-zparities functions to pass to (run). * Return more-accurate average epsilon, fill factor, and scalar epsilon values (eigenfrequencies are not affected). Thanks to Mischa Megens for bugging me. * Now outputs D and H in consistent units (previously, D was multiplied by a factor of -frequency). Thanks to Michelle Povinelli for worrying. * epsilon.h5 file now includes extra datasets for all components of the effective dielectric tensor. (This feature is not yet supported if you configure --with-inv-symmetry --with-hermitian-epsilon.) * run-polarization is replaced by run-parity, and run-even/run-odd are deprecated in favor of run-zeven/run-zodd. run-te/run-tm are now equivalent to run-zeven/run-zodd when invoked for 3d systems. * Noted new basis-size property of geometry-lattice, from libctl 1.5. This makes it easier to use conventional units in the fcc lattice. * Group-velocity computation no longer silently invalidates fields that have been loaded with get-dfield, etcetera. Thanks to Marin Soljacic for the bug report. * The configure script now checks that guile is in the $PATH. Thanks to Bing Li and Giridhar Malalahalli for their bug reports. * Rotated the W and K points of the diamond-lattice example so that they are oriented similarly to those in the Photonic Crystals book by Joannopoulos et al. (eigenfrequencies are not affected). Thanks to Robert Sheldon for pointing out that this was confusing. * Added honey-rods.ctl example file: a 2d honeycomb lattice of rods. * Added line-defect.ctl example file: a line-defect waveguide in a 2d triangular lattice of dielectric rods, formed by a missing row of rods. MPB 1.1.1 (7/4/2001) * Fixed bug in H-field output that caused subtly incorrect H-field files (only) for 3d problems when NOT using mpbi. * Fixed bug that caused mpbi to output incorrect results for 1d problems (e.g. outputted dielectric functions with zeros). * Changed default eigensolver tolerance from 1e-4 to 1e-7. * Added retrieve-gap convenience function to return the gap between two specified bands. * Fixed typo that prevented compilation of MPI (parallel) version. * C compiler flags -O3 are no longer used by default, since they don't work with some compilers; most of the performance depends upon the BLAS and FFTW anyway. (Users wishing greater optimization can set the CFLAGS environment variable.) Thanks to Giridhar Malalahalli for the bug report. MPB 1.1 (5/6/2001) * Added compute-energy-integral function to make it easier to compute arbitrary field-energy integrals for perturbation theory; thanks to Marin Soljacic for the suggestion. * Fixed bug in output-field routines for the case of a nonzero kz component, that caused the fields to be multiplied by an exp(ikx) phase with a k in the wrong direction. Thanks to Jesper Riishede for the bug report. MPB 1.0 (2/23/2001) * At long last, support for distributed-memory parallel machines with MPI. The computation time (and memory usage) can often improve nearly linearly with the number of processors. Thanks to Clarendon Photonics for funding this work. * Also added mpb-split script to parallelize in a simpler way, without MPI, on e.g. SMP machines, by dividing up the list of k-points among a number of serial mpb processes. * Fixed bug in mpbi where artifacts could be introduced in 3d field and dielectric-function output files. (This only affected the output files, not the frequency eigenvalues, etcetera.) Thanks to Michelle Povinelli for the bug report. * Added new material-function material type, so that you can now specify that the dielectric tensor be an arbitrary function of position. Thanks to Peter Bermel for needing this. * If MPB is configured with the flag --with-hermitian-epsilon, then complex-hermitian dielectric tensors (corresponding to magnetic materials, which break time-reversal symmetry) are supported. Thanks to Shanhui Fan for pestering me about this. * Eliminated output-copies input variable; if you want to visualize multiple unit cells, you should use mpb-data. * Added new "nothing" material that punches a hole through other objects to the background. (This is distinct from default-material when epsilon-input-file is used, or for compute-energy-in-objects.) * Fixed inability of MPB 0.13 to run under an old version (1.2) of Guile. * Now gives an error if k-point or dielectric tensor is incompatible with run-te/run-tm, or if the dielectric tensor is not positive-definite. * Default to vendor cc instead of gcc, so that C and Fortran compilers are in sync. (We default to the vendor f77 because it was probably used to compile LAPACK/BLAS, and Fortran libraries are picky.) * The manual now cites our recent publication on the methods behind MPB. * Bug fix in compute-energy-in-object-list for non-orthogonal lattices. * Bug fix in combine-band-functions and other functions of band functions, which did not handle functions of no arguments ("thunks") correctly (crashing with an error message). Thanks to Michelle Povinelli for the bug report. * Fixed a floating-point sensitivity bug in mpb-data that could cause a crash on the Alpha; thanks to Dominique Caron for the bug report and debugging information. MPB 0.13 (1/7/2001) * Can now take advantage of inversion symmetry in the geometry, gaining at least a factor of two in speed and a factor of two in memory. To use this, you configure MPB with --with-inv-symmetry; the resulting executable is installed as "mpbi" and only supports inversion symmetry, so you will usually want to install the ordinary MPB as well. * Added new eigensolver-block-size input variable, so that MPB can optionally solve for only a few bands at a time instead of all at once, reducing memory requirements and often increasing speed. * Improved handling of the singular (zero-frequency) solutions at the Gamma (k=0) point. This k point should no longer converge slowly (or cause additional problems in the targeted eigensolver). * Manual updates: please see new referencing suggestions; expanded table of contents; we now use more conventional units in diamond/fcc example. * You can now pass a "thunk" (function of no arguments) to run, and it will be evaluated once per k-point (instead of once per band per k-point as for ordinary band functions). * compute-field-energy function now also returns the fraction of the energy in the various field components. Thanks to Karl Koch for the suggestion. * The filename-prefix variable is now read each time an output function is called, instead of once per (run), so it can be changed frequently if desired. Thanks to Karl Koch for the suggestion. * Added first-brillouin-zone function to transform an arbitrary k-point into an equivalent point in the first Brillouin zone. Thanks to Payam Rabiei for the suggestion. * In mpb-data, the center of the output cell is now always identical to the origin of the coordinate system. Thanks to Michelle Povinelli for pointing out this deficiency. * Used improved spherical-quadrature formula in computing the effective dielectric tensor in 3d; this should increase accuracy somewhat at lower grid resolutions. Thanks to Doug Allan for helpful discussions. MPB 0.12 (7/9/2000) * Added fix-*field-phase functions to allow a deterministic phase in the output fields, thanks to a suggestion by Doug Allan. * Added group-velocity calculation functions (display-group-velocities, etcetera). * Added -e x,y,z option to mpb-data so that you can now specify an orientation of the output cell (e.g. to make the first axis the 111 direction of an fcc crystal). * Added (index n) substitute for epsilon property of dielectrics, equivalent to (epsilon (* n n)). * Documented new libgeom features: cone geometric object, coordinate conversion functions (reciprocal->lattice, lattice->cartesian, etc.), and vector/matrix rotation. * compute-field-energy now returns the total, unnormalized energy in the corresponding field; combined with compute-energy-in-objects, this makes it easy to do some perturbation theory and related calculations. * Eigensolver improvements. Periodic reorthogonalization and renormalization to combat some numerical problems. New line-minimization code, included with permission from MINPACK-2 by Jorge More. * Fixed breaking of 90-degree rotational symmetry-breaking by the mesh in 2d; thanks to Jim West and Doug Allan of Corning for the bug report. (In general, some symmetry-breaking by the discretization seems hard to avoid, however.) * Fixed bug in field output routines that could cause crashes for grid sizes not a multiple of 4. * Bug fix in dielectric function construction for 2d systems: we now use the xy plane at z=0 as documented, instead of z=-0.5. MPB 0.11 (2/12/2000) * configure script can now detect and link ATLAS 3.0 accelerated BLAS. * Added band-range-data output variable. * Running mpb-data multiple times on the same file now replaces the results of the previous run, instead of appending -new2, -new3, etcetera. * Fixed bug in run-even/run-odd that could seriously slow or even prevent eigensolver convergence. Thanks to Payam Rabiei for the bug report. * Fixed compilation --without-hdf5, or when HDF5 is not found. Thanks to Rajesh Rengarajan for the bug report. MPB 0.10 (1/28/2000) * Added mpb-data utility for post-processing data (e.g. for unskewing non-orthogonal lattices). See the data analysis tutorial or man mpb-data for more information. * Added new data analysis tutorial to the manual, describing how to analyze and visualize the results of two sample calculations. * Added support for a new material type, dielectric-anisotropic, so that you can specify arbitrary real/symmetric dielectric tensors. * Added new output-at-kpoint function to make it easier to output fields only at a single k-point in a band-structure calculation. * When outputting fields, output all field components (x, y, z, and real and imaginary parts) to a single HDF5 file. Also include info on the lattice and k-point vectors to facilitate post-processing. * Added new subsection to the installation manual describing some generic installation path issues on Unix that were confusing people. * Use CPPFLAGS environment variable instead of the less-standard INCLUDES to pass -I flags to the configure script (for header files in non-standard locations). * Added diamond.ctl example file for a 3d diamond (fcc) lattice of spheres. * Added (brief) mpb man page. * Fixed z-parity output and run-even/odd functions for 2d grids. * Fixed bug in output-dpwr-in-objects. Thanks to Mihai Ibanescu for the bug report. * Compilation fixes. We need to set SHELL in the Makefile for make on some systems. Also added rule to insure ctl-io.h is created before main.c is compiled. Thanks to Christoph Becher for the bug reports. MPB 0.9.1 (1/7/2000) * Fixed eigensolver bug where special handling of Gamma (k=0) point could screw up convergence for subsequent k-points, causing incorrect results. * Fixed behavior of filename-prefix input variable; thanks to Karl Koch for the bug report. MPB 0.9 (1/2/2000) * Added run-even and run-odd functions, so you can now compute only even/odd states (with respect to a z=0 mirror plane) in systems with sufficient symmetry. See also the new z-parity output variable. * Added epsilon-input-file variable, so that you can now read an arbitrary dielectric function from a file. * Field file names now include the polarization (e.g. ".tm"). * Some optimizations in the eigensolver. * Some documentation improvements; thanks to Edmond Chow for his comments. * configure should work even when there is no Fortran compiler on your system (assuming your BLAS, etc., libraries work without Fortran libs). Thanks to Antti Renko for the bug report. * Fixed problems detecting BLAS and LAPACK shared libraries in configure. Thanks to Karri Varris for the bug report. * Fixed trailing spaces in sed command, which were breaking 'make install' on some systems. Thanks to Ron Chase for the bug report. MPB 0.8.1 (11/22/1999) * Added output-hfield-x, output-dfield-y, etcetera, functions for outputting only specific field components (see manual reference section). * Sped up HDF5 field output routines. * Added output-copies variable to set the number of periods output by the band output functions (see manual reference section). MPB 0.8 (11/19/1999) * Initial public release. mpb-1.4.2/README0000644000175400001440000000072707015117057006646 MIT Photonic-Bands (http://ab-initio.mit.edu/mpb/) A program for computing photonic band structures, developed by Steven G. Johnson (stevenj@alum.mit.edu) of the Joannoupoulos Ab-Initio Physics group in the MIT Physics Department. See the MIT Photonic-Bands manual, in doc/index.html, for a complete description of the package and its user interface, as well as installation instructions, the license and copyright, contact addresses, and other important information. mpb-1.4.2/TODO0000644000175400001440000000055107537525035006461 Add more example files: more 3d crystals, strip waveguide, ... Export/import DXF, VRML, POV, ...? Import full epsilon tensor from a file. Make mpb-data pick default -n when -r is used. More eigensolver improvements...adaptive selection of an iteration technique? Try Jacobi-Davidson method with harmonic eigenvalues for targeted solver. World domination. mpb-1.4.2/acx_blas.m40000644000175400001440000001104007405732742010001 dnl @synopsis ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl This macro looks for a library that implements the BLAS dnl linear-algebra interface (see http://www.netlib.org/blas/). dnl On success, it sets the BLAS_LIBS output variable to dnl hold the requisite library linkages. dnl dnl To link with BLAS, you should link with: dnl $BLAS_LIBS $LIBS $FLIBS dnl in that order. FLIBS is the output variable of the dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), dnl and is sometimes necessary in order to link with F77 libraries. dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf dnl manual), for the same reason. dnl dnl Many libraries are searched for, from ATLAS to CXML to ESSL. dnl The user may also use --with-blas= in order to use some dnl specific BLAS library . In order to link successfully, dnl however, be aware that you will probably need to use the same dnl Fortran compiler (which can be set via the F77 env. var.) as dnl was used to compile the BLAS library. dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, dnl the default action will define HAVE_BLAS. dnl dnl This macro requires autoconf 2.50 or later. dnl dnl @version $Id: acx_blas.m4,v 1.3 2001/12/12 19:54:10 stevenj Exp $ dnl @author Steven G. Johnson AC_DEFUN([ACX_BLAS], [ AC_PREREQ(2.50) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) acx_blas_ok=no AC_ARG_WITH(blas, [AC_HELP_STRING([--with-blas=], [use BLAS library ])]) case $with_blas in yes | "") ;; no) acx_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. AC_F77_FUNC(sgemm) AC_F77_FUNC(dgemm) acx_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable if test $acx_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) AC_TRY_LINK_FUNC($sgemm, [acx_blas_ok=yes], [BLAS_LIBS=""]) AC_MSG_RESULT($acx_blas_ok) LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) if test $acx_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes]) LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test $acx_blas_ok = no; then AC_CHECK_LIB(atlas, ATL_xerbla, [AC_CHECK_LIB(f77blas, $sgemm, [AC_CHECK_LIB(cblas, cblas_dgemm, [acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas])], [], [-latlas])]) fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(dgemm, $dgemm, [AC_CHECK_LIB(sgemm, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-lblas])]) fi # BLAS in Alpha CXML library? if test $acx_blas_ok = no; then AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lcxml"]) fi # BLAS in Alpha DXML library? (now called CXML, see above) if test $acx_blas_ok = no; then AC_CHECK_LIB(dxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-ldxml"]) fi # BLAS in Sun Performance library? if test $acx_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC AC_CHECK_LIB(sunmath, acosp, [AC_CHECK_LIB(sunperf, $sgemm, [BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes],[],[-lsunmath])]) fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) if test $acx_blas_ok = no; then AC_CHECK_LIB(scs, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) fi # BLAS in SGIMATH library? if test $acx_blas_ok = no; then AC_CHECK_LIB(complib.sgimath, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(essl, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], [], [-lblas $FLIBS])]) fi # Generic BLAS library? if test $acx_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) fi AC_SUBST(BLAS_LIBS) LIBS="$acx_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_blas_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) : else acx_blas_ok=no $2 fi ])dnl ACX_BLAS mpb-1.4.2/acx_lapack.m40000644000175400001440000000610207436505417010317 dnl @synopsis ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl This macro looks for a library that implements the LAPACK dnl linear-algebra interface (see http://www.netlib.org/lapack/). dnl On success, it sets the LAPACK_LIBS output variable to dnl hold the requisite library linkages. dnl dnl To link with LAPACK, you should link with: dnl $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS dnl in that order. BLAS_LIBS is the output variable of the ACX_BLAS dnl macro, called automatically. FLIBS is the output variable of the dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), dnl and is sometimes necessary in order to link with F77 libraries. dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf dnl manual), for the same reason. dnl dnl The user may also use --with-lapack= in order to use some dnl specific LAPACK library . In order to link successfully, dnl however, be aware that you will probably need to use the same dnl Fortran compiler (which can be set via the F77 env. var.) as dnl was used to compile the LAPACK and BLAS libraries. dnl dnl ACTION-IF-FOUND is a list of shell commands to run if a LAPACK dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, dnl the default action will define HAVE_LAPACK. dnl dnl @version $Id: acx_lapack.m4,v 1.3 2002/02/25 19:05:51 stevenj Exp $ dnl @author Steven G. Johnson AC_DEFUN([ACX_LAPACK], [ AC_REQUIRE([ACX_BLAS]) acx_lapack_ok=no AC_ARG_WITH(lapack, [AC_HELP_STRING([--with-lapack=], [use LAPACK library ])]) case $with_lapack in yes | "") ;; no) acx_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac # Get fortran linker name of LAPACK function to check for. AC_F77_FUNC(cheev) # We cannot use LAPACK if BLAS is not found if test "x$acx_blas_ok" != xyes; then acx_lapack_ok=noblas fi # First, check LAPACK_LIBS environment variable if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) AC_TRY_LINK_FUNC($cheev, [acx_lapack_ok=yes], [LAPACK_LIBS=""]) AC_MSG_RESULT($acx_lapack_ok) LIBS="$save_LIBS" if test acx_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" AC_CHECK_FUNC($cheev, [acx_lapack_ok=yes]) LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_CHECK_LIB($lapack, $cheev, [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) LIBS="$save_LIBS" fi done AC_SUBST(LAPACK_LIBS) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_lapack_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) : else acx_lapack_ok=no $2 fi ])dnl ACX_LAPACK mpb-1.4.2/acx_mpi.m40000644000175400001440000000615207555700144007652 dnl @synopsis ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) dnl dnl This macro tries to find out how to compile programs that dnl use MPI (Message Passing Interface), a standard API for dnl parallel process communication (see http://www-unix.mcs.anl.gov/mpi/) dnl dnl On success, it sets the MPICC, MPICXX, or MPIF77 output variable to dnl the name of the MPI compiler, depending upon the current language. dnl (This may just be $CC/$CXX/$F77, but is more often something like dnl mpicc/mpiCC/mpif77.) It also sets MPILIBS to any libraries that are dnl needed for linking MPI (e.g. -lmpi, if a special MPICC/MPICXX/MPIF77 dnl was not found). dnl dnl If you want to compile everything with MPI, you should set: dnl dnl CC="$MPICC" #OR# CXX="$MPICXX" #OR# F77="$MPIF77" dnl LIBS="$MPILIBS $LIBS" dnl dnl The user can force a particular library/compiler by setting the dnl MPICC/MPICXX/MPIF77 and/or MPILIBS environment variables. dnl dnl ACTION-IF-FOUND is a list of shell commands to run if an MPI dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, dnl the default action will define HAVE_MPI. dnl dnl @version $Id: acx_mpi.m4,v 1.5 2002/10/24 05:08:52 stevenj Exp $ dnl @author Steven G. Johnson AC_DEFUN([ACX_MPI], [ AC_PREREQ(2.50) dnl for AC_LANG_CASE AC_LANG_CASE([C], [ AC_REQUIRE([AC_PROG_CC]) AC_CHECK_PROGS(MPICC, mpicc hcc mpcc mpcc_r mpxlc, $CC) acx_mpi_save_CC="$CC" CC="$MPICC" AC_SUBST(MPICC) ], [C++], [ AC_REQUIRE([AC_PROG_CXX]) AC_CHECK_PROGS(MPICXX, mpiCC mpCC, $CXX) acx_mpi_save_CXX="$CXX" CXX="$MPICXX" AC_SUBST(MPICXX) ], [Fortran 77], [ AC_REQUIRE([AC_PROG_F77]) AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf mpf77 mpif90 mpf90 mpxlf90 mpxlf95 mpxlf_r, $F77) acx_mpi_save_F77="$F77" F77="$MPIF77" AC_SUBST(MPIF77) ]) if test x = x"$MPILIBS"; then AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) AC_TRY_LINK([],[ call MPI_Init], [MPILIBS=" " AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) fi if test x = x"$MPILIBS"; then AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"]) fi if test x = x"$MPILIBS"; then AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) fi dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the dnl latter uses $CPP, not $CC (which may be mpicc). AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then AC_MSG_CHECKING([for mpi.h]) AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" AC_MSG_RESULT(no)]) fi], [C++], [if test x != x"$MPILIBS"; then AC_MSG_CHECKING([for mpi.h]) AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" AC_MSG_RESULT(no)]) fi]) AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], [C++], [CXX="$acx_mpi_save_CXX"], [Fortran 77], [F77="$acx_mpi_save_F77"]) AC_SUBST(MPILIBS) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x = x"$MPILIBS"; then $2 : else ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) : fi ])dnl ACX_MPI mpb-1.4.2/configure.ac0000644000175400001440000003514607631010661010254 # Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR([src/matrices/matrices.c]) AC_CONFIG_HEADER(src/config.h) MPB_VERSION=1.4.2 AC_SUBST(MPB_VERSION) AC_MSG_CHECKING([for vendor f77 to be used instead of g77]) AC_MSG_RESULT() AC_CHECK_PROGS(F77, f77 xlf77 cf77 fort77 f90 xlf90) AC_PROG_F77 # Get C compiler. AC_MSG_CHECKING([for vendor cc to be used instead of gcc]) AC_MSG_RESULT() AC_CHECK_PROGS(CC, cc xlc) # prefer vendor cc, to stay in sync with Fortran AC_PROG_CC # Checks for programs. AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_MAKE_SET # check how to transform the name of the installed program: AC_ARG_PROGRAM AC_ARG_ENABLE(single, [AC_HELP_STRING([--enable-single],[compile for single precision])], enable_single=$enableval, enable_single=no) if test "$enable_single" = "yes"; then AC_DEFINE(SCALAR_SINGLE_PREC,1,[Define to use single precision]) echo "*********************** SINGLE PRECISION ***********************" fi AC_ARG_ENABLE(debug, [AC_HELP_STRING([--enable-debug],[compile for debugging])], ok=$enableval, ok=no) if test "$ok" = "yes"; then CFLAGS="-g" AC_DEFINE(DEBUG,1,[Define to turn on debugging checks]) fi AC_ARG_ENABLE(debug-malloc, [AC_HELP_STRING([--enable-debug-malloc],[use debug malloc/free])], ok=$enableval, ok=no) if test "$ok" = "yes"; then AC_DEFINE(DEBUG_MALLOC,1,[Define to use debugging malloc/free]) fi AC_ARG_ENABLE(prof, [AC_HELP_STRING([--enable-prof],[compile for profiling])], ok=$enableval, ok=no) if test "$ok" = "yes"; then CFLAGS="$CFLAGS -pg" AC_DEFINE(ENABLE_PROF,1,[Define when using the profiler tool]) fi AC_ARG_ENABLE(checks, [AC_HELP_STRING([--disable-checks],[disable runtime checks])], ok=$enableval, ok=yes) if test "$ok" = "no"; then AC_DEFINE(CHECK_DISABLE,1,[Define to disable sanity checks in code]) fi BUILD_MPB_DATA=mpb-data # mpb-data program to build, if any AC_SUBST(BUILD_MPB_DATA) INSTALL_MPB_SPLIT=install-mpb-split # mpb-split target to install, if any AC_SUBST(INSTALL_MPB_SPLIT) AC_ARG_WITH(inv-symmetry,[AC_HELP_STRING([--with-inv-symmetry],[take advantage of (and require) inv. sym.])], inv_sym=$withval, inv_sym=no) if test "$inv_sym" = "no"; then AC_DEFINE(SCALAR_COMPLEX,1,[Define to use complex fields and not to require inversion symmetry]) SCALAR_TYPE=complex else SCALAR_TYPE=real # Make installed program mpbi instead of mpb, but don't change mpb-data program_transform_name='s,^mpb$$,mpbi,'";$program_transform_name" echo "*********************** INVERSION SYM. ***********************" fi AC_SUBST(SCALAR_TYPE) AC_ARG_WITH(hermitian-eps,[AC_HELP_STRING([--with-hermitian-eps],[allow complex-Hermitian dielectric tensors])], hermitian_epsilon=$withval, hermitian_epsilon=no) if test "$hermitian_epsilon" = "yes"; then AC_DEFINE(WITH_HERMITIAN_EPSILON,1,[Define to support Hermitian/complex dielectric tensors.]) echo "*********************** HERMITIAN EPS. ***********************" fi # Add lots of compiler warnings to check for if we are using gcc: # (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.) if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic" fi ############################################################################## # Checks for libraries: ############################################################################## AC_ARG_WITH(efence, [AC_HELP_STRING([--with-efence],[use ElectricFence library])], ok=$withval, ok=no) if test "$ok" = "yes"; then AC_CHECK_LIB(efence, malloc) fi ############################################################################## AC_CHECK_LIB(m, sqrt) # If we have a Fortran compiler, link to its libraries, since these # are probably needed to link with the BLAS/LAPACK libraries. if test x != x"$F77"; then AC_F77_LIBRARY_LDFLAGS AC_F77_WRAPPERS fi ############################################################################## # In principle, we should abort if some of the following libraries are # missing, or perhaps only compile some of the subdirectories. For now, # though, we do nothing (and wait for the compilation errors). ############################################################################## # Check for FFTW libraries if test "$enable_single" = "yes"; then AC_CHECK_LIB(sfftw, fftw) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(srfftw, rfftw) fi else AC_CHECK_LIB(dfftw, fftw) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(drfftw, rfftw) fi fi if test x = x"`echo $LIBS | egrep 'l[[ds]]fftw'`"; then AC_CHECK_LIB(fftw, fftw) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(rfftw, rfftw) fi fi if test x = x"`echo $LIBS | egrep 'l[[ds]]*fftw'`"; then AC_MSG_ERROR([The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary.]) fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[[ds]]*rfftw'`"; then AC_MSG_ERROR([The RFFTW libraries, which are required to compile MPB with inversion symmetry, could not be found. These should have been installed as a part of FFTW.]) fi fi ############################################################################## # Checks for BLAS and LAPACK libraries: sinclude(acx_blas.m4) sinclude(acx_lapack.m4) ACX_BLAS([], [AC_MSG_ERROR([BLAS was not found!])]) ACX_LAPACK([], [AC_MSG_ERROR([LAPACK was not found!])]) LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" ############################################################################## # Check for MPI library AC_ARG_WITH(mpi, [AC_HELP_STRING([--with-mpi],[enable MPI parallelization])], with_mpi=$withval, with_mpi=no) if test "x$with_mpi" = "xyes"; then sinclude(acx_mpi.m4) ACX_MPI([], [AC_MSG_ERROR(could not find mpi library for --with-mpi)]) CC="$MPICC" LIBS="$MPILIBS $LIBS" # Make installed program mpb_mpi instead of mpb if test x"$inv_sym" = xyes; then program_transform_name='s,^mpb$$,mpbi-mpi,'";$program_transform_name" else program_transform_name='s,^mpb$$,mpb-mpi,'";$program_transform_name" fi # Check for fftw_mpi library. if test "$enable_single" = "yes"; then AC_CHECK_LIB(sfftw_mpi, fftwnd_mpi) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(srfftw_mpi, rfftwnd_mpi) fi else AC_CHECK_LIB(dfftw_mpi, fftwnd_mpi) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(drfftw_mpi, rfftwnd_mpi) fi fi if test x = x"`echo $LIBS | egrep 'l[[ds]]fftw_mpi'`"; then AC_CHECK_LIB(fftw_mpi, fftwnd_mpi) if test x"$inv_sym" = xyes; then AC_CHECK_LIB(rfftw_mpi, rfftwnd_mpi) fi fi if test x = x"`echo $LIBS | egrep 'l[[ds]]*fftw_mpi'`"; then AC_MSG_ERROR([couldn't find fftw_mpi library for --with-mpi]) fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[[ds]]*rfftw_mpi'`"; then AC_MSG_ERROR([couldn't find rfftw_mpi library for --with-mpi --with-inv-symmetry]) fi fi AC_DEFINE(HAVE_MPI,1,[Define if you have & link an MPI library.]) BUILD_MPB_DATA="" # don't build/install MPI-linked mpb-data INSTALL_MPB_SPLIT="" # don't install mpb-split, since we don't know # how to run mpb-mpi in general fi ############################################################################## # Check for HDF5 library AC_ARG_WITH(hdf5, [AC_HELP_STRING([--without-hdf5],[do not use HDF5 output])], ok=$withval, ok=yes) if test "$ok" = "yes"; then AC_CHECK_LIB(z,deflate, [],[AC_MSG_WARN([zlib is required for HDF5!])]) save_LIBS_0="$LIBS" # save, to check later if we found any library AC_CHECK_LIB(hdf5, H5Pcreate, [ AC_CHECK_HEADERS(hdf5.h, [LIBS="-lhdf5 $LIBS" AC_DEFINE(HAVE_HDF5,1,[Define if we have & link HDF5])])]) if test x"$save_LIBS_0" = x"$LIBS"; then AC_MSG_WARN([Couldn't find the HDF5 library!! Switching to --without-hdf5.]) fi if test x != x"$MPILIBS"; then AC_CHECK_FUNCS(H5Pset_mpi H5Pset_fapl_mpio) fi fi ############################################################################## # Check for Guile library and flags: AC_CHECK_PROG(guile_ok, guile, yes, no) if test x"$guile_ok" = xno; then AC_MSG_ERROR([could not find guile program; check your PATH]) fi AC_CHECK_PROG(HAVE_GUILE_CONFIG, guile-config, yes, no) if test "$HAVE_GUILE_CONFIG" = "yes"; then CPPFLAGS="$CPPFLAGS `guile-config compile`" LIBS="`guile-config link` $LIBS" AC_MSG_CHECKING([if linking to guile works]) AC_TRY_LINK_FUNC(gh_enter, AC_MSG_RESULT(yes), [ AC_MSG_RESULT(no) AC_MSG_ERROR([guile-config is broken or Guile is not working.]) ]) else AC_CHECK_LIB(readline, readline) AC_CHECK_LIB(dl, dlopen) save_LIBS_0="$LIBS" # save, to check later if we found any library AC_CHECK_LIB(guile, gh_eval_str) if test x"$save_LIBS_0" = x"$LIBS"; then AC_MSG_ERROR([Couldn't find the required Guile library.]) fi fi AC_CHECK_FUNCS(scm_make_smob_type) AC_MSG_CHECKING([for SCM_SMOB_PREDICATE]) AC_TRY_LINK([#include #include ], [int x; SCM_SMOB_PREDICATE(1,x);], ok=yes, ok=no) AC_MSG_RESULT($ok) if test $ok = yes; then AC_DEFINE(HAVE_SCM_SMOB_PREDICATE, 1, [define if we have SCM_SMOB_PREDICATE]) fi AC_MSG_CHECKING([for SCM_SMOB_DATA]) AC_TRY_LINK([#include #include ], [int x; SCM_SMOB_DATA(x);], ok=yes, ok=no) AC_MSG_RESULT($ok) if test $ok = yes; then AC_DEFINE(HAVE_SCM_SMOB_DATA, 1, [define if we have SCM_SMOB_DATA]) fi AC_MSG_CHECKING([for SCM_NEWSMOB]) AC_TRY_LINK([#include #include ], [int x; SCM_NEWSMOB(x,1,0);], ok=yes, ok=no) AC_MSG_RESULT($ok) if test $ok = yes; then AC_DEFINE(HAVE_SCM_NEWSMOB, 1, [define if we have SCM_NEWSMOB]) fi # Check how to activate Guile readline support: ACTIVATE_READLINE="" AC_MSG_CHECKING(how to activate readline in Guile) ractivate="(use-modules (readline-activator)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then AC_MSG_RESULT(readline-activator) ACTIVATE_READLINE="$ractivate" else ractivate="(use-modules (ice-9 readline)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then AC_MSG_RESULT(ice-9 readline) ACTIVATE_READLINE="$ractivate" else AC_MSG_RESULT(cannot) ACTIVATE_READLINE="" fi fi AC_SUBST(ACTIVATE_READLINE) ############################################################################## # Check for libctl library and files AC_ARG_WITH(libctl, [AC_HELP_STRING([--with-libctl=],[specify libctl directory])], ok=$withval, ok=yes) if test "$ok" = "no"; then AC_MSG_ERROR([libctl is required and you may not disable it]) elif test "$ok" != "yes"; then LIBCTL_DIR="$ok" fi AC_MSG_CHECKING([for libctl dir]) if test x != x"$LIBCTL_DIR" -a ! -r "$LIBCTL_DIR/base/ctl.scm"; then LIBCTL_DIR="" fi if test x = x"$LIBCTL_DIR" -a -r /usr/local/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/local/share/libctl" fi if test x = x"$LIBCTL_DIR" -a -r /usr/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/share/libctl" fi if test x = x"$LIBCTL_DIR"; then AC_MSG_ERROR([could not find libctl files; use --with-libctl=]) fi AC_MSG_RESULT($LIBCTL_DIR) AC_SUBST(LIBCTL_DIR) AC_CHECK_PROG(gen_ctl_io_ok, gen-ctl-io, yes, no) if test x"$gen_ctl_io_ok" = xno; then AC_MSG_ERROR([could not find gen-ctl-io program; check your PATH]) fi GEN_CTL_IO=gen-ctl-io AC_SUBST(GEN_CTL_IO) # check for -lctl: AC_CHECK_LIB(ctl, ctl_get_vector3, [], [AC_MSG_ERROR([Couldn't find the required libctl library.])]) AC_CHECK_HEADER(ctl.h, [], [AC_MSG_ERROR([Couldn't find the libctl header.])]) # Check libctl version >= LIBCTL_MAJOR.LIBCTL_MINOR.LIBCTL_BUGFIX LIBCTL_MAJOR=2; LIBCTL_MINOR=1; LIBCTL_BUGFIX=1 AC_MSG_CHECKING([whether libctl version is at least ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX}]) AC_EGREP_CPP(yes, [[ #include #if LIBCTL_MAJOR_VERSION > $LIBCTL_MAJOR || (LIBCTL_MAJOR_VERSION == $LIBCTL_MAJOR && (LIBCTL_MINOR_VERSION > $LIBCTL_MINOR || (LIBCTL_MINOR_VERSION == $LIBCTL_MINOR && LIBCTL_BUGFIX_VERSION >= $LIBCTL_BUGFIX))) yes #endif ]], [AC_MSG_RESULT(ok)], [AC_MSG_ERROR([libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required])]) ############################################################################## # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h getopt.h) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE # Checks for library functions. AC_CHECK_FUNCS(getopt strncmp) ############################################################################## # Check to see if calling Fortran functions (in particular, the BLAS # complex dot product functions) works from C: AC_MSG_CHECKING([whether calling BLAS zdotc works]) AC_F77_FUNC(zdotc) AC_TRY_RUN([ #include #include typedef struct { double re, im; } cmplx; #ifdef __cplusplus extern "C" #endif extern cmplx $zdotc(int *, cmplx *, int *, cmplx *, int *); int main(void) { cmplx x[2] = { {1,0}, {0,1} }, y[2] = { {1,0}, {1,0} }; int n = 2, inc1 = 1, inc2 = 1; cmplx result = { 0, 0 }; result = $zdotc(&n, x, &inc1, y, &inc2); if (result.re != 1 || result.im != -1) return EXIT_FAILURE; else return EXIT_SUCCESS; } ], ok="yes", ok="no", ok="no") AC_MSG_RESULT($ok) if test "$ok" = "no"; then AC_DEFINE(NO_FORTRAN_FUNCTIONS,1,[Define if calling Fortran functions directly doesn't work.]) fi ############################################################################## # grab the various EIGS_ flags from eigensolver.h and substitute them # into mpb.scm.in (are not regular expressions fun?): # (note that autoconf gets unhappy if we have newlines; we must delete them) EIGS_FLAGS_SCM=`grep '#define EIGS_' $srcdir/src/matrices/eigensolver.h |sed 's/#define \([A-Za-z0-9_]*\) (1<<\([0-9]*\))/(define \1 (pow2 \2))/' |sed 's/#define \([A-Za-z0-9_]*\) (\(.*\))/(define \1 (+ \2))/' |sed 's/ *| */ /g' | tr -d '\n'` AC_SUBST(EIGS_FLAGS_SCM) ############################################################################## # Find a shell that supports job control, for mpb-split: AC_PATH_PROG(SH_JOB, bash ksh ash, sh) if test x"$SH_JOB" = xsh; then AC_MSG_WARN([Couldn't find bash or ksh shell on your system. The mpb-split command may not work if your sh doesn't support job control.]) fi ############################################################################## AC_CONFIG_FILES([Makefile tests/Makefile src/util/Makefile src/matrices/Makefile src/matrixio/Makefile src/maxwell/Makefile mpb-ctl/Makefile mpb-ctl/mpb.scm mpb-ctl/mpb-split utils/Makefile]) AC_OUTPUT mpb-1.4.2/mpb-ctl/0002755000175400001440000000000007631010727007400 5mpb-1.4.2/mpb-ctl/Makefile.in0000644000175400001440000001336607540733107011377 # libctl: flexible Guile-based control files for scientific software # Copyright (C) 1998 Steven G. Johnson # # This file may be used without restriction. It is in the public # domain, and is NOT restricted by the terms of any GNU license. # # This library 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 # Library General Public License for more details. # # Steven G. Johnson can be contacted at stevenj@alum.mit.edu. SHELL = @SHELL@ ############################################################################## # Makefile.in for programs using libctl (assumes that autoconf is # being used, of course). You should only need to change the definitions # in this section of the file. SPECIFICATION_FILE = mpb.scm PROGRAM_NAME = mpb # what is printed out when invoking your program with --version: VERSION_STRING = "MIT Photonic Bands @MPB_VERSION@, Copyright (C) 1999-2001 by MIT." # objects for program sources: OBJECTS = mpb.o epsilon.o fields.o epsilon_file.o matrix-smob.o field-smob.o \ geom.o # since we use the geom.scm utilities HEADERS = # any extra header files you are dependent on MY_LIBS = ../src/maxwell/maxwell.a \ ../src/matrixio/matrixio.a \ ../src/matrices/matrices.a \ ../src/util/util.a MY_LDFLAGS = # extra -L flags go here MY_CPPFLAGS = -I. -I../src/util -I../src/matrices -I../src/matrixio \ -I../src/maxwell MY_DEFS = -DHAVE_CTL_HOOKS=1 -DHAVE_CTL_EXPORT_HOOK=1 # The following variables should be detected and set by autoconf: # libctl install. dir., e.g. /usr/local/share/libctl LIBCTL_DIR = @LIBCTL_DIR@ # gen-ctl-io program GEN_CTL_IO = @GEN_CTL_IO@ ############################################################################## # don't (normally) edit past here # ############################################################################## CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I. $(MY_CPPFLAGS) @CPPFLAGS@ DEFS = @DEFS@ $(CTL_DEFS) $(MY_DEFS) ############################################################################## LIBS = $(MY_LIBS) @LIBS@ LDFLAGS = $(MY_LDFLAGS) @LDFLAGS@ ############################################################################## INSTALL = @INSTALL@ prefix = @prefix@ mandir = @mandir@ # c.f. AC_ARG_PROGRAM autoconf docs: transform=@program_transform_name@ @SET_MAKE@ ############################################################################## CTL_DEFS = -DCTL_SCM='"'$(LIBCTL_DIR)/base/ctl.scm'"' \ -DINCLUDE_SCM='"'$(LIBCTL_DIR)/base/include.scm'"' \ -DSPEC_SCM='"'$(prefix)/share/libctl/specs/$(SPECIFICATION_FILE)'"' \ -DVERSION_STRING='"'$(VERSION_STRING)'"' ############################################################################## ALL_OBJECTS = main.o ctl-io.o $(OBJECTS) all: $(PROGRAM_NAME) mpb-split-tmp main.o: main.c ctl-io.h mpb.o: mpb.c ctl-io.h mpb.h epsilon.o: epsilon.c ctl-io.h mpb.h fields.o: fields.c ctl-io.h mpb.h matrix-smob.o: matrix-smob.c matrix-smob.h my-smob.h ctl-io.h mpb.h field-smob.o: field-smob.c field-smob.h my-smob.h ctl-io.h mpb.h ctl-io.c ctl-io.h: $(SPECIFICATION_FILE) $(GEN_CTL_IO) $(SPECIFICATION_FILE) $(LIBCTL_DIR) # Some hackery follows. The program executable needs to have the # location of the spec file hard-coded into it. However, we have to # hard-code the location that the spec file *will* be in when it is # installed...but we would still like to be able to run the program # before installing it. So, the actual executable is named # .$(PROGRAM_NAME) (notice the leading dot), and $(PROGRAM_NAME) is a # shell script that calls the executable, specifying the uninstalled # spec file location via the --spec-file command-line argument. 'make # install' copies the real executable and spec files into their final # locations. $(PROGRAM_NAME): ctl-io.h $(ALL_OBJECTS) $(MY_LIBS) $(CC) $(LDFLAGS) $(CFLAGS) $(ALL_OBJECTS) $(LIBS) -o .$@ rm -f $@ echo '#!/bin/sh' > $@ echo `pwd`/.$@ --spec-file=`pwd`/$(SPECIFICATION_FILE) '$$*' >> $@ chmod u+x $@ main.c: $(LIBCTL_DIR)/base/main.c cp -f $(LIBCTL_DIR)/base/main.c $@ geom.c: $(LIBCTL_DIR)/utils/geom.c cp -f $(LIBCTL_DIR)/utils/geom.c $@ .c.o: $(HEADERS) ctl-io.h $(CC) -c $(DEFS) $(CPPFLAGS) $(CFLAGS) $< -o $@ # 'make install' target. This is supplied here so that you can easily # copy this Makefile into your own program, but it should not be # called for the example program included with libctl (and is not, at # least by the top-level Makefile). Two reasons: first, you don't # really want to install the example program; and second, it won't # work because LIBCTL_DIR is not set to the global (post-install) # location of libctl. install: install-mpb @INSTALL_MPB_SPLIT@ install-mpb: $(PROGRAM_NAME) $(INSTALL) -d $(prefix)/bin $(INSTALL) -m 0755 -s .$(PROGRAM_NAME) $(prefix)/bin/`echo $(PROGRAM_NAME)|sed '$(transform)'` $(INSTALL) -d $(prefix)/share/libctl/specs $(INSTALL) -m 0644 $(SPECIFICATION_FILE) $(prefix)/share/libctl/specs $(INSTALL) -d $(mandir)/man1 $(INSTALL) -m 0644 $(PROGRAM_NAME).1 $(mandir)/man1 mpb-split-tmp: rm -f mpb-split-tmp mpb_name=`echo mpb | sed '$(transform)'`; \ sed "s%\./mpb%"$(prefix)/bin/"$$mpb_name%g" mpb-split > mpb-split-tmp; install-mpb-split: mpb-split-tmp mpb_name=`echo mpb | sed '$(transform)'`; \ $(INSTALL) -m 0755 mpb-split-tmp $(prefix)/bin/$${mpb_name}-split $(INSTALL) -d $(mandir)/man1 $(INSTALL) -m 0644 mpb-split.1 $(mandir)/man1 clean: rm -f $(ALL_OBJECTS) ctl-io.c ctl-io.h main.c geom.c \ .$(PROGRAM_NAME) $(PROGRAM_NAME) core mpb-split-tmp ############################################################################## check: $(PROGRAM_NAME) ./$(PROGRAM_NAME) examples/check.ctl mpb-1.4.2/mpb-ctl/epsilon.c0000644000175400001440000002166607627001434011146 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../src/config.h" #include #include #include #include #include #include #include "mpb.h" #define USE_GEOMETRY_TREE 1 static geom_box_tree geometry_tree = NULL; /* recursive tree of geometry objects for fast searching */ /**************************************************************************/ typedef struct { maxwell_dielectric_function eps_file_func; void *eps_file_func_data; } epsilon_func_data; /* Given a position r in the basis of the lattice vectors, return the corresponding dielectric tensor and its inverse. Should be called from within init_params (or after init_params), so that the geometry input variables will have been read in (for use in libgeom). This function is passed to set_maxwell_dielectric to initialize the dielectric tensor array for eigenvector calculations. */ static void epsilon_func(symmetric_matrix *eps, symmetric_matrix *eps_inv, real r[3], void *edata) { epsilon_func_data *d = (epsilon_func_data *) edata; material_type material; vector3 p; boolean inobject; /* p needs to be in the lattice *unit* vector basis, while r is in the lattice vector basis. Also, shift origin to the center of the grid. */ p.x = (r[0] - 0.5) * geometry_lattice.size.x; p.y = dimensions <= 1 ? 0 : (r[1] - 0.5) * geometry_lattice.size.y; p.z = dimensions <= 2 ? 0 : (r[2] - 0.5) * geometry_lattice.size.z; /* call search routine from libctl/utils/libgeom/geom.c: */ #if USE_GEOMETRY_TREE material = material_of_point_in_tree_inobject(p, geometry_tree, &inobject); #else material = material_of_point_inobject(p, &inobject); #endif #if defined(DEBUG_GEOMETRY_TREE) && USE_GEOMETRY_TREE { material_type m2 = material_of_point_inobject(p, &inobject); CHECK(m2.which_subclass == material.which_subclass && m2.subclass.dielectric_data == material.subclass.dielectric_data, "material_of_point & material_of_point_in_tree don't agree!"); } #endif if (material.which_subclass == MATERIAL_TYPE_SELF) { material = default_material; inobject = 0; /* treat as a "nothing" object */ } /* if we aren't in any geometric object and we have an epsilon file, use that. */ if (!inobject && d->eps_file_func) { d->eps_file_func(eps, eps_inv, r, d->eps_file_func_data); } else { boolean destroy_material = 0; while (material.which_subclass == MATERIAL_FUNCTION) { material_type m; SCM mo; /* material_func is a Scheme function, taking a position vector and returning a material at that point: */ mo = gh_call1(material.subclass. material_function_data->material_func, ctl_convert_vector3_to_scm(p)); material_type_input(mo, &m); if (destroy_material) material_type_destroy(material); material = m; destroy_material = 1; } switch (material.which_subclass) { case DIELECTRIC: { real eps_val = material.subclass.dielectric_data->epsilon; eps->m00 = eps->m11 = eps->m22 = eps_val; eps_inv->m00 = eps_inv->m11 = eps_inv->m22 = 1.0 / eps_val; #ifdef WITH_HERMITIAN_EPSILON CASSIGN_ZERO(eps->m01); CASSIGN_ZERO(eps->m02); CASSIGN_ZERO(eps->m12); CASSIGN_ZERO(eps_inv->m01); CASSIGN_ZERO(eps_inv->m02); CASSIGN_ZERO(eps_inv->m12); #else eps->m01 = eps->m02 = eps->m12 = 0.0; eps_inv->m01 = eps_inv->m02 = eps_inv->m12 = 0.0; #endif break; } case DIELECTRIC_ANISOTROPIC: { dielectric_anisotropic *d = material.subclass.dielectric_anisotropic_data; eps->m00 = d->epsilon_diag.x; eps->m11 = d->epsilon_diag.y; eps->m22 = d->epsilon_diag.z; #ifdef WITH_HERMITIAN_EPSILON CASSIGN_SCALAR(eps->m01, d->epsilon_offdiag.x.re, d->epsilon_offdiag.x.im + d->epsilon_offdiag_imag.x); CASSIGN_SCALAR(eps->m02, d->epsilon_offdiag.y.re, d->epsilon_offdiag.y.im + d->epsilon_offdiag_imag.y); CASSIGN_SCALAR(eps->m12, d->epsilon_offdiag.z.re, d->epsilon_offdiag.z.im + d->epsilon_offdiag_imag.z); #else eps->m01 = d->epsilon_offdiag.x.re; eps->m02 = d->epsilon_offdiag.y.re; eps->m12 = d->epsilon_offdiag.z.re; CHECK(vector3_norm(vector3_plus( cvector3_im(d->epsilon_offdiag), d->epsilon_offdiag_imag)) == 0.0, "imaginary epsilon-offdiag is only supported when MPB is configured --with-hermitian-eps"); #endif maxwell_sym_matrix_invert(eps_inv, eps); break; } case MATERIAL_FUNCTION: CHECK(0, "invalid use of material-function"); break; case MATERIAL_TYPE_SELF: CHECK(0, "invalid use of material-type"); break; } if (destroy_material) material_type_destroy(material); } } /**************************************************************************/ /* Initialize the dielectric function of the global mdata structure, along with other geometry data. Should be called from init-params, or in general when global input vars have been loaded and mdata allocated. */ void init_epsilon(void) { int mesh[3], i; #if USE_GEOMETRY_TREE int tree_depth, tree_nobjects; #endif number no_size; no_size = 2.0 / ctl_get_number("infinity"); mpi_one_printf("Mesh size is %d.\n", mesh_size); mesh[0] = mesh_size; mesh[1] = (dimensions > 1) ? mesh_size : 1; mesh[2] = (dimensions > 2) ? mesh_size : 1; Rm.c0 = vector3_scale(geometry_lattice.size.x <= no_size ? 1 : geometry_lattice.size.x, geometry_lattice.basis.c0); Rm.c1 = vector3_scale(geometry_lattice.size.y <= no_size ? 1 : geometry_lattice.size.y, geometry_lattice.basis.c1); Rm.c2 = vector3_scale(geometry_lattice.size.z <= no_size ? 1 : geometry_lattice.size.z, geometry_lattice.basis.c2); mpi_one_printf("Lattice vectors:\n"); mpi_one_printf(" (%g, %g, %g)\n", Rm.c0.x, Rm.c0.y, Rm.c0.z); mpi_one_printf(" (%g, %g, %g)\n", Rm.c1.x, Rm.c1.y, Rm.c1.z); mpi_one_printf(" (%g, %g, %g)\n", Rm.c2.x, Rm.c2.y, Rm.c2.z); Vol = fabs(matrix3x3_determinant(Rm)); mpi_one_printf("Cell volume = %g\n", Vol); Gm = matrix3x3_inverse(matrix3x3_transpose(Rm)); mpi_one_printf("Reciprocal lattice vectors (/ 2 pi):\n"); mpi_one_printf(" (%g, %g, %g)\n", Gm.c0.x, Gm.c0.y, Gm.c0.z); mpi_one_printf(" (%g, %g, %g)\n", Gm.c1.x, Gm.c1.y, Gm.c1.z); mpi_one_printf(" (%g, %g, %g)\n", Gm.c2.x, Gm.c2.y, Gm.c2.z); if (eigensolver_nwork > MAX_NWORK) { mpi_one_printf("(Reducing nwork = %d to maximum: %d.)\n", eigensolver_nwork, MAX_NWORK); eigensolver_nwork = MAX_NWORK; } matrix3x3_to_arr(R, Rm); matrix3x3_to_arr(G, Gm); /* we must do this to correct for a non-orthogonal lattice basis: */ geom_fix_objects(); mpi_one_printf("Geometric objects:\n"); if (mpi_is_master()) for (i = 0; i < geometry.num_items; ++i) { display_geometric_object_info(5, geometry.items[i]); if (geometry.items[i].material.which_subclass == DIELECTRIC) printf("%*sdielectric constant epsilon = %g\n", 5 + 5, "", geometry.items[i].material. subclass.dielectric_data->epsilon); } #if USE_GEOMETRY_TREE destroy_geom_box_tree(geometry_tree); /* destroy any tree from previous runs */ geometry_tree = create_geom_box_tree(); if (verbose && mpi_is_master()) { printf("Geometry object bounding box tree:\n"); display_geom_box_tree(5, geometry_tree); } geom_box_tree_stats(geometry_tree, &tree_depth, &tree_nobjects); mpi_one_printf("Geometric object tree has depth %d and %d object nodes" " (vs. %d actual objects)\n", tree_depth, tree_nobjects, geometry.num_items); #endif mpi_one_printf("Initializing dielectric function...\n"); { epsilon_func_data d; get_epsilon_file_func(epsilon_input_file, &d.eps_file_func, &d.eps_file_func_data); set_maxwell_dielectric(mdata, mesh, R, G, epsilon_func, &d); destroy_epsilon_file_func_data(d.eps_file_func_data); } } mpb-1.4.2/mpb-ctl/epsilon_file.c0000644000175400001440000001210407442777144012145 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /**************************************************************************/ /* This file defines functions to initialize the dielectric function by reading epsilon values from a file, rather than using the geometry. Actually, we would like to use the geometry in addition to the epsilon file, for added flexibility. So, we return an epsilon function that can be used when no geometric objects are found. */ /**************************************************************************/ #include #include #include #include "../src/config.h" #include #include #include #include #include #include #include "mpb.h" typedef struct { int nx, ny, nz; real *data; } epsilon_file_data; /* Linearly interpolate a given point in a 3d grid of data. The point coordinates should be in the range [0,1). */ real linear_interpolate(real rx, real ry, real rz, real *data, int nx, int ny, int nz, int stride) { int x, y, z, x2, y2, z2; real dx, dy, dz; /* get the point corresponding to r in the epsilon array grid: */ x = rx * nx; y = ry * ny; z = rz * nz; /* get the difference between (x,y,z) and the actual point */ dx = rx * nx - x; dy = ry * ny - y; dz = rz * nz - z; /* get the other closest point in the grid, with periodic boundaries: */ x2 = (nx + (dx >= 0.0 ? x + 1 : x - 1)) % nx; y2 = (ny + (dy >= 0.0 ? y + 1 : y - 1)) % ny; z2 = (nz + (dz >= 0.0 ? z + 1 : z - 1)) % nz; /* take abs(d{xyz}) to get weights for {xyz} and {xyz}2: */ dx = fabs(dx); dy = fabs(dy); dz = fabs(dz); /* define a macro to give us data(x,y,z) on the grid, in row-major order (the order used by HDF5): */ #define D(x,y,z) (data[(((x)*ny + (y))*nz + (z)) * stride]) return(((D(x,y,z)*(1.0-dx) + D(x2,y,z)*dx) * (1.0-dy) + (D(x,y2,z)*(1.0-dx) + D(x2,y2,z)*dx) * dy) * (1.0-dz) + ((D(x,y,z2)*(1.0-dx) + D(x2,y,z2)*dx) * (1.0-dy) + (D(x,y2,z2)*(1.0-dx) + D(x2,y2,z2)*dx) * dy) * dz); #undef D } static void epsilon_file_func(symmetric_matrix *eps, symmetric_matrix *eps_inv, real r[3], void *edata) { epsilon_file_data *d = (epsilon_file_data *) edata; real rx, ry, rz; real eps_val; /* make sure r is positive: */ rx = r[0] >= 0.0 ? r[0] : (r[0] + (1 + (int) (-r[0]))); ry = r[1] >= 0.0 ? r[1] : (r[1] + (1 + (int) (-r[1]))); rz = r[2] >= 0.0 ? r[2] : (r[2] + (1 + (int) (-r[2]))); /* make sure r is in [0,1) */ rx = rx < 1.0 ? rx : rx - ((int) rx); ry = ry < 1.0 ? ry : ry - ((int) ry); rz = rz < 1.0 ? rz : rz - ((int) rz); eps_val = linear_interpolate(rx,ry,rz, d->data, d->nx,d->ny,d->nz, 1); eps->m00 = eps->m11 = eps->m22 = eps_val; eps_inv->m00 = eps_inv->m11 = eps_inv->m22 = 1.0 / eps_val; #ifdef WITH_HERMITIAN_EPSILON CASSIGN_ZERO(eps->m01); CASSIGN_ZERO(eps->m02); CASSIGN_ZERO(eps->m12); CASSIGN_ZERO(eps_inv->m01); CASSIGN_ZERO(eps_inv->m02); CASSIGN_ZERO(eps_inv->m12); #else eps->m01 = eps->m02 = eps->m12 = 0.0; eps_inv->m01 = eps_inv->m02 = eps_inv->m12 = 0.0; #endif } void get_epsilon_file_func(const char *fname, maxwell_dielectric_function *func, void **func_data) { if (fname && fname[0]) { char *eps_fname; matrixio_id file_id; epsilon_file_data *d; int rank = 3, dims[3]; CHK_MALLOC(d, epsilon_file_data, 1); eps_fname = ctl_fix_path(fname); mpi_one_printf("Using background dielectric from file \"%s\"...\n", eps_fname); file_id = matrixio_open(eps_fname, 1); free(eps_fname); d->data = matrixio_read_real_data(file_id, NULL, &rank, dims, 0,0,0, NULL); CHECK(d->data, "couldn't find dataset in dielectric file"); matrixio_close(file_id); d->nx = rank >= 1 ? dims[0] : 1; d->ny = rank >= 2 ? dims[1] : 1; d->nz = rank >= 3 ? dims[2] : 1; mpi_one_printf(" ...read %dx%dx%d dielectric function\n", d->nx, d->ny, d->nz); *func = epsilon_file_func; *func_data = (void*) d; } else { *func = NULL; *func_data = NULL; } } void destroy_epsilon_file_func_data(void *func_data) { epsilon_file_data *d = (epsilon_file_data *) func_data; if (d) { free(d->data); free(d); } } mpb-1.4.2/mpb-ctl/field-smob.c0000644000175400001440000003657007540771033011521 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include "../src/config.h" #include #include #include #include "field-smob.h" #include "mpb.h" /* null mark function, for smobs containing no SCM objects */ static SCM mark_null(SCM obj) { (void) obj; return SCM_BOOL_F; } /*************************************************************************/ long scm_tc16_smob_field_smob = 0; static SCM field_p(SCM obj) { return gh_bool2scm(FIELD_P(obj)); } static SCM rscalar_field_p(SCM obj) { return gh_bool2scm(RSCALAR_FIELD_P(obj)); } static SCM cvector_field_p(SCM obj) { return gh_bool2scm(CVECTOR_FIELD_P(obj)); } static int print_field_smob(SCM obj, SCM port, scm_print_state *pstate) { char buf[256]; field_smob *pf = FIELD(obj); (void) pstate; /* unused argument */ scm_puts("#nx, pf->ny, pf->nz); scm_puts(buf, port); switch (pf->type) { case RSCALAR_FIELD_SMOB: scm_puts(" real scalar field", port); break; case CVECTOR_FIELD_SMOB: scm_puts(" complex vector field", port); break; } if (pf->local_ny < pf->ny) { sprintf(buf, ", y=%d-%d local", pf->local_y_start, pf->local_y_start + pf->local_ny - 1); scm_puts(buf, port); } scm_putc('>', port); return 1; } static size_t free_field_smob(SCM obj) { field_smob *pf = FIELD(obj); free(pf->f.rs); free(pf); return 0; } #define mark_field_smob mark_null SCM field2scm(field_smob *pf) { SCM obj; NEWCELL_SMOB(obj, field_smob, pf); return obj; } /*************************************************************************/ void register_field_smobs(void) { #ifdef HAVE_SCM_MAKE_SMOB_TYPE scm_tc16_smob_field_smob = scm_make_smob_type("field", 0); scm_set_smob_free(scm_tc16_smob_field_smob, free_field_smob); scm_set_smob_print(scm_tc16_smob_field_smob, print_field_smob); #else /* old way to register smobs */ MAKE_SMOBFUNS(field_smob); REGISTER_SMOBFUNS(field_smob); #endif gh_new_procedure("field?", field_p, 1, 0, 0); gh_new_procedure("rscalar-field?", rscalar_field_p, 1, 0, 0); gh_new_procedure("cvector-field?", cvector_field_p, 1, 0, 0); } /*************************************************************************/ static field_smob curfield_smob; field_smob *update_curfield_smob(void) { CHECK(mdata, "init-params must be called before manipulating fields"); curfield_smob.nx = mdata->nx; curfield_smob.ny = mdata->ny; curfield_smob.nz = mdata->nz; curfield_smob.N = mdata->fft_output_size; curfield_smob.local_ny = mdata->local_ny; curfield_smob.local_y_start = mdata->local_y_start; curfield_smob.last_dim = mdata->last_dim; curfield_smob.last_dim_size = mdata->last_dim_size; curfield_smob.other_dims = mdata->other_dims; curfield_smob.type_char = curfield_type; if (strchr("dhecv", curfield_type)) { /* complex vector field */ curfield_smob.type = CVECTOR_FIELD_SMOB; curfield_smob.f.cv = curfield; } else if (strchr("DHnR", curfield_type)) { /* real scalar field */ curfield_smob.type = RSCALAR_FIELD_SMOB; curfield_smob.f.rs = (real *) curfield; } else { curfield_smob.type = RSCALAR_FIELD_SMOB; /* arbitrary */ curfield_smob.f.rs = (real *) curfield; if (!curfield_smob.f.rs) curfield_smob.f.rs = (real *) mdata->fft_data; return 0; } return &curfield_smob; } static void update_curfield(field_smob *pf) { if (pf == &curfield_smob) { curfield_type = curfield_smob.type_char; curfield = curfield_smob.f.cv; } } boolean cur_fieldp(SCM obj) { if (SCM_NIMP(obj) && SCM_SYMBOLP(obj)) { char *s = gh_symbol2newstr(obj, NULL); int ret = !strcmp(s, "cur-field"); free(s); return ret; } return 0; } /*************************************************************************/ field_smob *assert_field_smob(SCM fo) { field_smob *f = SAFE_FIELD(fo); CHECK(f, "wrong type argument: expecting field"); return f; } /*************************************************************************/ SCM rscalar_field_make(SCM f0) { int i; field_smob *pf; field_smob *pf0 = assert_field_smob(f0); CHK_MALLOC(pf, field_smob, 1); *pf = *pf0; pf->type = RSCALAR_FIELD_SMOB; pf->type_char = 'R'; CHK_MALLOC(pf->f.rs, real, pf->N); for (i = 0; i < pf->N; ++i) pf->f.rs[i] = 0.0; return field2scm(pf); } SCM cvector_field_make(SCM f0) { int i; field_smob *pf; field_smob *pf0 = assert_field_smob(f0); CHECK(mdata, "init-params must be called before rscalar-field-make"); CHK_MALLOC(pf, field_smob, 1); *pf = *pf0; pf->type = CVECTOR_FIELD_SMOB; pf->type_char = 'c'; CHK_MALLOC(pf->f.cv, scalar_complex, 3 * pf->N); for (i = 0; i < pf->N * 3; ++i) CASSIGN_ZERO(pf->f.cv[i]); return field2scm(pf); } void cvector_field_nonblochB(SCM f) { field_smob *pf = assert_field_smob(f); pf->type_char = 'v'; update_curfield(pf); } SCM field_make(SCM f0) { field_smob *pf0 = assert_field_smob(f0); switch (pf0->type) { case RSCALAR_FIELD_SMOB: return rscalar_field_make(f0); case CVECTOR_FIELD_SMOB: return cvector_field_make(f0); } return SCM_UNDEFINED; } static boolean fields_conform(field_smob *f1, field_smob *f2) { #define EQF(field) (f1->field == f2->field) return (EQF(nx) && EQF(ny) && EQF(nz) && EQF(N) && EQF(local_ny) && EQF(local_y_start) && EQF(last_dim) && EQF(last_dim_size) && EQF(other_dims)); #undef EQF } boolean fields_conformp(SCM f1o, SCM f2o) { field_smob *f1 = assert_field_smob(f1o); field_smob *f2 = assert_field_smob(f2o); return fields_conform(f1, f2); } static void field_set(field_smob *fd, field_smob *fs) { int i; CHECK(fd->type == fs->type && fields_conform(fd, fs), "fields for field-set! must conform"); switch (fs->type) { case RSCALAR_FIELD_SMOB: CHECK(fs->type_char != '-', "must load field for field-set!"); for (i = 0; i < fs->N; ++i) fd->f.rs[i] = fs->f.rs[i]; break; case CVECTOR_FIELD_SMOB: CHECK(fs->type_char != '-', "must load field for field-set!"); for (i = 0; i < fs->N * 3; ++i) fd->f.cv[i] = fs->f.cv[i]; break; } fd->type_char = fs->type_char; update_curfield(fd); } void field_setB(SCM dest, SCM src) { field_smob *fd = assert_field_smob(dest); field_smob *fs = assert_field_smob(src); field_set(fd, fs); } void field_load(SCM src) { field_smob *fs = assert_field_smob(src); CHECK(mdata, "init-params must be called before field-load"); update_curfield_smob(); CHECK(fields_conform(fs, &curfield_smob), "argument for field-load must conform to current size"); curfield_smob.type = fs->type; field_set(&curfield_smob, fs); } void field_mapLB(SCM dest, function f, SCM_list src) { field_smob *pd = assert_field_smob(dest); field_smob **ps; int i, j; CHK_MALLOC(ps, field_smob *, src.num_items); for (j = 0; j < src.num_items; ++j) { ps[j] = assert_field_smob(src.items[j]); CHECK(fields_conform(pd, ps[j]), "fields for field-map! must conform"); } for (i = 0; i < pd->N; ++i) { list arg_list = SCM_EOL; SCM result; for (j = src.num_items - 1; j >= 0; --j) { SCM item = SCM_EOL; switch (ps[j]->type) { case RSCALAR_FIELD_SMOB: item = gh_double2scm(ps[j]->f.rs[i]); break; case CVECTOR_FIELD_SMOB: item = cvector32scm(cscalar32cvector3(ps[j]->f.cv+3*i)); break; } arg_list = gh_cons(item, arg_list); } result = gh_apply(f, arg_list); switch (pd->type) { case RSCALAR_FIELD_SMOB: pd->f.rs[i] = gh_scm2double(result); break; case CVECTOR_FIELD_SMOB: cvector32cscalar3(pd->f.cv+3*i, scm2cvector3(result)); break; } } free(ps); if (src.num_items == 1 && ps[0]->type == pd->type) pd->type_char = ps[0]->type_char; else if (src.num_items > 1) switch (pd->type) { case RSCALAR_FIELD_SMOB: pd->type_char = 'R'; break; case CVECTOR_FIELD_SMOB: pd->type_char = 'c'; break; } update_curfield(pd); } /*************************************************************************/ static cvector3 cvector3_conj(cvector3 c) { cvector3 cc; cc.x = cnumber_conj(c.x); cc.y = cnumber_conj(c.y); cc.z = cnumber_conj(c.z); return cc; } /* Compute the integral of f(r, {fields}) over the cell. */ cnumber integrate_fieldL(function f, SCM_list fields) { int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; #ifdef HAVE_MPI int local_n2, local_y_start, local_n3; #endif real s1, s2, s3, c1, c2, c3; int ifield; field_smob **pf; cnumber integral = {0,0}; CHK_MALLOC(pf, field_smob *, fields.num_items); for (ifield = 0; ifield < fields.num_items; ++ifield) { pf[ifield] = assert_field_smob(fields.items[ifield]); CHECK(fields_conform(pf[0], pf[ifield]), "fields for integrate-fields must conform"); } if (fields.num_items > 0) { n1 = pf[0]->nx; n2 = pf[0]->ny; n3 = pf[0]->nz; n_other = pf[0]->other_dims; n_last = pf[0]->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); last_dim = pf[0]->last_dim; } else { n1 = mdata->nx; n2 = mdata->ny; n3 = mdata->nz; n_other = mdata->other_dims; n_last = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); last_dim = mdata->last_dim; } rank = (n3 == 1) ? (n2 == 1 ? 1 : 2) : 3; s1 = geometry_lattice.size.x / n1; s2 = geometry_lattice.size.y / n2; s3 = geometry_lattice.size.z / n3; c1 = n1 <= 1 ? 0 : geometry_lattice.size.x * 0.5; c2 = n2 <= 1 ? 0 : geometry_lattice.size.y * 0.5; c3 = n3 <= 1 ? 0 : geometry_lattice.size.z * 0.5; /* Here we have different loops over the coordinates, depending upon whether we are using complex or real and serial or parallel transforms. Each loop must define, in its body, variables (i2,j2,k2) describing the coordinate of the current point, and "index" describing the corresponding index in the curfield array. This was all stolen from maxwell_eps.c...it would be better if we didn't have to cut and paste, sigh. */ #ifdef SCALAR_COMPLEX # ifndef HAVE_MPI for (i = 0; i < n1; ++i) for (j = 0; j < n2; ++j) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j, k2 = k; int index = ((i * n2 + j) * n3 + k); # else /* HAVE_MPI */ if (fields.num_items > 0) { local_n2 = pf[0]->local_ny; local_y_start = pf[0]->local_y_start; } else { local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; } /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j + local_y_start, k2 = k; int index = ((j * n1 + i) * n3 + k); # endif /* HAVE_MPI */ #else /* not SCALAR_COMPLEX */ # ifndef HAVE_MPI for (i = 0; i < n_other; ++i) for (j = 0; j < n_last; ++j) { int index = i * n_last + j; int i2, j2, k2; switch (rank) { case 2: i2 = i; j2 = j; k2 = 0; break; case 3: i2 = i / n2; j2 = i % n2; k2 = j; break; default: i2 = j; j2 = k2 = 0; break; } # else /* HAVE_MPI */ if (fields.num_items > 0) { local_n2 = pf[0]->local_ny; local_y_start = pf[0]->local_y_start; } else { local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; } /* For a real->complex transform, the last dimension is cut in half. For a 2d transform, this is taken into account in local_ny already, but for a 3d transform we must compute the new n3: */ if (n3 > 1) { if (fields.num_items > 0) local_n3 = pf[0]->last_dim_size / 2; else local_n3 = mdata->last_dim_size / 2; } else local_n3 = 1; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < local_n3; ++k) { # define i2 i int j2 = j + local_y_start; # define k2 k int index = ((j * n1 + i) * local_n3 + k); # endif /* HAVE_MPI */ #endif /* not SCALAR_COMPLEX */ { list arg_list = SCM_EOL; cnumber integrand; vector3 p; p.x = i2 * s1 - c1; p.y = j2 * s2 - c2; p.z = k2 * s3 - c3; for (ifield = fields.num_items - 1; ifield >= 0; --ifield) { SCM item = SCM_EOL; switch (pf[ifield]->type) { case RSCALAR_FIELD_SMOB: item = gh_double2scm(pf[ifield]->f.rs[index]); break; case CVECTOR_FIELD_SMOB: item = cvector32scm(cscalar32cvector3( pf[ifield]->f.cv+3*index)); break; } arg_list = gh_cons(item, arg_list); } arg_list = gh_cons(vector32scm(p), arg_list); integrand = ctl_convert_cnumber_to_c(gh_apply(f, arg_list)); integral.re += integrand.re; integral.im += integrand.im; #ifndef SCALAR_COMPLEX { int last_index; # ifdef HAVE_MPI if (n3 == 1) last_index = j + local_y_start; else last_index = k; # else last_index = j; # endif if (last_index != 0 && 2*last_index != last_dim) { int i2c, j2c, k2c; i2c = i2 ? (n1 - i2) : 0; j2c = j2 ? (n2 - j2) : 0; k2c = k2 ? (n3 - k2) : 0; p.x = i2c * s1 - c1; p.y = j2c * s2 - c2; p.z = k2c * s3 - c3; arg_list = SCM_EOL; for (ifield = fields.num_items - 1; ifield >= 0; --ifield) { SCM item; switch (pf[ifield]->type) { case RSCALAR_FIELD_SMOB: item = gh_double2scm( pf[ifield]->f.rs[index]); break; case CVECTOR_FIELD_SMOB: item = cvector32scm( cvector3_conj(cscalar32cvector3( pf[ifield]->f.cv+3*index))); break; } arg_list = gh_cons(item, arg_list); } arg_list = gh_cons(vector32scm(p), arg_list); integrand = ctl_convert_cnumber_to_c(gh_apply(f, arg_list)); integral.re += integrand.re; integral.im += integrand.im; } } #endif } } free(pf); integral.re *= Vol / (n1 * n2 * n3); integral.im *= Vol / (n1 * n2 * n3); { cnumber integral_sum; mpi_allreduce(&integral, &integral_sum, 2, number, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); return integral_sum; } } mpb-1.4.2/mpb-ctl/field-smob.h0000644000175400001440000000335707537540643011532 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef FIELD_SMOB_H #define FIELD_SMOB_H #include "ctl-io.h" #include "my-smob.h" #include extern long scm_tc16_smob_field_smob; typedef enum { RSCALAR_FIELD_SMOB, CVECTOR_FIELD_SMOB } field_smob_type; typedef struct { field_smob_type type; char type_char; union { real *rs; scalar_complex *cv; } f; int nx, ny, nz, N; int local_ny, local_y_start; int last_dim, last_dim_size, other_dims; } field_smob; #define FIELD_P(X) T_SMOB_P(field_smob, X) #define FIELD(X) T_SMOB(field_smob, X) #define SAFE_FIELD(X) (cur_fieldp(X) ? update_curfield_smob() : SAFE_T_SMOB(field_smob, X)) #define RSCALAR_FIELD_P(X) (FIELD_P(X) && ((FIELD(X))->type == RSCALAR_FIELD_SMOB)) #define CVECTOR_FIELD_P(X) (FIELD_P(X) && ((FIELD(X))->type == CVECTOR_FIELD_SMOB)) extern field_smob *update_curfield_smob(void); extern void register_field_smobs(void); extern field_smob *assert_field_smob(SCM fo); #endif /* FIELD_SMOB_H */ mpb-1.4.2/mpb-ctl/fields.c0000644000175400001440000014427707540771033010752 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include #include #include "../src/config.h" #include #include #include #include #include #include #include #include "mpb.h" #include "field-smob.h" /**************************************************************************/ /* The following routines take the eigenvectors computed by solve-kpoint and compute the field (D, H, or E) in position space for one of the bands. This field is stored in the global curfield (actually an alias for mdata->fft_data, since the latter is unused and big enough). This field can then be manipulated with subsequent "*-field-*" functions below. You can also get the scalar field, epsilon. All of these functions are designed to be called by the user via Guile. */ void get_dfield(int which_band) { if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called before get-dfield!\n"); return; } if (!kpoint_index) { mpi_one_fprintf(stderr, "solve-kpoint must be called before get-dfield!\n"); return; } if (which_band < 1 || which_band > H.p) { mpi_one_fprintf(stderr, "must have 1 <= band index <= num_bands (%d)\n",H.p); return; } curfield = (scalar_complex *) mdata->fft_data; curfield_band = which_band; curfield_type = 'd'; maxwell_compute_d_from_H(mdata, H, curfield, which_band - 1, 1); /* Here, we correct for the fact that compute_d_from_H actually computes just (k+G) x H, whereas the actual D field is i/omega i(k+G) x H...so, there is an added factor of -1/omega. We also divide by the cell volume so that the integral of |H|^2 or of D*E is unity. (From the eigensolver + FFT, they are initially normalized to sum to nx*ny*nz.) */ { int i, N; double scale; N = mdata->fft_output_size; if (freqs.items[which_band - 1] != 0.0) { scale = -1.0 / freqs.items[which_band - 1]; } else scale = -1.0; /* arbitrary */ scale /= sqrt(Vol); for (i = 0; i < 3*N; ++i) { curfield[i].re *= scale; curfield[i].im *= scale; } } } void get_hfield(integer which_band) { if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called before get-hfield!\n"); return; } if (!kpoint_index) { mpi_one_fprintf(stderr, "solve-kpoint must be called before get-hfield!\n"); return; } if (which_band < 1 || which_band > H.p) { mpi_one_fprintf(stderr, "must have 1 <= band index <= num_bands (%d)\n",H.p); return; } curfield = (scalar_complex *) mdata->fft_data; curfield_band = which_band; curfield_type = 'h'; maxwell_compute_h_from_H(mdata, H, curfield, which_band - 1, 1); /* Divide by the cell volume so that the integral of |H|^2 or of D*E is unity. (From the eigensolver + FFT, they are initially normalized to sum to nx*ny*nz.) */ { int i, N; double scale; N = mdata->fft_output_size; scale = 1.0 / sqrt(Vol); for (i = 0; i < 3*N; ++i) { curfield[i].re *= scale; curfield[i].im *= scale; } } } void get_efield_from_dfield(void) { if (!curfield || curfield_type != 'd') { mpi_one_fprintf(stderr, "get-dfield must be called before " "get-efield-from-dfield!\n"); return; } CHECK(mdata, "unexpected NULL mdata"); maxwell_compute_e_from_d(mdata, curfield, 1); curfield_type = 'e'; } void get_efield(integer which_band) { get_dfield(which_band); get_efield_from_dfield(); } /* Extract the mean epsilon from the effective inverse dielectric tensor, which contains two eigenvalues that correspond to the mean epsilon, and one which corresponds to the harmonic mean. */ static real mean_epsilon(const symmetric_matrix *eps_inv) { real eps_eigs[3]; maxwell_sym_matrix_eigs(eps_eigs, eps_inv); /* the harmonic mean should be the largest eigenvalue (smallest epsilon), so we'll ignore it and average the other two: */ return 2.0 / (eps_eigs[0] + eps_eigs[1]); } /* get the dielectric function, and compute some statistics */ void get_epsilon(void) { int i, N, last_dim, last_dim_stored, nx, nz, local_y_start; real *epsilon; real eps_mean = 0, eps_inv_mean = 0, eps_high = -1e20, eps_low = 1e20; int fill_count = 0; if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called before get-epsilon!\n"); return; } curfield = (scalar_complex *) mdata->fft_data; epsilon = (real *) curfield; curfield_band = 0; curfield_type = 'n'; /* get epsilon. Recall that we actually have an inverse dielectric tensor at each point; define an average index by the inverse of the average eigenvalue of the 1/eps tensor. i.e. 3/(trace 1/eps). */ N = mdata->fft_output_size; last_dim = mdata->last_dim; last_dim_stored = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); nx = mdata->nx; nz = mdata->nz; local_y_start = mdata->local_y_start; for (i = 0; i < N; ++i) { epsilon[i] = mean_epsilon(mdata->eps_inv + i); if (epsilon[i] < eps_low) eps_low = epsilon[i]; if (epsilon[i] > eps_high) eps_high = epsilon[i]; eps_mean += epsilon[i]; eps_inv_mean += 1/epsilon[i]; if (epsilon[i] > 1.0001) ++fill_count; #ifndef SCALAR_COMPLEX /* most points need to be counted twice, by rfftw output symmetry: */ { int last_index; # ifdef HAVE_MPI if (nz == 1) /* 2d calculation: 1st dim. is truncated one */ last_index = i / nx + local_y_start; else last_index = i % last_dim_stored; # else last_index = i % last_dim_stored; # endif if (last_index != 0 && 2*last_index != last_dim) { eps_mean += epsilon[i]; eps_inv_mean += 1/epsilon[i]; if (epsilon[i] > 1.0001) ++fill_count; } } #endif } mpi_allreduce_1(&eps_mean, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); mpi_allreduce_1(&eps_inv_mean, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); mpi_allreduce_1(&eps_low, real, SCALAR_MPI_TYPE, MPI_MIN, MPI_COMM_WORLD); mpi_allreduce_1(&eps_high, real, SCALAR_MPI_TYPE, MPI_MAX, MPI_COMM_WORLD); mpi_allreduce_1(&fill_count, int, MPI_INT, MPI_SUM, MPI_COMM_WORLD); N = mdata->nx * mdata->ny * mdata->nz; eps_mean /= N; eps_inv_mean = N/eps_inv_mean; mpi_one_printf("epsilon: %g-%g, mean %g, harm. mean %g, " "%g%% > 1, %g%% \"fill\"\n", eps_low, eps_high, eps_mean, eps_inv_mean, (100.0 * fill_count) / N, eps_high == eps_low ? 100.0 : 100.0 * (eps_mean-eps_low) / (eps_high-eps_low)); } /* get the specified component of the dielectric tensor, or the inverse tensor if inv != 0 */ void get_epsilon_tensor(int c1, int c2, int imag, int inv) { int i, N; real *epsilon; int conj = 0, offset = 0; curfield_type = '-'; /* only used internally, for now */ epsilon = (real *) mdata->fft_data; N = mdata->fft_output_size; switch (c1 * 3 + c2) { case 0: offset = offsetof(symmetric_matrix, m00); break; case 1: offset = offsetof(symmetric_matrix, m01); break; case 2: offset = offsetof(symmetric_matrix, m02); break; case 3: offset = offsetof(symmetric_matrix, m01); /* = conj(m10) */ conj = imag; break; case 4: offset = offsetof(symmetric_matrix, m11); break; case 5: offset = offsetof(symmetric_matrix, m12); break; case 6: offset = offsetof(symmetric_matrix, m02); /* = conj(m20) */ conj = imag; break; case 7: offset = offsetof(symmetric_matrix, m12); /* = conj(m21) */ conj = imag; break; case 8: offset = offsetof(symmetric_matrix, m22); break; } #ifdef WITH_HERMITIAN_EPSILON if (c1 != c2 && imag) offset += offsetof(scalar_complex, im); #endif for (i = 0; i < N; ++i) { if (inv) { epsilon[i] = *((real *) (((char *) &mdata->eps_inv[i]) + offset)); } else { symmetric_matrix eps; maxwell_sym_matrix_invert(&eps, &mdata->eps_inv[i]); epsilon[i] = *((real *) (((char *) &eps) + offset)); } if (conj) epsilon[i] = -epsilon[i]; } } /**************************************************************************/ /* Replace curfield (either d or h) with the scalar energy density function, normalized to one. While we're at it, compute some statistics about the relative strength of different field components. Also return the integral of the energy density, which should be unity. */ number_list compute_field_energy(void) { int i, N, last_dim, last_dim_stored, nx, nz, local_y_start; real comp_sum2[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, comp_sum[6]; real energy_sum = 0.0; real *energy_density = (real *) curfield; number_list retval = { 0, 0 }; if (!curfield || !strchr("dh", curfield_type)) { mpi_one_fprintf(stderr, "The D or H field must be loaded first.\n"); return retval; } N = mdata->fft_output_size; last_dim = mdata->last_dim; last_dim_stored = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); nx = mdata->nx; nz = mdata->nz; local_y_start = mdata->local_y_start; for (i = 0; i < N; ++i) { scalar_complex field[3]; real comp_sqr0,comp_sqr1,comp_sqr2,comp_sqr3,comp_sqr4,comp_sqr5; /* energy is either |curfield|^2 or |curfield|^2 / epsilon, depending upon whether it is H or D. */ if (curfield_type == 'h') { field[0] = curfield[3*i]; field[1] = curfield[3*i+1]; field[2] = curfield[3*i+2]; } else assign_symmatrix_vector(field, mdata->eps_inv[i], curfield+3*i); comp_sum2[0] += comp_sqr0 = field[0].re * curfield[3*i].re; comp_sum2[1] += comp_sqr1 = field[0].im * curfield[3*i].im; comp_sum2[2] += comp_sqr2 = field[1].re * curfield[3*i+1].re; comp_sum2[3] += comp_sqr3 = field[1].im * curfield[3*i+1].im; comp_sum2[4] += comp_sqr4 = field[2].re * curfield[3*i+2].re; comp_sum2[5] += comp_sqr5 = field[2].im * curfield[3*i+2].im; /* Note: here, we write to energy_density[i]; this is safe, even though energy_density is aliased to curfield, since energy_density[i] is guaranteed to come at or before curfield[i] (which we are now done with). */ energy_sum += energy_density[i] = comp_sqr0+comp_sqr1+comp_sqr2+comp_sqr3+comp_sqr4+comp_sqr5; #ifndef SCALAR_COMPLEX /* most points need to be counted twice, by rfftw output symmetry: */ { int last_index; # ifdef HAVE_MPI if (nz == 1) /* 2d calculation: 1st dim. is truncated one */ last_index = i / nx + local_y_start; else last_index = i % last_dim_stored; # else last_index = i % last_dim_stored; # endif if (last_index != 0 && 2*last_index != last_dim) { energy_sum += energy_density[i]; comp_sum2[0] += comp_sqr0; comp_sum2[1] += comp_sqr1; comp_sum2[2] += comp_sqr2; comp_sum2[3] += comp_sqr3; comp_sum2[4] += comp_sqr4; comp_sum2[5] += comp_sqr5; } } #endif } mpi_allreduce_1(&energy_sum, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); mpi_allreduce(comp_sum2, comp_sum, 6, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); mpi_one_printf("%c-energy-components:, %d, %d", curfield_type, kpoint_index, curfield_band); for (i = 0; i < 6; ++i) { comp_sum[i] /= (energy_sum == 0 ? 1 : energy_sum); if (i % 2 == 1) mpi_one_printf(", %g", comp_sum[i] + comp_sum[i-1]); } mpi_one_printf("\n"); /* remember that we now have energy density; denoted by capital D/H */ curfield_type = toupper(curfield_type); /* The return value is a list of 7 items: the total energy, followed by the 6 elements of the comp_sum array (the fraction of the energy in the real/imag. parts of each field component). */ retval.num_items = 7; CHK_MALLOC(retval.items, number, retval.num_items); retval.items[0] = energy_sum * Vol / H.N; for (i = 0; i < 6; ++i) retval.items[i+1] = comp_sum[i]; return retval; } /**************************************************************************/ /* Fix the phase of the current field (e/h/d) to a canonical value. Also changes the phase of the corresponding eigenvector by the same amount, so that future calculations will have a consistent phase. The following procedure is used, derived from a suggestion by Doug Allan of Corning: First, choose the phase to maximize the sum of the squares of the real parts of the components. This doesn't fix the overall sign, though. That is done (after incorporating the above phase) by: (1) find the largest absolute value of the real part, (2) find the point with the greatest spatial array index that has |real part| at least half of the largest value, and (3) make that point positive. In the case of inversion symmetry, on the other hand, the overall phase is already fixed, to within a sign, by the choice to make the Fourier transform purely real. So, in that case we simply pick a sign, in a manner similar to (2) and (3) above. */ void fix_field_phase(void) { int i, N; real sq_sum2[2] = {0,0}, sq_sum[2], maxabs = 0.0; int maxabs_index = 0, maxabs_sign = 1; double theta; scalar phase; if (!curfield || !strchr("dhecv", curfield_type)) { mpi_one_fprintf(stderr, "The D/H/E field must be loaded first.\n"); return; } N = mdata->fft_output_size * 3; #ifdef SCALAR_COMPLEX /* Compute the phase that maximizes the sum of the squares of the real parts of the components. Equivalently, maximize the real part of the sum of the squares. */ for (i = 0; i < N; ++i) { real a,b; a = curfield[i].re; b = curfield[i].im; sq_sum2[0] += a*a - b*b; sq_sum2[1] += 2*a*b; } mpi_allreduce(sq_sum2, sq_sum, 2, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); /* compute the phase = exp(i*theta) maximizing the real part of the sum of the squares. i.e., maximize: cos(2*theta)*sq_sum[0] - sin(2*theta)*sq_sum[1] */ theta = 0.5 * atan2(-sq_sum[1], sq_sum[0]); phase.re = cos(theta); phase.im = sin(theta); #else /* ! SCALAR_COMPLEX */ phase = 1; #endif /* ! SCALAR_COMPLEX */ /* Next, fix the overall sign. We do this by first computing the maximum |real part| of the jmax component (after multiplying by phase), and then finding the last spatial index at which |real part| is at least half of this value. The sign is then chosen to make the real part positive at that point. (Note that we can't just make the point of maximum |real part| positive, as that would be ambiguous in the common case of an oscillating field within the unit cell.) In the case of inversion symmetry (!SCALAR_COMPLEX), we work with (real part - imag part) instead of (real part), to insure that we have something that is nonzero somewhere. */ for (i = 0; i < N; ++i) { #ifdef SCALAR_COMPLEX real r = fabs(curfield[i].re * phase.re - curfield[i].im * phase.im); #else real r = fabs(curfield[i].re - curfield[i].im); #endif if (r > maxabs) maxabs = r; } mpi_allreduce_1(&maxabs, real, SCALAR_MPI_TYPE, MPI_MAX, MPI_COMM_WORLD); for (i = N - 1; i >= 0; --i) { #ifdef SCALAR_COMPLEX real r = curfield[i].re * phase.re - curfield[i].im * phase.im; #else real r = curfield[i].re - curfield[i].im; #endif if (fabs(r) >= 0.5 * maxabs) { maxabs_index = i; maxabs_sign = r < 0 ? -1 : 1; break; } } if (i >= 0) /* convert index to global index in distributed array: */ maxabs_index += mdata->local_y_start * mdata->nx * mdata->nz; { /* compute maximum index and corresponding sign over all the processors, using the MPI_MAXLOC reduction operation: */ struct twoint_struct {int i; int s;} x; x.i = maxabs_index; x.s = maxabs_sign; mpi_allreduce_1(&x, struct twoint_struct, MPI_2INT, MPI_MAXLOC, MPI_COMM_WORLD); maxabs_index = x.i; maxabs_sign = x.s; } ASSIGN_SCALAR(phase, SCALAR_RE(phase)*maxabs_sign, SCALAR_IM(phase)*maxabs_sign); mpi_one_printf("Fixing %c-field (band %d) phase by %g + %gi; " "max ampl. = %g\n", curfield_type, curfield_band, SCALAR_RE(phase), SCALAR_IM(phase), maxabs); /* Now, multiply everything by this phase, *including* the stored "raw" eigenvector in H, so that any future fields that we compute will have a consistent phase: */ for (i = 0; i < N; ++i) { real a,b; a = curfield[i].re; b = curfield[i].im; curfield[i].re = a*SCALAR_RE(phase) - b*SCALAR_IM(phase); curfield[i].im = a*SCALAR_IM(phase) + b*SCALAR_RE(phase); } for (i = 0; i < H.n; ++i) { ASSIGN_MULT(H.data[i*H.p + curfield_band - 1], H.data[i*H.p + curfield_band - 1], phase); } } /**************************************************************************/ /* Functions to return epsilon, fields, energies, etcetera, at a specified point, linearly interpolating if necessary. */ static real get_val(int ix, int iy, int iz, int nx, int ny, int nz, int last_dim_size, real *data, int stride, int conjugate) { #ifndef SCALAR_COMPLEX { int nlast = last_dim_size / 2; if ((nz > 1 ? iz : (ny > 1 ? iy : ix)) >= nlast) { ix = ix ? nx - ix : ix; iy = iy ? ny - iy : iy; iz = iz ? nz - iz : iz; conjugate = conjugate ? 1 : 0; } else conjugate = 0; if (nz > 1) nz = nlast; else if (ny > 1) ny = nlast; else nx = nlast; } #else conjugate = 0; #endif #ifdef HAVE_MPI CHECK(0, "get-*-point not yet implemented for MPI!"); #else if (conjugate) return -data[(((ix * ny) + iy) * nz + iz) * stride]; else return data[(((ix * ny) + iy) * nz + iz) * stride]; #endif } static real interp_val(vector3 p, int nx, int ny, int nz, int last_dim_size, real *data, int stride, int conjugate) { double ipart; real rx, ry, rz, dx, dy, dz; int x, y, z, x2, y2, z2; rx = modf(p.x/geometry_lattice.size.x + 0.5, &ipart); if (rx < 0) rx += 1; ry = modf(p.y/geometry_lattice.size.y + 0.5, &ipart); if (ry < 0) ry += 1; rz = modf(p.z/geometry_lattice.size.z + 0.5, &ipart); if (rz < 0) rz += 1; /* get the point corresponding to r in the grid: */ x = rx * nx; y = ry * ny; z = rz * nz; /* get the difference between (x,y,z) and the actual point */ dx = rx * nx - x; dy = ry * ny - y; dz = rz * nz - z; /* get the other closest point in the grid, with periodic boundaries: */ x2 = (nx + (dx >= 0.0 ? x + 1 : x - 1)) % nx; y2 = (ny + (dy >= 0.0 ? y + 1 : y - 1)) % ny; z2 = (nz + (dz >= 0.0 ? z + 1 : z - 1)) % nz; /* take abs(d{xyz}) to get weights for {xyz} and {xyz}2: */ dx = fabs(dx); dy = fabs(dy); dz = fabs(dz); #define D(x,y,z) (get_val(x,y,z,nx,ny,nz,last_dim_size, data,stride,conjugate)) return(((D(x,y,z)*(1.0-dx) + D(x2,y,z)*dx) * (1.0-dy) + (D(x,y2,z)*(1.0-dx) + D(x2,y2,z)*dx) * dy) * (1.0-dz) + ((D(x,y,z2)*(1.0-dx) + D(x2,y,z2)*dx) * (1.0-dy) + (D(x,y2,z2)*(1.0-dx) + D(x2,y2,z2)*dx) * dy) * dz); #undef D } static scalar_complex interp_cval(vector3 p, int nx, int ny, int nz, int last_dim_size, real *data, int stride) { scalar_complex cval; cval.re = interp_val(p, nx,ny,nz,last_dim_size, data, stride, 0); cval.im = interp_val(p, nx,ny,nz,last_dim_size,data + 1, stride, 1); return cval; } #define f_interp_val(p,f,data,stride,conj) interp_val(p,f->nx,f->ny,f->nz,f->last_dim_size,data,stride,conj) #define f_interp_cval(p,f,data,stride) interp_cval(p,f->nx,f->ny,f->nz,f->last_dim_size,data,stride) static symmetric_matrix interp_eps_inv(vector3 p) { int stride = sizeof(symmetric_matrix) / sizeof(real); symmetric_matrix eps_inv; eps_inv.m00 = f_interp_val(p, mdata, &mdata->eps_inv->m00, stride, 0); eps_inv.m11 = f_interp_val(p, mdata, &mdata->eps_inv->m11, stride, 0); eps_inv.m22 = f_interp_val(p, mdata, &mdata->eps_inv->m22, stride, 0); #ifdef WITH_HERMITIAN_EPSILON eps_inv.m01 = f_interp_cval(p, mdata, &mdata->eps_inv->m01.re, stride); eps_inv.m02 = f_interp_cval(p, mdata, &mdata->eps_inv->m02.re, stride); eps_inv.m12 = f_interp_cval(p, mdata, &mdata->eps_inv->m12.re, stride); #else eps_inv.m01 = f_interp_val(p, mdata, &mdata->eps_inv->m01, stride, 0); eps_inv.m02 = f_interp_val(p, mdata, &mdata->eps_inv->m02, stride, 0); eps_inv.m12 = f_interp_val(p, mdata, &mdata->eps_inv->m12, stride, 0); #endif return eps_inv; } number get_epsilon_point(vector3 p) { symmetric_matrix eps_inv; eps_inv = interp_eps_inv(p); return mean_epsilon(&eps_inv); } cmatrix3x3 get_epsilon_inverse_tensor_point(vector3 p) { symmetric_matrix eps_inv; eps_inv = interp_eps_inv(p); #ifdef WITH_HERMITIAN_EPSILON return make_hermitian_cmatrix3x3(eps_inv.m00,eps_inv.m11,eps_inv.m22, cscalar2cnumber(eps_inv.m01), cscalar2cnumber(eps_inv.m02), cscalar2cnumber(eps_inv.m12)); #else return make_hermitian_cmatrix3x3(eps_inv.m00,eps_inv.m11,eps_inv.m22, make_cnumber(eps_inv.m01,0), make_cnumber(eps_inv.m02,0), make_cnumber(eps_inv.m12,0)); #endif } number get_energy_point(vector3 p) { CHECK(curfield && strchr("DHR", curfield_type), "compute-field-energy must be called before get-energy-point"); return f_interp_val(p, mdata, (real *) curfield, 1, 0); } cvector3 get_bloch_field_point(vector3 p) { scalar_complex field[3]; cvector3 F; CHECK(curfield && strchr("dhecv", curfield_type), "field must be must be loaded before get-*field*-point"); field[0] = f_interp_cval(p, mdata, &curfield[0].re, 6); field[1] = f_interp_cval(p, mdata, &curfield[1].re, 6); field[2] = f_interp_cval(p, mdata, &curfield[2].re, 6); F.x = cscalar2cnumber(field[0]); F.y = cscalar2cnumber(field[1]); F.z = cscalar2cnumber(field[2]); return F; } cvector3 get_field_point(vector3 p) { scalar_complex field[3], phase; cvector3 F; CHECK(curfield && strchr("dhecv", curfield_type), "field must be must be loaded before get-*field*-point"); field[0] = f_interp_cval(p, mdata, &curfield[0].re, 6); field[1] = f_interp_cval(p, mdata, &curfield[1].re, 6); field[2] = f_interp_cval(p, mdata, &curfield[2].re, 6); if (curfield_type != 'v') { double phase_phi = TWOPI * (cur_kvector.x * (p.x/geometry_lattice.size.x+0.5) + cur_kvector.y * (p.y/geometry_lattice.size.y+0.5) + cur_kvector.z * (p.z/geometry_lattice.size.z+0.5)); CASSIGN_SCALAR(phase, cos(phase_phi), sin(phase_phi)); CASSIGN_MULT(field[0], field[0], phase); CASSIGN_MULT(field[1], field[1], phase); CASSIGN_MULT(field[2], field[2], phase); } F.x = cscalar2cnumber(field[0]); F.y = cscalar2cnumber(field[1]); F.z = cscalar2cnumber(field[2]); return F; } number rscalar_field_get_point(SCM fo, vector3 p) { field_smob *f = assert_field_smob(fo); CHECK(f->type == RSCALAR_FIELD_SMOB, "invalid argument to rscalar-field-get-point"); return f_interp_val(p, f, f->f.rs, 1, 0); } cvector3 cvector_field_get_point_bloch(SCM fo, vector3 p) { scalar_complex field[3]; cvector3 F; field_smob *f = assert_field_smob(fo); CHECK(f->type == CVECTOR_FIELD_SMOB, "invalid argument to cvector-field-get-point"); field[0] = f_interp_cval(p, f, &f->f.cv[0].re, 6); field[1] = f_interp_cval(p, f, &f->f.cv[1].re, 6); field[2] = f_interp_cval(p, f, &f->f.cv[2].re, 6); F.x = cscalar2cnumber(field[0]); F.y = cscalar2cnumber(field[1]); F.z = cscalar2cnumber(field[2]); return F; } cvector3 cvector_field_get_point(SCM fo, vector3 p) { scalar_complex field[3]; cvector3 F; field_smob *f = assert_field_smob(fo); CHECK(f->type == CVECTOR_FIELD_SMOB, "invalid argument to cvector-field-get-point"); field[0] = f_interp_cval(p, f, &f->f.cv[0].re, 6); field[1] = f_interp_cval(p, f, &f->f.cv[1].re, 6); field[2] = f_interp_cval(p, f, &f->f.cv[2].re, 6); if (f->type_char != 'v') { /* v fields have no kvector */ scalar_complex phase; double phase_phi = TWOPI * (cur_kvector.x * (p.x/geometry_lattice.size.x+0.5) + cur_kvector.y * (p.y/geometry_lattice.size.y+0.5) + cur_kvector.z * (p.z/geometry_lattice.size.z+0.5)); CASSIGN_SCALAR(phase, cos(phase_phi), sin(phase_phi)); CASSIGN_MULT(field[0], field[0], phase); CASSIGN_MULT(field[1], field[1], phase); CASSIGN_MULT(field[2], field[2], phase); } F.x = cscalar2cnumber(field[0]); F.y = cscalar2cnumber(field[1]); F.z = cscalar2cnumber(field[2]); return F; } /**************************************************************************/ /* compute the fraction of the field energy that is located in the given range of dielectric constants: */ number compute_energy_in_dielectric(number eps_low, number eps_high) { int N, i, last_dim, last_dim_stored, nx, nz, local_y_start; real *energy = (real *) curfield; real epsilon, energy_sum = 0.0; if (!curfield || !strchr("DHR", curfield_type)) { mpi_one_fprintf(stderr, "The D or H energy density must be loaded first.\n"); return 0.0; } N = mdata->fft_output_size; last_dim = mdata->last_dim; last_dim_stored = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); nx = mdata->nx; nz = mdata->nz; local_y_start = mdata->local_y_start; for (i = 0; i < N; ++i) { epsilon = mean_epsilon(mdata->eps_inv +i); if (epsilon >= eps_low && epsilon <= eps_high) { energy_sum += energy[i]; #ifndef SCALAR_COMPLEX /* most points are counted twice, by rfftw output symmetry: */ { int last_index; # ifdef HAVE_MPI if (nz == 1) /* 2d: 1st dim. is truncated one */ last_index = i / nx + local_y_start; else last_index = i % last_dim_stored; # else last_index = i % last_dim_stored; # endif if (last_index != 0 && 2*last_index != last_dim) energy_sum += energy[i]; } #endif } } mpi_allreduce_1(&energy_sum, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); energy_sum *= Vol / H.N; return energy_sum; } /**************************************************************************/ /* Prepend the prefix to the fname, and (if parity_suffix is true) append a parity specifier (if any) (e.g. ".te"), returning a new string, which should be deallocated with free(). fname or prefix may be NULL, in which case they are treated as the empty string. */ static char *fix_fname(const char *fname, const char *prefix, maxwell_data *d, int parity_suffix) { char *s; CHK_MALLOC(s, char, (fname ? strlen(fname) : 0) + (prefix ? strlen(prefix) : 0) + 20); strcpy(s, prefix ? prefix : ""); strcat(s, fname ? fname : ""); if (parity_suffix && d->parity != NO_PARITY) { /* assumes parity suffix is less than 20 characters; currently it is less than 12 */ strcat(s, "."); strcat(s, parity_string(d)); } return s; } static void output_scalarfield(real *vals, const int dims[3], const int local_dims[3], const int start[3], matrixio_id file_id, const char *dataname, int last_dim_index, int last_dim_start, int last_dim_size, int first_dim_start, int first_dim_size, int write_start0_special) { matrixio_id data_id = -1; fieldio_write_real_vals(vals, 3, dims, local_dims, start, file_id, 0, dataname, &data_id); #ifndef SCALAR_COMPLEX { int start_new[3], local_dims_new[3]; start_new[0] = start[0]; start_new[1] = start[1]; start_new[2] = start[2]; local_dims_new[0] = local_dims[0]; local_dims_new[1] = local_dims[1]; local_dims_new[2] = local_dims[2]; maxwell_scalarfield_otherhalf(mdata, vals); start_new[last_dim_index] = last_dim_start; local_dims_new[last_dim_index] = last_dim_size; start_new[0] = first_dim_start; local_dims_new[0] = first_dim_size; if (write_start0_special) { /* The conjugated array half may be discontiguous. First, write the part not containing start_new[0], and then write the start_new[0] slab. */ fieldio_write_real_vals(vals + local_dims_new[1] * local_dims_new[2], 3, dims, local_dims_new, start_new, file_id, 1, dataname, &data_id); local_dims_new[0] = 1; start_new[0] = 0; fieldio_write_real_vals(vals, 3, dims, local_dims_new, start_new, file_id, 1, dataname, &data_id); } else { fieldio_write_real_vals(vals, 3, dims, local_dims_new, start_new, file_id, 1, dataname, &data_id); } } #endif if (data_id >= 0) matrixio_close_dataset(data_id); } /* given the field in curfield, store it to HDF (or whatever) using the matrixio (fieldio) routines. Allow the component to be specified (which_component 0/1/2 = x/y/z, -1 = all) for vector fields. Also allow the user to specify a prefix string for the filename. */ void output_field_to_file(integer which_component, string filename_prefix) { char fname[100], *fname2, description[100]; int dims[3], local_dims[3], start[3] = {0,0,0}; matrixio_id file_id = -1; int attr_dims[2] = {3, 3}; real output_k[3]; /* kvector in reciprocal lattice basis */ real output_R[3][3]; /* where to put "otherhalf" block of output, only used for real scalars */ int last_dim_index = 0; int last_dim_start = 0, last_dim_size = 0; int first_dim_start = 0, first_dim_size = 0; int write_start0_special = 0; if (!curfield) { mpi_one_fprintf(stderr, "fields, energy dens., or epsilon must be loaded first.\n"); return; } #ifdef HAVE_MPI /* The first two dimensions (x and y) of the position-space fields are transposed when we use MPI, so we need to transpose everything. */ dims[0] = mdata->ny; local_dims[1] = dims[1] = mdata->nx; local_dims[2] = dims[2] = mdata->nz; local_dims[0] = mdata->local_ny; start[0] = mdata->local_y_start; # ifndef SCALAR_COMPLEX /* Ugh, hairy. See also maxwell_vectorfield_otherhalf. */ if (dims[2] == 1) { last_dim_index = 0; first_dim_size = local_dims[0]; first_dim_start = dims[0] - (start[0] + local_dims[0] - 1); if (start[0] == 0) --first_dim_size; /* DC frequency is not in other half */ if (start[0] + local_dims[0] == mdata->last_dim_size / 2 && dims[0] % 2 == 0) { --first_dim_size; /* Nyquist frequency is not in other half */ ++first_dim_start; } last_dim_start = first_dim_start; last_dim_size = first_dim_size; } else { last_dim_index = 2; local_dims[last_dim_index] = mdata->last_dim_size / 2; if (start[0] == 0) { first_dim_size = local_dims[0] - 1; first_dim_start = dims[0] - first_dim_size; write_start0_special = 1; } else { first_dim_start = dims[0] - (start[0] + local_dims[0] - 1); first_dim_size = local_dims[0]; } last_dim_start = local_dims[last_dim_index]; last_dim_size = dims[last_dim_index] - local_dims[last_dim_index]; } # endif /* ! SCALAR_COMPLEX */ output_k[0] = R[1][0]*mdata->current_k[0] + R[1][1]*mdata->current_k[1] + R[1][2]*mdata->current_k[2]; output_k[1] = R[0][0]*mdata->current_k[0] + R[0][1]*mdata->current_k[1] + R[0][2]*mdata->current_k[2]; output_k[2] = R[2][0]*mdata->current_k[0] + R[2][1]*mdata->current_k[1] + R[2][2]*mdata->current_k[2]; output_R[0][0]=R[1][0]; output_R[0][1]=R[1][1]; output_R[0][2]=R[1][2]; output_R[1][0]=R[0][0]; output_R[1][1]=R[0][1]; output_R[1][2]=R[0][2]; output_R[2][0]=R[2][0]; output_R[2][1]=R[2][1]; output_R[2][2]=R[2][2]; #else /* ! HAVE_MPI */ dims[0] = mdata->nx; local_dims[1] = dims[1] = mdata->ny; local_dims[2] = dims[2] = mdata->nz; local_dims[0] = mdata->local_nx; # ifndef SCALAR_COMPLEX last_dim_index = dims[2] == 1 ? (dims[1] == 1 ? 0 : 1) : 2; local_dims[last_dim_index] = mdata->last_dim_size / 2; last_dim_start = local_dims[last_dim_index]; last_dim_size = dims[last_dim_index] - local_dims[last_dim_index]; first_dim_start = last_dim_index ? 0 : last_dim_start; first_dim_size = last_dim_index ? local_dims[0] : last_dim_size; # endif start[0] = mdata->local_x_start; output_k[0] = R[0][0]*mdata->current_k[0] + R[0][1]*mdata->current_k[1] + R[0][2]*mdata->current_k[2]; output_k[1] = R[1][0]*mdata->current_k[0] + R[1][1]*mdata->current_k[1] + R[1][2]*mdata->current_k[2]; output_k[2] = R[2][0]*mdata->current_k[0] + R[2][1]*mdata->current_k[1] + R[2][2]*mdata->current_k[2]; output_R[0][0]=R[0][0]; output_R[0][1]=R[0][1]; output_R[0][2]=R[0][2]; output_R[1][0]=R[1][0]; output_R[1][1]=R[1][1]; output_R[1][2]=R[1][2]; output_R[2][0]=R[2][0]; output_R[2][1]=R[2][1]; output_R[2][2]=R[2][2]; #endif /* ! HAVE_MPI */ if (strchr("Rv", curfield_type)) /* generic scalar/vector field */ output_k[0] = output_k[1] = output_k[2] = 0.0; /* don't know k */ if (strchr("dhecv", curfield_type)) { /* outputting vector field */ matrixio_id data_id[6] = {-1,-1,-1,-1,-1,-1}; int i; sprintf(fname, "%c.k%02d.b%02d", curfield_type, kpoint_index, curfield_band); if (which_component >= 0) { char comp_str[] = ".x"; comp_str[1] = 'x' + which_component; strcat(fname, comp_str); } sprintf(description, "%c field, kpoint %d, band %d, freq=%g", curfield_type, kpoint_index, curfield_band, freqs.items[curfield_band - 1]); fname2 = fix_fname(fname, filename_prefix, mdata, 1); mpi_one_printf("Outputting fields to %s...\n", fname2); file_id = matrixio_create(fname2); free(fname2); fieldio_write_complex_field(curfield, 3, dims, local_dims, start, which_component, output_k, file_id, 0, data_id); #ifndef SCALAR_COMPLEX /* Here's where it gets hairy. */ maxwell_vectorfield_otherhalf(mdata, curfield, output_k[0], output_k[1], output_k[2]); start[last_dim_index] = last_dim_start; local_dims[last_dim_index] = last_dim_size; start[0] = first_dim_start; local_dims[0] = first_dim_size; if (write_start0_special) { /* The conjugated array half may be discontiguous. First, write the part not containing start[0], and then write the start[0] slab. */ fieldio_write_complex_field(curfield + 3 * local_dims[1] * local_dims[2], 3, dims, local_dims, start, which_component, NULL, file_id, 1, data_id); local_dims[0] = 1; start[0] = 0; fieldio_write_complex_field(curfield, 3, dims,local_dims,start, which_component, NULL, file_id, 1, data_id); } else { fieldio_write_complex_field(curfield, 3, dims,local_dims,start, which_component, NULL, file_id, 1, data_id); } #endif for (i = 0; i < 6; ++i) if (data_id[i] >= 0) matrixio_close_dataset(data_id[i]); matrixio_write_data_attr(file_id, "Bloch wavevector", output_k, 1, attr_dims); } else if (strchr("DHnR", curfield_type)) { /* scalar field */ if (curfield_type == 'n') { sprintf(fname, "epsilon"); sprintf(description, "dielectric function, epsilon"); } else { sprintf(fname, "%cpwr.k%02d.b%02d", tolower(curfield_type), kpoint_index, curfield_band); sprintf(description, "%c field energy density, kpoint %d, band %d, freq=%g", curfield_type, kpoint_index, curfield_band, freqs.items[curfield_band - 1]); } fname2 = fix_fname(fname, filename_prefix, mdata, /* no parity suffix for epsilon: */ curfield_type != 'n'); mpi_one_printf("Outputting %s...\n", fname2); file_id = matrixio_create(fname2); free(fname2); output_scalarfield((real *) curfield, dims, local_dims, start, file_id, "data", last_dim_index, last_dim_start, last_dim_size, first_dim_start, first_dim_size, write_start0_special); if (curfield_type == 'n') { int c1, c2, inv; char dataname[100]; for (inv = 0; inv < 2; ++inv) for (c1 = 0; c1 < 3; ++c1) for (c2 = c1; c2 < 3; ++c2) { get_epsilon_tensor(c1,c2, 0, inv); sprintf(dataname, "%s.%c%c", inv ? "epsilon_inverse" : "epsilon", c1 + 'x', c2 + 'x'); output_scalarfield((real *) curfield, dims, local_dims, start, file_id, dataname, last_dim_index, last_dim_start, last_dim_size, first_dim_start, first_dim_size, write_start0_special); #if defined(WITH_HERMITIAN_EPSILON) if (c1 != c2) { get_epsilon_tensor(c1,c2, 1, inv); strcat(dataname, ".i"); #ifndef SCALAR_COMPLEX /* scalarfield_otherhalf isn't right */ strcat(dataname, ".screwy"); #endif output_scalarfield((real *) curfield, dims, local_dims, start, file_id, dataname, last_dim_index, last_dim_start, last_dim_size, first_dim_start, first_dim_size, write_start0_special); } #endif } } } else mpi_one_fprintf(stderr, "unknown field type!\n"); if (file_id >= 0) { matrixio_write_data_attr(file_id, "lattice vectors", &output_R[0][0], 2, attr_dims); matrixio_write_string_attr(file_id, "description", description); matrixio_close(file_id); } /* We have destroyed curfield (by multiplying it by phases, and/or reorganizing in the case of real-amplitude fields). */ curfield_reset(); } /**************************************************************************/ /* For curfield an energy density, compute the fraction of the energy that resides inside the given list of geometric objects. Later objects in the list have precedence, just like the ordinary geometry list. */ number compute_energy_in_object_list(geometric_object_list objects) { int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; #ifdef HAVE_MPI int local_n2, local_y_start, local_n3; #endif real s1, s2, s3, c1, c2, c3; real *energy = (real *) curfield; real energy_sum = 0; if (!curfield || !strchr("DHR", curfield_type)) { mpi_one_fprintf(stderr, "The D or H energy density must be loaded first.\n"); return 0.0; } for (i = 0; i < objects.num_items; ++i) geom_fix_object(objects.items[i]); n1 = mdata->nx; n2 = mdata->ny; n3 = mdata->nz; n_other = mdata->other_dims; n_last = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); last_dim = mdata->last_dim; rank = (n3 == 1) ? (n2 == 1 ? 1 : 2) : 3; s1 = geometry_lattice.size.x / n1; s2 = geometry_lattice.size.y / n2; s3 = geometry_lattice.size.z / n3; c1 = n1 <= 1 ? 0 : geometry_lattice.size.x * 0.5; c2 = n2 <= 1 ? 0 : geometry_lattice.size.y * 0.5; c3 = n3 <= 1 ? 0 : geometry_lattice.size.z * 0.5; /* Here we have different loops over the coordinates, depending upon whether we are using complex or real and serial or parallel transforms. Each loop must define, in its body, variables (i2,j2,k2) describing the coordinate of the current point, and "index" describing the corresponding index in the curfield array. This was all stolen from maxwell_eps.c...it would be better if we didn't have to cut and paste, sigh. */ #ifdef SCALAR_COMPLEX # ifndef HAVE_MPI for (i = 0; i < n1; ++i) for (j = 0; j < n2; ++j) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j, k2 = k; int index = ((i * n2 + j) * n3 + k); # else /* HAVE_MPI */ local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j + local_y_start, k2 = k; int index = ((j * n1 + i) * n3 + k); # endif /* HAVE_MPI */ #else /* not SCALAR_COMPLEX */ # ifndef HAVE_MPI for (i = 0; i < n_other; ++i) for (j = 0; j < n_last; ++j) { int index = i * n_last + j; int i2, j2, k2; switch (rank) { case 2: i2 = i; j2 = j; k2 = 0; break; case 3: i2 = i / n2; j2 = i % n2; k2 = j; break; default: i2 = j; j2 = k2 = 0; break; } # else /* HAVE_MPI */ local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; /* For a real->complex transform, the last dimension is cut in half. For a 2d transform, this is taken into account in local_ny already, but for a 3d transform we must compute the new n3: */ if (n3 > 1) local_n3 = mdata->last_dim_size / 2; else local_n3 = 1; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < local_n3; ++k) { # define i2 i int j2 = j + local_y_start; # define k2 k int index = ((j * n1 + i) * local_n3 + k); # endif /* HAVE_MPI */ #endif /* not SCALAR_COMPLEX */ { vector3 p; int n; p.x = i2 * s1 - c1; p.y = j2 * s2 - c2; p.z = k2 * s3 - c3; for (n = objects.num_items - 1; n >= 0; --n) if (point_in_periodic_fixed_objectp(p, objects.items[n])) { if (objects.items[n].material.which_subclass == MATERIAL_TYPE_SELF) break; /* treat as a "nothing" object */ energy_sum += energy[index]; #ifndef SCALAR_COMPLEX { int last_index; # ifdef HAVE_MPI if (n3 == 1) last_index = j + local_y_start; else last_index = k; # else last_index = j; # endif if (last_index != 0 && 2*last_index != last_dim) energy_sum += energy[index]; } #endif break; } } } mpi_allreduce_1(&energy_sum, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); energy_sum *= Vol / H.N; return energy_sum; } /**************************************************************************/ /* Compute the integral of f(energy/field, epsilon, r) over the cell. */ cnumber compute_field_integral(function f) { int i, j, k, n1, n2, n3, n_other, n_last, rank, last_dim; #ifdef HAVE_MPI int local_n2, local_y_start, local_n3; #endif real s1, s2, s3, c1, c2, c3; int integrate_energy; real *energy = (real *) curfield; cnumber integral = {0,0}; vector3 kvector = {0,0,0}; if (!curfield || !strchr("dheDHRcv", curfield_type)) { mpi_one_fprintf(stderr, "The D or H energy/field must be loaded first.\n"); return integral; } if (curfield_type != 'v') kvector = cur_kvector; integrate_energy = strchr("DHR", curfield_type) != NULL; n1 = mdata->nx; n2 = mdata->ny; n3 = mdata->nz; n_other = mdata->other_dims; n_last = mdata->last_dim_size / (sizeof(scalar_complex)/sizeof(scalar)); last_dim = mdata->last_dim; rank = (n3 == 1) ? (n2 == 1 ? 1 : 2) : 3; s1 = geometry_lattice.size.x / n1; s2 = geometry_lattice.size.y / n2; s3 = geometry_lattice.size.z / n3; c1 = n1 <= 1 ? 0 : geometry_lattice.size.x * 0.5; c2 = n2 <= 1 ? 0 : geometry_lattice.size.y * 0.5; c3 = n3 <= 1 ? 0 : geometry_lattice.size.z * 0.5; /* Here we have different loops over the coordinates, depending upon whether we are using complex or real and serial or parallel transforms. Each loop must define, in its body, variables (i2,j2,k2) describing the coordinate of the current point, and "index" describing the corresponding index in the curfield array. This was all stolen from maxwell_eps.c...it would be better if we didn't have to cut and paste, sigh. */ #ifdef SCALAR_COMPLEX # ifndef HAVE_MPI for (i = 0; i < n1; ++i) for (j = 0; j < n2; ++j) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j, k2 = k; int index = ((i * n2 + j) * n3 + k); # else /* HAVE_MPI */ local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < n3; ++k) { int i2 = i, j2 = j + local_y_start, k2 = k; int index = ((j * n1 + i) * n3 + k); # endif /* HAVE_MPI */ #else /* not SCALAR_COMPLEX */ # ifndef HAVE_MPI for (i = 0; i < n_other; ++i) for (j = 0; j < n_last; ++j) { int index = i * n_last + j; int i2, j2, k2; switch (rank) { case 2: i2 = i; j2 = j; k2 = 0; break; case 3: i2 = i / n2; j2 = i % n2; k2 = j; break; default: i2 = j; j2 = k2 = 0; break; } # else /* HAVE_MPI */ local_n2 = mdata->local_ny; local_y_start = mdata->local_y_start; /* For a real->complex transform, the last dimension is cut in half. For a 2d transform, this is taken into account in local_ny already, but for a 3d transform we must compute the new n3: */ if (n3 > 1) local_n3 = mdata->last_dim_size / 2; else local_n3 = 1; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < local_n3; ++k) { # define i2 i int j2 = j + local_y_start; # define k2 k int index = ((j * n1 + i) * local_n3 + k); # endif /* HAVE_MPI */ #endif /* not SCALAR_COMPLEX */ { real epsilon; vector3 p; epsilon = mean_epsilon(mdata->eps_inv + index); p.x = i2 * s1 - c1; p.y = j2 * s2 - c2; p.z = k2 * s3 - c3; if (integrate_energy) { integral.re += ctl_convert_number_to_c( gh_call3(f, ctl_convert_number_to_scm(energy[index]), ctl_convert_number_to_scm(epsilon), ctl_convert_vector3_to_scm(p))); } else { cvector3 F; double phase_phi; scalar_complex phase; cnumber integrand; phase_phi = TWOPI * (kvector.x * (p.x/geometry_lattice.size.x+0.5) + kvector.y * (p.y/geometry_lattice.size.y+0.5) + kvector.z * (p.z/geometry_lattice.size.z+0.5)); CASSIGN_SCALAR(phase, cos(phase_phi), sin(phase_phi)); CASSIGN_MULT_RE(F.x.re, curfield[3*index+0], phase); CASSIGN_MULT_IM(F.x.im, curfield[3*index+0], phase); CASSIGN_MULT_RE(F.y.re, curfield[3*index+1], phase); CASSIGN_MULT_IM(F.y.im, curfield[3*index+1], phase); CASSIGN_MULT_RE(F.z.re, curfield[3*index+2], phase); CASSIGN_MULT_IM(F.z.im, curfield[3*index+2], phase); integrand = ctl_convert_cnumber_to_c( gh_call3(f, ctl_convert_cvector3_to_scm(F), ctl_convert_number_to_scm(epsilon), ctl_convert_vector3_to_scm(p))); integral.re += integrand.re; integral.im += integrand.im; } #ifndef SCALAR_COMPLEX { int last_index; # ifdef HAVE_MPI if (n3 == 1) last_index = j + local_y_start; else last_index = k; # else last_index = j; # endif if (last_index != 0 && 2*last_index != last_dim) { int i2c, j2c, k2c; i2c = i2 ? (n1 - i2) : 0; j2c = j2 ? (n2 - j2) : 0; k2c = k2 ? (n3 - k2) : 0; p.x = i2c * s1 - c1; p.y = j2c * s2 - c2; p.z = k2c * s3 - c3; if (integrate_energy) integral.re += ctl_convert_number_to_c( gh_call3(f, ctl_convert_number_to_scm(energy[index]), ctl_convert_number_to_scm(epsilon), ctl_convert_vector3_to_scm(p))); else { cvector3 F; double phase_phi; scalar_complex phase, Fx, Fy, Fz; cnumber integrand; Fx = curfield[3*index+0]; Fy = curfield[3*index+1]; Fz = curfield[3*index+2]; Fx.im= -Fx.im; Fy.im= -Fy.im; Fz.im= -Fz.im; phase_phi = TWOPI * (kvector.x * (p.x/geometry_lattice.size.x+0.5) + kvector.y * (p.y/geometry_lattice.size.y+0.5) + kvector.z * (p.z/geometry_lattice.size.z+0.5)); CASSIGN_SCALAR(phase, cos(phase_phi), sin(phase_phi)); CASSIGN_MULT_RE(F.x.re, Fx, phase); CASSIGN_MULT_IM(F.x.im, Fx, phase); CASSIGN_MULT_RE(F.y.re, Fy, phase); CASSIGN_MULT_IM(F.y.im, Fy, phase); CASSIGN_MULT_RE(F.z.re, Fz, phase); CASSIGN_MULT_IM(F.z.im, Fz, phase); integrand = ctl_convert_cnumber_to_c( gh_call3(f, ctl_convert_cvector3_to_scm(F), ctl_convert_number_to_scm(epsilon), ctl_convert_vector3_to_scm(p))); integral.re += integrand.re; integral.im += integrand.im; } } } #endif } } integral.re *= Vol / H.N; integral.im *= Vol / H.N; { cnumber integral_sum; mpi_allreduce(&integral, &integral_sum, 2, number, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); return integral_sum; } } number compute_energy_integral(function f) { if (!curfield || !strchr("DHR", curfield_type)) { mpi_one_fprintf(stderr, "The D or H energy density must be loaded first.\n"); return 0.0; } return cnumber_re(compute_field_integral(f)); } /**************************************************************************/ mpb-1.4.2/mpb-ctl/matrix-smob.c0000644000175400001440000002012607540427027011731 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include "../src/config.h" #include #include #include #include #include "matrix-smob.h" #include "mpb.h" /* null mark function, for smobs containing no SCM objects */ static SCM mark_null(SCM obj) { (void) obj; return SCM_BOOL_F; } /*************************************************************************/ long scm_tc16_smob_evectmatrix = 0; static SCM evectmatrix_p(SCM obj) { return gh_bool2scm(EVECTMATRIX_P(obj)); } static int print_evectmatrix(SCM obj, SCM port, scm_print_state *pstate) { char buf[256]; evectmatrix *pm = EVECTMATRIX(obj); (void) pstate; /* unused argument */ scm_puts("#N, pm->c, pm->p); scm_puts(buf, port); #ifdef SCALAR_COMPLEX scm_puts(" complex", port); #else scm_puts(" real", port); #endif if (pm->localN < pm->N) { sprintf(buf, ", (%dx%d)x%d local", pm->localN, pm->c, pm->p); scm_puts(buf, port); } scm_putc('>', port); return 1; } static size_t free_evectmatrix(SCM obj) { evectmatrix *pm = EVECTMATRIX(obj); destroy_evectmatrix(*pm); free(pm); return 0; } #define mark_evectmatrix mark_null /*************************************************************************/ long scm_tc16_smob_sqmatrix = 0; static SCM sqmatrix_p(SCM obj) { return gh_bool2scm(SQMATRIX_P(obj)); } static int print_sqmatrix(SCM obj, SCM port, scm_print_state *pstate) { char buf[256]; sqmatrix *pm = SQMATRIX(obj); (void) pstate; /* unused argument */ scm_puts("#p, pm->p); scm_puts(buf, port); #ifdef SCALAR_COMPLEX scm_puts(" complex", port); #else scm_puts(" real", port); #endif if (pm->alloc_p > pm->p) { sprintf(buf, ", %dx%d alloc", pm->alloc_p, pm->alloc_p); scm_puts(buf, port); } scm_putc('>', port); return 1; } static size_t free_sqmatrix(SCM obj) { sqmatrix *pm = SQMATRIX(obj); destroy_sqmatrix(*pm); free(pm); return 0; } #define mark_sqmatrix mark_null /*************************************************************************/ /* return a Scheme object *copy* of m */ SCM evectmatrix2scm(evectmatrix m) { SCM obj; evectmatrix *mp; CHK_MALLOC(mp, evectmatrix, 1); *mp = create_evectmatrix(m.N, m.c, m.p, m.localN, m.Nstart, m.allocN); evectmatrix_copy(*mp, m); NEWCELL_SMOB(obj, evectmatrix, mp); return obj; } /* return a Scheme object *copy* of the given columns of m */ SCM evectmatrix_slice2scm(evectmatrix m, int p_start, int p) { SCM obj; evectmatrix *mp; CHECK(p_start >= 0 && p_start + p <= m.p && p >= 0, "invalid arguments in evectmatrix_slice2scm"); CHK_MALLOC(mp, evectmatrix, 1); *mp = create_evectmatrix(m.N, m.c, p, m.localN, m.Nstart, m.allocN); evectmatrix_copy_slice(*mp, m, 0, p_start, p); NEWCELL_SMOB(obj, evectmatrix, mp); return obj; } SCM sqmatrix2scm(sqmatrix m) { SCM obj; sqmatrix *mp; CHK_MALLOC(mp, sqmatrix, 1); *mp = create_sqmatrix(m.p); sqmatrix_copy(*mp, m); NEWCELL_SMOB(obj, sqmatrix, mp); return obj; } /*************************************************************************/ void register_matrix_smobs(void) { #ifdef HAVE_SCM_MAKE_SMOB_TYPE scm_tc16_smob_evectmatrix = scm_make_smob_type("evectmatrix", 0); scm_set_smob_free(scm_tc16_smob_evectmatrix, free_evectmatrix); scm_set_smob_print(scm_tc16_smob_evectmatrix, print_evectmatrix); scm_tc16_smob_sqmatrix = scm_make_smob_type("sqmatrix", 0); scm_set_smob_free(scm_tc16_smob_sqmatrix, free_sqmatrix); scm_set_smob_print(scm_tc16_smob_sqmatrix, print_sqmatrix); #else /* old way to register smobs */ MAKE_SMOBFUNS(evectmatrix); MAKE_SMOBFUNS(sqmatrix); REGISTER_SMOBFUNS(evectmatrix); REGISTER_SMOBFUNS(sqmatrix); #endif gh_new_procedure("evectmatrix?", evectmatrix_p, 1, 0, 0); gh_new_procedure("sqmatrix?", sqmatrix_p, 1, 0, 0); } /*************************************************************************/ sqmatrix *assert_sqmatrix_smob(SCM mo) { sqmatrix *m = SAFE_SQMATRIX(mo); CHECK(m, "wrong type argument: expecting sqmatrix"); return m; } evectmatrix *assert_evectmatrix_smob(SCM mo) { evectmatrix *m = SAFE_EVECTMATRIX(mo); CHECK(m, "wrong type argument: expecting evectmatrix"); return m; } /*************************************************************************/ integer sqmatrix_size(SCM mo) { sqmatrix *m = assert_sqmatrix_smob(mo); return m->p; } cnumber sqmatrix_ref(SCM mo, integer i, integer j) { sqmatrix *m = assert_sqmatrix_smob(mo); cnumber c; CHECK(m && i >= 0 && j >= 0 && i < m->p && j < m->p, "invalid arguments to sqmatrix-ref"); c.re = SCALAR_RE(m->data[i * m->p + j]); c.im = SCALAR_IM(m->data[i * m->p + j]); return c; } /*************************************************************************/ SCM get_eigenvectors(integer b_start, integer num_bands) { CHECK(mdata, "init-params must be called before get-eigenvectors"); return evectmatrix_slice2scm(H, b_start - 1, num_bands); } void set_eigenvectors(SCM mo, integer b_start) { evectmatrix *m = assert_evectmatrix_smob(mo); CHECK(mdata, "init-params must be called before set-eigenvectors"); evectmatrix_copy_slice(H, *m, b_start - 1, 0, m->p); curfield_reset(); } SCM dot_eigenvectors(SCM mo, integer b_start) { evectmatrix *m = assert_evectmatrix_smob(mo); sqmatrix U, S; SCM obj; CHECK(mdata, "init-params must be called before dot-eigenvectors"); U = create_sqmatrix(m->p); S = create_sqmatrix(m->p); evectmatrix_XtY_slice(U, *m, H, 0, b_start - 1, m->p, S); destroy_sqmatrix(S); obj = sqmatrix2scm(U); destroy_sqmatrix(U); return obj; } void scale_eigenvector(integer b, cnumber scale) { scalar s; CHECK(mdata, "init-params must be called before scale-eigenvector"); CHECK(b > 0 && b <= H.p, "invalid band number in scale-eigenvector"); #ifndef SCALAR_COMPLEX CHECK(fabs(cnumber_im(scale) * cnumber_re(scale)) < 1e-14, "scale-eigenvector must be called with real argument in mpbi"); #endif ASSIGN_SCALAR(s, cnumber_re(scale), cnumber_im(scale)); blasglue_scal(H.n, s, H.data + b-1, H.p); curfield_reset(); } void output_eigenvectors(SCM mo, char *filename) { evectmatrix *m = assert_evectmatrix_smob(mo); evectmatrixio_writeall_raw(filename, *m); curfield_reset(); } SCM input_eigenvectors(char *filename, integer num_bands) { SCM mo = get_eigenvectors(1, num_bands); { evectmatrix *m = assert_evectmatrix_smob(mo); evectmatrixio_readall_raw(filename, *m); } return mo; } void save_eigenvectors(char *filename) { CHECK(mdata, "init-params must be called before save-eigenvectors"); printf("Saving eigenvectors to \"%s\"...\n", filename); evectmatrixio_writeall_raw(filename, H); } void load_eigenvectors(char *filename) { CHECK(mdata, "init-params must be called before load-eigenvectors"); printf("Loading eigenvectors from \"%s\"...\n", filename); evectmatrixio_readall_raw(filename, H); curfield_reset(); } /*************************************************************************/ mpb-1.4.2/mpb-ctl/matrix-smob.h0000644000175400001440000000324407537540643011746 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MATRIX_SMOB_H #define MATRIX_SMOB_H #include "ctl-io.h" #include "my-smob.h" #include extern long scm_tc16_smob_evectmatrix; extern long scm_tc16_smob_sqmatrix; #define EVECTMATRIX_P(X) T_SMOB_P(evectmatrix, X) #define EVECTMATRIX(X) T_SMOB(evectmatrix, X) #define SAFE_EVECTMATRIX(X) SAFE_T_SMOB(evectmatrix, X) #define SQMATRIX_P(X) T_SMOB_P(sqmatrix, X) #define SQMATRIX(X) T_SMOB(sqmatrix, X) #define SAFE_SQMATRIX(X) SAFE_T_SMOB(sqmatrix, X) extern SCM evectmatrix2scm(evectmatrix m); extern SCM evectmatrix_sub2scm(evectmatrix m, int p_start, int p_end); extern SCM sqmatrix2scm(sqmatrix m); extern integer sqmatrix_size(object mo); extern cnumber sqmatrix_ref(object mo, integer i, integer j); extern void register_matrix_smobs(void); extern sqmatrix *assert_sqmatrix_smob(SCM mo); extern evectmatrix *assert_evectmatrix_smob(SCM mo); #endif /* MATRIX_SMOB_H */ mpb-1.4.2/mpb-ctl/mpb-split.10000644000175400001440000000613707443766434011334 .\" Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. .\" .\" 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 .\" .TH MPB 1 "March 13, 2002" "MPB" "MIT Photonic-Bands Package" .SH NAME mpb-split \- compute eigenmodes with MPB using multiple processes .SH SYNOPSIS .B mpb-split \fINUM-SPLIT\fR [\fIDEFINITION\fR]... [\fICTLFILE\fR]... .SH DESCRIPTION .PP ." Add any additional description here mpb-split is a parallelizing front-end to MIT Photonic Bands (MPB). For a computation with several k points, it splits the list of k points over multiple processes. Of course, this will only benefit you on a system where different processes will run on different processors, such as an SMP or a cluster with automatic process migration (e.g. MOSIX). mpb-split is actually a trivial shell script, though, so you can easily modify it if you need to use a special command to launch processes on other processors/machines. MIT Photonic Bands (MPB) is a free program to compute the band structures (dispersion relations) and electromagnetic modes of periodic dielectric structures, and is applicable both to photonic crystals (photonic band-gap materials) and a wide range of other optical problems. .PP More information on MPB, including a detailed manual, can be found online at the MPB home page: .I http://ab-initio.mit.edu/mpb/ .PP A typical invocation of .I mpb-split looks like: .PP .Vb 1 \& mpb-split num-split foo.ctl >& foo.out .Ve .PP This causes .I mpb-split to process the control file foo.ctl, divide the k points into . B num-split equal chunks, run each list in a separate process with MPB, and redirect the output (in order) to foo.out. (One typically redirects output to a file, as the output is verbose and contains a number of comma-delimited datasets that one can extract by grepping.) .PP Overall, the behavior and arguments are the same as for .I mpb except that the first argument must be the integer \fBnum-split\fR. .PP What .I mpb-split technically does is to set the MPB variable k-split-num to .B num-split and k-split-index to the index (starting with 0) of the chunk for each process. If you want, you can use these variables to divide the problem in some other way and then reset them to 1 and 0, respectively. .SH BUGS Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. .SH AUTHORS Written by Steven G. Johnson. Copyright (c) 1999, 2000, 2001, 2002 by the Massachusetts Institute of Technology. .SH "SEE ALSO" mpb(1), mpb-data(1) mpb-1.4.2/mpb-ctl/mpb-split.in0000755000175400001440000000204207270044444011560 #! @SH_JOB@ if test x"`echo $1 | egrep '^[0-9]*$'`" = x; then echo "Syntax: $0 [mpb arguments...]" 1>&2 exit 1 fi tmpname=/tmp/mpb-split.$$.tmp # unique temporary filename subprocesses="" # keep a list of the subprocess ids launched # If a SIGINT or SIGHUP is received, kill subprocesses and delete temp. files: trap 'echo "killing subprocesses: $subprocesses"; kill -9 $subprocesses; rm -f $tmpname.*; exit 1' 1 2 # Run num-split instances of mpb, each with a chunk of k-points, with # the first chunk going to stdout and the rest going to temporary files # to be output later. ./mpb interactive?=false k-split-index=0 k-split-num=$* & subprocesses="$subprocesses $!" i=1 while test `expr $i \< $1` = 1; do ./mpb interactive?=false k-split-index=$i k-split-num=$* > $tmpname.$i & subprocesses="$subprocesses $!" i=`expr $i + 1` done # After all mpb processes have finished, concatenate their outputs in order. wait i=1 while test `expr $i \< $1` = 1; do cat $tmpname.$i rm -f $tmpname.$i i=`expr $i + 1` done mpb-1.4.2/mpb-ctl/mpb.10000644000175400001440000000667207443766434010207 .\" Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. .\" .\" 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 .\" .TH MPB 1 "January 27, 2000" "MPB" "MIT Photonic-Bands Package" .SH NAME mpb \- compute eigenmodes of periodic dielectric structures .SH SYNOPSIS .B mpb [\fIOPTION\fR]... [\fIDEFINITION\fR]... [\fICTLFILE\fR]... .SH DESCRIPTION .PP ." Add any additional description here MIT Photonic Bands (MPB) is a free program to compute the band structures (dispersion relations) and electromagnetic modes of periodic dielectric structures, and is applicable both to photonic crystals (photonic band-gap materials) and a wide range of other optical problems. Its features include: fully-vectorial, 3D computations; a flexible user-interface based upon the GNU Guile scripting language; output in HDF format; and iterative, targeted eigensolver methods to address very large problems by solving for only a few states near a specified frequency. .PP More information on MPB, including a detailed manual, can be found online at the MPB home page: .I http://ab-initio.mit.edu/mpb/ .PP A typical invocation of MPB looks like: .PP .Vb 1 \& mpb foo.ctl >& foo.out .Ve .PP This causes MPB to process the control file foo.ctl and redirect its output to foo.out. (One typically redirects output to a file, as the output is verbose and contains a number of comma-delimited datasets that one can extract by grepping.) .PP You can also use MPB in an interactive mode, in which you can type in MPB commands (in Scheme/Guile) and immediately see their results. Interactive mode is entered when you invoke .I mpb with no control files, or if your control files don't contain any .I run statements (which disable interactive mode), or if the last control file ends by setting .I (set! interactive? true) in which case interactive mode is entered after the control files execute. .PP Another useful feature is that you can alter parameters in your control files from the command line, by including definitions of the form \fIvariable\fR=\fIvalue\fR as arguments to .I mpb (before the control files). This overrides the values of variables defined with .I define-param in the control file (including all of the predefined MPB input variables). .PP Multiple control files and definitions are executed in sequence, in the order they are specified on the command line. .SH OPTIONS .TP \fB\-h\fR, \fB\--help\fR Display help on the command-line options and usage. .TP \fB\-V\fR, \fB\--version\fR Print the version number and copyright info for mpb. .TP \fB\-v\fR, \fB\--verbose\fR Verbose output. .SH BUGS Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. .SH AUTHORS Written by Steven G. Johnson. Copyright (c) 1999, 2000, 2001, 2002 by the Massachusetts Institute of Technology. .SH "SEE ALSO" mpb-split(1), mpb-data(1) mpb-1.4.2/mpb-ctl/mpb.c0000644000175400001440000006043707542651075010262 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /**************************************************************************/ /* Here, we define the external functions callable from Guile, as defined by mpb.scm. */ /**************************************************************************/ #include #include #include #include #include #include #include /* GNU Guile library header file: */ #include /* Header files for my eigensolver routines: */ #include "../src/config.h" #include #include #include #include #include #include #include /* Header file for the ctl-file (Guile) interface; automatically generated from mpb.scm */ #include /* Routines from libctl/utils/geom.c: */ #include /* shared declarations for the files in mpb-ctl: */ #include "mpb.h" /* matrix/field "smobs" (Scheme objects) */ #include "matrix-smob.h" #include "field-smob.h" /**************************************************************************/ /* use Guile malloc function instead of plain malloc, to force use of the garbage collector when we run low */ static void *malloc_hook(size_t n) { return (void*) scm_must_malloc(n, "stuff for MPB"); } /* The following are hook functions called from main() when starting the program and just before exiting. We use them to initialize MPI. */ void ctl_start_hook(int *argc, char ***argv) { my_malloc_hook = malloc_hook; MPI_Init(argc, argv); } void ctl_stop_hook(void) { MPI_Finalize(); } /* The following is a hook function called from main() when initializing Guile, which can export any additional symbols to Guile: */ void ctl_export_hook(void) { register_matrix_smobs(); register_field_smobs(); } /**************************************************************************/ /* Some Guile-callable functions so that ctl files can know something about MPI. */ boolean mpi_is_masterp(void) { return mpi_is_master(); } boolean using_mpip(void) { #ifdef HAVE_MPI return 1; #else return 0; #endif } integer mpi_num_procs(void) { int num_procs; MPI_Comm_size(MPI_COMM_WORLD, &num_procs); return num_procs; } integer mpi_proc_index(void) { int proc_num; MPI_Comm_rank(MPI_COMM_WORLD, &proc_num); return proc_num; } /**************************************************************************/ /* a couple of utilities to convert libctl data types to the data types of the eigensolver & maxwell routines: */ void vector3_to_arr(real arr[3], vector3 v) { arr[0] = v.x; arr[1] = v.y; arr[2] = v.z; } void matrix3x3_to_arr(real arr[3][3], matrix3x3 m) { vector3_to_arr(arr[0], m.c0); vector3_to_arr(arr[1], m.c1); vector3_to_arr(arr[2], m.c2); } /**************************************************************************/ /* global variables for retaining data about the eigenvectors between calls from Guile: */ int nwork_alloc = 0; maxwell_data *mdata = NULL; maxwell_target_data *mtdata = NULL; evectmatrix H, W[MAX_NWORK], Hblock; vector3 cur_kvector; scalar_complex *curfield = NULL; int curfield_band; char curfield_type = '-'; void curfield_reset(void) { curfield = NULL; curfield_type = '-'; } /* R[i]/G[i] are lattice/reciprocal-lattice vectors */ real R[3][3], G[3][3]; matrix3x3 Rm, Gm; /* same thing, but matrix3x3 */ real Vol; /* computational cell volume = |det Rm| */ /* index of current kpoint, for labeling output */ int kpoint_index = 0; /**************************************************************************/ scalar_complex cnumber2cscalar(cnumber c) { scalar_complex cs; CASSIGN_SCALAR(cs, cnumber_re(c), cnumber_im(c)); return cs; } cnumber cscalar2cnumber(scalar_complex cs) { return make_cnumber(CSCALAR_RE(cs), CSCALAR_IM(cs)); } cvector3 cscalar32cvector3(const scalar_complex *cs) { cvector3 v; v.x = cscalar2cnumber(cs[0]); v.y = cscalar2cnumber(cs[1]); v.z = cscalar2cnumber(cs[2]); return v; } void cvector32cscalar3(scalar_complex *cs, cvector3 v) { cs[0] = cnumber2cscalar(v.x); cs[1] = cnumber2cscalar(v.y); cs[2] = cnumber2cscalar(v.z); } /**************************************************************************/ /* initialize the field to random numbers; should only be called after init-params. (Guile-callable.) */ void randomize_fields(void) { int i; if (!mdata) return; mpi_one_printf("Initializing fields to random numbers...\n"); for (i = 0; i < H.n * H.p; ++i) { ASSIGN_SCALAR(H.data[i], rand() * 1.0 / RAND_MAX, rand() * 1.0 / RAND_MAX); } } /**************************************************************************/ /* Guile-callable functions for getting/setting the kpoint index. */ integer get_kpoint_index(void) { return kpoint_index; } void set_kpoint_index(integer i) { kpoint_index = i; } /**************************************************************************/ /* return a string describing the current parity, used for frequency and filename prefixes */ const char *parity_string(maxwell_data *d) { static char s[128]; strcpy(s, ""); if (d->parity & EVEN_Z_PARITY) strcat(s, (d->nz == 1) ? "te" : "zeven"); else if (d->parity & ODD_Z_PARITY) strcat(s, (d->nz == 1) ? "tm" : "zodd"); if (d->parity & EVEN_Y_PARITY) strcat(s, "yeven"); else if (d->parity & ODD_Y_PARITY) strcat(s, "yodd"); return s; } /* Set the current parity to solve for. (init-params should have already been called. (Guile-callable; see mpb.scm.) p >= 0 means a bitwise OR of the various parity constants from maxwell.h (NO_PARITY, EVEN_Z_PARITY, etcetera). p = -1 means the parity of the previous call, or NO_PARITY if this is the first call */ void set_parity(integer p) { static int last_p = -2; /* initialize to some non-value */ if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called before set-parity!\n"); return; } if (p == -1) p = last_p < 0 ? NO_PARITY : last_p; set_maxwell_data_parity(mdata, p); CHECK(mdata->parity == p, "k vector incompatible with parity"); mpi_one_printf("Solving for band polarization: %s.\n", parity_string(mdata)); last_p = p; set_kpoint_index(0); /* reset index */ } /**************************************************************************/ /* Guile-callable function: init-params, which initializes any data that we need for the eigenvalue calculation. When this function is called, the input variables (the geometry, etcetera) have already been read into the global variables defined in ctl-io.h. p is the parity to use for the coming calculation, although this can be changed by calling set-parity. p is interpreted in the same way as for set-parity. If reset_fields is false, then any fields from a previous run are retained if they are of the same dimensions. Otherwise, new fields are allocated and initialized to random numbers. */ void init_params(integer p, boolean reset_fields) { int i, local_N, N_start, alloc_N; int nx, ny, nz; int have_old_fields = 0; int block_size; /* Output a bunch of stuff so that the user can see what we're doing and what we've read in. */ mpi_one_printf("init-params: initializing eigensolver data\n"); #ifndef SCALAR_COMPLEX mpi_one_printf(" -- assuming INVERSION SYMMETRY in the geometry.\n"); #endif mpi_one_printf("Computing %d bands with %e tolerance.\n", num_bands, tolerance); if (target_freq != 0.0) mpi_one_printf("Target frequency is %g\n", target_freq); get_grid_size_n(&nx, &ny, &nz); { int true_rank = nz > 1 ? 3 : (ny > 1 ? 2 : 1); if (true_rank < dimensions) dimensions = true_rank; else if (true_rank > dimensions) { mpi_one_fprintf(stderr, "WARNING: rank of grid is > dimensions.\n" " setting extra grid dims. to 1.\n"); /* force extra dims to be 1: */ if (dimensions <= 2) nz = 1; if (dimensions <= 1) ny = 1; } } mpi_one_printf("Working in %d dimensions.\n", dimensions); mpi_one_printf("Grid size is %d x %d x %d.\n", nx, ny, nz); if (eigensolver_block_size != 0 && eigensolver_block_size < num_bands) { block_size = eigensolver_block_size; if (block_size < 0) { /* Guess a block_size near -block_size, chosen so that all blocks are nearly equal in size: */ block_size = (num_bands - block_size - 1) / (-block_size); block_size = (num_bands + block_size - 1) / block_size; } mpi_one_printf("Solving for %d bands at a time.\n", block_size); } else block_size = num_bands; if (mdata) { /* need to clean up from previous init_params call */ if (nx == mdata->nx && ny == mdata->ny && nz == mdata->nz && block_size == Hblock.alloc_p && num_bands == H.p && eigensolver_nwork == nwork_alloc) have_old_fields = 1; /* don't need to reallocate */ else { destroy_evectmatrix(H); for (i = 0; i < nwork_alloc; ++i) destroy_evectmatrix(W[i]); if (Hblock.data != H.data) destroy_evectmatrix(Hblock); } destroy_maxwell_target_data(mtdata); mtdata = NULL; destroy_maxwell_data(mdata); mdata = NULL; curfield_reset(); } else srand(time(NULL)); /* init random seed for field initialization */ if (deterministicp) { /* check input variable "deterministic?" */ /* seed should be the same for each run, although it should be different for each process: */ int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); srand(314159 * (rank + 1)); } mpi_one_printf("Creating Maxwell data...\n"); mdata = create_maxwell_data(nx, ny, nz, &local_N, &N_start, &alloc_N, block_size, NUM_FFT_BANDS); CHECK(mdata, "NULL mdata"); if (target_freq != 0.0) mtdata = create_maxwell_target_data(mdata, target_freq); else mtdata = NULL; if (!have_old_fields) { mpi_one_printf("Allocating fields...\n"); H = create_evectmatrix(nx * ny * nz, 2, num_bands, local_N, N_start, alloc_N); nwork_alloc = eigensolver_nwork; for (i = 0; i < nwork_alloc; ++i) W[i] = create_evectmatrix(nx * ny * nz, 2, block_size, local_N, N_start, alloc_N); if (block_size < num_bands) Hblock = create_evectmatrix(nx * ny * nz, 2, block_size, local_N, N_start, alloc_N); else Hblock = H; } init_epsilon(); mpi_one_printf("%d k-points:\n", k_points.num_items); for (i = 0; i < k_points.num_items; ++i) mpi_one_printf(" (%g,%g,%g)\n", k_points.items[i].x, k_points.items[i].y, k_points.items[i].z); set_parity(p); if (!have_old_fields || reset_fields) randomize_fields(); { int ierr = check_maxwell_dielectric(mdata, negative_epsilon_okp); if (ierr == 1) mpi_one_fprintf(stderr, "ERROR: non positive-definite dielectric tensor\n"); else if (ierr == 2) mpi_one_fprintf(stderr, "ERROR: dielectric tensor must not couple xy " "plane with z direction for 2D TE/TM calculations\n"); CHECK(!ierr, "invalid dielectric function\n"); } evectmatrix_flops = eigensolver_flops; /* reset, if changed */ } /**************************************************************************/ /* When we are solving for a few bands at a time, we solve for the upper bands by "deflation"--by continually orthogonalizing them against the already-computed lower bands. (This constraint commutes with the eigen-operator, of course, so all is well.) */ typedef struct { evectmatrix Y; /* the vectors to orthogonalize against; Y must itself be normalized (Yt Y = 1) */ int p; /* the number of columns of Y to orthogonalize against */ scalar *S; /* a matrix for storing the dot products; should have at least p * X.p elements (see below for X) */ scalar *S2; /* a scratch matrix the same size as S */ } deflation_data; static void deflation_constraint(evectmatrix X, void *data) { deflation_data *d = (deflation_data *) data; CHECK(X.n == d->Y.n && d->Y.p >= d->p, "invalid dimensions"); /* (Sigh...call the BLAS functions directly since we are not using all the columns of Y...evectmatrix is not set up for this case.) */ /* compute S = Xt Y (i.e. all the dot products): */ blasglue_gemm('C', 'N', X.p, d->p, X.n, 1.0, X.data, X.p, d->Y.data, d->Y.p, 0.0, d->S2, d->p); mpi_allreduce(d->S2, d->S, d->p * X.p * SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); /* compute X = X - Y*St = (1 - Y Yt) X */ blasglue_gemm('N', 'C', X.n, X.p, d->p, -1.0, d->Y.data, d->Y.p, d->S, d->p, 1.0, X.data, X.p); } /**************************************************************************/ /* Solve for the bands at a given k point. Must only be called after init_params! */ void solve_kpoint(vector3 kvector) { int i, total_iters = 0, ib, ib0; real *eigvals; real k[3]; int flags; deflation_data deflation; int prev_parity; mpi_one_printf("solve_kpoint (%g,%g,%g):\n", kvector.x, kvector.y, kvector.z); curfield_reset(); if (num_bands == 0) { mpi_one_printf(" num-bands is zero, not solving for any bands\n"); return; } if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called before solve-kpoint!\n"); return; } /* if this is the first k point, print out a header line for for the frequency grep data: */ if (!kpoint_index && mpi_is_master()) { printf("%sfreqs:, k index, k1, k2, k3, kmag/2pi", parity_string(mdata)); for (i = 0; i < num_bands; ++i) printf(", %s%sband %d", parity_string(mdata), mdata->parity == NO_PARITY ? "" : " ", i + 1); printf("\n"); } prev_parity = mdata->parity; cur_kvector = kvector; vector3_to_arr(k, kvector); update_maxwell_data_k(mdata, k, G[0], G[1], G[2]); CHECK(mdata->parity == prev_parity, "k vector is incompatible with specified parity"); CHK_MALLOC(eigvals, real, num_bands); flags = eigensolver_flags; /* ctl file input variable */ if (verbose) flags |= EIGS_VERBOSE; /* constant (zero frequency) bands at k=0 are handled specially, so remove them from the solutions for the eigensolver: */ if (mdata->zero_k && !mtdata) { int in, ip; ib0 = maxwell_zero_k_num_const_bands(H, mdata); for (in = 0; in < H.n; ++in) for (ip = 0; ip < H.p - ib0; ++ip) H.data[in * H.p + ip] = H.data[in * H.p + ip + ib0]; evectmatrix_resize(&H, H.p - ib0, 1); } else ib0 = 0; /* solve for all bands */ /* Set up deflation data: */ if (H.data != Hblock.data) { deflation.Y = H; deflation.p = 0; CHK_MALLOC(deflation.S, scalar, H.p * Hblock.p); CHK_MALLOC(deflation.S2, scalar, H.p * Hblock.p); } for (ib = ib0; ib < num_bands; ib += Hblock.alloc_p) { evectconstraint_chain *constraints; int num_iters; /* don't solve for too many bands if the block size doesn't divide the number of bands: */ if (ib + mdata->num_bands > num_bands) { maxwell_set_num_bands(mdata, num_bands - ib); for (i = 0; i < nwork_alloc; ++i) evectmatrix_resize(&W[i], num_bands - ib, 0); evectmatrix_resize(&Hblock, num_bands - ib, 0); } mpi_one_printf("Solving for bands %d to %d...\n", ib + 1, ib + Hblock.p); constraints = NULL; constraints = evect_add_constraint(constraints, maxwell_parity_constraint, (void *) mdata); if (mdata->zero_k) constraints = evect_add_constraint(constraints, maxwell_zero_k_constraint, (void *) mdata); if (Hblock.data != H.data) { /* initialize fields of block from H */ int in, ip; for (in = 0; in < Hblock.n; ++in) for (ip = 0; ip < Hblock.p; ++ip) Hblock.data[in * Hblock.p + ip] = H.data[in * H.p + ip + (ib-ib0)]; deflation.p = ib-ib0; if (deflation.p > 0) constraints = evect_add_constraint(constraints, deflation_constraint, &deflation); } if (mtdata) { /* solving for bands near a target frequency */ if (eigensolver_davidsonp) eigensolver_davidson( Hblock, eigvals + ib, maxwell_target_operator, (void *) mtdata, simple_preconditionerp ? maxwell_target_preconditioner : maxwell_target_preconditioner2, (void *) mtdata, evectconstraint_chain_func, (void *) constraints, W, nwork_alloc, tolerance, &num_iters, flags, 0.0); else eigensolver(Hblock, eigvals + ib, maxwell_target_operator, (void *) mtdata, simple_preconditionerp ? maxwell_target_preconditioner : maxwell_target_preconditioner2, (void *) mtdata, evectconstraint_chain_func, (void *) constraints, W, nwork_alloc, tolerance, &num_iters, flags); /* now, diagonalize the real Maxwell operator in the solution subspace to get the true eigenvalues and eigenvectors: */ CHECK(nwork_alloc >= 2, "not enough workspace"); eigensolver_get_eigenvals(Hblock, eigvals + ib, maxwell_operator,mdata, W[0],W[1]); } else { if (eigensolver_davidsonp) eigensolver_davidson( Hblock, eigvals + ib, maxwell_operator, (void *) mdata, simple_preconditionerp ? maxwell_preconditioner : maxwell_preconditioner2, (void *) mdata, evectconstraint_chain_func, (void *) constraints, W, nwork_alloc, tolerance, &num_iters, flags, 0.0); else eigensolver(Hblock, eigvals + ib, maxwell_operator, (void *) mdata, simple_preconditionerp ? maxwell_preconditioner : maxwell_preconditioner2, (void *) mdata, evectconstraint_chain_func, (void *) constraints, W, nwork_alloc, tolerance, &num_iters, flags); } if (Hblock.data != H.data) { /* save solutions of current block */ int in, ip; for (in = 0; in < Hblock.n; ++in) for (ip = 0; ip < Hblock.p; ++ip) H.data[in * H.p + ip + (ib-ib0)] = Hblock.data[in * Hblock.p + ip]; } evect_destroy_constraints(constraints); mpi_one_printf("Finished solving for bands %d to %d after " "%d iterations.\n", ib + 1, ib + Hblock.p, num_iters); total_iters += num_iters * Hblock.p; } if (num_bands - ib0 > Hblock.alloc_p) mpi_one_printf("Finished k-point with %g mean iterations/band.\n", total_iters * 1.0 / num_bands); /* Manually put in constant (zero-frequency) solutions for k=0: */ if (mdata->zero_k && !mtdata) { int in, ip; evectmatrix_resize(&H, H.alloc_p, 1); for (in = 0; in < H.n; ++in) for (ip = H.p - ib0 - 1; ip >= 0; --ip) H.data[in * H.p + ip + ib0] = H.data[in * H.p + ip]; maxwell_zero_k_set_const_bands(H, mdata); for (ib = 0; ib < ib0; ++ib) eigvals[ib] = 0; } /* Reset scratch matrix sizes: */ evectmatrix_resize(&Hblock, Hblock.alloc_p, 0); for (i = 0; i < nwork_alloc; ++i) evectmatrix_resize(&W[i], W[i].alloc_p, 0); maxwell_set_num_bands(mdata, Hblock.alloc_p); /* Destroy deflation data: */ if (H.data != Hblock.data) { free(deflation.S2); free(deflation.S); } if (num_write_output_vars > 1) { /* clean up from prev. call */ free(freqs.items); free(parity); } CHK_MALLOC(parity, char, strlen(parity_string(mdata)) + 1); parity = strcpy(parity, parity_string(mdata)); iterations = total_iters; /* iterations output variable */ /* create freqs array for storing frequencies in a Guile list */ freqs.num_items = num_bands; CHK_MALLOC(freqs.items, number, freqs.num_items); set_kpoint_index(kpoint_index + 1); mpi_one_printf("%sfreqs:, %d, %g, %g, %g, %g", parity, kpoint_index, k[0], k[1], k[2], vector3_norm(matrix3x3_vector3_mult(Gm, kvector))); for (i = 0; i < num_bands; ++i) { freqs.items[i] = negative_epsilon_okp ? eigvals[i] : sqrt(eigvals[i]); mpi_one_printf(", %g", freqs.items[i]); } mpi_one_printf("\n"); eigensolver_flops = evectmatrix_flops; free(eigvals); } /**************************************************************************/ /* Return a list of the z/y parities, one for each band. */ number_list compute_zparities(void) { number_list z_parity; z_parity.num_items = num_bands; z_parity.items = maxwell_zparity(H, mdata); return z_parity; } number_list compute_yparities(void) { number_list y_parity; y_parity.num_items = num_bands; y_parity.items = maxwell_yparity(H, mdata); return y_parity; } /**************************************************************************/ /* Compute the group velocity dw/dk in the given direction d (where the length of d is ignored). d is in the reciprocal lattice basis. Should only be called after solve_kpoint. Returns a list of the group velocities, one for each band, in units of c. */ number_list compute_group_velocity_component(vector3 d) { number_list group_v; number *gv_scratch; real u[3]; int i, ib; group_v.num_items = 0; group_v.items = (number *) NULL; curfield_reset(); /* has the side effect of overwriting curfield scratch */ if (!mdata) { mpi_one_fprintf(stderr, "init-params must be called first!\n"); return group_v; } if (!kpoint_index) { mpi_one_fprintf(stderr, "solve-kpoint must be called first!\n"); return group_v; } /* convert d to unit vector in Cartesian coords: */ d = unit_vector3(matrix3x3_vector3_mult(Gm, d)); u[0] = d.x; u[1] = d.y; u[2] = d.z; group_v.num_items = num_bands; CHK_MALLOC(group_v.items, number, group_v.num_items); CHK_MALLOC(gv_scratch, number, group_v.num_items); /* now, compute group_v.items = diag Re : */ /* ...we have to do this in blocks of eigensolver_block_size since the work matrix W[0] may not have enough space to do it all at once. */ for (ib = 0; ib < num_bands; ib += Hblock.alloc_p) { if (ib + mdata->num_bands > num_bands) { maxwell_set_num_bands(mdata, num_bands - ib); evectmatrix_resize(&W[0], num_bands - ib, 0); evectmatrix_resize(&Hblock, num_bands - ib, 0); } if (Hblock.data != H.data) { /* initialize fields of block from H */ int in, ip; for (in = 0; in < Hblock.n; ++in) for (ip = 0; ip < Hblock.p; ++ip) Hblock.data[in * Hblock.p + ip] = H.data[in * H.p + ip + ib]; } maxwell_ucross_op(Hblock, W[0], mdata, u); evectmatrix_XtY_diag_real(Hblock, W[0], group_v.items + ib, gv_scratch); } free(gv_scratch); /* Reset scratch matrix sizes: */ evectmatrix_resize(&Hblock, Hblock.alloc_p, 0); evectmatrix_resize(&W[0], W[0].alloc_p, 0); maxwell_set_num_bands(mdata, Hblock.alloc_p); /* The group velocity is given by: grad_k(omega)*d = grad_k(omega^2)*d / 2*omega = grad_k()*d / 2*omega = Re / omega Note that our k is in units of 2*Pi/a, and omega is in units of 2*Pi*c/a, so the result will be in units of c. */ for (i = 0; i < num_bands; ++i) { if (freqs.items[i] == 0) /* v is undefined in this case */ group_v.items[i] = 0.0; /* just set to zero */ else group_v.items[i] /= negative_epsilon_okp ? sqrt(fabs(freqs.items[i])) : freqs.items[i]; } return group_v; } /**************************************************************************/ mpb-1.4.2/mpb-ctl/mpb.h0000644000175400001440000000557107540771033010260 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MPB_H #define MPB_H #include /* this integer flag is defined by main.c from libctl, and is set when the user runs the program with --verbose */ extern int verbose; #define MAX2(a,b) ((a) > (b) ? (a) : (b)) #define MIN2(a,b) ((a) < (b) ? (a) : (b)) #define TWOPI 6.2831853071795864769252867665590057683943388 /**************************************************************************/ extern void get_epsilon_file_func(const char *fname, maxwell_dielectric_function *func, void **func_data); extern void destroy_epsilon_file_func_data(void *func_data); extern real linear_interpolate(real rx, real ry, real rz, real *data, int nx, int ny, int nz, int stride); /**************************************************************************/ /* global variables for retaining data about the eigenvectors between calls from Guile: */ #define MAX_NWORK 10 extern int nwork_alloc; #define NUM_FFT_BANDS 20 /* max number of bands to FFT at a time */ extern maxwell_data *mdata; extern maxwell_target_data *mtdata; extern evectmatrix H, W[MAX_NWORK], Hblock; extern vector3 cur_kvector; extern scalar_complex *curfield; extern int curfield_band; extern char curfield_type; extern void curfield_reset(void); /* R[i]/G[i] are lattice/reciprocal-lattice vectors */ extern real R[3][3], G[3][3]; extern matrix3x3 Rm, Gm; /* same thing, but matrix3x3 */ extern real Vol; /* computational cell volume = |det Rm| */ /* index of current kpoint, for labeling output */ extern int kpoint_index; /**************************************************************************/ extern void vector3_to_arr(real arr[3], vector3 v); extern void matrix3x3_to_arr(real arr[3][3], matrix3x3 m); extern scalar_complex cnumber2cscalar(cnumber c); extern cnumber cscalar2cnumber(scalar_complex cs); extern cvector3 cscalar32cvector3(const scalar_complex *cs); extern void cvector32cscalar3(scalar_complex *cs, cvector3 v); /**************************************************************************/ extern void init_epsilon(void); extern const char *parity_string(maxwell_data *d); #endif /* MPB_H */ mpb-1.4.2/mpb-ctl/mpb.scm.in0000644000175400001440000007371207627512765011235 ; Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. ; ; 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 ; **************************************************************** ; Get the number of arguments to a function p. However, some ; older versions of Guile (e.g. 1.2) do not support the 'arity ; property, and procedure-property just returns false. In ; this case, we assume that the procedure returns 1 argument, ; as this is the most useful default for our purposes. Sigh. (define (procedure-num-args p) (let ((arity (procedure-property p 'arity))) (if arity (car arity) 1))) ; **************************************************************** (define-class material-type no-parent) (define-class dielectric material-type (define-property epsilon no-default 'number)) (define (index n) (epsilon (* n n))) ; convenient substitute for epsilon (define-class dielectric-anisotropic material-type (define-property epsilon-diag no-default 'vector3) (define-property epsilon-offdiag (vector3 0 0 0) 'cvector3) (define-property epsilon-offdiag-imag (vector3 0 0 0) 'vector3)) (define-class material-function material-type (define-property material-func no-default 'function (lambda (p) (= 1 (procedure-num-args p))))) ; use the solid geometry classes, variables, etcetera in libgeom: ; (one specifications file can include another specifications file) (include "@LIBCTL_DIR@/utils/geom.scm") ; **************************************************************** ; eigensolver flags (grabbed from eigensolver.h by configure) ; first, we must define a function (pow2 n) to return 2^n: (define (pow2 n) (if (<= n 0) 1 (* 2 (pow2 (- n 1))))) @EIGS_FLAGS_SCM@ ; substituted by configure script ; **************************************************************** ; More input/output variables (besides those defined by libgeom, above). (define-input-var k-points '() (make-list-type 'vector3)) (define-input-var num-bands 1 'integer) (define-input-var tolerance 1.0e-7 'number positive?) (define-input-var target-freq 0.0 'number (lambda (x) (>= x 0))) (define-input-var mesh-size 3 'integer positive?) (define-input-var epsilon-input-file "" 'string) (define-input-var deterministic? false 'boolean) ; Eigensolver minutiae: (define-input-var simple-preconditioner? false 'boolean) (define-input-var eigensolver-flags EIGS_DEFAULT_FLAGS 'integer) (define-input-var eigensolver-block-size -11 'integer) (define-input-var eigensolver-nwork 3 'integer positive?) (define-input-var eigensolver-davidson? false 'boolean) (define-input-output-var eigensolver-flops 0 'number) (define-output-var freqs (make-list-type 'number)) (define-output-var iterations 'integer) (define-output-var parity 'string) (define-input-var negative-epsilon-ok? false 'boolean) (define (allow-negative-epsilon) (set! negative-epsilon-ok? true) (set! target-freq (/ 1 infinity))) ; **************************************************************** ; Definitions of external (C) functions: ; (init-params p true) initializes the geometry, etcetera, and does ; everything else that's needed to get ready for an eigenvalue ; calculation with parity p (see below). This should be called ; after the input variables are changed. If false is passed instead ; of true, fields from a previous run are retained, if possible, as a ; starting point for the eigensolver. (define-external-function init-params true false no-return-value 'integer 'boolean) ; (set-parity p) changes the parity that is solved for by ; solve-kpoint, below. p should be one of the following constants ; init-params should already have been called. Be sure to call ; (randomize-fields) if you change the parity without calling ; init-params. (define NO-PARITY 0) (define EVEN-Z 1) (define ODD-Z 2) (define EVEN-Y 4) (define ODD-Y 8) (define TE EVEN-Z) (define TM ODD-Z) (define PREV-PARITY -1) (define-external-function set-parity false false no-return-value 'integer) (define set-polarization set-parity) ; backwards compatibility ; (randomize-fields) initializes the fields to random values; should ; only be called after init-params. (define-external-function randomize-fields false false no-return-value) ; (solve-kpoint kpoint) solves for the specified bands at the given k point. ; Requires that (init-params) has been called, and does not re-read the ; input variables, but does write the output vars. (define-external-function solve-kpoint false true no-return-value 'vector3) (define-external-function get-dfield false false no-return-value 'integer) (define-external-function get-hfield false false no-return-value 'integer) (define-external-function get-efield-from-dfield false false no-return-value) (define-external-function get-epsilon false false no-return-value) (define-external-function fix-field-phase false false no-return-value) (define-external-function compute-field-energy false false (make-list-type 'number)) (define-external-function get-epsilon-point false false 'number 'vector3) (define-external-function get-epsilon-inverse-tensor-point false false 'cmatrix3x3 'vector3) (define-external-function get-energy-point false false 'number 'vector3) (define get-scalar-field-point get-energy-point) (define-external-function get-bloch-field-point false false 'cvector3 'vector3) (define-external-function get-field-point false false 'cvector3 'vector3) (define-external-function compute-energy-in-dielectric false false 'number 'number 'number) (define-external-function compute-field-integral false false 'cnumber 'function) (define-external-function compute-energy-integral false false 'number 'function) (define-external-function compute-energy-in-object-list false false 'number (make-list-type 'geometric-object)) (define-external-function output-field-to-file false false no-return-value 'integer 'string) (define-external-function mpi-is-master? false false 'boolean) (define-external-function using-mpi? false false 'boolean) (define-external-function mpi-num-procs false false 'integer) (define-external-function mpi-proc-index false false 'integer) (define-external-function get-kpoint-index false false 'integer) (define-external-function set-kpoint-index false false no-return-value 'integer) (define-external-function sqmatrix-size false false 'integer 'SCM) (define-external-function sqmatrix-ref false false 'cnumber 'SCM 'integer 'integer) (define-external-function get-eigenvectors false false 'SCM 'integer 'integer) (define-external-function set-eigenvectors false false no-return-value 'SCM 'integer) (define-external-function dot-eigenvectors false false 'SCM 'SCM 'integer) (define-external-function scale-eigenvector false false no-return-value 'integer 'cnumber) (define-external-function output-eigenvectors false false no-return-value 'SCM 'string) (define-external-function input-eigenvectors false false 'SCM 'string 'integer) (define-external-function save-eigenvectors false false no-return-value 'string) (define-external-function load-eigenvectors false false no-return-value 'string) (define cur-field 'cur-field) (define-external-function cur-field? false false 'boolean 'SCM) (define-external-function rscalar-field-make false false 'SCM 'SCM) (define-external-function cvector-field-make false false 'SCM 'SCM) (define-external-function cvector-field-nonbloch! false false no-return-value 'SCM) (define-external-function field-make false false 'SCM 'SCM) (define-external-function fields-conform? false false 'boolean 'SCM 'SCM) (define-external-function field-set! false false no-return-value 'SCM 'SCM) (define (field-copy f) (let ((f' (field-make f))) (field-set! f' f) f')) (define-external-function field-load false false no-return-value 'SCM) (define-external-function field-mapL! false false no-return-value 'SCM 'function (make-list-type 'SCM)) (define (field-map! dest f . src) (apply field-mapL! (list dest f src))) (define-external-function integrate-fieldL false false 'cnumber 'function (make-list-type 'SCM)) (define (integrate-fields f . src) (apply integrate-fieldL (list f src))) (define-external-function rscalar-field-get-point false false 'number 'SCM 'vector3) (define-external-function cvector-field-get-point false false 'cvector3 'SCM 'vector3) (define-external-function cvector-field-get-point-bloch false false 'cvector3 'SCM 'vector3) ; **************************************************************** ; Set print-ok? to whether or not we are the MPI master process. ; However, don't try this if we are running within gen-ctl-io, ; as it won't work. (if (not (defined? 'output-source)) ; (a function defined by gen-ctl-io) (set! print-ok? (mpi-is-master?))) (if (and (not (defined? 'output-source)) (using-mpi?)) (set! interactive? false)) ; MPI doesn't support interactive mode ; **************************************************************** ; Utility function to display a comma-delimited list of data for the ; current k point, prefixed by data-name and the current parity. (define (display-kpoint-data data-name data) (print parity data-name ":, " (get-kpoint-index)) (map (lambda (d) (print ", " d)) data) (print "\n")) ; **************************************************************** ; Computing parities: (define-external-function compute-zparities false false (make-list-type 'number)) (define-external-function compute-yparities false false (make-list-type 'number)) (define (display-zparities) (display-kpoint-data "zparity" (compute-zparities))) (define (display-yparities) (display-kpoint-data "yparity" (compute-yparities))) ; **************************************************************** ; Computing group velocities: (define-external-function compute-group-velocity-component false false (make-list-type 'number) 'vector3) ; Return a list of the group velocity vector3's, in the cartesian ; basis (and units of c): (define (compute-group-velocities) (let ((vx (compute-group-velocity-component (cartesian->reciprocal (vector3 1 0 0)))) (vy (compute-group-velocity-component (cartesian->reciprocal (vector3 0 1 0)))) (vz (compute-group-velocity-component (cartesian->reciprocal (vector3 0 0 1))))) (map (lambda (x y z) (vector3 x y z)) vx vy vz))) ; Define a band function to be passed to run, so that you can easily ; display the group velocities for each k-point. (define (display-group-velocities) (display-kpoint-data "velocity" (compute-group-velocities))) ; **************************************************************** ; Add some predefined variables, for convenience: (define vacuum (make dielectric (epsilon 1.0))) (define air vacuum) (define nothing (make material-type)) ; punches a "hole" through objects ; to the default/background material (define infinity 1.0e20) ; big number for infinite dimensions of objects (set! default-material air) ; **************************************************************** ; The remainder of this file consists of Scheme convenience functions. ; **************************************************************** ; Function to convert a k-point k into an equivalent point in the ; first Brillouin zone (not necessarily the irreducible Brillouin zone): (define (first-brillouin-zone k) (define (n k) (vector3-norm (reciprocal->cartesian k))) (define (try+ k v) (if (< (n (vector3+ k v)) (n k)) (try+ (vector3+ k v) v) k)) (define (try k v) (try+ (try+ k v) (vector3- (vector3 0) v))) (define (try-all k) (try (try (try k (vector3 1 0 0)) (vector3 0 1 0)) (vector3 0 0 1))) (define (try-all&repeat k) (let ((knew (try-all k))) (if (< (n knew) (n k)) (try-all&repeat knew) k))) (let ((k0 (vector3- k (vector-map inexact->exact k)))) (if (< (n k0) (n k)) (try-all&repeat k0) (try-all&repeat k)))) ; functions to manipulate the fields; these are mainly convenient ; wrappers for the external functions defined previously. (define (get-efield which-band) (get-dfield which-band) (get-efield-from-dfield)) (define-param filename-prefix "") (define (output-field) (output-field-to-file -1 filename-prefix)) (define (output-field-x) (output-field-to-file 0 filename-prefix)) (define (output-field-y) (output-field-to-file 1 filename-prefix)) (define (output-field-z) (output-field-to-file 2 filename-prefix)) (define (output-epsilon) (get-epsilon) (output-field-to-file -1 filename-prefix)) (define (compute-energy-in-objects . objects) (compute-energy-in-object-list objects)) ; **************************************************************** ; Functions to compute and output gaps, given the lists of frequencies ; computed at each k point. ; The band-range-data is a list if ((min . k-point) . (max . k-point)) ; pairs, with each pair describing the frequency range of a band and ; the k-points where it achieves its maximum/minimum. Here, we update ; this data with a new list of band frequencies, and return the new ; data. If band-range-data is null or too short, the needed entries ; will be created. (define (update-band-range-data band-range-data freqs k-point) (define (ubrd band-range-data freqs br-start) (if (null? freqs) (append (reverse br-start) band-range-data) (let ((br (if (null? band-range-data) (cons (cons infinity -1) (cons (- infinity) -1)) (car band-range-data))) (br-rest (if (null? band-range-data) '() (cdr band-range-data)))) (let ((newmin (if (< (car freqs) (caar br)) (cons (car freqs) k-point) (car br))) (newmax (if (> (car freqs) (cadr br)) (cons (car freqs) k-point) (cdr br)))) (ubrd br-rest (cdr freqs) (cons (cons newmin newmax) br-start)))))) (ubrd band-range-data freqs '())) ; Output the band range data in a nice format: (define (output-band-range-data br-data) (define (obr br i) (if (not (null? br)) (begin (print "Band " i " range: " (caaar br) " at " (cdaar br) " to " (cadar br) " at " (cddar br) "\n") (obr (cdr br) (+ i 1))))) (obr br-data 1)) ; Output any gaps in the given band ranges, and return a list ; of the gaps as a list of (percent freq-min freq-max) lists. (define (output-gaps band-range-data) (define (ogaps br-cur br-rest i gaps) (if (null? br-rest) (reverse gaps) (if (>= (cadr br-cur) (caaar br-rest)) (ogaps (car br-rest) (cdr br-rest) (+ i 1) gaps) (let ((gap-size (/ (* 200 (- (caaar br-rest) (cadr br-cur))) (+ (caaar br-rest) (cadr br-cur))))) (print "Gap from band " i " (" (cadr br-cur) ") to band " (+ i 1) " (" (caaar br-rest) "), " gap-size "%\n") (ogaps (car br-rest) (cdr br-rest) (+ i 1) (cons (list gap-size (cadr br-cur) (caaar br-rest)) gaps)) )))) (if (null? band-range-data) '() (ogaps (car band-range-data) (cdr band-range-data) 1 '()))) ; variables holding the band range data and current list of gaps, in ; the format returned by update-band-range-data and output-gaps, above: (define band-range-data '()) (define gap-list '()) ; Return the frequency gap from the band #lower-band to the band ; #(lower-band+1), as a percentage of mid-gap frequency. The "gap" ; may be negative if the maximum of the lower band is higher than the ; minimum of the upper band. (The gap is computed from the ; band-range-data of the previous run.) (define (retrieve-gap lower-band) (if (> (+ lower-band 1) (length band-range-data)) (error "retrieve-gap called for higher band than was calculated") (let ((f1 (cadr (list-ref band-range-data (- lower-band 1)))) (f2 (caar (list-ref band-range-data lower-band)))) (/ (- f2 f1) (* 0.005 (+ f1 f2)))))) ; **************************************************************** ; stuff to keep statistics on the eigensolver performance, for tuning: (define eigensolver-iters '()) ; the iterations used, updated by (run) (define total-run-time 0.0) ; the total time used by (run) functions (seconds) (define (display-eigensolver-stats) (let ((num-runs (length eigensolver-iters))) (if (> num-runs 0) (let ((min-iters (apply min eigensolver-iters)) (max-iters (apply max eigensolver-iters)) (mean-iters (/ (fold-right + 0 eigensolver-iters) num-runs))) (print "eigensolver iterations for " num-runs " k-points: " min-iters "-" max-iters ", mean = " mean-iters) (if (defined? 'sort) ; sort was added in Guile 1.3.x (let ((sorted-iters (sort eigensolver-iters <))) (let ((median-iters (* 0.5 (+ (list-ref sorted-iters (quotient num-runs 2)) (list-ref sorted-iters (- (quotient (+ num-runs 1) 2) 1)))))) (print ", median = " median-iters)))) (print "\nmean flops per iteration = " (/ eigensolver-flops (* num-runs mean-iters)) "\n") (print "mean time per iteration = " (/ total-run-time (* mean-iters num-runs)) " s\n"))))) ; **************************************************************** ; Define an easy way for the user to split the k-points list over multiple ; processes. k-split-num is the number of chunks to split the k-points into, ; and k-split-index is the index of the current chunk (0 to k-split-num - 1). (define-param k-split-num 1) (define-param k-split-index 0) ; Split a list L into num more-or-less equal pieces, returning the piece ; given by index (in 0..num-1), along with the index in L of the first ; element of the piece, as a car pair: (first-index . piece-of-L). (define (list-split L num index) (define (list-sub L start len index rest) (if (null? L) (reverse rest) (if (and (>= index start) (< index (+ start len))) (list-sub (cdr L) start len (+ index 1) (cons (car L) rest)) (list-sub (cdr L) start len (+ index 1) rest)))) (if (or (>= index num) (negative? index)) (cons (length L) '()) (let ((block-size (quotient (+ (length L) num -1) num))) (let ((start (* index block-size)) (len (min block-size (- (length L) (* index block-size))))) (cons start (list-sub L start len 0 '())))))) ; **************************************************************** (define current-k (vector3 0)) ; current k point in the run function (define all-freqs '()) ; list of all freqs computed in a run ; (run) functions, to do vanilla calculations. They all take zero or ; more "band functions." Each function should take a single ; parameter, the band index, and is called for each band index at ; every k point. These are typically used to output the bands. (define (run-parity p reset-fields . band-functions) (set! total-run-time (+ total-run-time (begin-time "total elapsed time for run: " (set! all-freqs '()) (set! band-range-data '()) (set! interactive? false) ; don't be interactive if we call (run) (begin-time "elapsed time for initialization: " (init-params p (if reset-fields true false)) (if (string? reset-fields) (load-eigenvectors reset-fields))) (let ((k-split (list-split k-points k-split-num k-split-index))) (set-kpoint-index (car k-split)) (if (zero? (car k-split)) (output-epsilon)) ; output epsilon immediately for 1st k block (if (> num-bands 0) (begin (map (lambda (k) (set! current-k k) (begin-time "elapsed time for k point: " (solve-kpoint k)) (set! all-freqs (cons freqs all-freqs)) (set! band-range-data (update-band-range-data band-range-data freqs k)) (set! eigensolver-iters (append eigensolver-iters (list (/ iterations num-bands)))) (map (lambda (f) (if (zero? (procedure-num-args f)) (f) ; f is a thunk: evaluate once per k-point (do ((band 1 (+ band 1))) ((> band num-bands)) (f band)))) band-functions)) (cdr k-split)) (if (> (length (cdr k-split)) 1) (begin (output-band-range-data band-range-data) (set! gap-list (output-gaps band-range-data))) (set! gap-list '())))))))) (set! all-freqs (reverse all-freqs)) ; put them in the right order (print "done.\n")) (define run-polarization run-parity) ; backwards compatibility ; a macro to create a run function with a given name and parity (defmacro-public define-run (name parity) `(define (,name . band-functions) (apply run-parity (append (list ,parity true) band-functions)))) (define-run run NO-PARITY) (define-run run-zeven EVEN-Z) (define-run run-zodd ODD-Z) (define-run run-yeven EVEN-Y) (define-run run-yodd ODD-Y) (define-run run-yeven-zeven (+ EVEN-Y EVEN-Z)) (define-run run-yeven-zodd (+ EVEN-Y ODD-Z)) (define-run run-yodd-zeven (+ ODD-Y EVEN-Z)) (define-run run-yodd-zodd (+ ODD-Y ODD-Z)) (define run-even run-zeven) ; backwards compatibility (define run-odd run-zodd) ; backwards compatibility (define run-te run-zeven) (define run-tm run-zodd) (define run-te-yeven run-yeven-zeven) (define run-te-yodd run-yodd-zeven) (define run-tm-yeven run-yeven-zodd) (define run-tm-yodd run-yodd-zodd) ; **************************************************************** ; Some predefined output functions (functions of the band index), ; for passing to (run). (define (output-hfield which-band) (get-hfield which-band) (output-field)) (define (output-hfield-x which-band) (get-hfield which-band) (output-field-x)) (define (output-hfield-y which-band) (get-hfield which-band) (output-field-y)) (define (output-hfield-z which-band) (get-hfield which-band) (output-field-z)) (define (output-dfield which-band) (get-dfield which-band) (output-field)) (define (output-dfield-x which-band) (get-dfield which-band) (output-field-x)) (define (output-dfield-y which-band) (get-dfield which-band) (output-field-y)) (define (output-dfield-z which-band) (get-dfield which-band) (output-field-z)) (define (output-efield which-band) (get-efield which-band) (output-field)) (define (output-efield-x which-band) (get-efield which-band) (output-field-x)) (define (output-efield-y which-band) (get-efield which-band) (output-field-y)) (define (output-efield-z which-band) (get-efield which-band) (output-field-z)) (define (output-hpwr which-band) (get-hfield which-band) (compute-field-energy) (output-field)) (define (output-dpwr which-band) (get-dfield which-band) (compute-field-energy) (output-field)) (define (get-poynting which-band) (get-efield which-band) ; put E in cur-field (let ((e (field-copy cur-field))) ; ... and copy to local var. (get-hfield which-band) ; put H in cur-field (field-map! cur-field ; write ExH to cur-field (lambda (e h) (vector3-cross (vector3-conj e) h)) e cur-field) (cvector-field-nonbloch! cur-field))) (define (output-poynting which-band) (get-poynting which-band) (output-field-to-file -1 (string-append filename-prefix "flux."))) (define (output-poynting-x which-band) (get-poynting which-band) (output-field-to-file 0 (string-append filename-prefix "flux."))) (define (output-poynting-y which-band) (get-poynting which-band) (output-field-to-file 1 (string-append filename-prefix "flux."))) (define (output-poynting-z which-band) (get-poynting which-band) (output-field-to-file 2 (string-append filename-prefix "flux."))) (define (get-tot-pwr which-band) (get-dfield which-band) (compute-field-energy) (let ((epwr (field-copy cur-field)) (tot-pwr (rscalar-field-make cur-field))) (get-hfield which-band) (compute-field-energy) (field-map! tot-pwr (lambda (epwr hpwr) (+ epwr hpwr)) epwr cur-field) (field-load tot-pwr))) (define (output-tot-pwr which-band) (get-tot-pwr which-band) (output-field-to-file -1 (string-append filename-prefix "tot."))) ; We need a special function to evaluate band functions, since ; band functions can either be a function of the band number or ; a thunk (function of no arguments, evaluated once per k-point). (define (apply-band-func-thunk band-func which-band eval-thunk?) (if (zero? (procedure-num-args band-func)) (if eval-thunk? (band-func)) ; evaluate thunks once per k-point (band-func which-band))) (define (apply-band-func band-func which-band) (apply-band-func-thunk band-func which-band (= which-band 1))) ; The following function returns an output function that calls ; output-func for bands with D energy in objects > min-energy. ; For example, (output-dpwr-in-objects output-dfield 0.20 some-object) ; would return an output function that would spit out the D field ; for bands with at least %20 of their D energy in some-object. (define (output-dpwr-in-objects output-func min-energy . objects) (lambda (which-band) (get-dfield which-band) (compute-field-energy) (let ((energy (compute-energy-in-object-list objects))) ; output the computed energy for grepping: (print "dpwr:, " which-band ", " (list-ref freqs (- which-band 1)) ", " energy "\n") (if (>= energy min-energy) (apply-band-func output-func which-band))))) ; Combines zero or more band functions into one: (define (combine-band-functions . band-funcs) (lambda (which-band) (map (lambda (f) (apply-band-func f which-band)) band-funcs))) ; Only invoke the given band functions for the specified k-point: (define (output-at-kpoint kpoint . band-funcs) (let ((band-func (apply combine-band-functions band-funcs))) (lambda (which-band) (if (vector3= current-k kpoint) (band-func which-band))))) ; Band functions to pick a canonical phase for the eigenstate of the ; given band based upon the spatial representation of the given field: (define (fix-hfield-phase which-band) (get-hfield which-band) (fix-field-phase)) (define (fix-dfield-phase which-band) (get-dfield which-band) (fix-field-phase)) (define (fix-efield-phase which-band) (get-efield which-band) (fix-field-phase)) ; **************************************************************** ; Here, we solve the inverse problem, that of solving for the ; wavevectors for a set of bands at a given frequency. To do ; this, we use the fact that we can compute the group velocities ; cheaply, and thus can employ find-root-deriv (Newton's method). ; Moreover, we save information gathered while finding the k's of ; higher bands to speed the computation for lower bands. (define (find-k p omega band-min band-max kdir tol kmag-guess kmag-min kmag-max . band-funcs) (define (ncdr n lst) (if (> n 0) (ncdr (- n 1) (cdr lst)) lst)) (let ((num-bands-save num-bands) (k-points-save k-points) (nb (- band-max band-min -1)) (kdir1 (cartesian->reciprocal (unit-vector3 (reciprocal->cartesian kdir)))) ; k0s is an array caching the best k value found for each band: (k0s (if (list? kmag-guess) (list->vector kmag-guess) (make-vector (- band-max band-min -1) kmag-guess))) ; bktab is a table (assoc. list) to memoize all (band . k) results: (bktab '())) (define ((rootfun b) k) (let ((tab-val (assoc (cons b k) bktab))) ; first, look in cached table (if tab-val (begin ; use cached result if available (print "find-k " b " at " k ": " (cadr tab-val) " (cached)\n") (cdr tab-val)) (begin ; otherwise, compute bands and cache results (set! num-bands b) (set! k-points (list (vector3-scale k kdir1))) (run-parity p false) (let ((v (compute-group-velocity-component kdir1))) ; cache computed values: (map (lambda (b f v) (let ((tabval (assoc (cons b (vector-ref k0s (- b band-min))) bktab))) (if (or (not tabval) (< (abs (- f omega)) (abs (cadr tabval)))) (vector-set! k0s (- b band-min) k))) ; cache k0 (set! bktab (cons (cons (cons b k) (cons (- f omega) v)) bktab))) (arith-sequence band-min 1 (- b band-min -1)) (ncdr (- band-min 1) freqs) (ncdr (- band-min 1) v)) ; finally return (frequency - omega . derivative): (let ((fun (- (car (reverse freqs)) omega))) (print "find-k " b " at " k ": " fun "\n") (cons fun (car (reverse v))))))))) (randomize-fields) ; don't let previous computations interfere (let ((ks (reverse (map (lambda (b) (find-root-deriv (rootfun b) tol kmag-min kmag-max (vector-ref k0s (- b band-min)))) (arith-sequence band-max -1 nb))))) (if band-funcs (map (lambda (b k) (set! num-bands b) (set! k-points (list (vector3-scale k kdir1))) (run-parity p false (lambda (b') (if (= b' b) (map (lambda (f) (apply-band-func-thunk f b true)) band-funcs))))) (arith-sequence band-max -1 nb) (reverse ks))) (set! num-bands num-bands-save) (set! k-points k-points-save) (print parity "kvals:, " omega ", " band-min ", " band-max) (vector-map (lambda (k) (print ", " k)) kdir1) (map (lambda (k) (print ", " k)) ks) (print "\n") ks))) ; **************************************************************** (define (sqmatrix-diag m) (map (lambda (i) (sqmatrix-ref m i i)) (arith-sequence 0 1 (sqmatrix-size m)))) (define (fix-phase-consistency old-eigs first-band) (let ((dots (dot-eigenvectors old-eigs first-band))) (let ((phases (map (lambda (d) (conj (make-polar 1 (angle d)))) (sqmatrix-diag dots)))) (map (lambda (i phase) (scale-eigenvector i phase) (conj phase)) (arith-sequence first-band 1 (length phases)) phases)))) ; **************************************************************** ; Load GNU Readline support, for easier command-line editing support. ; This is not loaded in by default in Guile 1.3.2+ because readline ; is licensed under the GPL, which would have caused Guile to effectively ; be under the GPL itself. However, since the MIT Photonic Bands package ; is under the GPL too, we can load Readline by default with no problems. @ACTIVATE_READLINE@ ; command to activate readline is determined by configure (set! scm-repl-prompt "mpb> ") ; **************************************************************** mpb-1.4.2/mpb-ctl/my-smob.h0000644000175400001440000000466007540741163011064 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef SMOB_H #define SMOB_H 1 /* use new smob functions from Guile 1.4+ */ #include #ifndef HAVE_SCM_MAKE_SMOB_TYPE /* Thanks to Greg Badros for posting a Guile smob tutorial; see http://sources.redhat.com/ml/guile/1999-04/msg00107.html However, this way of creating smobs no longer works as of Guile 1.4. */ #define REGISTER_SMOBFUNS(T) \ do { scm_tc16_smob_ ## T = scm_newsmob(& T ## _smobfuns); } while (0) #define MAKE_SMOBFUNS(T) \ static scm_smobfuns T ## _smobfuns = { \ &mark_ ## T, \ &free_ ## T, \ &print_ ## T, 0 } #endif /* ! HAVE_SCM_MAKE_SMOB_TYPE */ #ifdef HAVE_SCM_NEWSMOB # define NEWCELL_SMOB(ANSWER,T,PSMOB) \ SCM_NEWSMOB(ANSWER, scm_tc16_smob_ ## T, PSMOB) #else # define NEWCELL_SMOB(ANSWER,T,PSMOB) do { \ SCM_NEWCELL((ANSWER)); \ SCM_SETCAR((ANSWER),scm_tc16_smob_ ## T); \ SCM_SETCDR((ANSWER),(SCM) (PSMOB)); \ } while (0) #endif /* T_SMOB_P(T, X) is true iff X is an instance of the T SMOB type */ #ifdef HAVE_SCM_SMOB_PREDICATE # define T_SMOB_P(T, X) SCM_SMOB_PREDICATE(scm_tc16_smob_ ## T, X) #else # define T_SMOB_P(T, X) (SCM_NIMP (X) \ && SCM_TYP16 (X) == (scm_tc16_smob_ ## T)) #endif /* T_SMOB(T, X) returns the T * with the guts of the X instance; it assumes X is a T SMOB instance, and could crash if it is not */ #ifdef HAVE_SCM_SMOB_DATA # define T_SMOB(T, X) ((T *) SCM_SMOB_DATA(X)) #else # define T_SMOB(T, X) ((T *)SCM2PTR(SCM_CDR(X))) #endif /* Since T_SMOB(X) can be dangerous if X is not a T object, we also have a SAFE_T_SMOB macro: */ #define SAFE_T_SMOB(T, X) (T_SMOB_P(T,X) ? T_SMOB(T,X) : NULL) #endif /* SMOB_H */ mpb-1.4.2/mpb-ctl/examples/0002755000175400001440000000000007631010727011216 5mpb-1.4.2/mpb-ctl/examples/bragg-sine.ctl0000644000175400001440000000213307441566537013673 ; Compute the band structure for a Bragg mirror consisting of a ; sinusoidally-varying dielectric index. ; The index will vary sinusoidally between index-min and index-max: (define-param index-min 1) (define-param index-max 3) (define pi (* 4 (atan 1))) ; 3.14159... ; Define a function of position p (in the lattice basis) that returns ; the material at that position. In this case, we use the function: ; index-min + 0.5 * (index-max - index-min) ; * (1 + cos(2*pi*x)) ; This is periodic, and also has inversion symmetry. (define (eps-func p) (make dielectric (index (+ index-min (* 0.5 (- index-max index-min) (+ 1 (cos (* 2 pi (vector3-x p))))))))) (set! geometry-lattice (make lattice (size 1 no-size no-size))) ; 1d cell ; We'll just make it the default material, so that it goes everywhere. (set! default-material (make material-function (material-func eps-func))) (set! k-points (interpolate 9 (list (vector3 0 0 0) (vector3 0.5 0 0)))) (set-param! resolution 32) (set-param! num-bands 8) ; the TM and TE bands are degenerate, so we only need TM: (run-tm) mpb-1.4.2/mpb-ctl/examples/bragg.ctl0000644000175400001440000000136207441566537012742 ; Compute the bands at the X point for a quarter-wave stack Bragg ; mirror (this is the point that defines the band gap edges). ; the high and low indices: (define-param n-lo 1.0) (define-param n-hi 3.0) (define-param w-hi (/ n-lo (+ n-hi n-lo))) ; a quarter-wave stack (set! geometry-lattice (make lattice (size 1 no-size no-size))) ; 1d cell (set! default-material (make dielectric (index n-lo))) (set! geometry (list (make cylinder (material (make dielectric (index n-hi))) (center 0 0 0) (axis 1 0 0) (radius infinity) (height w-hi)))) (define-param kx 0.5) (set! k-points (list (vector3 kx 0 0))) (set-param! resolution 32) (set-param! num-bands 8) (run-tm) ; note that TM and TE bands are degenerate, so we only need TM mpb-1.4.2/mpb-ctl/examples/check.ctl0000644000175400001440000004245207361143631012725 ; Test suite for MPB. This file runs MPB for a variety of cases, ; and compares it against known results from previous versions. If the ; answers aren't sufficiently close, it exits with an error. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Some general setup and utility routines first: (set! tolerance 1e-9) ; use a low tolerance to get consistent results ; keep track of some error statistics: (define min-err infinity) (define max-err 0) (define sum-err 0) (define num-err 0) ; function to check if two results are sufficently close: (define-param check-tolerance 1e-4) (define (almost-equal? x y) (if (> (abs x) 1e-3) (let ((err (/ (abs (- x y)) (* 0.5 (+ (abs x) (abs y)))))) (set! min-err (min min-err err)) (set! max-err (max max-err err)) (set! num-err (+ num-err 1)) (set! sum-err (+ sum-err err)))) (or (< (abs (- x y)) (* 0.5 check-tolerance (+ (abs x) (abs y)))) (and (< (abs x) 1e-3) (< (abs (- x y)) 1e-3)))) ; Convert a list l into a list of indices '(1 2 ...) of the same length. (define (indices l) (if (null? l) '() (cons 1 (map (lambda (x) (+ x 1)) (indices (cdr l)))))) ; Check whether the freqs returned by a run (all-freqs) match correct-freqs. (define (check-freqs correct-freqs) (define (check-freqs-aux fc-list f-list ik) (define (check-freqs-aux2 fc f ib) (if (not (almost-equal? fc f)) (error "check-freqs: k-point " ik " band " ib " is " f " instead of " fc))) (if (= (length fc-list) (length f-list)) (map check-freqs-aux2 fc-list f-list (indices f-list)) (error "check-freqs: wrong number of bands at k-point " ik))) (if (= (length correct-freqs) (length all-freqs)) (begin (map check-freqs-aux correct-freqs all-freqs (indices all-freqs)) (print "check-freqs: PASSED\n")) (error "check-freqs: wrong number of k-points"))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if (not (using-mpi?)) ; MPI code currently doesn't support 1d systems (begin ; Use a lower tolerance for the 1d cases, since it is cheap; otherwise, ; the Bragg-sine case perennially causes problems. (set! tolerance (/ tolerance 10000)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; First test: a simple 1d Bragg mirror: (print "**************************************************************************\n" " Test case: 1d quarter-wave stack.\n" "**************************************************************************\n" ) (set! geometry (list (make cylinder (material (make dielectric (epsilon 9.0))) (center 0) (axis 1) (radius infinity) (height 0.25)))) (set! k-points (interpolate 4 (list (vector3 0 0 0) (vector3 0.5 0 0)))) (set! grid-size (vector3 32 1 1)) (set! num-bands 8) (define correct-freqs '((0.0 0.648351064758882 0.666667517098436 1.29488075758612 1.33336075391282 1.93757672906421 2.00024045502069 2.57413377730507) (0.0567106459132849 0.599851835766128 0.715264618493464 1.2533516328214 1.37508036430362 1.9023030310515 2.03577843681173 2.5447607302785) (0.111808338549745 0.544964035370552 0.770470132482679 1.19886555431273 1.43019048406127 1.84869942534301 2.09026194963917 2.49305185532527) (0.162554443030826 0.494234387214952 0.821807214979002 1.14762423868064 1.48265526473298 1.79656499475259 2.14420182927269 2.44000721223413) (0.202728586444506 0.454051807431849 0.862903053647553 1.1065252897017 1.52568848270994 1.75360874628753 2.19029794218108 2.3942414201896) (0.219409188989471 0.437366603189744 0.880190598314617 1.08923081762878 1.5443398403343 1.7349704450792 2.21143711778794 2.3731975719957))) (run-tm) (check-freqs correct-freqs) (run-te) (check-freqs correct-freqs) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Second test: a less-simple 1d Bragg mirror, consisting of a sinusoidally ; varying dielectric index (see also bragg-sine.ctl): (print "**************************************************************************\n" " Test case: 1d sinusoidal Bragg mirrors.\n" "**************************************************************************\n" ) (define pi (* 4 (atan 1))) ; 3.14159... (define (eps-func p) (make dielectric (index (+ 2 (cos (* 2 pi (vector3-x p))))))) (set! default-material (make material-function (material-func eps-func))) (set! k-points (interpolate 9 (list (vector3 0 0 0) (vector3 0.5 0 0)))) (set! grid-size (vector3 32 1 1)) (set! num-bands 8) (run-tm) (check-freqs '((0.0 0.460752283717811 0.542059418927331 0.968412011064827 1.01592861336746 1.48283705488259 1.48374633575784 1.9677172977623) (0.0231436084314742 0.454366673639236 0.548556852963559 0.958177155747471 1.02618660946863 1.45880923902184 1.50778401398672 1.94923038830116) (0.046211542432863 0.43910864609908 0.56416208641797 0.938077927197344 1.0463565943812 1.43434696639083 1.53227646120221 1.92515716944815) (0.069114503567596 0.420004628065799 0.583886947263537 0.915558839464672 1.06899842076893 1.40990248972574 1.55677337160932 1.90076649748739) (0.0917307818062977 0.399446033671752 0.605415353767922 0.892293385266758 1.09244722981119 1.38548487907905 1.58126958017841 1.87630217942291) (0.113873900258811 0.378515461211418 0.627800248852586 0.868769802653355 1.11623067344131 1.36110772786128 1.60575883658692 1.85181932375803) (0.135229085992452 0.357912554145201 0.650585137964263 0.845213453792503 1.14015387025798 1.33679639228579 1.63023029383128 1.82734480769861) (0.155218781840958 0.338398194422463 0.673453381248859 0.821821692886828 1.16408502920442 1.31260712790103 1.65466024698586 1.8029089496478) (0.17271618668617 0.321193301395356 0.695971967442052 0.798962935723639 1.18782670146768 1.28869970774005 1.67898024504888 1.77858329794573) (0.185552735718465 0.308516113919293 0.716800284215745 0.777942357002287 1.21065518331675 1.26577816162819 1.70286746606745 1.75469220803656) (0.190472580448255 0.303646927430686 0.728334358202394 0.76634602375042 1.22537034565911 1.25103296039095 1.72050247023166 1.73705584292802))) (set! default-material air) ; don't screw up later tests ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (set! tolerance (* tolerance 10000)) )) ; if (not (using-mpi?)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Square lattice of dielectric rods in air. (print "**************************************************************************\n" " Test case: Square lattice of dielectric rods in air.\n" "**************************************************************************\n" ) (set! geometry (list (make cylinder (material (make dielectric (epsilon 11.56))) (center 0 0) (radius 0.2) (height infinity)))) (set! k-points (interpolate 4 (list (vector3 0) (vector3 0.5) (vector3 0.5 0.5 0) (vector3 0)))) (set! grid-size (vector3 32 32 1)) (set! num-bands 8) (run-te) (check-freqs '((0.0 0.567309249824085 0.785322464218187 0.78533907114069 0.919065314955226 1.01180231506563 1.01180439396285 1.0986987562052) (0.089747533106419 0.565478962844045 0.770909925689672 0.786976045327448 0.911716296164207 1.00922747558406 1.01332658097629 1.12204775958112) (0.178766635242442 0.558183927765058 0.733727796380775 0.791352310664549 0.894869659413299 1.01797556826237 1.01831492275664 1.12431478868499) (0.266049753471709 0.538687892094626 0.690403576061145 0.796919728740922 0.879307985310368 1.02568655836391 1.04031515320176 1.11602169025839) (0.34960857098187 0.496962222790986 0.66067962204941 0.801560565910096 0.869495965837476 1.0350024763644 1.06884798601087 1.10467620761345) (0.413082417117357 0.446395530337967 0.65145059507318 0.803368099819892 0.866189516688412 1.04010576541796 1.09753776038 1.09827456525779) (0.424034318475705 0.450850117081375 0.647112289739006 0.807637589363962 0.86115857996382 0.99417414554491 1.0595794172637 1.11992767773851) (0.455082616824108 0.463338791124478 0.635212403292713 0.819735856354933 0.838315627232708 0.939938902646522 1.01486587270942 1.12838695905218) (0.481198597820564 0.501609229763058 0.618522175753187 0.786155073927434 0.838317450345758 0.913939091232541 0.970884228080751 1.13184861079901) (0.499280260937176 0.556434275007696 0.601659180916135 0.721570044167946 0.862218793047699 0.905816154022519 0.931039089966407 1.13347236398634) (0.507900932587 0.593526292833574 0.593596593124933 0.680566062367046 0.88387598815364 0.903945296603264 0.903949249935734 1.13397288782519) (0.4766282365696 0.551926957646813 0.607311768805225 0.746127961399139 0.852479455285177 0.903785999923616 0.949896076238274 1.13279836961847) (0.373412079642824 0.547353877862403 0.645745076852373 0.820546048524794 0.833821226258539 0.90364772169965 1.02088954489018 1.12643735967833) (0.252290144958668 0.555861520941481 0.701023986684804 0.802063555906004 0.904841846692795 0.906101988454332 1.09483334397003 1.10211421754981) (0.126868830236271 0.564051618328441 0.757943082512391 0.789566003897487 0.91058219271459 0.971875854812309 1.04852328393723 1.12559272973884) (0.0 0.567309249697206 0.785322464388339 0.785339071278791 0.919065315098791 1.01180231580376 1.0118043941002 1.09869875597474))) (run-tm) (check-freqs '((0.0 0.550430733979162 0.566241371578254 0.566241371590288 0.835198392541763 0.872522248550314 0.972318183103308 1.08920254179769) (0.0654861240038261 0.527080481428998 0.566799276739625 0.589165207611584 0.835576055520486 0.870980062620355 0.960846516368135 1.05902201031889) (0.128358448231762 0.495999172056421 0.568271183796953 0.619721421825485 0.833562960542279 0.867048180733246 0.930077475889248 1.04306779424378) (0.185088034665959 0.463940092597231 0.570113900868756 0.653567078126228 0.817881354346977 0.862372411985142 0.90187550142523 1.04123744478054) (0.229126816125475 0.435593887869437 0.571624367586527 0.691156829464893 0.782224998842116 0.858716310201942 0.891825123400888 1.04461063360963) (0.247300696006748 0.422810121349707 0.572206120768814 0.722519491352313 0.749366763369664 0.857346110926564 0.890391539673791 1.0468678713734) (0.250809748878834 0.429554276590146 0.565096567434357 0.720355410169051 0.758471422549885 0.858178250955784 0.890488360212771 1.03491655457074) (0.260255079137602 0.448078995516004 0.547933657276557 0.713707158688594 0.782090347346113 0.86101638088251 0.890741336275652 1.00608368845575) (0.272587744232561 0.473364092545489 0.528315799682105 0.702811847529422 0.814130266536548 0.8667463670677 0.891050068065077 0.96973788503882) (0.28329017996901 0.496884116939824 0.512907153651487 0.690607961839939 0.850483079390603 0.876011183352539 0.89126643613903 0.93077987299414) (0.287601798196358 0.507006838456059 0.507006838475394 0.684706840348946 0.883530037853841 0.883530037866573 0.889824048148961 0.898389144733936) (0.277734985850212 0.494789217195798 0.512794766069262 0.693585317484579 0.841827176583588 0.86555977664715 0.91182965298438 0.91364862207229) (0.241654191448818 0.481926694377318 0.527837662343768 0.687466863320862 0.831639003520604 0.850551381755549 0.915313305877234 0.946702579779498) (0.176222602981777 0.490886438976766 0.546175771973787 0.650073604194652 0.841125231854928 0.853522369326247 0.92744923560386 0.987456182887339) (0.0920144002040036 0.518511998133382 0.560750416146476 0.60406552818857 0.836485468004983 0.868856191329739 0.954250999892416 1.03716877067079) (0.0 0.550430733878627 0.566241371572124 0.566241371574826 0.835198392501417 0.872522248512609 0.972318183150721 1.0892025391774))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Using the targeted solver to find a defect state in a 5x5 triangular ; lattice of rods. (print "**************************************************************************\n" " Test case: 3x3 triangular lattice of rods in air, dipole defect states.\n" "**************************************************************************\n" ) (set! geometry-lattice (make lattice (size 3 3 1) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) (set! k-points (list (vector3 0 0.5 0))) ; K (set! geometry (list (make cylinder (material (make dielectric (epsilon 12))) (center 0 0) (radius 0.2) (height infinity)))) (set! geometry (geometric-objects-lattice-duplicates geometry)) (set! geometry (append geometry (list (make cylinder (center 0 0 0) (radius 0.33) (height infinity) (material (make dielectric (epsilon 12))))))) (set! grid-size (vector3 (* 16 5) (* 16 5) 1)) (set! num-bands 2) (set! target-freq 0.35) (run-tm) (define ct-save check-tolerance) (set! check-tolerance (* ct-save 10)) (check-freqs '((0.335269274821527 0.337652210814253))) (set! check-tolerance ct-save) (set! target-freq 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (print "**************************************************************************\n" " Test case: fcc lattice of air spheres in dielectric.\n" "**************************************************************************\n" ) (set! geometry-lattice (make lattice (basis1 0 1 1) (basis2 1 0 1) (basis3 1 1 0))) (set! k-points (interpolate 1 (list (vector3 0 0.5 0.5) ; X (vector3 0 0.625 0.375) ; U (vector3 0 0.5 0) ; L (vector3 0 0 0) ; Gamma (vector3 0 0.5 0.5) ; X (vector3 0.25 0.75 0.5) ; W (vector3 0.375 0.75 0.375)))) ; K (set! geometry (list (make sphere (center 0) (radius 0.5) (material air)))) (set! default-material (make dielectric (epsilon 11.56))) (set! grid-size (vector3 16 16 16)) (set! mesh-size 5) (set! num-bands 10) (run) (check-freqs '((0.368116356209037 0.369980241542025 0.379067426858622 0.380355825481755 0.49108300146986 0.509321674949346 0.519652077187981 0.521986848659634 0.589861118480048 0.657547105547574) (0.366168952442295 0.375372406889818 0.381873532967479 0.384010857377027 0.468647962388753 0.503195261165308 0.5211472033283 0.529177355618733 0.605687520175585 0.641010575966524) (0.355246298748627 0.378149323797633 0.390663162132607 0.398125290587968 0.435685869130532 0.491330183134628 0.525117050044954 0.539115916262814 0.632010879838287 0.636550876453458) (0.321237491869962 0.32910168786935 0.394743530898447 0.397841804199817 0.460891072117548 0.511490690292887 0.531312372506223 0.544975783308705 0.626070719045844 0.638849253793513) (0.304996789723474 0.306490030344765 0.38399757686853 0.386731926388109 0.49072085711492 0.534558361399195 0.535010673589626 0.538001547079021 0.618866648935078 0.622227387005411) (0.177728088406801 0.178577250117289 0.470894345930347 0.474296006694487 0.503036395546177 0.534075106832263 0.536910305396605 0.53914018449749 0.61872969865244 0.62126604417647) (0.0 0.0 0.517651812996759 0.521927400026579 0.521927400063738 0.542668842573521 0.54266884259157 0.545547143439792 0.606298961911071 0.608727263482667) (0.205019177848376 0.205741665417928 0.47151402965987 0.473988482367252 0.505357910726724 0.524526583531831 0.52820880373352 0.530578318673899 0.599219767232565 0.650319562639214) (0.368116356275522 0.369980241620613 0.379067426974632 0.380355825610059 0.49108300157512 0.509321674971744 0.519652077334165 0.521986848798089 0.589861118539645 0.657547147736461) (0.370158114992911 0.374979196275145 0.382883733677173 0.389256458552047 0.46024288611451 0.498652679435423 0.50235588768182 0.54800304095417 0.61691332252954 0.630865854030288) (0.371583334129105 0.38388611636557 0.384082592553739 0.407084651822841 0.431532334012398 0.487181534553358 0.488970298812729 0.56643459591284 0.619483995411123 0.64959455705408) (0.36210028608351 0.37995099453707 0.387759257999464 0.402824645197872 0.434538805815819 0.490156436339851 0.502759548908983 0.558462259582065 0.626513356662261 0.64047989670839) (0.356962911196037 0.377342903138122 0.389053322326131 0.399531555896904 0.434217203098185 0.491795282316179 0.527518754499718 0.53933002172486 0.633265155959861 0.637548652538048))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (print "**************************************************************************\n" " Test case: simple cubic lattice with anisotropic dielectric.\n" "**************************************************************************\n" ) (set! geometry-lattice (make lattice)) (set! default-material air) (set! k-points (list (vector3 0) (vector3 0.5) (vector3 0.5 0.5) (vector3 0.5 0.5 0.5))) (set! grid-size (vector3 16 16 16)) (set! mesh-size 5) (define hi-all (make dielectric (epsilon 12))) (define hi-x (make dielectric-anisotropic (epsilon-diag 12 1 1))) (define hi-y (make dielectric-anisotropic (epsilon-diag 1 12 1))) (define hi-z (make dielectric-anisotropic (epsilon-diag 1 1 12))) (set! geometry (list (make block (center 0) (size 0.313 0.313 1) (material hi-z)) (make block (center 0) (size 0.313 1 0.313) (material hi-y)) (make block (center 0) (size 1 0.313 0.313) (material hi-x)) (make block (center 0) (size 0.313 0.313 0.313) (material hi-all)))) (set! num-bands 3) (run) (check-freqs '((0.0 0.0 0.54604008820461) (0.250972002681914 0.250975086788192 0.428868017659483) (0.291417685034807 0.33426762303395 0.48002200778248) (0.351623530055896 0.3516235300955 0.483724678054855))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (display-eigensolver-stats) (print "Relative error ranged from " min-err " to " max-err ", with a mean of " (/ sum-err num-err) "\n") (print "PASSED all tests.\n") mpb-1.4.2/mpb-ctl/examples/diamond.ctl0000644000175400001440000000274607441566537013302 ; Dielectric spheres in a diamond (fcc) lattice. This file is used in ; the "Data Analysis Tutorial" section of the MPB manual. (set! geometry-lattice (make lattice (basis-size (sqrt 0.5) (sqrt 0.5) (sqrt 0.5)) (basis1 0 1 1) (basis2 1 0 1) (basis3 1 1 0))) ; Corners of the irreducible Brillouin zone for the fcc lattice, ; in a canonical order: (set! k-points (interpolate 4 (list (vector3 0 0.5 0.5) ; X (vector3 0 0.625 0.375) ; U (vector3 0 0.5 0) ; L (vector3 0 0 0) ; Gamma (vector3 0 0.5 0.5) ; X (vector3 0.25 0.75 0.5) ; W (vector3 0.375 0.75 0.375)))) ; K ; define a couple of parameters (which we can set from the command-line) (define-param eps 11.56) ; the dielectric constant of the spheres (define-param r 0.25) ; the radius of the spheres (define diel (make dielectric (epsilon eps))) ; A diamond lattice has two "atoms" per unit cell: (set! geometry (list (make sphere (center 0.125 0.125 0.125) (radius r) (material diel)) (make sphere (center -0.125 -0.125 -0.125) (radius r) (material diel)))) ; (A simple fcc lattice would have only one sphere/object at the origin.) (set-param! resolution 16) ; use a 16x16x16 grid (set-param! mesh-size 5) (set-param! num-bands 5) ; run calculation, outputting electric-field energy density at the U point: (run (output-at-kpoint (vector3 0 0.625 0.375) output-dpwr)) mpb-1.4.2/mpb-ctl/examples/dos.scm0000644000175400001440000000436607532775275012456 ; A simple function to compute the density of states (DOS) by summing ; Gaussian smoothing functions around each computed frequency point. ; This scheme was suggested by Xavier Gonze and implemented in ABINIT ; (http://www.mapr.ucl.ac.be/Fr/PCPM/ABINIT/), with further ; suggestions by Doug Allan of Corning. (There are also more ; sophisticated algorithms employing the group velocity, but we have ; not implemented them yet.) ; To apply it to output, say, the density of states at 100 points ; points in the frequency range 0 to 1 you would do the following ; (*after* using (run) to compute the frequencies at a bunch of ; k-points filling the irreducible Brillouin zone): ; ; (include "dos.scm") ; (print-dos 0 1 100) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Given a list of frequencies, freqs, and a broadening width df, ; return a function (dos f) that returns the density of states at a ; frequency f. The integral of dos equals the number of elements of ; freqs. See also broaden, below, to compute a default df. (define ((broaden-df freqs df) f) (/ (fold-left + 0 (map (lambda (f0) (exp (- (sqr (/ (- f f0) df))))) freqs)) (* 2 df (sqrt (atan 1))))) ; Return the median difference between consecutive numbers in the list nums. (define (median-diff nums) (let ((snums (sort nums <)) (n (- (length nums) 1))) (let ((sdiff (sort (map (lambda (x y) (- y x)) (reverse (cdr (reverse snums))) (cdr snums)) <))) (* 0.5 (+ (list-ref sdiff (quotient n 2)) (list-ref sdiff (- (quotient (+ n 1) 2) 1))))))) ; Like broaden-df, above, but use a default df given by (median-diff freqs). (define (broaden freqs) (broaden-df freqs (median-diff freqs))) ; Return the broaden (dos) function applied to all-freqs, the list of ; all frequencies computed from the last run. (Actually, all-freqs ; is the list of lists of frequencies at each k-point.) (define (all-freqs-broaden) (broaden (fold-left append '() all-freqs))) ; Output the DOS from all-freqs, at num-freq points from freq-min to freq-max. (define (print-dos freq-min freq-max num-freq) (let ((dos (all-freqs-broaden))) (map (lambda (f) (print "dos:, " f ", " (dos f) "\n")) (interpolate (max 0 (- num-freq 2)) (list freq-min freq-max))))) mpb-1.4.2/mpb-ctl/examples/hole-slab.ctl0000644000175400001440000000407607572572512013526 ; Photonic crystal slab consisting of a triangular lattice of air ; holes in a finite-thickness dielectric slab, optionally with a ; substrate on one side of the slab. See the paper: S. G. Johnson, ; S. Fan, P. R. Villeneuve, J. D. Joannopoulos, L. A. Kolodziejski, ; "Guided modes in photonic crystal slabs," PRB 60, 5751 (August ; 1999). ; Note that this structure has mirror symmetry throught the z=0 plane, ; and we are looking at k-vectors in the xy plane only. Thus, we can ; break up the modes into even and odd (analogous to TE and TM), using ; the run-zeven and run-zodd functions. (define-param h 0.5) ; the thickness of the slab (define-param eps 12.0) ; the dielectric constant of the slab (define-param loweps 1.0) ; the dielectric constant of the substrate (define-param r 0.3) ; the radius of the holes (define-param supercell-h 4) ; height of the supercell ; triangular lattice with vertical supercell: (set! geometry-lattice (make lattice (size 1 1 supercell-h) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) (set! geometry (list (make block (material (make dielectric (epsilon loweps))) (center 0 0 (* 0.25 supercell-h)) (size infinity infinity (* 0.5 supercell-h))) (make block (material (make dielectric (epsilon eps))) (center 0) (size infinity infinity h)) (make cylinder (material air) (center 0) (radius r) (height supercell-h)))) ; 1st Brillouin zone of a triangular lattice: (define Gamma (vector3 0 0 0)) (define M (vector3 0 0.5 0)) (define K (vector3 (/ -3) (/ 3) 0)) (define-param only-K false) ; run with only-K=true to only do this k-point (define-param k-interp 4) ; the number of k points to interpolate (if only-K (set! k-points (list K)) (set! k-points (interpolate k-interp (list Gamma M K Gamma)))) (set-param! resolution (vector3 32 32 16)) (set-param! num-bands 9) ; Run even and odd bands, outputting fields only at the K point: (run-zeven (output-at-kpoint K output-hfield-z)) (run-zodd (output-at-kpoint K output-dfield-z)) (display-eigensolver-stats) mpb-1.4.2/mpb-ctl/examples/honey-rods.ctl0000644000175400001440000000320707441566537013747 ; A honeycomb lattice of dielectric rods in air. (This structure has ; a complete (overlapping TE/TM) band gap.) A honeycomb lattice is really ; just a triangular lattice with two rods per unit cell, so we just ; take the lattice, k-points, etcetera from tri-rods.ctl. (define-param r 0.14) ; the rod radius (define-param eps 12) ; the rod dielectric constant ; triangular lattice: (set! geometry-lattice (make lattice (size 1 1 no-size) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) ; Two rods per unit cell, at the correct positions to form a honeycomb ; lattice, and arranged to have inversion symmetry: (set! geometry (list (make cylinder (center (/ 6) (/ 6) 0) (radius r) (height infinity) (material (make dielectric (epsilon eps)))) (make cylinder (center (/ -6) (/ -6) 0) (radius r) (height infinity) (material (make dielectric (epsilon eps)))))) ; The k-points list, for the Brillouin zone of a triangular lattice: (set! k-points (list (vector3 0 0 0) ; Gamma (vector3 0 0.5 0) ; M (vector3 (/ -3) (/ 3) 0) ; K (vector3 0 0 0))) ; Gamma (define-param k-interp 4) ; number of k-points to interpolate (set! k-points (interpolate k-interp k-points)) (set-param! resolution 32) (set-param! num-bands 8) (run-tm) (run-te) ; Since there is a complete gap, we could instead see it just by using: ; (run) ; The gap is between bands 12 and 13 in this case. (Note that there is ; a false gap between bands 2 and 3, which disappears as you increase the ; k-point resolution.) mpb-1.4.2/mpb-ctl/examples/line-defect.ctl0000644000175400001440000000371507441566537014043 ; A line-defect waveguide in a 2d triangular lattice of dielectric ; rods (c.f. tri-rods.ctl), formed by a row of missing rods along the ; "x" direction. (Here, "x" and "y" refer to the first and second ; basis directions.) This structure supports a single guided band ; within the band gap, much like the analogous waveguide in a square ; lattice of rods (see "Photonic Crystals" by Joannopoulos et al.). (define-param supercell-y 7) ; the (odd) number of lateral supercell periods (set! geometry-lattice (make lattice (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5) (size 1 supercell-y no-size))) (define-param eps 12) ; the dielectric constant of the rods (define-param r 0.2) ; the rod radius in the bulk crystal (set! geometry (list (make cylinder (center 0 0 0) (radius r) (height infinity) (material (make dielectric (epsilon eps)))))) (set! geometry (append ; duplicate the bulk crystal rods over the supercell: (geometric-objects-lattice-duplicates geometry) ; add a rod of air, to erase a row of rods and form a waveguide: (list (make cylinder (center 0) (radius r) (height infinity) (material air))))) (define Gamma (vector3 0 0 0)) (define K' (lattice->reciprocal (vector3 0.5 0 0))) ; edge of Brillouin zone. (set! k-points (interpolate 4 (list Gamma K'))) ; the bigger the supercell, the more bands you need to compute to get ; to the defect modes (the lowest band is "folded" supercell-y times): (define-param extra-bands 5) ; number of extra bands to compute above the gap (set! num-bands (+ supercell-y extra-bands)) (set-param! resolution 32) ; Compute the TM modes, outputting the Ez field in the *middle* of the ; band. (In general, the guided mode in such an air defect may have ; exited the gap by the time it reaches the edge of the Brillouin ; zone at K'.) (run-tm (output-at-kpoint (list-ref k-points (quotient (length k-points) 2)) fix-efield-phase output-efield-z)) mpb-1.4.2/mpb-ctl/examples/sq-rods.ctl0000644000175400001440000000201507613120031013214 ; Compute band structure for a square lattice of dielectric rods ; in air. ; Define various parameters with define-param so that they are ; settable from the command-line (with mpb =): (define-param r 0.2) ; radius of the rods (define-param eps 11.56) ; dielectric constant (define-param k-interp 4) ; number of k points to interpolate (define GaAs (make dielectric (epsilon eps))) (set! geometry-lattice (make lattice (size 1 1 no-size))) ; 2d cell (set! geometry (list (make cylinder (material GaAs) (center 0 0) (radius r) (height infinity)))) (define Gamma (vector3 0 0 0)) (define X (vector3 0.5 0 0)) (define M (vector3 0.5 0.5 0)) (set! k-points (interpolate k-interp (list Gamma X M Gamma))) (set-param! resolution 32) (set-param! num-bands 8) ; Compute the TE and TM bands. Wrap in the (begin-time message ...) ; construct from libctl so that we report the total elapsed time: (begin-time "total time for both TE and TM bands: " (run-te) (run-tm)) (display-eigensolver-stats) mpb-1.4.2/mpb-ctl/examples/tri-holes.ctl0000644000175400001440000000250607573161114013553 ; 2d system: triangular lattice of air holes in dielectric ; This structure has a complete band gap (i.e. a gap in both TE and TM ; simultaneously) for a hole radius of 0.45a and a dielectric constant of ; 12. (See, e.g., the book "Photonic Crystals" by Joannopoulos et al.) ; first, define the lattice vectors and k-points for a triangular lattice: (set! geometry-lattice (make lattice (size 1 1 no-size) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) (define-param kz 0) ; use non-zero kz to consider vertical propagation (set! k-points (list (vector3 0 0 kz) ; Gamma (vector3 0 0.5 kz) ; M (vector3 (/ -3) (/ 3) kz) ; K (vector3 0 0 kz))) ; Gamma (define-param k-interp 4) (set! k-points (interpolate k-interp k-points)) ; Now, define the geometry, etcetera: (define-param eps 12) ; the dielectric constant of the background (define-param r 0.45) ; the hole radius (set! default-material (make dielectric (epsilon eps))) (set! geometry (list (make cylinder (center 0) (material air) (radius r) (height infinity)))) (set-param! resolution 32) (set-param! num-bands 8) (if (= kz 0) (begin (run-te) (run-tm)) (run)) ; if kz != 0 there are no purely te and tm bands mpb-1.4.2/mpb-ctl/examples/tri-rods.ctl0000644000175400001440000000162207441566537013422 ; A triangular lattice of dielectric rods in air. (This structure has ; a band-gap for TM fields.) This file is used in the "Data Analysis ; Tutorial" section of the MPB manual. (set! num-bands 8) (set! geometry-lattice (make lattice (size 1 1 no-size) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) (set! geometry (list (make cylinder (center 0 0 0) (radius 0.2) (height infinity) (material (make dielectric (epsilon 12)))))) (set! k-points (list (vector3 0 0 0) ; Gamma (vector3 0 0.5 0) ; M (vector3 (/ -3) (/ 3) 0) ; K (vector3 0 0 0))) ; Gamma (set! k-points (interpolate 4 k-points)) (set! resolution 32) (run-tm (output-at-kpoint (vector3 (/ -3) (/ 3) 0) fix-efield-phase output-efield-z)) (run-te) mpb-1.4.2/mpb-ctl/examples/tutorial.ctl0000644000175400001440000001171207441566537013523 ; This file contains the Scheme commands from the user tutorial section ; of the manual. It is meant to be run interactively by the user. ; *** Our First Band Structure *** (print "********** Square lattice of rods in air **********\n") (set! num-bands 8) (set! k-points (list (vector3 0 0 0) ; Gamma (vector3 0.5 0 0) ; X (vector3 0.5 0.5 0) ; M (vector3 0 0 0))) ; Gamma (set! k-points (interpolate 4 k-points)) (set! geometry (list (make cylinder (center 0 0 0) (radius 0.2) (height infinity) (material (make dielectric (epsilon 12)))))) (set! geometry-lattice (make lattice (size 1 1 no-size))) (set! resolution 32) (print "********** Square lattice of rods: TE bands**********\n") (run-te) (print "********** Square lattice of rods: TM bands **********\n") (run-tm) (print "********** Square lattice of rods: TM, w/efield **********\n") (run-tm output-efield-z) (print "********** Square lattice of rods: TE, w/hfield & dpwr **********\n") (run-te (output-at-kpoint (vector3 0.5 0 0) output-hfield-z output-dpwr)) ; *** Bands of a Triangular Lattice *** (print "********** Triangular lattice of rods in air **********\n") (set! geometry-lattice (make lattice (size 1 1 no-size) (basis1 (/ (sqrt 3) 2) 0.5) (basis2 (/ (sqrt 3) 2) -0.5))) (set! k-points (list (vector3 0 0 0) ; Gamma (vector3 0 0.5 0) ; M (vector3 (/ -3) (/ 3) 0) ; K (vector3 0 0 0))) ; Gamma (set! k-points (interpolate 4 k-points)) (run-tm) ; *** Maximizing the First TM Gap *** (print "********** Maximizing the first TM gap **********\n") (define (first-tm-gap r) (set! geometry (list (make cylinder (center 0 0 0) (radius r) (height infinity) (material (make dielectric (epsilon 12)))))) (run-tm) (retrieve-gap 1)) ; return the gap from TM band 1 to TM band 2 (set! num-bands 2) (set! mesh-size 7) ; increase from default value of 3 (define result (maximize first-tm-gap 0.1 0.1 0.5)) (print "radius at maximum: " (max-arg result) "\n") (print "gap size at maximum: " (max-val result) "\n") (set! mesh-size 3) ; reset to default value of 3 ; *** A Complete 2D Gap with an Anisotropic Dielectric *** (print "********** Anisotropic complete 2d gap **********\n") (set! geometry (list (make cylinder (center 0 0 0) (radius 0.3) (height infinity) (material (make dielectric-anisotropic (epsilon-diag 1 1 12)))))) (set! default-material (make dielectric-anisotropic (epsilon-diag 12 12 1))) (set! num-bands 8) (run) ; just use run, instead of run-te or run-tm, to find the complete gap ; *** Finding a Point-defect State *** (print "********** 5x5 point defect **********\n") (set! geometry-lattice (make lattice (size 5 5 no-size))) (set! geometry (list (make cylinder (center 0 0 0) (radius 0.2) (height infinity) (material (make dielectric (epsilon 12)))))) (set! geometry (geometric-objects-lattice-duplicates geometry)) (set! geometry (append geometry (list (make cylinder (center 0 0 0) (radius 0.2) (height infinity) (material air))))) (set! resolution 16) (set! k-points (list (vector3 0.5 0.5 0))) (set! num-bands 50) (run-tm) (output-efield-z 25) (get-dfield 25) ; compute the D field for band 25 (compute-field-energy) ; compute the energy density from D (print "energy in cylinder: " (compute-energy-in-objects (make cylinder (center 0 0 0) (radius 1.0) (height infinity) (material air))) "\n") (print "********** 5x5 point defect, targeted solver **********\n") (set! num-bands 1) ; only need to compute a single band, now! (set! target-freq (/ (+ 0.2812 0.4174) 2)) (set! tolerance 1e-8) (run-tm) ; *** Tuning the Point-defect Mode *** (print "********** Tuning the 5x5 point defect **********\n") (define old-geometry geometry) ; save the 5x5 grid with a missing rod (define (rootfun eps) ; add the cylinder of epsilon = eps to the old geometry: (set! geometry (append old-geometry (list (make cylinder (center 0 0 0) (radius 0.2) (height infinity) (material (make dielectric (epsilon eps))))))) (run-tm) ; solve for the mode (using the targeted solver) (print "epsilon = " eps " gives freq. = " (list-ref freqs 0) "\n") (- (list-ref freqs 0) 0.314159)) ; return 1st band freq. - 0.314159 (define rooteps (find-root rootfun 0.01 1 12)) (print "root (value of epsilon) is at: " rooteps "\n") (define rootval (rootfun rooteps)) (print "root function at " rooteps " = " rootval "\n") mpb-1.4.2/src/0002755000175400001440000000000007631010734006627 5mpb-1.4.2/src/matrices/0002755000175400001440000000000007631010727010440 5mpb-1.4.2/src/matrices/Makefile.in0000644000175400001440000000113507540733107012426 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I../util -I. @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ AR = ar all: libs OBJECTS = eigensolver.o eigensolver_utils.o \ evectmatrix.o sqmatrix.o matrices.o blasglue.o \ minpack2-linmin.o linmin.o eigensolver_davidson.o LIBNAME = matrices.a libs: $(LIBNAME) matrices.a: $(OBJECTS) rm -f $@ $(AR) r $@ $(OBJECTS) $(RANLIB) $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ clean: rm -f $(OBJECTS) core $(LIBNAME) mpb-1.4.2/src/matrices/README0000644000175400001440000000246206563000551011237 In this directory are datatypes and subroutines to handle matrix types and operations common to iterative block eigensolver algorithms. The block eigensolver algorithm itself is implemented in eigensolver.c. Such algorithms solve for the first p eigenstates of an n x n (sparse) matrix A. This corresponds to minimizing Yt*A*Y under the constraint Yt*Y==1, where Y is an n x p matrix whose columns are the eigenvectors and Yt is its adjoint. The components of Y are, in general, complex vectors of length c. We define two datatypes: evectmatrix -- An (N x c) x p matrix (row-major) whose columns are the eigenvects. n = localN*c rows are stored local to the current process. sqmatrix -- a p x p matrix. These are typically used to hold things like Yt*Y. The main reason for having two separate datatypes is that, on a parallel machine, evectmatrix's are distributed while sqmatrix's are not. (In particular, evectmatrix's are distributed across their rows.) Various operations are defined on these matrices (multiplication, a X + Y, etcetera, typically using BLAS routines internally). The sqmatrix type also has operations like (dense) inversion and diagonalization (based on LAPACK). Together, these operations can be used to easily implement most eigensolver algorithms. mpb-1.4.2/src/matrices/blasglue.c0000644000175400001440000002244407446257377012350 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /* Glue code to make the interface to BLAS routines more C-like. These routines take care of translating between C and Fortran argument conventions, including array formats--the C code can call these routines using ordinary row-major convention, and the arguments will be translated to Fortran's column-major format automatically. (No data movement is required for this.) Note that, where in Fortran you pass the leading dimension ("ld") of each array to the routines, in C (here) we pass the final dimension ("fd") of each array. This code also automatically selects the right version of the BLAS routines, depending upon which data type is defined in scalar.h. */ /* This file also includes similar glue code for some LAPACK routines. */ /*************************************************************************/ #include #include #include "../config.h" #include #include "blasglue.h" #include "scalar.h" /*************************************************************************/ /* Define a macro F(x,X) that works similarly to the F77_FUNC macro except that it appends an appropriate BLAS prefix (c,z,s,d) to the routine name depending upon the type defined in scalar.h */ #ifdef SCALAR_COMPLEX # ifdef SCALAR_SINGLE_PREC # define F(x,X) F77_FUNC(c##x, C##X) # else # define F(x,X) F77_FUNC(z##x, Z##X) # endif #else # ifdef SCALAR_SINGLE_PREC # define F(x,X) F77_FUNC(s##x, S##X) # else # define F(x,X) F77_FUNC(d##x, D##X) # endif #endif /* FR(x,X) is for functions where we always pass real arguments, even when SCALAR_COMPLEX is defined. */ #ifdef SCALAR_SINGLE_PREC # define FR(x,X) F77_FUNC(s##x, S##X) #else # define FR(x,X) F77_FUNC(d##x, D##X) #endif /*************************************************************************/ /* Prototypes for BLAS and LAPACK functions. Note that we need to wrap these in extern "C" if this is compiled under C++, or all hell will break loose. (i.e. C++'s name munging will conflict with Fortran's.) */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ extern void F(axpy,AXPY) (int *, scalar *, scalar *, int *, scalar *, int *); extern void F(scal,SCAL) (int *, scalar *, scalar *, int *); extern void F(copy,COPY) (int *, scalar *, int *, scalar *, int *); extern scalar F(dotc,DOTC) (int *, scalar *, int *, scalar *, int *); extern scalar F(dot,DOT) (int *, scalar *, int *, scalar *, int *); extern void F(gemm,GEMM) (char *, char *, int *, int *, int *, scalar *, scalar *, int *, scalar *, int *, scalar *, scalar *, int *); extern void F(herk,HERK) (char *, char *, int *, int *, real *, scalar *, int *, real *, scalar *, int *); extern void F(syrk,SYRK) (char *, char *, int *, int *, real *, scalar *, int *, real *, scalar *, int *); extern void F(potrf,POTRF) (char *, int *, scalar *, int *, int *); extern void F(potri,POTRI) (char *, int *, scalar *, int *, int *); extern void F(hetrf,HETRF) (char *, int *, scalar *, int *, int *, scalar *, int *, int *); extern void F(hetri,HETRI) (char *, int *, scalar *, int *, int *, scalar *, int *); extern void F(sytrf,SYTRF) (char *, int *, scalar *, int *, int *, scalar *, int *, int *); extern void F(sytri,SYTRI) (char *, int *, scalar *, int *, int *, scalar *, int *); extern void F(heev,HEEV) (char *, char *, int *, scalar *, int *, real *, scalar *, int *, real *, int *); extern void FR(syev,SYEV) (char *, char *, int *, real *, int *, real *, real *, int *, int *); #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ /*************************************************************************/ void blasglue_axpy(int n, real a, scalar *x, int incx, scalar *y, int incy) { scalar alpha; ASSIGN_REAL(alpha, a); F(axpy,AXPY) (&n, &alpha, x, &incx, y, &incy); } void blasglue_scal(int n, scalar a, scalar *x, int incx) { F(scal,SCAL) (&n, &a, x, &incx); } void blasglue_rscal(int n, real a, scalar *x, int incx) { scalar alpha; ASSIGN_REAL(alpha, a); F(scal,SCAL) (&n, &alpha, x, &incx); } void blasglue_copy(int n, scalar *x, int incx, scalar *y, int incy) { F(copy,COPY) (&n, x, &incx, y, &incy); } scalar blasglue_dotc(int n, scalar *x, int incx, scalar *y, int incy) { #ifndef NO_FORTRAN_FUNCTIONS # ifdef SCALAR_COMPLEX return (F(dotc,DOTC) (&n, x, &incx, y, &incy)); # else return (F(dot,DOT) (&n, x, &incx, y, &incy)); # endif #else /* on some machines, return values from Fortran functions don't work */ int i; scalar sum = SCALAR_INIT_ZERO; for (i = 0; i < n; ++i) { # ifdef SCALAR_COMPLEX real x_re = x[i*incx].re, x_im = x[i*incx].im; real y_re = y[i*incy].re, y_im = y[i*incy].im; /* the dot product is conj(x) * y: */ sum.re += x_re * y_re + x_im * y_im; sum.im += x_re * y_im - x_im * y_re; # else sum += x[i*incx] * y[i*incy]; # endif } return sum; #endif } void blasglue_gemm(char transa, char transb, int m, int n, int k, real a, scalar *A, int fdA, scalar *B, int fdB, real b, scalar *C, int fdC) { scalar alpha, beta; if (m*n == 0) return; if (k == 0) { int i, j; for (i = 0; i < m; ++i) for (j = 0; j < n; ++j) ASSIGN_ZERO(C[i*fdC + j]); return; } CHECK(A != C && B != C, "gemm output array must be distinct"); ASSIGN_REAL(alpha,a); ASSIGN_REAL(beta,b); F(gemm,GEMM) (&transb, &transa, &n, &m, &k, &alpha, B, &fdB, A, &fdA, &beta, C, &fdC); } void blasglue_herk(char uplo, char trans, int n, int k, real a, scalar *A, int fdA, real b, scalar *C, int fdC) { if (n == 0) return; if (k == 0) { int i, j; for (i = 0; i < n; ++i) for (j = 0; j < n; ++j) ASSIGN_ZERO(C[i*fdC + j]); return; } CHECK(A != C, "herk output array must be distinct"); uplo = uplo == 'U' ? 'L' : 'U'; trans = (trans == 'C' || trans == 'T') ? 'N' : 'C'; #ifdef SCALAR_COMPLEX F(herk,HERK) (&uplo, &trans, &n, &k, &a, A, &fdA, &b, C, &fdC); #else F(syrk,SYRK) (&uplo, &trans, &n, &k, &a, A, &fdA, &b, C, &fdC); #endif } /*************************************************************************/ #ifndef NO_LAPACK void lapackglue_potrf(char uplo, int n, scalar *A, int fdA) { int info; uplo = uplo == 'U' ? 'L' : 'U'; F(potrf,POTRF) (&uplo, &n, A, &fdA, &info); CHECK(info >= 0, "invalid argument in potrf"); CHECK(info <= 0, "non positive-definite matrix in potrf"); } void lapackglue_potri(char uplo, int n, scalar *A, int fdA) { int info; uplo = uplo == 'U' ? 'L' : 'U'; F(potri,POTRI) (&uplo, &n, A, &fdA, &info); CHECK(info >= 0, "invalid argument in potri"); CHECK(info <= 0, "zero diagonal element (singular matrix) in potri"); } void lapackglue_hetrf(char uplo, int n, scalar *A, int fdA, int *ipiv, scalar *work, int lwork) { int info; uplo = uplo == 'U' ? 'L' : 'U'; #ifdef SCALAR_COMPLEX F(hetrf,HETRF) (&uplo, &n, A, &fdA, ipiv, work, &lwork, &info); #else F(sytrf,SYTRF) (&uplo, &n, A, &fdA, ipiv, work, &lwork, &info); #endif CHECK(info >= 0, "invalid argument in hetrf"); CHECK(info <= 0, "singular matrix in hetrf"); } void lapackglue_hetri(char uplo, int n, scalar *A, int fdA, int *ipiv, scalar *work) { int info; uplo = uplo == 'U' ? 'L' : 'U'; #ifdef SCALAR_COMPLEX F(hetri,HETRI) (&uplo, &n, A, &fdA, ipiv, work, &info); #else F(sytri,SYTRI) (&uplo, &n, A, &fdA, ipiv, work, &info); #endif CHECK(info >= 0, "invalid argument in hetri"); CHECK(info <= 0, "zero diagonal element (singular matrix) in hetri"); } void lapackglue_heev(char jobz, char uplo, int n, scalar *A, int fdA, real *w, scalar *work, int lwork, real *rwork) { int info; uplo = uplo == 'U' ? 'L' : 'U'; #ifdef SCALAR_COMPLEX F(heev,HEEV) (&jobz, &uplo, &n, A, &fdA, w, work, &lwork, rwork, &info); #else F(syev,SYEV) (&jobz, &uplo, &n, A, &fdA, w, work, &lwork, &info); #endif CHECK(info >= 0, "invalid argument in heev"); CHECK(info <= 0, "failure to converge in heev"); } void lapackglue_syev(char jobz, char uplo, int n, real *A, int fdA, real *w, real *work, int lwork) { int info; uplo = uplo == 'U' ? 'L' : 'U'; FR(syev,SYEV) (&jobz, &uplo, &n, A, &fdA, w, work, &lwork, &info); CHECK(info >= 0, "invalid argument in heev"); CHECK(info <= 0, "failure to converge in heev"); } #endif mpb-1.4.2/src/matrices/blasglue.h0000644000175400001440000000416507446257377012355 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef BLASGLUE_H #define BLASGLUE_H #include "scalar.h" extern void blasglue_axpy(int n, real a, scalar *x, int incx, scalar *y, int incy); extern void blasglue_scal(int n, scalar a, scalar *x, int incx); extern void blasglue_rscal(int n, real a, scalar *x, int incx); extern void blasglue_copy(int n, scalar *x, int incx, scalar *y, int incy); extern scalar blasglue_dotc(int n, scalar *x, int incx, scalar *y, int incy); void blasglue_gemm(char transa, char transb, int m, int n, int k, real a, scalar *A, int fdA, scalar *B, int fdB, real b, scalar *C, int fdC); extern void blasglue_herk(char uplo, char trans, int n, int k, real a, scalar *A, int fdA, real b, scalar *C, int fdC); extern void lapackglue_potrf(char uplo, int n, scalar *A, int fdA); extern void lapackglue_potri(char uplo, int n, scalar *A, int fdA); extern void lapackglue_hetrf(char uplo, int n, scalar *A, int fdA, int *ipiv, scalar *work, int lwork); extern void lapackglue_hetri(char uplo, int n, scalar *A, int fdA, int *ipiv, scalar *work); extern void lapackglue_heev(char jobz, char uplo, int n, scalar *A, int fdA, real *w, scalar *work, int lwork, real *rwork); extern void lapackglue_syev(char jobz, char uplo, int n, real *A, int fdA, real *w, real *work, int lwork); #endif /* BLASGLUE_H */ mpb-1.4.2/src/matrices/eigensolver.c0000644000175400001440000005624507446257377013102 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include #include #include #include #include "eigensolver.h" #include "linmin.h" extern void eigensolver_get_eigenvals_aux(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectmatrix Work1, evectmatrix Work2, sqmatrix U, sqmatrix Usqrt, sqmatrix Uwork); #define STRINGIZEx(x) #x /* a hack so that we can stringize macro values */ #define STRINGIZE(x) STRINGIZEx(x) #define K_PI 3.141592653589793238462643383279502884197 #define MIN2(a,b) ((a) < (b) ? (a) : (b)) #define MAX2(a,b) ((a) > (b) ? (a) : (b)) /* Evalutate op, and set t to the elapsed time (in seconds). */ #define TIME_OP(t, op) { \ mpiglue_clock_t xxx_time_op_start_time = MPIGLUE_CLOCK; \ { \ op; \ } \ (t) = MPIGLUE_CLOCK_DIFF(MPIGLUE_CLOCK, xxx_time_op_start_time); \ } /**************************************************************************/ #define EIGENSOLVER_MAX_ITERATIONS 10000 #define FEEDBACK_TIME 4.0 /* elapsed time before we print progress feedback */ /* Number of iterations after which to reset conjugate gradient direction to steepest descent. (Picked after some experimentation. Is there a better basis? Should this change with the problem size?) */ #define CG_RESET_ITERS 70 /* Threshold for trace(1/YtY) = trace(U) before we reorthogonalize: */ #define EIGS_TRACE_U_THRESHOLD 1e8 /**************************************************************************/ /* estimated times/iteration for different iteration schemes, based on the measure times for various operations and the operation counts: */ #define EXACT_LINMIN_TIME(t_AZ, t_KZ, t_ZtW, t_ZS, t_ZtZ, t_linmin) \ ((t_AZ)*2 + (t_KZ) + (t_ZtW)*4 + (t_ZS)*2 + (t_ZtZ)*2 + (t_linmin)) #define APPROX_LINMIN_TIME(t_AZ, t_KZ, t_ZtW, t_ZS, t_ZtZ) \ ((t_AZ)*2 + (t_KZ) + (t_ZtW)*2 + (t_ZS)*2 + (t_ZtZ)*2) /* Guess for the convergence slowdown factor due to the approximate line minimization. It is probably best to be conservative, as the exact line minimization is more reliable and we only want to abandon it if there is a big speed gain. */ #define APPROX_LINMIN_SLOWDOWN_GUESS 2.0 /* We also don't want to use the approximate line minimization if the exact line minimization makes a big difference in the value of the trace that's achieved (i.e. if one step of Newton's method on the trace derivative does not do a good job). The following is the maximum improvement by the exact line minimization (over one step of Newton) at which we'll allow the use of approximate line minimization. */ #define APPROX_LINMIN_IMPROVEMENT_THRESHOLD 0.05 /**************************************************************************/ typedef struct { sqmatrix YtAY, DtAD, symYtAD, YtY, DtD, symYtD, S1, S2, S3; } trace_func_data; static double trace_func(double theta, double *trace_deriv, void *data) { double trace; trace_func_data *d = (trace_func_data *) data; { double c = cos(theta), s = sin(theta); sqmatrix_copy(d->S1, d->YtY); sqmatrix_aApbB(c*c, d->S1, s*s, d->DtD); sqmatrix_ApaB(d->S1, 2*s*c, d->symYtD); sqmatrix_invert(d->S1, 1, d->S2); sqmatrix_copy(d->S2, d->YtAY); sqmatrix_aApbB(c*c, d->S2, s*s, d->DtAD); sqmatrix_ApaB(d->S2, 2*s*c, d->symYtAD); trace = SCALAR_RE(sqmatrix_traceAtB(d->S2, d->S1)); } if (trace_deriv) { double c2 = cos(2*theta), s2 = sin(2*theta); sqmatrix_copy(d->S3, d->YtAY); sqmatrix_ApaB(d->S3, -1.0, d->DtAD); sqmatrix_aApbB(-0.5 * s2, d->S3, c2, d->symYtAD); *trace_deriv = SCALAR_RE(sqmatrix_traceAtB(d->S1, d->S3)); sqmatrix_AeBC(d->S3, d->S1, 0, d->S2, 1); sqmatrix_AeBC(d->S2, d->S3, 0, d->S1, 1); sqmatrix_copy(d->S3, d->YtY); sqmatrix_ApaB(d->S3, -1.0, d->DtD); sqmatrix_aApbB(-0.5 * s2, d->S3, c2, d->symYtD); *trace_deriv -= SCALAR_RE(sqmatrix_traceAtB(d->S2, d->S3)); *trace_deriv *= 2; } return trace; } /**************************************************************************/ #define EIG_HISTORY_SIZE 5 void eigensolver(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectpreconditioner K, void *Kdata, evectconstraint constraint, void *constraint_data, evectmatrix Work[], int nWork, real tolerance, int *num_iterations, int flags) { real convergence_history[EIG_HISTORY_SIZE]; evectmatrix G, D, X, prev_G; short usingConjugateGradient = 0, use_polak_ribiere = 0, use_linmin = 1; real E, prev_E = 0.0; real d_scale = 1.0; real traceGtX, prev_traceGtX = 0.0; real theta, prev_theta = 0.5; int i, iteration = 0; mpiglue_clock_t prev_feedback_time; real time_AZ, time_KZ=0, time_ZtZ, time_ZtW, time_ZS, time_linmin=0; real linmin_improvement = 0; sqmatrix YtAYU, DtAD, symYtAD, YtY, U, DtD, symYtD, S1, S2, S3; trace_func_data tfd; prev_feedback_time = MPIGLUE_CLOCK; #ifdef DEBUG flags |= EIGS_VERBOSE; #endif CHECK(nWork >= 2, "not enough workspace"); G = Work[0]; X = Work[1]; usingConjugateGradient = nWork >= 3; if (usingConjugateGradient) { D = Work[2]; for (i = 0; i < D.n * D.p; ++i) ASSIGN_ZERO(D.data[i]); } else D = X; use_polak_ribiere = nWork >= 4; if (use_polak_ribiere) { prev_G = Work[3]; for (i = 0; i < Y.n * Y.p; ++i) ASSIGN_ZERO(prev_G.data[i]); if (flags & EIGS_ORTHOGONAL_PRECONDITIONER) /* see below */ fprintf(stderr, "WARNING: Polak-Ribiere may not work with the " "orthogonal-preconditioner option.\n"); } else prev_G = G; YtAYU = create_sqmatrix(Y.p); /* holds Yt A Y */ DtAD = create_sqmatrix(Y.p); /* holds Dt A D */ symYtAD = create_sqmatrix(Y.p); /* holds (Yt A D + Dt A Y) / 2 */ YtY = create_sqmatrix(Y.p); /* holds Yt Y */ U = create_sqmatrix(Y.p); /* holds 1 / (Yt Y) */ DtD = create_sqmatrix(Y.p); /* holds Dt D */ symYtD = create_sqmatrix(Y.p); /* holds (Yt D + Dt Y) / 2 */ /* Notation note: "t" represents a dagger superscript, so Yt represents adjoint(Y), or Y' in MATLAB syntax. */ /* scratch matrices: */ S1 = create_sqmatrix(Y.p); S2 = create_sqmatrix(Y.p); S3 = create_sqmatrix(Y.p); tfd.YtAY = S1; tfd.DtAD = DtAD; tfd.symYtAD = symYtAD; tfd.YtY = YtY; tfd.DtD = DtD; tfd.symYtD = symYtD; tfd.S1 = YtAYU; tfd.S2 = S2; tfd.S3 = S3; if (flags & EIGS_ORTHONORMALIZE_FIRST_STEP) { evectmatrix_XtX(U, Y, S2); sqmatrix_invert(U, 1, S2); sqmatrix_sqrt(S1, U, S2); /* S1 = 1/sqrt(Yt*Y) */ evectmatrix_XeYS(G, Y, S1, 1); /* G = orthonormalize Y */ evectmatrix_copy(Y, G); } for (i = 0; i < Y.p; ++i) eigenvals[i] = 0.0; for (i = 0; i < EIG_HISTORY_SIZE; ++i) convergence_history[i] = 10000.0; if (constraint) constraint(Y, constraint_data); do { real y_norm, gamma_numerator = 0; if (flags & EIGS_FORCE_APPROX_LINMIN) use_linmin = 0; TIME_OP(time_ZtZ, evectmatrix_XtX(YtY, Y, S2)); y_norm = sqrt(SCALAR_RE(sqmatrix_trace(YtY)) / Y.p); blasglue_rscal(Y.p * Y.n, 1/y_norm, Y.data, 1); blasglue_rscal(Y.p * Y.p, 1/(y_norm*y_norm), YtY.data, 1); sqmatrix_copy(U, YtY); sqmatrix_invert(U, 1, S2); /* If trace(1/YtY) gets big, it means that the columns of Y are becoming nearly parallel. This sometimes happens, especially in the targeted eigensolver, because the preconditioner pushes all the columns towards the ground state. If it gets too big, it seems to be a good idea to re-orthogonalize, resetting conjugate-gradient, as otherwise we start to encounter numerical problems. */ if (flags & EIGS_REORTHOGONALIZE) { real traceU = SCALAR_RE(sqmatrix_trace(U)); mpi_assert_equal(traceU); if (traceU > EIGS_TRACE_U_THRESHOLD * U.p) { mpi_one_printf(" re-orthonormalizing Y\n"); sqmatrix_sqrt(S1, U, S2); /* S1 = 1/sqrt(Yt*Y) */ evectmatrix_XeYS(G, Y, S1, 1); /* G = orthonormalize Y */ evectmatrix_copy(Y, G); prev_traceGtX = 0.0; evectmatrix_XtX(YtY, Y, S2); y_norm = sqrt(SCALAR_RE(sqmatrix_trace(YtY)) / Y.p); blasglue_rscal(Y.p * Y.n, 1/y_norm, Y.data, 1); blasglue_rscal(Y.p * Y.p, 1/(y_norm*y_norm), YtY.data, 1); sqmatrix_copy(U, YtY); sqmatrix_invert(U, 1, S2); } } TIME_OP(time_AZ, A(Y, X, Adata, 1, G)); /* X = AY; G is scratch */ /* G = AYU; note that U is Hermitian: */ TIME_OP(time_ZS, evectmatrix_XeYS(G, X, U, 1)); TIME_OP(time_ZtW, evectmatrix_XtY(YtAYU, Y, G, S2)); E = SCALAR_RE(sqmatrix_trace(YtAYU)); CHECK(!BADNUM(E), "crazy number detected in trace!!\n"); mpi_assert_equal(E); convergence_history[iteration % EIG_HISTORY_SIZE] = 200.0 * fabs(E - prev_E) / (fabs(E) + fabs(prev_E)); if (iteration > 0 && mpi_is_master() && ((flags & EIGS_VERBOSE) || MPIGLUE_CLOCK_DIFF(MPIGLUE_CLOCK, prev_feedback_time) > FEEDBACK_TIME)) { printf(" iteration %4d: " "trace = %0.16g (%g%% change)\n", iteration, E, convergence_history[iteration % EIG_HISTORY_SIZE]); if (flags & EIGS_VERBOSE) debug_output_malloc_count(); fflush(stdout); /* make sure output appears */ prev_feedback_time = MPIGLUE_CLOCK; /* reset feedback clock */ } if (iteration > 0 && fabs(E - prev_E) < tolerance * 0.5 * (E + prev_E + 1e-7)) break; /* convergence! hooray! */ /* Compute gradient of functional: G = (1 - Y U Yt) A Y U */ sqmatrix_AeBC(S1, U, 0, YtAYU, 0); evectmatrix_XpaYS(G, -1.0, Y, S1, 1); /* set X = precondition(G): */ if (K != NULL) { TIME_OP(time_KZ, K(G, X, Kdata, Y, NULL, YtY)); /* Note: we passed NULL for eigenvals since we haven't diagonalized YAY (nor are the Y's orthonormal). */ } else evectmatrix_copy(X, G); /* preconditioner is identity */ /* We have to apply the constraint here, in case it doesn't commute with the preconditioner. */ if (constraint) constraint(X, constraint_data); if (flags & EIGS_PROJECT_PRECONDITIONING) { /* Operate projection P = (1 - Y U Yt) on X: */ evectmatrix_XtY(symYtD, Y, X, S2); /* symYtD = Yt X */ sqmatrix_AeBC(S1, U, 0, symYtD, 0); evectmatrix_XpaYS(X, -1.0, Y, S1, 0); } /* Now, for the case of EIGS_ORTHOGONAL_PRECONDITIONER, we need to use G as scratch space in order to avoid the need for an extra column bundle. Before that, we need to do any computations that we need with G. (Yes, we're playing tricksy games here, but isn't it fun?) */ mpi_assert_equal(traceGtX = SCALAR_RE(evectmatrix_traceXtY(G, X))); if (usingConjugateGradient) { if (use_polak_ribiere) { /* assign G = G - prev_G and copy prev_G = G in the same loop. We can't use the BLAS routines because we would then need an extra n x p array. */ for (i = 0; i < Y.n * Y.p; ++i) { scalar g = G.data[i]; ACCUMULATE_DIFF(G.data[i], prev_G.data[i]); prev_G.data[i] = g; } gamma_numerator = SCALAR_RE(evectmatrix_traceXtY(G, X)); } else /* otherwise, use Fletcher-Reeves (ignore prev_G) */ gamma_numerator = traceGtX; mpi_assert_equal(gamma_numerator); } /* The motivation for the following code came from a trick I noticed in Sleijpen and Van der Vorst, "A Jacobi-Davidson iteration method for linear eigenvalue problems," SIAM J. Matrix Anal. Appl. 17, 401-425 (April 1996). (The motivation in our case comes from the fact that if you look at the Hessian matrix of the problem, it has a projection operator just as in the above reference, and so we should the same technique to invert it.) So far, though, the hoped-for savings haven't materialized; maybe we need a better preconditioner first. */ if (flags & EIGS_ORTHOGONAL_PRECONDITIONER) { real traceGtX_delta; /* change in traceGtX when we update X */ /* set G = precondition(Y): */ if (K != NULL) K(Y, G, Kdata, Y, NULL, YtY); else evectmatrix_copy(G, Y); /* preconditioner is identity */ /* let X = KG - KY S3t, where S3 is chosen so that YtX = 0: S3 = (YtKG)t / (YtKY). Recall that, at this point, X holds KG and G holds KY. K is assumed Hermitian. */ evectmatrix_XtY(S1, Y, G, S2); sqmatrix_invert(S1, 0, S2); /* S1 = 1 / (YtKY) */ evectmatrix_XtY(S2, X, Y, S3); /* S2 = GtKY = (YtKG)t */ sqmatrix_AeBC(S3, S2, 0 , S1, 1); evectmatrix_XpaYS(X, -1.0, G, S3, 1); /* Update traceGtX and gamma_numerator. The update for gamma_numerator isn't really right in the case of Polak-Ribiere; it amounts to doing a weird combination of P-R and Fletcher-Reeves...what will happen? (To do the right thing, I think we would need an extra column bundle.) */ traceGtX_delta = -SCALAR_RE(sqmatrix_traceAtB(S3, S2)); traceGtX += traceGtX_delta; if (usingConjugateGradient) gamma_numerator += traceGtX_delta; } /* In conjugate-gradient, the minimization direction D is a combination of X with the previous search directions. Otherwise, we just have D = X. */ if (usingConjugateGradient) { real gamma; if (prev_traceGtX == 0.0) gamma = 0.0; else gamma = gamma_numerator / prev_traceGtX; if ((flags & EIGS_DYNAMIC_RESET_CG) && 2.0 * convergence_history[iteration % EIG_HISTORY_SIZE] >= convergence_history[(iteration+1) % EIG_HISTORY_SIZE]) { gamma = 0.0; if (flags & EIGS_VERBOSE) mpi_one_printf(" dynamically resetting CG direction...\n"); for (i = 1; i < EIG_HISTORY_SIZE; ++i) convergence_history[(iteration+i) % EIG_HISTORY_SIZE] = 10000.0; } if ((flags & EIGS_RESET_CG) && (iteration + 1) % CG_RESET_ITERS == 0) { /* periodically forget previous search directions, and just juse D = X */ gamma = 0.0; if (flags & EIGS_VERBOSE) mpi_one_printf(" resetting CG direction...\n"); } mpi_assert_equal(gamma * d_scale); evectmatrix_aXpbY(gamma * d_scale, D, 1.0, X); } d_scale = 1.0; /* Minimize the trace along Y + lamba*D: */ if (!use_linmin) { real dE, E2, d2E, t, d_norm; /* Here, we do an approximate line minimization along D by evaluating dE (the derivative) at the current point, and the trace E2 at a second point, and then approximating the second derivative d2E by finite differences. Then, we use one step of Newton's method on the derivative. This has the advantage of requiring two fewer O(np^2) matrix multiplications compared to the exact linmin. */ d_norm = sqrt(SCALAR_RE(evectmatrix_traceXtY(D,D)) / Y.p); mpi_assert_equal(d_norm); /* dE = 2 * tr Gt D. (Use prev_G instead of G so that it works even when we are using Polak-Ribiere.) */ dE = 2.0 * SCALAR_RE(evectmatrix_traceXtY(prev_G, D)) / d_norm; /* shift Y by prev_theta along D, in the downhill direction: */ t = dE < 0 ? -fabs(prev_theta) : fabs(prev_theta); evectmatrix_aXpbY(1.0, Y, t / d_norm, D); evectmatrix_XtX(U, Y, S2); sqmatrix_invert(U, 1, S2); /* U = 1 / (Yt Y) */ A(Y, G, Adata, 1, X); /* G = AY; X is scratch */ evectmatrix_XtY(S1, Y, G, S2); /* S1 = Yt A Y */ E2 = SCALAR_RE(sqmatrix_traceAtB(S1, U)); mpi_assert_equal(E2); /* Get finite-difference approximation for the 2nd derivative of the trace. Equivalently, fit to a quadratic of the form: E(theta) = E + dE theta + 1/2 d2E theta^2 */ d2E = (E2 - E - dE * t) / (0.5 * t * t); theta = -dE/d2E; /* If the 2nd derivative is negative, or a big shift in the trace is predicted (compared to the previous iteration), then this approximate line minimization is probably not very good; switch back to the exact line minimization. Hopefully, we won't have to abort like this very often, as it wastes operations. */ if (d2E < 0 || -0.5*dE*theta > 20.0 * fabs(E-prev_E)) { if (flags & EIGS_FORCE_APPROX_LINMIN) { if (flags & EIGS_VERBOSE) mpi_one_printf(" using previous stepsize\n"); } else { if (flags & EIGS_VERBOSE) mpi_one_printf(" switching back to exact " "line minimization\n"); use_linmin = 1; evectmatrix_aXpbY(1.0, Y, -t / d_norm, D); prev_theta = atan(prev_theta); /* convert to angle */ /* don't do this again: */ flags |= EIGS_FORCE_EXACT_LINMIN; } } else { /* Shift Y by theta, hopefully minimizing the trace: */ evectmatrix_aXpbY(1.0, Y, (theta - t) / d_norm, D); } } if (use_linmin) { real dE, d2E; d_scale = sqrt(SCALAR_RE(evectmatrix_traceXtY(D, D)) / Y.p); mpi_assert_equal(d_scale); blasglue_rscal(Y.p * Y.n, 1/d_scale, D.data, 1); A(D, G, Adata, 0, X); /* G = A D; X is scratch */ evectmatrix_XtX(DtD, D, S2); evectmatrix_XtY(DtAD, D, G, S2); evectmatrix_XtY(S1, Y, D, S2); sqmatrix_symmetrize(symYtD, S1); evectmatrix_XtY(S1, Y, G, S2); sqmatrix_symmetrize(symYtAD, S1); sqmatrix_AeBC(S1, U, 0, symYtD, 1); dE = 2.0 * (SCALAR_RE(sqmatrix_traceAtB(U, symYtAD)) - SCALAR_RE(sqmatrix_traceAtB(YtAYU, S1))); sqmatrix_copy(S2, DtD); sqmatrix_ApaBC(S2, -4.0, symYtD, 0, S1, 0); sqmatrix_AeBC(S3, symYtAD, 0, S1, 0); sqmatrix_AeBC(S1, U, 0, S2, 1); d2E = 2.0 * (SCALAR_RE(sqmatrix_traceAtB(U, DtAD)) - SCALAR_RE(sqmatrix_traceAtB(YtAYU, S1)) - 4.0 * SCALAR_RE(sqmatrix_traceAtB(U, S3))); /* this is just Newton-Raphson to find a root of the first derivative: */ theta = -dE/d2E; if (d2E < 0) { if (flags & EIGS_VERBOSE) mpi_one_printf(" near maximum in trace\n"); theta = dE > 0 ? -fabs(prev_theta) : fabs(prev_theta); } else if (-0.5*dE*theta > 2.0 * fabs(E-prev_E)) { if (flags & EIGS_VERBOSE) mpi_one_printf(" large trace change predicted " "(%g%%)\n", -0.5*dE*theta/E * 100.0); } if (fabs(theta) >= K_PI) { if (flags & EIGS_VERBOSE) mpi_one_printf(" large theta (%g)\n", theta); theta = dE > 0 ? -fabs(prev_theta) : fabs(prev_theta); } /* Set S1 to YtAYU * YtY = YtAY for use in linmin. (tfd.YtAY == S1). */ sqmatrix_AeBC(S1, YtAYU, 0, YtY, 1); mpi_assert_equal(theta); { double new_E, new_dE; TIME_OP(time_linmin, theta = linmin(&new_E, &new_dE, theta, E, dE, 0.1, MIN2(tolerance, 1e-6), 1e-14, 0, dE > 0 ? -K_PI : K_PI, trace_func, &tfd, flags & EIGS_VERBOSE)); linmin_improvement = fabs(E - new_E) * 2.0/fabs(E + new_E); } mpi_assert_equal(theta); CHECK(fabs(theta) <= K_PI, "converged out of bounds!"); /* Shift Y to new location minimizing the trace along D: */ evectmatrix_aXpbY(cos(theta), Y, sin(theta), D); } /* In exact arithmetic, we don't need to do this, but in practice it is probably a good idea to keep errors from adding up and eventually violating the constraints. */ if (constraint) constraint(Y, constraint_data); prev_traceGtX = traceGtX; prev_theta = theta; prev_E = E; /* Finally, we use the times for the various operations to help us pick an algorithm for the next iteration: */ { real t_exact, t_approx; t_exact = EXACT_LINMIN_TIME(time_AZ, time_KZ, time_ZtW, time_ZS, time_ZtZ, time_linmin); t_approx = APPROX_LINMIN_TIME(time_AZ, time_KZ, time_ZtW, time_ZS, time_ZtZ); if (flags & EIGS_PROJECT_PRECONDITIONING) { t_exact += time_ZtW + time_ZS; t_approx += time_ZtW + time_ZS; } /* Sum the times over the processors so that all the processors compare the same, average times. */ mpi_allreduce_1(&t_exact, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); mpi_allreduce_1(&t_approx, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); if (!(flags & EIGS_FORCE_EXACT_LINMIN) && linmin_improvement > 0 && linmin_improvement <= APPROX_LINMIN_IMPROVEMENT_THRESHOLD && t_exact > t_approx * APPROX_LINMIN_SLOWDOWN_GUESS) { if ((flags & EIGS_VERBOSE) && use_linmin) mpi_one_printf(" switching to approximate " "line minimization (decrease time by %g%%)\n", (t_exact - t_approx) * 100.0 / t_exact); use_linmin = 0; } else if (!(flags & EIGS_FORCE_APPROX_LINMIN)) { if ((flags & EIGS_VERBOSE) && !use_linmin) mpi_one_printf(" switching back to exact " "line minimization\n"); use_linmin = 1; prev_theta = atan(prev_theta); /* convert to angle */ } } } while (++iteration < EIGENSOLVER_MAX_ITERATIONS); CHECK(iteration < EIGENSOLVER_MAX_ITERATIONS, "failure to converge after " STRINGIZE(EIGENSOLVER_MAX_ITERATIONS) " iterations"); evectmatrix_XtX(U, Y, S2); sqmatrix_invert(U, 1, S2); eigensolver_get_eigenvals_aux(Y, eigenvals, A, Adata, X, G, U, S1, S2); *num_iterations = iteration; destroy_sqmatrix(S3); destroy_sqmatrix(S2); destroy_sqmatrix(S1); destroy_sqmatrix(symYtD); destroy_sqmatrix(DtD); destroy_sqmatrix(U); destroy_sqmatrix(YtY); destroy_sqmatrix(symYtAD); destroy_sqmatrix(DtAD); destroy_sqmatrix(YtAYU); } mpb-1.4.2/src/matrices/eigensolver.h0000644000175400001440000000601307441753311013053 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef EIGENSOLVER_H #define EIGENSOLVER_H #include typedef void (*evectoperator) (evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work); typedef void (*evectpreconditioner) (evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); typedef void (*evectconstraint) (evectmatrix X, void *data); extern void eigensolver(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectpreconditioner K, void *Kdata, evectconstraint constraint, void *constraint_data, evectmatrix Work[], int nWork, real tolerance, int *num_iterations, int flags); extern void eigensolver_davidson(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectpreconditioner K, void *Kdata, evectconstraint constraint, void *constraint_data, evectmatrix Work[], int nWork, real tolerance, int *num_iterations, int flags, real target); extern void eigensolver_get_eigenvals(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectmatrix Work1, evectmatrix Work2); /* eigensolver option flags, designed to be combined with a bitwise or ('|'); each flag should set exactly one bit. */ #define EIGS_VERBOSE (1<<0) #define EIGS_PROJECT_PRECONDITIONING (1<<1) #define EIGS_RESET_CG (1<<2) #define EIGS_FORCE_EXACT_LINMIN (1<<3) #define EIGS_FORCE_APPROX_LINMIN (1<<4) #define EIGS_ORTHONORMALIZE_FIRST_STEP (1<<5) #define EIGS_REORTHOGONALIZE (1<<6) #define EIGS_DYNAMIC_RESET_CG (1<<7) #define EIGS_ORTHOGONAL_PRECONDITIONER (1<<8) /* default flags: what we think works best most of the time: */ #define EIGS_DEFAULT_FLAGS (EIGS_RESET_CG | EIGS_REORTHOGONALIZE) typedef struct evectconstraint_chain_struct { evectconstraint C; void *constraint_data; struct evectconstraint_chain_struct *next; } evectconstraint_chain; extern evectconstraint_chain *evect_add_constraint(evectconstraint_chain *constraints, evectconstraint C, void *constraint_data); extern void evect_destroy_constraints(evectconstraint_chain *constraints); extern void evectconstraint_chain_func(evectmatrix X, void *data); #endif /* EIGENSOLVER_H */ mpb-1.4.2/src/matrices/eigensolver_davidson.c0000644000175400001440000001646407441753311014750 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /* This file contains an alternative eigensolver, currently experimental, based on the Davidson method (a preconditioned variant of Lanczos): M. Crouzeix, B. Philippe, and M. Sadkane, "The Davidson Method," SIAM J. Sci. Comput. 15, no. 1, pp. 62-76 (January 1994). */ #include #include #include #include "../config.h" #include #include #include #include #include #include #include "eigensolver.h" extern void eigensolver_get_eigenvals_aux(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectmatrix Work1, evectmatrix Work2, sqmatrix U, sqmatrix Usqrt, sqmatrix Uwork); #define STRINGIZEx(x) #x /* a hack so that we can stringize macro values */ #define STRINGIZE(x) STRINGIZEx(x) /**************************************************************************/ #define EIGENSOLVER_MAX_ITERATIONS 10000 #define FEEDBACK_TIME 4.0 /* elapsed time before we print progress feedback */ /**************************************************************************/ void eigensolver_davidson(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectpreconditioner K, void *Kdata, evectconstraint constraint, void *constraint_data, evectmatrix Work[], int nWork, real tolerance, int *num_iterations, int flags, real target) { int nbasis, q; evectmatrix *AV, *V; sqmatrix VAV, S, Swork, U, S2, S3, I; mpiglue_clock_t prev_feedback_time; int iteration = 0, ibasis = 0; real *eigenvals2, prev_E = 0; prev_feedback_time = MPIGLUE_CLOCK; #ifdef DEBUG flags |= EIGS_VERBOSE; #endif CHECK(nWork >= 4, "not enough workspace"); nbasis = nWork / 2; V = Work; AV = Work + nbasis; q = Y.p * nbasis; VAV = create_sqmatrix(q); S = create_sqmatrix(q); Swork = create_sqmatrix(q); sqmatrix_resize(&VAV, 0, 0); sqmatrix_resize(&S, 0, 0); sqmatrix_resize(&Swork, 0, 0); CHK_MALLOC(eigenvals2, real, q); U = create_sqmatrix(Y.p); S2 = create_sqmatrix(Y.p); S3 = create_sqmatrix(Y.p); I = create_sqmatrix(0); if (constraint) constraint(Y, constraint_data); evectmatrix_XtX(U, Y, S3); sqmatrix_invert(U, 1, S3); sqmatrix_sqrt(S2, U, S3); /* S2 = 1/sqrt(Yt*Y) */ evectmatrix_XeYS(V[0], Y, S2, 1); /* V[0] = orthonormalize Y */ do { real E; int itarget, i; A(V[ibasis], AV[ibasis], Adata, 0, Y); q = Y.p * (ibasis + 1); sqmatrix_resize(&VAV, q, 1); sqmatrix_resize(&S, q, 0); sqmatrix_resize(&Swork, q, 0); for (i = 0; i <= ibasis; ++i) { evectmatrixXtY_sub(VAV, Y.p * (q * i + ibasis), V[i], AV[ibasis], S3); } sqmatrix_copy_upper2full(S, VAV); sqmatrix_eigensolve(S, eigenvals2, Swork); /* find index itarget of start of "window" around the target frequency : */ if (target == 0.0) /* not attempting targeted eigensolver */ itarget = 0; else { /* note that this technique seems to have convergence trouble */ for (itarget = 0; itarget + Y.p < q && fabs(target - eigenvals2[itarget]) > fabs(target - eigenvals2[itarget + Y.p]); ++itarget) ; } for (E = 0.0, i = 0; i < Y.p; ++i) { E += (eigenvals[i] = eigenvals2[itarget + i]); } mpi_assert_equal(E); /* compute Y = best eigenvectors */ for (i = 0; i <= ibasis; ++i) { evectmatrix_aXpbYS_sub(i ? 1.0 : 0.0, Y, 1.0, V[i], S, itarget * q + Y.p * i, 1); } if (iteration > 0 && mpi_is_master() && ((flags & EIGS_VERBOSE) || MPIGLUE_CLOCK_DIFF(MPIGLUE_CLOCK, prev_feedback_time) > FEEDBACK_TIME)) { printf(" iteration %4d: " "trace = %0.16g (%g%% change)\n", iteration, E, 200.0 * fabs(E - prev_E) / (fabs(E) + fabs(prev_E))); fflush(stdout); /* make sure output appears */ prev_feedback_time = MPIGLUE_CLOCK; /* reset feedback clock */ } if (iteration > 0 && fabs(E - prev_E) < tolerance * 0.5 * (fabs(E) + fabs(prev_E) + 1e-7)) break; /* convergence! hooray! */ /* compute new directions from residual & update basis: */ { int ibasis2 = (ibasis + 1) % nbasis; /* compute V[ibasis2] = AY */ #if 1 for (i = 0; i <= ibasis; ++i) { evectmatrix_aXpbYS_sub(i ? 1.0 : 0.0, V[ibasis2], 1.0, AV[i], S, itarget * q + Y.p * i, 1); } #else A(Y, V[ibasis2], Adata, 1, Y); #endif /* handle restart case: */ if (ibasis2 == 0) { evectmatrix_copy(AV[0], V[0]); evectmatrix_copy(V[0], Y); sqmatrix_resize(&VAV, Y.p, 0); evectmatrix_XtY(VAV, V[0], AV[0], S3); ibasis2 = 1; evectmatrix_copy(V[ibasis2], AV[0]); } /* V[ibasis2] = residual = AY - Y * eigenvals */ matrix_XpaY_diag_real(V[ibasis2].data, -1.0, Y.data, eigenvals, Y.n, Y.p); /* AV[ibasis2] = precondition V[ibasis2]: */ if (K != NULL) K(V[ibasis2], AV[ibasis2], Kdata, Y, eigenvals, I); else evectmatrix_copy(AV[ibasis2], V[ibasis2]); /* project by the constraints, if any: */ if (constraint) constraint(AV[ibasis2], constraint_data); /* orthogonalize against previous V: */ for (i = 0; i < ibasis2; ++i) { evectmatrix_XtY(U, V[i], AV[ibasis2], S3); evectmatrix_XpaYS(AV[ibasis2], -1.0, V[i], U, 0); } /* orthonormalize within itself: */ evectmatrix_XtX(U, AV[ibasis2], S3); sqmatrix_invert(U, 1, S3); sqmatrix_sqrt(S2, U, S3); evectmatrix_XeYS(V[ibasis2], AV[ibasis2], S2, 1); ibasis = ibasis2; } prev_E = E; } while (++iteration < EIGENSOLVER_MAX_ITERATIONS); CHECK(iteration < EIGENSOLVER_MAX_ITERATIONS, "failure to converge after " STRINGIZE(EIGENSOLVER_MAX_ITERATIONS) " iterations"); evectmatrix_XtX(U, Y, S3); sqmatrix_invert(U, 1, S3); eigensolver_get_eigenvals_aux(Y, eigenvals, A, Adata, V[0], AV[0], U, S3, S2); free(eigenvals2); destroy_sqmatrix(VAV); destroy_sqmatrix(S); destroy_sqmatrix(Swork); destroy_sqmatrix(U); destroy_sqmatrix(S2); destroy_sqmatrix(S3); destroy_sqmatrix(I); *num_iterations = iteration; } mpb-1.4.2/src/matrices/eigensolver_utils.c0000644000175400001440000000641407441753311014273 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include #include #include "eigensolver.h" /**************************************************************************/ void eigensolver_get_eigenvals_aux(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectmatrix Work1, evectmatrix Work2, sqmatrix U, sqmatrix Usqrt, sqmatrix Uwork) { sqmatrix_sqrt(Usqrt, U, Uwork); /* Usqrt = 1/sqrt(Yt*Y) */ evectmatrix_XeYS(Work1, Y, Usqrt, 1); /* Work1 = orthornormalize(Y) */ A(Work1, Work2, Adata, 1, Y); /* Work2 = A Work1; Y is scratch */ evectmatrix_XtY(U, Work1, Work2, Uwork); /* U = Work1 * A * Work1 */ sqmatrix_eigensolve(U, eigenvals, Uwork); evectmatrix_XeYS(Y, Work1, U, 1); } void eigensolver_get_eigenvals(evectmatrix Y, real *eigenvals, evectoperator A, void *Adata, evectmatrix Work1, evectmatrix Work2) { sqmatrix U, Usqrt, Uwork; U = create_sqmatrix(Y.p); Usqrt = create_sqmatrix(Y.p); Uwork = create_sqmatrix(Y.p); evectmatrix_XtX(U, Y, Uwork); sqmatrix_invert(U, 1, Uwork); eigensolver_get_eigenvals_aux(Y, eigenvals, A, Adata, Work1, Work2, U, Usqrt, Uwork); destroy_sqmatrix(U); destroy_sqmatrix(Usqrt); destroy_sqmatrix(Uwork); } /**************************************************************************/ /* Subroutines for chaining constraints, to make it easy to pass multiple constraint functions to the eigensolver: */ evectconstraint_chain *evect_add_constraint(evectconstraint_chain *constraints, evectconstraint C, void *constraint_data) { evectconstraint_chain *new_constraints; CHK_MALLOC(new_constraints, evectconstraint_chain, 1); new_constraints->C = C; new_constraints->constraint_data = constraint_data; new_constraints->next = constraints; return new_constraints; } void evect_destroy_constraints(evectconstraint_chain *constraints) { while (constraints) { evectconstraint_chain *cur_constraint = constraints; constraints = constraints->next; free(cur_constraint); } } void evectconstraint_chain_func(evectmatrix X, void *data) { evectconstraint_chain *constraints = (evectconstraint_chain *) data; while (constraints) { if (constraints->C) constraints->C(X, constraints->constraint_data); constraints = constraints->next; } } mpb-1.4.2/src/matrices/evectmatrix.c0000644000175400001440000002133707446257377013105 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include "../config.h" #include #include #include "matrices.h" #include "blasglue.h" extern double evectmatrix_flops = 0; /* Operations on evectmatrix blocks: X + a Y, X * S, X + a Y * S, Xt * X, Xt * Y, trace(Xt * Y), etc. (X, Y: evectmatrix, S: sqmatrix) */ /* X = Y */ void evectmatrix_copy(evectmatrix X, evectmatrix Y) { CHECK(X.n == Y.n && X.p == Y.p, "arrays not conformant"); blasglue_copy(X.n * X.p, Y.data, 1, X.data, 1); } /* set p selected columns of X to those in Y, starting at ix and iy. */ void evectmatrix_copy_slice(evectmatrix X, evectmatrix Y, int ix, int iy, int p) { CHECK(ix + p <= X.p && iy + p <= Y.p && ix >= 0 && iy >= 0 && X.n == Y.n, "invalid arguments to evectmatrix_copy_slice"); if (ix == 0 && iy == 0 && p == X.p && p == Y.p) evectmatrix_copy(X, Y); else if (p == 1) blasglue_copy(X.n, Y.data + iy, Y.p, X.data + ix, X.p); else { int i; for (i == 0; i < X.n; ++i) blasglue_copy(p, Y.data + iy + i * Y.p, 1, X.data + ix + i * X.p, 1); } } /* Resize A from its current size to an nxp matrix, assuming that A was initially allocated to hold at least this big a matrix. If preserve_data is nonzero, copies the existing data in A (or a subset of it, if the matrix is shrinking) to the corresponding entries of the resized matrix. */ void evectmatrix_resize(evectmatrix *A, int p, short preserve_data) { CHECK(p <= A->alloc_p, "tried to resize beyond allocated limit"); if (preserve_data) { int i, j; if (p < A->p) { for (i = 0; i < A->n; ++i) for (j = 0; j < p; ++j) A->data[i*p + j] = A->data[i*A->p + j]; } else { for (i = A->n-1; i >= 0; --i) for (j = A->p-1; j >= 0; --j) A->data[i*p + j] = A->data[i*A->p + j]; } } A->p = p; } /* compute X = a*X + b*Y; X and Y may be equal. */ void evectmatrix_aXpbY(real a, evectmatrix X, real b, evectmatrix Y) { CHECK(X.n == Y.n && X.p == Y.p, "arrays not conformant"); if (a != 1.0) blasglue_rscal(X.n * X.p, a, X.data, 1); blasglue_axpy(X.n * X.p, b, Y.data, 1, X.data, 1); evectmatrix_flops += X.N * X.c * X.p * 3; } /* Compute X = a*X + b*Y*S. Instead of using the entire S matrix, however, we use only a Y.p x Y.p submatrix, beginning at the element indexed by Soffset. If sdagger != 0, then the adjoint of the submatrix is used instead of the submatrix. */ void evectmatrix_aXpbYS_sub(real a, evectmatrix X, real b, evectmatrix Y, sqmatrix S, int Soffset, short sdagger) { if (S.p == 0) /* we treat the S.p == 0 case as if S were the identity */ evectmatrix_aXpbY(a, X, b, Y); else { CHECK(X.n == Y.n && X.p == Y.p && X.p <= S.p, "arrays not conformant"); CHECK(Soffset + (Y.p-1)*S.p + Y.p <= S.p*S.p, "submatrix exceeds matrix bounds"); blasglue_gemm('N', sdagger ? 'C' : 'N', X.n, X.p, X.p, b, Y.data, Y.p, S.data + Soffset, S.p, a, X.data, X.p); evectmatrix_flops += X.N * X.c * X.p * (3 + 2 * X.p); } } /* compute X = YS. If sherm != 0, then S is assumed to be Hermitian. This can be used to make the multiplication more efficient. */ void evectmatrix_XeYS(evectmatrix X, evectmatrix Y, sqmatrix S, short sherm) { CHECK(S.p == 0 || S.p == Y.p, "arrays not conformant"); evectmatrix_aXpbYS_sub(0.0, X, 1.0, Y, S, 0, sherm); } /* compute X += a Y * S. If sdagger != 0, then St is used instead of S. */ void evectmatrix_XpaYS(evectmatrix X, real a, evectmatrix Y, sqmatrix S, short sdagger) { CHECK(S.p == 0 || S.p == Y.p, "arrays not conformant"); evectmatrix_aXpbYS_sub(1.0, X, a, Y, S, 0, sdagger); } /* compute U = adjoint(X) * X, with S a scratch matrix. */ void evectmatrix_XtX(sqmatrix U, evectmatrix X, sqmatrix S) { CHECK(X.p == U.p && U.p <= S.alloc_p, "matrices not conformant"); /* blasglue_gemm('C', 'N', X.p, X.p, X.n, 1.0, X.data, X.p, X.data, X.p, 0.0, S.data, U.p); */ /* take advantage of the fact that U is Hermitian and only write out the upper triangle of the matrix */ blasglue_herk('U', 'C', X.p, X.n, 1.0, X.data, X.p, 0.0, S.data, U.p); evectmatrix_flops += X.N * X.c * X.p * (X.p - 1); /* Now, copy the conjugate of the upper half onto the lower half of S */ { int i, j; for (i = 0; i < U.p; ++i) for (j = i + 1; j < U.p; ++j) { ASSIGN_CONJ(S.data[j * U.p + i], S.data[i * U.p + j]); } } mpi_allreduce(S.data, U.data, U.p * U.p * SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } /* Dot p selected columns of X with those in Y, starting at ix and iy. Stores the result in U, with S a scratch matrix. */ void evectmatrix_XtY_slice(sqmatrix U, evectmatrix X, evectmatrix Y, int ix, int iy, int p, sqmatrix S) { CHECK(ix + p <= X.p && iy + p <= Y.p && ix >= 0 && iy >= 0 && X.n == Y.n && p == U.p && p <= S.alloc_p, "invalid arguments to XtY_slice"); blasglue_gemm('C', 'N', p, p, X.n, 1.0, X.data + ix, X.p, Y.data + iy, Y.p, 0.0, S.data, U.p); evectmatrix_flops += X.N * X.c * p * (2*p); mpi_allreduce(S.data, U.data, U.p * U.p * SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } /* compute U = adjoint(X) * Y, with S a scratch matrix. */ void evectmatrix_XtY(sqmatrix U, evectmatrix X, evectmatrix Y, sqmatrix S) { CHECK(X.p == Y.p, "matrices not conformant"); evectmatrix_XtY_slice(U, X, Y, 0, 0, X.p, S); } /* Compute adjoint(X) * Y, storing the result in U at an offset Uoffset with the matrix (i.e. as a submatrix within U). S is a scratch matrix (at least Y.p by Y.p). */ void evectmatrixXtY_sub(sqmatrix U, int Uoffset, evectmatrix X, evectmatrix Y, sqmatrix S) { int i; CHECK(X.p == Y.p && X.n == Y.n && U.p >= Y.p, "matrices not conformant"); CHECK(Uoffset + (Y.p-1)*U.p + Y.p <= U.p*U.p, "submatrix exceeds matrix bounds"); CHECK(Y.p <= S.alloc_p, "scratch matrix too small"); blasglue_gemm('C', 'N', X.p, X.p, X.n, 1.0, X.data, X.p, Y.data, Y.p, 0.0, S.data, Y.p); evectmatrix_flops += X.N * X.c * X.p * (2*X.p); for (i = 0; i < Y.p; ++i) { mpi_allreduce(S.data + i*Y.p, U.data + Uoffset + i*U.p, Y.p * SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } } /* Compute only the diagonal elements of XtY, storing in diag (with scratch_diag a scratch array of the same size as diag). */ void evectmatrix_XtY_diag(evectmatrix X, evectmatrix Y, scalar *diag, scalar *scratch_diag) { matrix_XtY_diag(X.data, Y.data, X.n, X.p, scratch_diag); evectmatrix_flops += X.N * X.c * X.p * 2; mpi_allreduce(scratch_diag, diag, X.p * SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } /* As above, but only compute real parts of diagonal. */ void evectmatrix_XtY_diag_real(evectmatrix X, evectmatrix Y, real *diag, real *scratch_diag) { matrix_XtY_diag_real(X.data, Y.data, X.n, X.p, scratch_diag); evectmatrix_flops += X.N * X.c * X.p * (2*X.p); mpi_allreduce(scratch_diag, diag, X.p, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } /* As above, but compute only the diagonal elements of XtX. */ void evectmatrix_XtX_diag_real(evectmatrix X, real *diag, real *scratch_diag) { matrix_XtX_diag_real(X.data, X.n, X.p, scratch_diag); evectmatrix_flops += X.N * X.c * X.p * (2*X.p); mpi_allreduce(scratch_diag, diag, X.p, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); } /* compute trace(adjoint(X) * Y) */ scalar evectmatrix_traceXtY(evectmatrix X, evectmatrix Y) { scalar trace, trace_scratch; CHECK(X.p == Y.p && X.n == Y.n, "matrices not conformant"); trace_scratch = blasglue_dotc(X.n * X.p, X.data, 1, Y.data, 1); evectmatrix_flops += X.N * X.c * X.p * (2*X.p) + X.p; mpi_allreduce(&trace_scratch, &trace, SCALAR_NUMVALS, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); return trace; } mpb-1.4.2/src/matrices/linmin.c0000644000175400001440000000610707441753311012016 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /* Nice C wrappers around minpack2-linmin.c functions. */ #include #include #include "../config.h" #include #include #include "linmin.h" extern int dcsrch(double *stp, double *f, double *g, double *ftol, double *gtol, double *xtol, char *task, double *stpmin, double *stpmax, int *isave, double *dsave); /* Our line minimization algorithm is designed only for f(x) for x >= 0. If the minimum lies for negative x, we use reverse_func below to transform f(x) into f(-x). */ typedef struct { linmin_func f; void *f_data; } linmin_func_data; double reverse_func(double x, double *deriv, void *data) { linmin_func_data *d = (linmin_func_data *) data; double val; val = d->f(-x, deriv, d->f_data); *deriv = -*deriv; return val; } double linmin(double *converged_f, double *converged_df, double x_guess, double f_0, double df_0, double f_tol, double df_tol, double x_tol, double x_min, double x_max, linmin_func f, void *f_data, int verbose) { if (df_0 > 0) { /* minimum lies for negative x; transform to f(-x) */ linmin_func_data d; double x; d.f = f; d.f_data = f_data; x = linmin(converged_f, converged_df, -x_guess, f_0, -df_0, f_tol, df_tol, x_tol, -x_min, -x_max, reverse_func, &d, verbose); *converged_df = -*converged_df; return(-x); } else { char task[300] = "START"; int isave[2]; double dsave[13], x, f_x, df_x; int iters = 0; x = x_guess; f_x = f_0; df_x = df_0; /* initially, pass in f and df at x=0 */ dcsrch(&x, &f_x, &df_x, &f_tol, &df_tol, &x_tol, task, &x_min, &x_max, isave, dsave); while (*task == 'F') { f_x = f(x, &df_x, f_data); mpi_assert_equal(x); mpi_assert_equal(f_x); ++iters; dcsrch(&x, &f_x, &df_x, &f_tol, &df_tol, &x_tol, task, &x_min, &x_max, isave, dsave); } if (*task != 'C') { /* not converged; warning or error */ if (verbose || *task == 'E') mpi_one_fprintf(stderr, "linmin: %s\n", task); CHECK(*task != 'E', "linmin failure"); } if (verbose) mpi_one_printf(" linmin: converged after %d iterations.\n", iters); *converged_f = f_x; *converged_df = df_x; return x; } } mpb-1.4.2/src/matrices/linmin.h0000644000175400001440000000223007441753311012014 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef LINMIN_H #define LINMIN_H typedef double (*linmin_func) (double x, double *deriv, void *data); extern double linmin(double *converged_f, double *converged_df, double x_guess, double f_0, double df_0, double f_tol, double df_tol, double x_tol, double x_min, double x_max, linmin_func f, void *f_data, int verbose); #endif /* LINMIN_H */ mpb-1.4.2/src/matrices/matrices.c0000644000175400001440000001174207441753311012340 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include "../config.h" #include #include "matrices.h" /* Basic operations: allocation, deallocation, etcetera. */ evectmatrix create_evectmatrix(int N, int c, int p, int localN, int Nstart, int allocN) { evectmatrix X; CHECK(localN <= N && allocN >= localN && Nstart < N, "invalid N arguments"); X.N = N; X.localN = localN; X.Nstart = Nstart; X.allocN = allocN; X.c = c; X.n = localN * c; X.alloc_p = X.p = p; if (allocN > 0) { CHK_MALLOC(X.data, scalar, allocN * c * p); } else X.data = NULL; return X; } void destroy_evectmatrix(evectmatrix X) { free(X.data); } sqmatrix create_sqmatrix(int p) { sqmatrix X; X.alloc_p = X.p = p; if (p > 0) { CHK_MALLOC(X.data, scalar, p * p); } else X.data = (scalar*) NULL; return X; } void destroy_sqmatrix(sqmatrix X) { free(X.data); } /***********************************************************************/ /* a few general matrix operations for diagonal matrices; these will be used both by evectmatrix and sqmatrix routines: */ /* compute diag = diagonal elements of Xt * Y, where X and Y are n x p. */ void matrix_XtY_diag(scalar *X, scalar *Y, int n, int p, scalar *diag) { int i, j; for (j = 0; j < p; ++j) { ASSIGN_ZERO(diag[j]); } for (i = 0; i < n; ++i) for (j = 0; j < p; ++j) { ACCUMULATE_SUM_CONJ_MULT(diag[j], X[i*p+j], Y[i*p+j]); } } /* compute diag = diagonal elements of Re[Xt * Y], where X and Y are n x p. */ void matrix_XtY_diag_real(scalar *X, scalar *Y, int n, int p, real *diag) { int i, j; for (j = 0; j < p; ++j) { diag[j] = 0; } for (i = 0; i < n; ++i) for (j = 0; j < p; ++j) { diag[j] += (SCALAR_RE(X[i*p+j]) * SCALAR_RE(Y[i*p+j]) + SCALAR_IM(X[i*p+j]) * SCALAR_IM(Y[i*p+j])); } } /* compute diag = diagonal elements of Xt * X, where X is n x p. */ void matrix_XtX_diag_real(scalar *X, int n, int p, real *diag) { int i, j; for (j = 0; j < p; ++j) { diag[j] = 0; } for (i = 0; i < n; ++i) for (j = 0; j < p; ++j) { ACCUMULATE_SUM_SQ(diag[j], X[i*p+j]); } } /* compute X += a * Y * diag(diag), where X and Y are n x p */ void matrix_XpaY_diag(scalar *X, real a, scalar *Y, scalar *diag, int n, int p) { int i, j; for (i = 0; i < n; ++i) { for (j = 0; j < p; ++j) { scalar c; ASSIGN_MULT(c, Y[i*p+j], diag[j]); ASSIGN_SCALAR(X[i*p+j], SCALAR_RE(X[i*p+j]) + a * SCALAR_RE(c), SCALAR_IM(X[i*p+j]) + a * SCALAR_IM(c)); } } } /* compute X += a * Y * diag(diag), where X and Y are n x p and diag is real */ void matrix_XpaY_diag_real(scalar *X, real a, scalar *Y, real *diag, int n, int p) { int i, j; for (i = 0; i < n; ++i) { for (j = 0; j < p; ++j) { real d = a * diag[j]; ASSIGN_SCALAR(X[i*p+j], SCALAR_RE(X[i*p+j]) + d * SCALAR_RE(Y[i*p+j]), SCALAR_IM(X[i*p+j]) + d * SCALAR_IM(Y[i*p+j])); } } } /* compute X = X * diag1 + Y * diag2, where X and Y are n x p and diag1 and diag2 are real diagonal matrices */ void matrix_X_diag_real_pY_diag_real(scalar *X, real *diag1, scalar *Y, real *diag2, int n, int p) { int i, j; for (i = 0; i < n; ++i) { for (j = 0; j < p; ++j) { real d1 = diag1[j], d2 = diag2[j]; ASSIGN_SCALAR(X[i*p+j], d1 * SCALAR_RE(X[i*p+j]) + d2 * SCALAR_RE(Y[i*p+j]), d1 * SCALAR_IM(X[i*p+j]) + d2 * SCALAR_IM(Y[i*p+j])); } } } /* compute Re [ trace A * diag(diag) ], where A is p by p. */ real matrix_re_trace_A_diag_real(scalar *A, real *diag, int p) { real trace = 0.0; int i; for (i = 0; i < p; ++i) trace += SCALAR_RE(A[i*(p+1)]) * diag[i]; return trace; } scalar matrix_diag_trace(scalar *diag, int p) { scalar trace = SCALAR_INIT_ZERO; int i; for (i = 0; i < p; ++i) { ACCUMULATE_SUM(trace, diag[i]); } return trace; } real matrix_diag_real_trace(real *diag, int p) { real trace = 0.0; int i; for (i = 0; i < p; ++i) trace += diag[i]; return trace; } mpb-1.4.2/src/matrices/matrices.h0000644000175400001440000001106607446257377012364 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MATRICES_H #define MATRICES_H #include "scalar.h" typedef struct { int N, localN, Nstart, allocN; int c; int n, p, alloc_p; scalar *data; } evectmatrix; typedef struct { int p, alloc_p; scalar *data; } sqmatrix; /* try to keep track of flops, at least from evectmatrix multiplications */ extern double evectmatrix_flops; /* general creation/destruction operations: */ extern evectmatrix create_evectmatrix(int N, int c, int p, int localN, int Nstart, int allocN); extern void destroy_evectmatrix(evectmatrix X); extern sqmatrix create_sqmatrix(int p); extern void destroy_sqmatrix(sqmatrix X); /* diagonal matrix utils: */ extern void matrix_XtY_diag(scalar *X, scalar *Y, int n, int p, scalar *diag); extern void matrix_XtY_diag_real(scalar *X, scalar *Y, int n, int p, real *diag); extern void matrix_XtX_diag_real(scalar *X, int n, int p, real *diag); extern void matrix_XpaY_diag(scalar *X, real a, scalar *Y, scalar *diag, int n, int p); extern void matrix_XpaY_diag_real(scalar *X, real a, scalar *Y, real *diag, int n, int p); extern void matrix_X_diag_real_pY_diag_real(scalar *X, real *diag1, scalar *Y, real *diag2, int n, int p); extern real matrix_re_trace_A_diag_real(scalar *A, real *diag, int p); extern scalar matrix_diag_trace(scalar *diag, int p); extern real matrix_diag_real_trace(real *diag, int p); /* evectmatrix operations, defined in evectmatrix.c: */ extern void evectmatrix_resize(evectmatrix *A, int p, short preserve_data); extern void evectmatrix_copy(evectmatrix X, evectmatrix Y); extern void evectmatrix_copy_slice(evectmatrix X, evectmatrix Y, int ix, int iy, int p); extern void evectmatrix_aXpbY(real a, evectmatrix X, real b, evectmatrix Y); extern void evectmatrix_aXpbYS_sub(real a, evectmatrix X, real b, evectmatrix Y, sqmatrix S, int Soffset, short sdagger); extern void evectmatrix_XeYS(evectmatrix X, evectmatrix Y, sqmatrix S, short sherm); extern void evectmatrix_XpaYS(evectmatrix X, real a, evectmatrix Y, sqmatrix S, short sdagger); extern void evectmatrix_XtX(sqmatrix U, evectmatrix X, sqmatrix S); extern void evectmatrix_XtY(sqmatrix U, evectmatrix X, evectmatrix Y, sqmatrix S); extern void evectmatrix_XtY_slice(sqmatrix U, evectmatrix X, evectmatrix Y, int ix, int iy, int p, sqmatrix S); extern void evectmatrixXtY_sub(sqmatrix U, int Uoffset, evectmatrix X, evectmatrix Y, sqmatrix S); extern void evectmatrix_XtY_diag(evectmatrix X, evectmatrix Y, scalar *diag, scalar *scratch_diag); extern void evectmatrix_XtY_diag_real(evectmatrix X, evectmatrix Y, real *diag, real *scratch_diag); extern void evectmatrix_XtX_diag_real(evectmatrix X, real *diag, real *scratch_diag); extern scalar evectmatrix_traceXtY(evectmatrix X, evectmatrix Y); /* sqmatrix operations, defined in sqmatrix.c: */ extern void sqmatrix_copy(sqmatrix A, sqmatrix B); extern void sqmatrix_resize(sqmatrix *A, int p, short preserve_data); extern void sqmatrix_copy_upper2full(sqmatrix F, sqmatrix U); extern void sqmatrix_symmetrize(sqmatrix Asym, sqmatrix A); extern scalar sqmatrix_trace(sqmatrix U); extern scalar sqmatrix_traceAtB(sqmatrix A, sqmatrix B); extern void sqmatrix_AeBC(sqmatrix A, sqmatrix B, short bdagger, sqmatrix C, short cdagger); extern void sqmatrix_ApaBC(sqmatrix A, real a, sqmatrix B, short bdagger, sqmatrix C, short cdagger); extern void sqmatrix_ApaB(sqmatrix A, real a, sqmatrix B); extern void sqmatrix_aApbB(real a, sqmatrix A, real b, sqmatrix B); extern void sqmatrix_invert(sqmatrix U, short positive_definite, sqmatrix Work); extern void sqmatrix_eigensolve(sqmatrix U, real *eigenvals, sqmatrix W); extern void sqmatrix_sqrt(sqmatrix Usqrt, sqmatrix U, sqmatrix W); #endif /* MATRICES_H */ mpb-1.4.2/src/matrices/minpack2-linmin.c0000644000175400001440000006104307227107244013520 /* Copyright (C) 1996 Jorge J. More'. * * 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 */ /* The routines in this file were taken from the MINPACK-2 package by Jorge J. More', specifically its line search subroutines in the MINPACK-2/csrch, in the files dcsrch.f and dcstep.f. MINPACK-2 is software for the solution of systems of nonlinear equations, nonlinear least squares problems, and minimization problems. Web pages and ftp sites for MINPACK-2 can be found at: http://www.mcs.anl.gov/~more/minpack-2/minpack-2.html ftp://info.mcs.anl.gov/pub/MINPACK-2/ http://www-fp.mcs.anl.gov/otc/minpack/summary.html It implements the line search algorithm described in: Jorge J. More and David J. Thuente, "Line search algorithms with guaranteed sufficient decrease," ACM Trans. on Mathematical Software, vol. 20, no. 3, pp. 286-307 (September 1994). The original code was under the copyright and license listed below, but Jorge J. More' graciously granted me permission to distribute under the terms of the GNU General Public License. Original copyright and license statement: * This program discloses material protectable under copyright laws of * the United States. Permission to copy and modify this software and * its documentation for internal research use is hereby granted, * provided that this notice is retained thereon and on all copies or * modifications. The University of Chicago makes no representations * as to the suitability and operability of this software for any * purpose. It is provided "as is" without express or implied * warranty. * * Use of this software for commercial purposes is expressly * prohibited without contacting. * * Jorge J. More' * Mathematics and Computer Science Division * Argonne National Laboratory * 9700 S. Cass Ave. * Argonne, Illinois 60439-4844 * e-mail: more@mcs.anl.gov * * Argonne National Laboratory with facilities in the states of * Illinois and Idaho, is owned by The United States Government, and * operated by the University of Chicago under provision of a contract * with the Department of Energy. */ /* minpack2-linmin.f -- translated by f2c (version 19991025). C code cleaned up by Steven G. Johnson . */ #include #include #include "../config.h" /* Definitions so that we don't need -lf2c or f2c.h: */ typedef double doublereal; typedef int integer; typedef int logical; typedef int ftnlen; #ifndef HAVE_STRNCMP /* provide a strncmp replacement if the system does not provide one: */ static int strncmp(const char *s1, const char *s2, size_t n) { size_t i; for (i = 0; i < n && s1[i] && s2[i] && s1[i] == s2[i]; ++i) ; if (i >= n) return 0; else return (s1[i] - s2[i]); } #endif /* ! HAVE_STRNCMP */ #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define ABS(x) fabs(x) #define s_cmp(s1, s2, len1, len2) strncmp(s1, s2, MIN(len1, len2)) #define s_copy(s1, s2, len1, len2) strcpy(s1, s2) #define TRUE_ 1 #define FALSE_ 0 /* cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc */ /* cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc */ /* Subroutine */ int dcsrch(doublereal *stp, doublereal *f, doublereal *g, doublereal *ftol, doublereal *gtol, doublereal *xtol, char *task, doublereal *stpmin, doublereal *stpmax, integer *isave, doublereal * dsave) { /* System generated locals */ doublereal d__1; /* Builtin functions */ /* Local variables */ integer stage; doublereal finit, ginit, width, ftest, gtest, stmin, stmax, width1, fm, gm, fx, fy, gx, gy; logical brackt; extern /* Subroutine */ int dcstep(doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, doublereal *, logical *, doublereal *, doublereal *); doublereal fxm, fym, gxm, gym, stx, sty; /* ********** */ /* Subroutine dcsrch */ /* This subroutine finds a step that satisfies a sufficient */ /* decrease condition and a curvature condition. */ /* Each call of the subroutine updates an interval with */ /* endpoints stx and sty. The interval is initially chosen */ /* so that it contains a minimizer of the modified function */ /* psi(stp) = f(stp) - f(0) - ftol*stp*f'(0). */ /* If psi(stp) <= 0 and f'(stp) >= 0 for some step, then the */ /* interval is chosen so that it contains a minimizer of f. */ /* The algorithm is designed to find a step that satisfies */ /* the sufficient decrease condition */ /* f(stp) <= f(0) + ftol*stp*f'(0), */ /* and the curvature condition */ /* ABS(f'(stp)) <= gtol*ABS(f'(0)). */ /* If ftol is less than gtol and if, for example, the function */ /* is bounded below, then there is always a step which satisfies */ /* both conditions. */ /* If no step can be found that satisfies both conditions, then */ /* the algorithm stops with a warning. In this case stp only */ /* satisfies the sufficient decrease condition. */ /* A typical invocation of dcsrch has the following outline: */ /* Evaluate the function at stp = 0.0d0; store in f. */ /* Evaluate the gradient at stp = 0.0d0; store in g. */ /* Choose a starting step stp. */ /* task = 'START' */ /* 10 continue */ /* call dcsrch(stp,f,g,ftol,gtol,xtol,task,stpmin,stpmax, */ /* + isave,dsave) */ /* if (task .eq. 'FG') then */ /* Evaluate the function and the gradient at stp */ /* go to 10 */ /* end if */ /* NOTE: The user must not alter work arrays between calls. */ /* The subroutine statement is */ /* subroutine dcsrch(f,g,stp,ftol,gtol,xtol,stpmin,stpmax, */ /* task,isave,dsave) */ /* where */ /* stp is a double precision variable. */ /* On entry stp is the current estimate of a satisfactory */ /* step. On initial entry, a positive initial estimate */ /* must be provided. */ /* On exit stp is the current estimate of a satisfactory step */ /* if task = 'FG'. If task = 'CONV' then stp satisfies */ /* the sufficient decrease and curvature condition. */ /* f is a double precision variable. */ /* On initial entry f is the value of the function at 0. */ /* On subsequent entries f is the value of the */ /* function at stp. */ /* On exit f is the value of the function at stp. */ /* g is a double precision variable. */ /* On initial entry g is the derivative of the function at 0. */ /* On subsequent entries g is the derivative of the */ /* function at stp. */ /* On exit g is the derivative of the function at stp. */ /* ftol is a double precision variable. */ /* On entry ftol specifies a nonnegative tolerance for the */ /* sufficient decrease condition. */ /* On exit ftol is unchanged. */ /* gtol is a double precision variable. */ /* On entry gtol specifies a nonnegative tolerance for the */ /* curvature condition. */ /* On exit gtol is unchanged. */ /* xtol is a double precision variable. */ /* On entry xtol specifies a nonnegative relative tolerance */ /* for an acceptable step. The subroutine exits with a */ /* warning if the relative difference between sty and stx */ /* is less than xtol. */ /* On exit xtol is unchanged. */ /* task is a character variable of length at least 60. */ /* On initial entry task must be set to 'START'. */ /* On exit task indicates the required action: */ /* If task(1:2) = 'FG' then evaluate the function and */ /* derivative at stp and call dcsrch again. */ /* If task(1:4) = 'CONV' then the search is successful. */ /* If task(1:4) = 'WARN' then the subroutine is not able */ /* to satisfy the convergence conditions. The exit value of */ /* stp contains the best point found during the search. */ /* If task(1:5) = 'ERROR' then there is an error in the */ /* input arguments. */ /* On exit with convergence, a warning or an error, the */ /* variable task contains additional information. */ /* stpmin is a double precision variable. */ /* On entry stpmin is a nonnegative lower bound for the step. */ /* On exit stpmin is unchanged. */ /* stpmax is a double precision variable. */ /* On entry stpmax is a nonnegative upper bound for the step. */ /* On exit stpmax is unchanged. */ /* isave is an integer work array of dimension 2. */ /* dsave is a double precision work array of dimension 13. */ /* Subprograms called */ /* MINPACK-2 ... dcstep */ /* MINPACK-1 Project. June 1983. */ /* Argonne National Laboratory. */ /* Jorge J. More' and David J. Thuente. */ /* MINPACK-2 Project. November 1993. */ /* Argonne National Laboratory and University of Minnesota. */ /* Brett M. Averick, Richard G. Carter, and Jorge J. More'. */ /* ********** */ /* Initialization block. */ /* Parameter adjustments */ --dsave; --isave; /* Function Body */ if (s_cmp(task, "START", (ftnlen)5, (ftnlen)5) == 0) { /* Check the input arguments for errors. */ if (*stp < *stpmin) { s_copy(task, "ERROR: STP .LT. STPMIN", task_len, (ftnlen)22); } if (*stp > *stpmax) { s_copy(task, "ERROR: STP .GT. STPMAX", task_len, (ftnlen)22); } if (*g >= 0.) { s_copy(task, "ERROR: INITIAL G .GE. ZERO", task_len, (ftnlen)26); } if (*ftol < 0.) { s_copy(task, "ERROR: FTOL .LT. ZERO", task_len, (ftnlen)21); } if (*gtol < 0.) { s_copy(task, "ERROR: GTOL .LT. ZERO", task_len, (ftnlen)21); } if (*xtol < 0.) { s_copy(task, "ERROR: XTOL .LT. ZERO", task_len, (ftnlen)21); } if (*stpmin < 0.) { s_copy(task, "ERROR: STPMIN .LT. ZERO", task_len, (ftnlen)23); } if (*stpmax < *stpmin) { s_copy(task, "ERROR: STPMAX .LT. STPMIN", task_len, (ftnlen)25); } /* Exit if there are errors on input. */ if (s_cmp(task, "ERROR", (ftnlen)5, (ftnlen)5) == 0) { return 0; } /* Initialize local variables. */ brackt = FALSE_; stage = 1; finit = *f; ginit = *g; gtest = *ftol * ginit; width = *stpmax - *stpmin; width1 = width / .5; /* The variables stx, fx, gx contain the values of the step, */ /* function, and derivative at the best step. */ /* The variables sty, fy, gy contain the value of the step, */ /* function, and derivative at sty. */ /* The variables stp, f, g contain the values of the step, */ /* function, and derivative at stp. */ stx = 0.; fx = finit; gx = ginit; sty = 0.; fy = finit; gy = ginit; stmin = 0.; stmax = *stp + *stp * 4.; s_copy(task, "FG", task_len, (ftnlen)2); goto L10; } else { /* Restore local variables. */ if (isave[1] == 1) { brackt = TRUE_; } else { brackt = FALSE_; } stage = isave[2]; ginit = dsave[1]; gtest = dsave[2]; gx = dsave[3]; gy = dsave[4]; finit = dsave[5]; fx = dsave[6]; fy = dsave[7]; stx = dsave[8]; sty = dsave[9]; stmin = dsave[10]; stmax = dsave[11]; width = dsave[12]; width1 = dsave[13]; } /* If psi(stp) <= 0 and f'(stp) >= 0 for some step, then the */ /* algorithm enters the second stage. */ ftest = finit + *stp * gtest; if (stage == 1 && *f <= ftest && *g >= 0.) { stage = 2; } /* Test for warnings. */ if (brackt && (*stp <= stmin || *stp >= stmax)) { s_copy(task, "WARNING: ROUNDING ERRORS PREVENT PROGRESS", task_len, ( ftnlen)41); } if (brackt && stmax - stmin <= *xtol * stmax) { s_copy(task, "WARNING: XTOL TEST SATISFIED", task_len, (ftnlen)28); } if (*stp == *stpmax && *f <= ftest && *g <= gtest) { s_copy(task, "WARNING: STP = STPMAX", task_len, (ftnlen)21); } if (*stp == *stpmin && (*f > ftest || *g >= gtest)) { s_copy(task, "WARNING: STP = STPMIN", task_len, (ftnlen)21); } /* Test for convergence. */ if (*f <= ftest && ABS(*g) <= *gtol * (-ginit)) { s_copy(task, "CONVERGENCE", task_len, (ftnlen)11); } /* Test for termination. */ if (s_cmp(task, "WARN", (ftnlen)4, (ftnlen)4) == 0 || s_cmp(task, "CONV", (ftnlen)4, (ftnlen)4) == 0) { goto L10; } /* A modified function is used to predict the step during the */ /* first stage if a lower function value has been obtained but */ /* the decrease is not sufficient. */ if (stage == 1 && *f <= fx && *f > ftest) { /* Define the modified function and derivative values. */ fm = *f - *stp * gtest; fxm = fx - stx * gtest; fym = fy - sty * gtest; gm = *g - gtest; gxm = gx - gtest; gym = gy - gtest; /* Call dcstep to update stx, sty, and to compute the new step. */ dcstep(&stx, &fxm, &gxm, &sty, &fym, &gym, stp, &fm, &gm, &brackt, & stmin, &stmax); /* Reset the function and derivative values for f. */ fx = fxm + stx * gtest; fy = fym + sty * gtest; gx = gxm + gtest; gy = gym + gtest; } else { /* Call dcstep to update stx, sty, and to compute the new step. */ dcstep(&stx, &fx, &gx, &sty, &fy, &gy, stp, f, g, &brackt, &stmin, & stmax); } /* Decide if a bisection step is needed. */ if (brackt) { if ((d__1 = sty - stx, ABS(d__1)) >= width1 * .66) { *stp = stx + (sty - stx) * .5; } width1 = width; width = (d__1 = sty - stx, ABS(d__1)); } /* Set the minimum and maximum steps allowed for stp. */ if (brackt) { stmin = MIN(stx,sty); stmax = MAX(stx,sty); } else { stmin = *stp + (*stp - stx) * 1.1; stmax = *stp + (*stp - stx) * 4.; } /* Force the step to be within the bounds stpmax and stpmin. */ *stp = MAX(*stp,*stpmin); *stp = MIN(*stp,*stpmax); /* If further progress is not possible, let stp be the best */ /* point obtained during the search. */ if ((brackt && (*stp <= stmin || *stp >= stmax)) || (brackt && stmax - stmin <= *xtol * stmax)) { *stp = stx; } /* Obtain another function and derivative. */ s_copy(task, "FG", task_len, (ftnlen)2); L10: /* Save local variables. */ if (brackt) { isave[1] = 1; } else { isave[1] = 0; } isave[2] = stage; dsave[1] = ginit; dsave[2] = gtest; dsave[3] = gx; dsave[4] = gy; dsave[5] = finit; dsave[6] = fx; dsave[7] = fy; dsave[8] = stx; dsave[9] = sty; dsave[10] = stmin; dsave[11] = stmax; dsave[12] = width; dsave[13] = width1; return 0; } /* dcsrch */ /* ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc */ /* ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc */ /* Subroutine */ int dcstep(doublereal *stx, doublereal *fx, doublereal *dx, doublereal *sty, doublereal *fy, doublereal *dy, doublereal *stp, doublereal *fp, doublereal *dp, logical *brackt, doublereal *stpmin, doublereal *stpmax) { /* System generated locals */ doublereal d__1, d__2, d__3; /* Local variables */ doublereal sgnd, stpc, stpf, stpq, p, q, gamma, r__, s, theta; /* ********** */ /* Subroutine dcstep */ /* This subroutine computes a safeguarded step for a search */ /* procedure and updates an interval that contains a step that */ /* satisfies a sufficient decrease and a curvature condition. */ /* The parameter stx contains the step with the least function */ /* value. If brackt is set to .true. then a minimizer has */ /* been bracketed in an interval with endpoints stx and sty. */ /* The parameter stp contains the current step. */ /* The subroutine assumes that if brackt is set to .true. then */ /* MIN(stx,sty) < stp < MAX(stx,sty), */ /* and that the derivative at stx is negative in the direction */ /* of the step. */ /* The subroutine statement is */ /* subroutine dcstep(stx,fx,dx,sty,fy,dy,stp,fp,dp,brackt, */ /* stpmin,stpmax) */ /* where */ /* stx is a double precision variable. */ /* On entry stx is the best step obtained so far and is an */ /* endpoint of the interval that contains the minimizer. */ /* On exit stx is the updated best step. */ /* fx is a double precision variable. */ /* On entry fx is the function at stx. */ /* On exit fx is the function at stx. */ /* dx is a double precision variable. */ /* On entry dx is the derivative of the function at */ /* stx. The derivative must be negative in the direction of */ /* the step, that is, dx and stp - stx must have opposite */ /* signs. */ /* On exit dx is the derivative of the function at stx. */ /* sty is a double precision variable. */ /* On entry sty is the second endpoint of the interval that */ /* contains the minimizer. */ /* On exit sty is the updated endpoint of the interval that */ /* contains the minimizer. */ /* fy is a double precision variable. */ /* On entry fy is the function at sty. */ /* On exit fy is the function at sty. */ /* dy is a double precision variable. */ /* On entry dy is the derivative of the function at sty. */ /* On exit dy is the derivative of the function at the exit sty. */ /* stp is a double precision variable. */ /* On entry stp is the current step. If brackt is set to .true. */ /* then on input stp must be between stx and sty. */ /* On exit stp is a new trial step. */ /* fp is a double precision variable. */ /* On entry fp is the function at stp */ /* On exit fp is unchanged. */ /* dp is a double precision variable. */ /* On entry dp is the the derivative of the function at stp. */ /* On exit dp is unchanged. */ /* brackt is an logical variable. */ /* On entry brackt specifies if a minimizer has been bracketed. */ /* Initially brackt must be set to .false. */ /* On exit brackt specifies if a minimizer has been bracketed. */ /* When a minimizer is bracketed brackt is set to .true. */ /* stpmin is a double precision variable. */ /* On entry stpmin is a lower bound for the step. */ /* On exit stpmin is unchanged. */ /* stpmax is a double precision variable. */ /* On entry stpmax is an upper bound for the step. */ /* On exit stpmax is unchanged. */ /* MINPACK-1 Project. June 1983 */ /* Argonne National Laboratory. */ /* Jorge J. More' and David J. Thuente. */ /* MINPACK-2 Project. November 1993. */ /* Argonne National Laboratory and University of Minnesota. */ /* Brett M. Averick and Jorge J. More'. */ /* ********** */ sgnd = *dp * (*dx / ABS(*dx)); /* First case: A higher function value. The minimum is bracketed. */ /* If the cubic step is closer to stx than the quadratic step, the */ /* cubic step is taken, otherwise the average of the cubic and */ /* quadratic steps is taken. */ if (*fp > *fx) { theta = (*fx - *fp) * 3. / (*stp - *stx) + *dx + *dp; /* Computing MAX */ d__1 = ABS(theta), d__2 = ABS(*dx), d__1 = MAX(d__1,d__2), d__2 = ABS( *dp); s = MAX(d__1,d__2); /* Computing 2nd power */ d__1 = theta / s; gamma = s * sqrt(d__1 * d__1 - *dx / s * (*dp / s)); if (*stp < *stx) { gamma = -gamma; } p = gamma - *dx + theta; q = gamma - *dx + gamma + *dp; r__ = p / q; stpc = *stx + r__ * (*stp - *stx); stpq = *stx + *dx / ((*fx - *fp) / (*stp - *stx) + *dx) / 2. * (*stp - *stx); if ((d__1 = stpc - *stx, ABS(d__1)) < (d__2 = stpq - *stx, ABS(d__2))) { stpf = stpc; } else { stpf = stpc + (stpq - stpc) / 2.; } *brackt = TRUE_; /* Second case: A lower function value and derivatives of opposite */ /* sign. The minimum is bracketed. If the cubic step is farther from */ /* stp than the secant step, the cubic step is taken, otherwise the */ /* secant step is taken. */ } else if (sgnd < 0.) { theta = (*fx - *fp) * 3. / (*stp - *stx) + *dx + *dp; /* Computing MAX */ d__1 = ABS(theta), d__2 = ABS(*dx), d__1 = MAX(d__1,d__2), d__2 = ABS( *dp); s = MAX(d__1,d__2); /* Computing 2nd power */ d__1 = theta / s; gamma = s * sqrt(d__1 * d__1 - *dx / s * (*dp / s)); if (*stp > *stx) { gamma = -gamma; } p = gamma - *dp + theta; q = gamma - *dp + gamma + *dx; r__ = p / q; stpc = *stp + r__ * (*stx - *stp); stpq = *stp + *dp / (*dp - *dx) * (*stx - *stp); if ((d__1 = stpc - *stp, ABS(d__1)) > (d__2 = stpq - *stp, ABS(d__2))) { stpf = stpc; } else { stpf = stpq; } *brackt = TRUE_; /* Third case: A lower function value, derivatives of the same sign, */ /* and the magnitude of the derivative decreases. */ } else if (ABS(*dp) < ABS(*dx)) { /* The cubic step is computed only if the cubic tends to infinity */ /* in the direction of the step or if the minimum of the cubic */ /* is beyond stp. Otherwise the cubic step is defined to be the */ /* secant step. */ theta = (*fx - *fp) * 3. / (*stp - *stx) + *dx + *dp; /* Computing MAX */ d__1 = ABS(theta), d__2 = ABS(*dx), d__1 = MAX(d__1,d__2), d__2 = ABS( *dp); s = MAX(d__1,d__2); /* The case gamma = 0 only arises if the cubic does not tend */ /* to infinity in the direction of the step. */ /* Computing MAX */ /* Computing 2nd power */ d__3 = theta / s; d__1 = 0., d__2 = d__3 * d__3 - *dx / s * (*dp / s); gamma = s * sqrt((MAX(d__1,d__2))); if (*stp > *stx) { gamma = -gamma; } p = gamma - *dp + theta; q = gamma + (*dx - *dp) + gamma; r__ = p / q; if (r__ < 0. && gamma != 0.) { stpc = *stp + r__ * (*stx - *stp); } else if (*stp > *stx) { stpc = *stpmax; } else { stpc = *stpmin; } stpq = *stp + *dp / (*dp - *dx) * (*stx - *stp); if (*brackt) { /* A minimizer has been bracketed. If the cubic step is */ /* closer to stp than the secant step, the cubic step is */ /* taken, otherwise the secant step is taken. */ if ((d__1 = stpc - *stp, ABS(d__1)) < (d__2 = stpq - *stp, ABS( d__2))) { stpf = stpc; } else { stpf = stpq; } if (*stp > *stx) { /* Computing MIN */ d__1 = *stp + (*sty - *stp) * .66; stpf = MIN(d__1,stpf); } else { /* Computing MAX */ d__1 = *stp + (*sty - *stp) * .66; stpf = MAX(d__1,stpf); } } else { /* A minimizer has not been bracketed. If the cubic step is */ /* farther from stp than the secant step, the cubic step is */ /* taken, otherwise the secant step is taken. */ if ((d__1 = stpc - *stp, ABS(d__1)) > (d__2 = stpq - *stp, ABS( d__2))) { stpf = stpc; } else { stpf = stpq; } stpf = MIN(*stpmax,stpf); stpf = MAX(*stpmin,stpf); } /* Fourth case: A lower function value, derivatives of the same sign, */ /* and the magnitude of the derivative does not decrease. If the */ /* minimum is not bracketed, the step is either stpmin or stpmax, */ /* otherwise the cubic step is taken. */ } else { if (*brackt) { theta = (*fp - *fy) * 3. / (*sty - *stp) + *dy + *dp; /* Computing MAX */ d__1 = ABS(theta), d__2 = ABS(*dy), d__1 = MAX(d__1,d__2), d__2 = ABS(*dp); s = MAX(d__1,d__2); /* Computing 2nd power */ d__1 = theta / s; gamma = s * sqrt(d__1 * d__1 - *dy / s * (*dp / s)); if (*stp > *sty) { gamma = -gamma; } p = gamma - *dp + theta; q = gamma - *dp + gamma + *dy; r__ = p / q; stpc = *stp + r__ * (*sty - *stp); stpf = stpc; } else if (*stp > *stx) { stpf = *stpmax; } else { stpf = *stpmin; } } /* Update the interval which contains a minimizer. */ if (*fp > *fx) { *sty = *stp; *fy = *fp; *dy = *dp; } else { if (sgnd < 0.) { *sty = *stx; *fy = *fx; *dy = *dx; } *stx = *stp; *fx = *fp; *dx = *dp; } /* Compute the new step. */ *stp = stpf; return 0; } /* dcstep */ mpb-1.4.2/src/matrices/scalar.h0000644000175400001440000001356207441753311012005 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef SCALAR_H #define SCALAR_H #ifdef SCALAR_SINGLE_PREC typedef float real; #define SCALAR_MPI_TYPE MPI_FLOAT #else typedef double real; #define SCALAR_MPI_TYPE MPI_DOUBLE #endif /********************* complex types and operations **********************/ typedef struct { real re, im; } scalar_complex; #define CSCALAR_NUMVALS (2) #define CSCALAR_INIT_ZERO { 0.0, 0.0 } #define CSCALAR_RE(a) ((a).re) #define CSCALAR_IM(a) ((a).im) #define CASSIGN_SCALAR(a, real, imag) { (a).re = (real); (a).im = (imag); } #define CACCUMULATE_SCALAR(a, real, imag) { (a).re +=(real); (a).im +=(imag); } #define CACCUMULATE_DIFF_SCALAR(a, real, imag) { (a).re -=(real); (a).im -=(imag); } #define CASSIGN_ZERO(a) CASSIGN_SCALAR(a, 0.0, 0.0); #define CASSIGN_REAL(a, c) CASSIGN_SCALAR(a, c, 0.0) #define CASSIGN_CONJ(a, b) CASSIGN_SCALAR(a, CSCALAR_RE(b), -CSCALAR_IM(b)) #define CSCALAR_NORMSQR(a) ((a).re * (a).re + (a).im * (a).im) /* a = b * c */ #define CASSIGN_MULT(a, b, c) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ real cccc_re = (c).re, cccc_im = (c).im; \ CASSIGN_SCALAR(a, bbbb_re * cccc_re - bbbb_im * cccc_im, \ bbbb_re * cccc_im + bbbb_im * cccc_re); \ } /* a = b / c = b * conj(c) / |c|^2 */ #define CASSIGN_DIV(a, b, c) { \ scalar_complex aaaa_tmp; real aaaa_tmp_norm; \ CASSIGN_CONJ(aaaa_tmp, c); \ aaaa_tmp_norm = 1.0 / CSCALAR_NORMSQR(aaaa_tmp); \ CASSIGN_MULT(aaaa_tmp, b, aaaa_tmp); \ CASSIGN_SCALAR(a, aaaa_tmp.re*aaaa_tmp_norm, aaaa_tmp.im*aaaa_tmp_norm); \ } /* a = Re (b * c) */ #define CASSIGN_MULT_RE(a, b, c) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ real cccc_re = (c).re, cccc_im = (c).im; \ (a) = bbbb_re * cccc_re - bbbb_im * cccc_im; \ } /* a = Im (b * c) */ #define CASSIGN_MULT_IM(a, b, c) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ real cccc_re = (c).re, cccc_im = (c).im; \ (a) = bbbb_re * cccc_im + bbbb_im * cccc_re; \ } /* a += b * c */ #define CACCUMULATE_SUM_MULT(a, b, c) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ real cccc_re = (c).re, cccc_im = (c).im; \ CACCUMULATE_SCALAR(a, bbbb_re * cccc_re - bbbb_im * cccc_im, \ bbbb_re * cccc_im + bbbb_im * cccc_re); \ } /* a += conj(b) * c */ #define CACCUMULATE_SUM_CONJ_MULT(a, b, c) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ real cccc_re = (c).re, cccc_im = (c).im; \ CACCUMULATE_SCALAR(a, bbbb_re * cccc_re + bbbb_im * cccc_im, \ bbbb_re * cccc_im - bbbb_im * cccc_re); \ } /* a += |b|^2 */ #define CACCUMULATE_SUM_SQ(a, b) { \ real bbbb_re = (b).re, bbbb_im = (b).im; \ (a) += bbbb_re * bbbb_re + bbbb_im * bbbb_im; \ } #define CACCUMULATE_SUM(sum, a) CACCUMULATE_SCALAR(sum,CSCALAR_RE(a),CSCALAR_IM(a)) #define CACCUMULATE_DIFF(sum, a) CACCUMULATE_DIFF_SCALAR(sum,CSCALAR_RE(a),CSCALAR_IM(a)) /************************** scalars are complex **************************/ #ifdef SCALAR_COMPLEX typedef scalar_complex scalar; #define SCALAR_NUMVALS CSCALAR_NUMVALS #define SCALAR_INIT_ZERO CSCALAR_INIT_ZERO #define SCALAR_RE(a) CSCALAR_RE(a) #define SCALAR_IM(a) CSCALAR_IM(a) #define ASSIGN_SCALAR(a, real, imag) CASSIGN_SCALAR(a, real, imag) #define ACCUMULATE_SCALAR(a, real, imag) CACCUMULATE_SCALAR(a, real, imag) #define ACCUMULATE_DIFF_SCALAR(a, real, imag) CACCUMULATE_DIFF_SCALAR(a, real, imag) #define SCALAR_NORMSQR(a) CSCALAR_NORMSQR(a) /* a = b * c */ #define ASSIGN_MULT(a, b, c) CASSIGN_MULT(a, b, c) /* a = b / c = b * conj(c) / |c|^2 */ #define ASSIGN_DIV(a, b, c) CASSIGN_DIV(a, b, c) /* a = Re (b * c) */ #define ASSIGN_MULT_RE(a, b, c) CASSIGN_MULT_RE(a, b, c) /* a = Im (b * c) */ #define ASSIGN_MULT_IM(a, b, c) CASSIGN_MULT_IM(a, b, c) /* a += b * c */ #define ACCUMULATE_SUM_MULT(a, b, c) CACCUMULATE_SUM_MULT(a, b, c) /* a += conj(b) * c */ #define ACCUMULATE_SUM_CONJ_MULT(a, b, c) CACCUMULATE_SUM_CONJ_MULT(a, b, c) /* a += |b|^2 */ #define ACCUMULATE_SUM_SQ(a, b) CACCUMULATE_SUM_SQ(a, b) /*************************** scalars are real ****************************/ #else /* scalars are real */ typedef real scalar; #define SCALAR_NUMVALS 1 #define SCALAR_INIT_ZERO 0.0 #define SCALAR_RE(a) (a) #define SCALAR_IM(a) (0.0) #define ASSIGN_SCALAR(a, real, imag) (a) = (real); #define ACCUMULATE_SCALAR(a, real, imag) (a) += (real); #define ACCUMULATE_DIFF_SCALAR(a, real, imag) (a) -= (real); #define SCALAR_NORMSQR(a) ((a) * (a)) #define ASSIGN_MULT(a, b, c) (a) = (b) * (c); #define ASSIGN_DIV(a, b, c) (a) = (b) / (c); #define ASSIGN_MULT_RE(a, b, c) (a) = (b) * (c); #define ASSIGN_MULT_IM(a, b, c) (a) = 0.0; #define ACCUMULATE_SUM_MULT(a, b, c) (a) += (b) * (c); #define ACCUMULATE_SUM_CONJ_MULT(a, b, c) (a) += (b) * (c); #define ACCUMULATE_SUM_SQ(a, b) { real bbbb = (b); (a) += bbbb * bbbb; } #endif /* scalars are real */ #define ASSIGN_ZERO(a) ASSIGN_SCALAR(a, 0.0, 0.0); #define ASSIGN_REAL(a, c) ASSIGN_SCALAR(a, c, 0.0) #define ASSIGN_CONJ(a, b) ASSIGN_SCALAR(a, SCALAR_RE(b), -SCALAR_IM(b)) #define ACCUMULATE_SUM(sum, a) ACCUMULATE_SCALAR(sum,SCALAR_RE(a),SCALAR_IM(a)) #define ACCUMULATE_DIFF(sum, a) ACCUMULATE_DIFF_SCALAR(sum,SCALAR_RE(a),SCALAR_IM(a)) #endif /* SCALAR_H */ mpb-1.4.2/src/matrices/sqmatrix.c0000644000175400001440000001734707446257377012430 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include "matrices.h" #include "blasglue.h" /* Simple operations on sqmatrices. Also, some not-so-simple operations, like inversion and eigenvalue decomposition. */ /* A = B */ void sqmatrix_copy(sqmatrix A, sqmatrix B) { CHECK(A.p == B.p, "arrays not conformant"); blasglue_copy(A.p * A.p, B.data, 1, A.data, 1); } /* Resize A from its current size to a pxp matrix, assuming that A was initially allocated to hold at least this big a matrix. If preserve_data is nonzero, copies the existing data in A (or a subset of it, if the matrix is shrinking) to the corresponding entries of the resized matrix. */ void sqmatrix_resize(sqmatrix *A, int p, short preserve_data) { CHECK(p <= A->alloc_p, "tried to resize beyond allocated limit"); if (preserve_data) { int i, j; if (p < A->p) { for (i = 0; i < p; ++i) for (j = 0; j < p; ++j) A->data[i*p + j] = A->data[i*A->p + j]; } else { for (i = A->p-1; i >= 0; --i) for (j = A->p-1; j >= 0; --j) A->data[i*p + j] = A->data[i*A->p + j]; } } A->p = p; } /* U contains the upper triangle of a Hermitian matrix; we copy this to F and also fill in the lower triangle with the adjoint of the upper. */ void sqmatrix_copy_upper2full(sqmatrix F, sqmatrix U) { int i, j; CHECK(F.p == U.p, "arrays not conformant"); for (i = 0; i < U.p; ++i) { for (j = 0; j < i; ++j) { ASSIGN_CONJ(F.data[i*U.p + j], U.data[j*U.p + i]); } for (; j < U.p; ++j) F.data[i*U.p + j] = U.data[i*U.p + j]; } } /* Asym = (A + adjoint(A)) / 2. Asym is thus Hermitian. */ void sqmatrix_symmetrize(sqmatrix Asym, sqmatrix A) { int i, j; CHECK(Asym.p == A.p, "arrays not conformant"); for (i = 0; i < A.p; ++i) for (j = 0; j < A.p; ++j) { int ij = i * A.p + j, ji = j * A.p + i; ASSIGN_SCALAR(Asym.data[ij], 0.5 * (SCALAR_RE(A.data[ij]) + SCALAR_RE(A.data[ji])), 0.5 * (SCALAR_IM(A.data[ij]) - SCALAR_IM(A.data[ji]))); } } /* trace(U) */ scalar sqmatrix_trace(sqmatrix U) { int i; scalar trace = SCALAR_INIT_ZERO; for (i = 0; i < U.p; ++i) ACCUMULATE_SUM(trace, U.data[i*U.p + i]); return trace; } /* compute trace(adjoint(A) * B) */ scalar sqmatrix_traceAtB(sqmatrix A, sqmatrix B) { scalar trace; CHECK(A.p == B.p, "matrices not conformant"); trace = blasglue_dotc(A.p * A.p, A.data, 1, B.data, 1); return trace; } /* A = B * C. If bdagger != 0, then adjoint(B) is used; similarly for C. A must be distinct from B and C. Note that since the matrices are stored in row-major order, the most efficient operation should be B * adjoint(C), assuming the BLAS is sane. i.e. if C is hermitian, you should use cdagger = 1. Conversely, the worst operation is probably adjoint(B) * C. */ void sqmatrix_AeBC(sqmatrix A, sqmatrix B, short bdagger, sqmatrix C, short cdagger) { CHECK(A.p == B.p && A.p == C.p, "matrices not conformant"); blasglue_gemm(bdagger ? 'C' : 'N', cdagger ? 'C' : 'N', A.p, A.p, A.p, 1.0, B.data, B.p, C.data, C.p, 0.0, A.data, A.p); } /* A += a B * C. bdagger, cdagger are as for sqmatrix_AeBC, above. */ void sqmatrix_ApaBC(sqmatrix A, real a, sqmatrix B, short bdagger, sqmatrix C, short cdagger) { CHECK(A.p == B.p && A.p == C.p, "matrices not conformant"); blasglue_gemm(bdagger ? 'C' : 'N', cdagger ? 'C' : 'N', A.p, A.p, A.p, a, B.data, B.p, C.data, C.p, 1.0, A.data, A.p); } /* A += a B */ void sqmatrix_ApaB(sqmatrix A, real a, sqmatrix B) { CHECK(A.p == B.p, "matrices not conformant"); blasglue_axpy(A.p * A.p, a, B.data, 1, A.data, 1); } /* compute A = a*A + b*B; A and B may be equal. */ void sqmatrix_aApbB(real a, sqmatrix A, real b, sqmatrix B) { CHECK(A.p == B.p, "arrays not conformant"); if (a != 1.0) blasglue_rscal(A.p * A.p, a, A.data, 1); blasglue_axpy(A.p * A.p, b, B.data, 1, A.data, 1); } /* U <- 1/U. U must be Hermitian and, if positive_definite != 0, positive-definite (e.g. U = Yt*Y). Work is a scratch matrix. */ void sqmatrix_invert(sqmatrix U, short positive_definite, sqmatrix Work) { int i, j; if (positive_definite) { /* factorize U: */ lapackglue_potrf('U', U.p, U.data, U.p); /* QUESTION: would it be more efficient to stop here, returning the Cholesky factorization of U? This could then be used to multiply by 1/U without ever calculating the inverse explicitely. It would probably be more numerically stable, but how do the computational costs compare? */ /* Compute 1/U (upper half only) */ lapackglue_potri('U', U.p, U.data, U.p); } else { int *ipiv; CHK_MALLOC(ipiv, int, U.p); CHECK(Work.p * Work.p >= U.p, "scratch matrix is too small"); /* factorize U: */ lapackglue_hetrf('U', U.p, U.data, U.p, ipiv, Work.data, Work.p * Work.p); /* Compute 1/U (upper half only) */ lapackglue_hetri('U', U.p, U.data, U.p, ipiv, Work.data); free(ipiv); } /* Now, copy the conjugate of the upper half onto the lower half of U */ for (i = 0; i < U.p; ++i) for (j = i + 1; j < U.p; ++j) { ASSIGN_CONJ(U.data[j * U.p + i], U.data[i * U.p + j]); } } /* U <- eigenvectors of U. U must be Hermitian. eigenvals <- eigenvalues. W is a work array. The columns of adjoint(U') are the eigenvectors, so that U == adjoint(U') D U', with D = diag(eigenvals). The eigenvalues are returned in ascending order. */ void sqmatrix_eigensolve(sqmatrix U, real *eigenvals, sqmatrix W) { real *work; CHK_MALLOC(work, real, 3*U.p - 2); if (W.p * W.p >= 3 * U.p - 1) lapackglue_heev('V', 'U', U.p, U.data, U.p, eigenvals, W.data, W.p * W.p, work); else { scalar *morework; CHK_MALLOC(morework, scalar, 3 * U.p - 1); lapackglue_heev('V', 'U', U.p, U.data, U.p, eigenvals, morework, 3 * U.p - 1, work); free(morework); } free(work); } /* Compute Usqrt <- sqrt(U), where U must be Hermitian positive-definite. W is a work array, and must be the same size as U. Both U and W are overwritten. */ void sqmatrix_sqrt(sqmatrix Usqrt, sqmatrix U, sqmatrix W) { real *eigenvals; CHECK(Usqrt.p == U.p && U.p == W.p, "matrices not conformant"); CHK_MALLOC(eigenvals, real, U.p); sqmatrix_eigensolve(U, eigenvals, W); { int i; /* Compute W = diag(sqrt(eigenvals)) * U; i.e. the rows of W become the rows of U times sqrt(corresponding eigenvalue) */ for (i = 0; i < U.p; ++i) { CHECK(eigenvals[i] > 0, "non-positive eigenvalue"); blasglue_copy(U.p, U.data + i*U.p, 1, W.data + i*U.p, 1); blasglue_rscal(U.p, sqrt(eigenvals[i]), W.data + i*U.p, 1); } } free(eigenvals); /* compute Usqrt = Ut * W */ sqmatrix_AeBC(Usqrt, U, 1, W, 0); } mpb-1.4.2/src/matrixio/0002755000175400001440000000000007631010727010465 5mpb-1.4.2/src/matrixio/Makefile.in0000644000175400001440000000077407540733107012463 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I../util -I../matrices -I. @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ AR = ar all: libs OBJECTS = fieldio.o evectmatrixio.o matrixio.o LIBNAME = matrixio.a libs: $(LIBNAME) matrixio.a: $(OBJECTS) rm -f $@ $(AR) r $@ $(OBJECTS) $(RANLIB) $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ clean: rm -f $(OBJECTS) core $(LIBNAME) mpb-1.4.2/src/matrixio/evectmatrixio.c0000644000175400001440000000363107537467712013454 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include "matrixio.h" void evectmatrixio_writeall_raw(const char *filename, evectmatrix a) { int dims[3], start[3] = {0, 0, 0}; matrixio_id file_id, data_id; dims[0] = a.N; dims[1] = a.c * SCALAR_NUMVALS; dims[2] = a.p; start[0] = a.Nstart; file_id = matrixio_create(filename); data_id = matrixio_create_dataset(file_id, "rawdata", NULL, 3, dims); dims[0] = a.localN; matrixio_write_real_data(data_id, dims, start, 1, (real *) a.data); matrixio_close_dataset(data_id); matrixio_close(file_id); } void evectmatrixio_readall_raw(const char *filename, evectmatrix a) { int rank = 3, dims[3]; matrixio_id file_id; dims[0] = a.N; dims[1] = a.c * SCALAR_NUMVALS; dims[2] = a.p; file_id = matrixio_open(filename, 1); CHECK(matrixio_read_real_data(file_id, "rawdata", &rank, dims, a.localN, a.Nstart, 1, (real *) a.data), "error reading data set in file"); matrixio_close(file_id); } mpb-1.4.2/src/matrixio/fieldio.c0000644000175400001440000001057707441753311012176 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include #include "../config.h" #include #include #include "matrixio.h" #define TWOPI 6.2831853071795864769252867665590057683943388 #define MAX2(a,b) ((a) > (b) ? (a) : (b)) /* note that kvector here is given in the reciprocal basis */ void fieldio_write_complex_field(scalar_complex *field, int rank, const int dims[3], const int local_dims[3], const int start[3], int which_component, const real *kvector, matrixio_id file_id, int append, matrixio_id data_id[6]) { int i, j, k, component, ri_part; rank = dims[2] == 1 ? (dims[1] == 1 ? 1 : 2) : 3; if (kvector) { real s[3]; /* the step size between grid points dotted with k */ scalar_complex *phasex, *phasey, *phasez; for (i = 0; i < 3; ++i) s[i] = TWOPI * kvector[i] / dims[i]; /* cache exp(ikx) along each of the directions, for speed */ CHK_MALLOC(phasex, scalar_complex, local_dims[0]); CHK_MALLOC(phasey, scalar_complex, local_dims[1]); CHK_MALLOC(phasez, scalar_complex, local_dims[2]); for (i = 0; i < local_dims[0]; ++i) { real phase = s[0] * (i + start[0]); phasex[i].re = cos(phase); phasex[i].im = sin(phase); } for (j = 0; j < local_dims[1]; ++j) { real phase = s[1] * (j + start[1]); phasey[j].re = cos(phase); phasey[j].im = sin(phase); } for (k = 0; k < local_dims[2]; ++k) { real phase = s[2] * (k + start[2]); phasez[k].re = cos(phase); phasez[k].im = sin(phase); } /* Now, multiply field by exp(i k*r): */ for (i = 0; i < local_dims[0]; ++i) { scalar_complex px = phasex[i]; for (j = 0; j < local_dims[1]; ++j) { scalar_complex py; real re = phasey[j].re, im = phasey[j].im; py.re = px.re * re - px.im * im; py.im = px.re * im + px.im * re; for (k = 0; k < local_dims[2]; ++k) { int ijk = ((i*local_dims[1] + j)*local_dims[2] + k)*3; real p_re, p_im; real re = phasez[k].re, im = phasez[k].im; p_re = py.re * re - py.im * im; p_im = py.re * im + py.im * re; for (component = 0; component < 3; ++component) { int ijkc = ijk + component; re = field[ijkc].re; im = field[ijkc].im; field[ijkc].re = re * p_re - im * p_im; field[ijkc].im = im * p_re + re * p_im; } } } } free(phasez); free(phasey); free(phasex); } /* write hyperslabs for each field component: */ for (component = 0; component < 3; ++component) if (component == which_component || which_component < 0) for (ri_part = 0; ri_part < 2; ++ri_part) { char name[] = "x.i"; name[0] = 'x' + component; name[2] = ri_part ? 'i' : 'r'; if (!append) data_id[component*2 + ri_part] = matrixio_create_dataset(file_id, name, NULL, rank, dims); matrixio_write_real_data( data_id[component*2 + ri_part], local_dims, start, 6, ri_part ? &field[component].im : &field[component].re); } } void fieldio_write_real_vals(real *vals, int rank, const int dims[3], const int local_dims[3], const int start[3], matrixio_id file_id, int append, const char *dataname, matrixio_id *data_id) { rank = dims[2] == 1 ? (dims[1] == 1 ? 1 : 2) : 3; if (!append || *data_id < 0) *data_id = matrixio_create_dataset(file_id, dataname, NULL, rank,dims); matrixio_write_real_data(*data_id,local_dims,start,1,vals); } mpb-1.4.2/src/matrixio/matrixio.c0000644000175400001440000005573607441753311012425 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /* matrixio.c: This file layers a "matrixio" abstraction on top of the HDF5 binary i/o interface. This abstraction should make HDF5 much easier to use for our purposes, and could also conceivably allow us to replace HDF5 with some other file format (e.g. HDF4). */ #include #include #include #include "../config.h" #include #include #include #include #include "matrixio.h" /*****************************************************************************/ /* If we have the H5Pset_fapl_mpio function (which is available if HDF5 was compiled for MPI), then we can perform collective file i/o operations (e.g. all processes call H5Fcreate at the same time to create one file). If we don't, however, then we deal with it by having one process work with the file at a time: "exclusive" access. The following macro helps us select different bits of code depending upon whether this is the case. */ #ifdef HAVE_H5PSET_MPI /* old name for this routine */ # define H5Pset_fapl_mpio H5Pset_mpi # ifndef HAVE_H5PSET_FAPL_MPIO # define HAVE_H5PSET_FAPL_MPIO 1 # endif #endif #ifdef HAVE_H5PSET_FAPL_MPIO # define IF_EXCLUSIVE(yes,no) no #else # define IF_EXCLUSIVE(yes,no) yes #endif /*****************************************************************************/ /* Normally, HDF5 prints out all sorts of error messages, e.g. if a dataset can't be found, in addition to returning an error code. The following macro can be wrapped around code to temporarily suppress error messages. */ #define SUPPRESS_HDF5_ERRORS(statements) { \ H5E_auto_t xxxxx_err_func; \ void *xxxxx_err_func_data; \ H5Eget_auto(&xxxxx_err_func, &xxxxx_err_func_data); \ H5Eset_auto(NULL, NULL); \ { statements; } \ H5Eset_auto(xxxxx_err_func, xxxxx_err_func_data); \ } /*****************************************************************************/ /* Wrappers to write/read an attribute attached to id. HDF5 attributes can *not* be attached to files, in which case we'll write/read it as an ordinary dataset. Ugh. */ static void write_attr(matrixio_id id, matrixio_id type_id, matrixio_id space_id, const char *name, void *val) { #if defined(HAVE_HDF5) hid_t attr_id; if (!mpi_is_master()) return; /* only one process should add attributes */ if (H5I_FILE == H5Iget_type(id)) { attr_id = H5Dcreate(id, name, type_id, space_id, H5P_DEFAULT); CHECK(id >= 0, "error creating HDF attr"); H5Dwrite(attr_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, val); H5Dclose(attr_id); } else { attr_id = H5Acreate(id, name, type_id, space_id, H5P_DEFAULT); CHECK(id >= 0, "error creating HDF attr"); H5Awrite(attr_id, type_id, val); H5Aclose(attr_id); } #endif } static matrixio_id open_attr(matrixio_id id, matrixio_id *type_id, matrixio_id *space_id, const char *name) { #if defined(HAVE_HDF5) hid_t attr_id; if (H5I_FILE == H5Iget_type(id)) { SUPPRESS_HDF5_ERRORS(attr_id = H5Dopen(id, name)); if (attr_id >= 0) { *type_id = H5Dget_type(attr_id); *space_id = H5Dget_space(attr_id); } } else { SUPPRESS_HDF5_ERRORS(attr_id = H5Aopen_name(id, name)); if (attr_id >= 0) { *type_id = H5Aget_type(attr_id); *space_id = H5Aget_space(attr_id); } } return attr_id; #else return -1; #endif } static void read_attr(matrixio_id id, matrixio_id attr_id, matrixio_id mem_type_id, void *val) { #if defined(HAVE_HDF5) if (H5I_FILE == H5Iget_type(id)) { H5Dread(attr_id, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, val); } else { H5Aread(attr_id, mem_type_id, val); } #endif } static void close_attr(matrixio_id id, matrixio_id attr_id) { #if defined(HAVE_HDF5) if (H5I_FILE == H5Iget_type(id)) { H5Dclose(attr_id); } else { H5Aclose(attr_id); } #endif } /*****************************************************************************/ void matrixio_write_string_attr(matrixio_id id, const char *name, const char *val) { #if defined(HAVE_HDF5) hid_t type_id; hid_t space_id; if (!val || !name || !name[0] || !val[0]) return; /* don't try to create empty attributes */ type_id = H5Tcopy(H5T_C_S1); H5Tset_size(type_id, strlen(val) + 1); space_id = H5Screate(H5S_SCALAR); write_attr(id, type_id, space_id, name, (void*) val); H5Sclose(space_id); H5Tclose(type_id); #endif } void matrixio_write_data_attr(matrixio_id id, const char *name, const real *val, int rank, const int *dims) { #if defined(HAVE_HDF5) hid_t type_id; hid_t space_id; hsize_t *space_dims; int i; if (!val || !name || !name[0] || rank < 0 || !dims) return; /* don't try to create empty attributes */ #ifdef SCALAR_SINGLE_PREC type_id = H5T_NATIVE_FLOAT; #else type_id = H5T_NATIVE_DOUBLE; #endif if (rank > 0) { CHK_MALLOC(space_dims, hsize_t, rank); for (i = 0; i < rank; ++i) space_dims[i] = dims[i]; space_id = H5Screate_simple(rank, space_dims, NULL); free(space_dims); } else { space_id = H5Screate(H5S_SCALAR); } write_attr(id, type_id, space_id, name, (void*) val); H5Sclose(space_id); #endif } char *matrixio_read_string_attr(matrixio_id id, const char *name) { #if defined(HAVE_HDF5) hid_t attr_id; hid_t type_id; hid_t space_id; int len; char *s = NULL; if (!name || !name[0]) return NULL; /* don't try to read empty-named attributes */ attr_id = open_attr(id, &type_id, &space_id, name); if (attr_id < 0) return NULL; if (H5Sget_simple_extent_npoints(space_id) == 1) { len = H5Tget_size(type_id); H5Tclose(type_id); type_id = H5Tcopy(H5T_C_S1); H5Tset_size(type_id, len); CHK_MALLOC(s, char, len); read_attr(id, attr_id, type_id, (void*) s); } H5Tclose(type_id); H5Sclose(space_id); close_attr(id, attr_id); return s; #else return NULL; #endif } real *matrixio_read_data_attr(matrixio_id id, const char *name, int *rank, int max_rank, int *dims) { #if defined(HAVE_HDF5) hid_t attr_id, type_id, mem_type_id, space_id; real *d = NULL; if (!name || !name[0] || max_rank < 0 || !dims) return NULL; /* don't try to create empty attributes */ #ifdef SCALAR_SINGLE_PREC mem_type_id = H5T_NATIVE_FLOAT; #else mem_type_id = H5T_NATIVE_DOUBLE; #endif attr_id = open_attr(id, &type_id, &space_id, name); if (attr_id < 0) return NULL; *rank = H5Sget_simple_extent_ndims(space_id); if (*rank <= max_rank) { if (*rank > 0) { int i; hsize_t *space_dims, *maxdims; CHK_MALLOC(space_dims, hsize_t, *rank); CHK_MALLOC(maxdims, hsize_t, *rank); H5Sget_simple_extent_dims(space_id, space_dims, maxdims); for (i = 0; i < *rank; ++i) dims[i] = space_dims[i]; free(maxdims); free(space_dims); } CHK_MALLOC(d, real, H5Sget_simple_extent_npoints(space_id)); read_attr(id, attr_id, mem_type_id, (void*) d); } H5Tclose(type_id); H5Sclose(space_id); close_attr(id, attr_id); return d; #else return NULL; #endif } /*****************************************************************************/ #define FNAME_SUFFIX ".h5" /* standard HDF5 filename suffix */ static char *add_fname_suffix(const char *fname) { int oldlen = strlen(fname); int suflen = strlen(FNAME_SUFFIX); char *new_fname; CHECK(fname, "null filename!"); CHK_MALLOC(new_fname, char, oldlen + suflen + 1); strcpy(new_fname, fname); /* only add suffix if it is not already there: */ if (strstr(new_fname, FNAME_SUFFIX) != new_fname + oldlen - suflen) strcat(new_fname, FNAME_SUFFIX); return new_fname; } /*****************************************************************************/ static int matrixio_critical_section_tag = 0; matrixio_id matrixio_create(const char *fname) { #if defined(HAVE_HDF5) char *new_fname; matrixio_id id; hid_t access_props; access_props = H5Pcreate (H5P_FILE_ACCESS); # if defined(HAVE_MPI) && defined(HAVE_H5PSET_FAPL_MPIO) H5Pset_fapl_mpio(access_props, MPI_COMM_WORLD, MPI_INFO_NULL); # endif new_fname = add_fname_suffix(fname); # ifdef HAVE_H5PSET_FAPL_MPIO id = H5Fcreate(new_fname, H5F_ACC_TRUNC, H5P_DEFAULT, access_props); # else mpi_begin_critical_section(matrixio_critical_section_tag); if (mpi_is_master()) id = H5Fcreate(new_fname, H5F_ACC_TRUNC, H5P_DEFAULT, access_props); else id = H5Fopen(new_fname, H5F_ACC_RDWR, access_props); # endif CHECK(id >= 0, "error creating HDF output file"); free(new_fname); H5Pclose(access_props); return id; #else mpi_one_fprintf(stderr, "matrixio: cannot output \"%s\" (compiled without HDF)\n", fname); return 0; #endif } matrixio_id matrixio_open(const char *fname, int read_only) { #if defined(HAVE_HDF5) char *new_fname; matrixio_id id; hid_t access_props; access_props = H5Pcreate (H5P_FILE_ACCESS); # if defined(HAVE_MPI) && defined(HAVE_H5PSET_FAPL_MPIO) H5Pset_fapl_mpio(access_props, MPI_COMM_WORLD, MPI_INFO_NULL); # endif new_fname = add_fname_suffix(fname); IF_EXCLUSIVE(mpi_begin_critical_section(matrixio_critical_section_tag),0); if (read_only) id = H5Fopen(new_fname, H5F_ACC_RDONLY, access_props); else id = H5Fopen(new_fname, H5F_ACC_RDWR, access_props); CHECK(id >= 0, "error opening HDF input file"); free(new_fname); H5Pclose(access_props); return id; #else CHECK(0, "no matrixio implementation is linked"); return 0; #endif } void matrixio_close(matrixio_id id) { #if defined(HAVE_HDF5) CHECK(H5Fclose(id) >= 0, "error closing HDF file"); IF_EXCLUSIVE(mpi_end_critical_section(matrixio_critical_section_tag++),0); #endif } /*****************************************************************************/ matrixio_id matrixio_create_sub(matrixio_id id, const char *name, const char *description) { #if defined(HAVE_HDF5) matrixio_id sub_id; /* when running a parallel job, only the master process creates the group. It flushes the group to disk and then the other processes open the group. Is this the right thing to do, or is the H5Gcreate function parallel-aware? */ if (mpi_is_master()) { sub_id = H5Gcreate(id, name, 0 /* ==> default size */ ); matrixio_write_string_attr(sub_id, "description", description); H5Fflush(sub_id, H5F_SCOPE_GLOBAL); IF_EXCLUSIVE(0,MPI_Barrier(MPI_COMM_WORLD)); } else { IF_EXCLUSIVE(0,MPI_Barrier(MPI_COMM_WORLD)); sub_id = H5Gopen(id, name); } return sub_id; #else return 0; #endif } void matrixio_close_sub(matrixio_id id) { #if defined(HAVE_HDF5) CHECK(H5Gclose(id) >= 0, "error closing HDF group"); #endif } /*****************************************************************************/ matrixio_id matrixio_open_dataset(matrixio_id id, const char *name, int rank, const int *dims) { #if defined(HAVE_HDF5) int i, rank_copy; hid_t space_id, data_id; hsize_t *dims_copy, *maxdims; data_id = H5Dopen(id, name); CHECK((data_id = H5Dopen(id, name)) >= 0, "error in H5Dopen"); CHECK((space_id = H5Dget_space(data_id)) >= 0, "error in H5Dget_space"); rank_copy = H5Sget_simple_extent_ndims(space_id); CHECK(rank == rank_copy, "rank in HDF5 file doesn't match expected rank"); CHK_MALLOC(dims_copy, hsize_t, rank); CHK_MALLOC(maxdims, hsize_t, rank); H5Sget_simple_extent_dims(space_id, dims_copy, maxdims); free(maxdims); for (i = 0; i < rank; ++i) { CHECK(dims_copy[i] == dims[i], "array size in HDF5 file doesn't match expected size"); } free(dims_copy); H5Sclose(space_id); return data_id; #else return 0; #endif } /*****************************************************************************/ matrixio_id matrixio_create_dataset(matrixio_id id, const char *name, const char *description, int rank, const int *dims) { #if defined(HAVE_HDF5) int i; hid_t space_id, type_id, data_id; hsize_t *dims_copy; /* delete pre-existing datasets, or we'll have an error; I think we can only do this on the master process. (?) */ if (matrixio_dataset_exists(id, name)) { if (mpi_is_master()) { matrixio_dataset_delete(id, name); H5Fflush(id, H5F_SCOPE_GLOBAL); } IF_EXCLUSIVE(0,MPI_Barrier(MPI_COMM_WORLD)); } CHECK(rank > 0, "non-positive rank"); CHK_MALLOC(dims_copy, hsize_t, rank); for (i = 0; i < rank; ++i) dims_copy[i] = dims[i]; space_id = H5Screate_simple(rank, dims_copy, NULL); free(dims_copy); #ifdef SCALAR_SINGLE_PREC type_id = H5T_NATIVE_FLOAT; #else type_id = H5T_NATIVE_DOUBLE; #endif /* Create the dataset. Note that, on parallel machines, H5Dcreate should do the right thing; it is supposedly a collective operation. */ IF_EXCLUSIVE( if (mpi_is_master()) data_id = H5Dcreate(id, name, type_id, space_id, H5P_DEFAULT); else data_id = H5Dopen(id, name), data_id = H5Dcreate(id, name, type_id, space_id, H5P_DEFAULT)); H5Sclose(space_id); /* the dataset should have its own copy now */ matrixio_write_string_attr(data_id, "description", description); return data_id; #else return 0; #endif } void matrixio_close_dataset(matrixio_id data_id) { #if defined(HAVE_HDF5) CHECK(H5Dclose(data_id) >= 0, "error closing HDF dataset"); #endif } int matrixio_dataset_exists(matrixio_id id, const char *name) { #if defined(HAVE_HDF5) hid_t data_id; SUPPRESS_HDF5_ERRORS(data_id = H5Dopen(id, name)); if (data_id >= 0) H5Dclose(data_id); return (data_id >= 0); #else return 0; #endif } void matrixio_dataset_delete(matrixio_id id, const char *name) { #if defined(HAVE_HDF5) H5Gunlink(id, name); #endif } /*****************************************************************************/ void matrixio_write_real_data(matrixio_id data_id, const int *local_dims, const int *local_start, int stride, real *data) { #if defined(HAVE_HDF5) int rank; hsize_t *dims, *maxdims; hid_t space_id, type_id, mem_space_id; hssize_t *start; hsize_t *strides, *count, count_prod; int i; real *data_copy; int data_copy_stride = 1, free_data_copy = 0, do_write = 1; /*******************************************************************/ /* Get dimensions of dataset */ space_id = H5Dget_space(data_id); rank = H5Sget_simple_extent_ndims(space_id); CHK_MALLOC(dims, hsize_t, rank); CHK_MALLOC(maxdims, hsize_t, rank); H5Sget_simple_extent_dims(space_id, dims, maxdims); free(maxdims); #ifdef SCALAR_SINGLE_PREC type_id = H5T_NATIVE_FLOAT; #else type_id = H5T_NATIVE_DOUBLE; #endif /*******************************************************************/ /* if stride > 1, make a contiguous copy; hdf5 is much faster in this case. */ if (stride > 1) { int N = 1; for (i = 0; i < rank; ++i) N *= local_dims[i]; CHK_MALLOC(data_copy, real, N); if (data_copy) { free_data_copy = 1; for (i = 0; i < (N & 3); ++i) data_copy[i] = data[i * stride]; for (; i < N; i += 4) { real d0 = data[i * stride]; real d1 = data[(i + 1) * stride]; real d2 = data[(i + 2) * stride]; real d3 = data[(i + 3) * stride]; data_copy[i] = d0; data_copy[i+1] = d1; data_copy[i+2] = d2; data_copy[i+3] = d3; } CHECK(i == N, "bug in matrixio copy routine"); } else { data_copy = data; data_copy_stride = stride; } } else data_copy = data; /*******************************************************************/ /* Before we can write the data to the data set, we must define the dimensions and "selections" of the arrays to be read & written: */ CHK_MALLOC(start, hssize_t, rank); CHK_MALLOC(strides, hsize_t, rank); CHK_MALLOC(count, hsize_t, rank); count_prod = 1; for (i = 0; i < rank; ++i) { start[i] = local_start[i]; count[i] = local_dims[i]; strides[i] = 1; count_prod *= count[i]; } if (count_prod > 0) { H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL); for (i = 0; i < rank; ++i) start[i] = 0; strides[rank - 1] = data_copy_stride; count[rank - 1] *= data_copy_stride; mem_space_id = H5Screate_simple(rank, count, NULL); count[rank - 1] = local_dims[rank - 1]; H5Sselect_hyperslab(mem_space_id, H5S_SELECT_SET, start, data_copy_stride <= 1 ? NULL : strides, count, NULL); } else { /* this can happen on leftover processes in MPI */ H5Sselect_none(space_id); mem_space_id = H5Scopy(space_id); /* can't create an empty space */ H5Sselect_none(mem_space_id); do_write = 0; /* HDF5 complains about empty dataspaces otherwise */ } /*******************************************************************/ /* Write the data, then free all the stuff we've allocated. */ if (do_write) H5Dwrite(data_id, type_id, mem_space_id, space_id, H5P_DEFAULT, (void*) data_copy); if (free_data_copy) free(data_copy); H5Sclose(mem_space_id); free(count); free(strides); free(start); free(dims); H5Sclose(space_id); #endif } #if defined(HAVE_HDF5) /* check if the given name is a dataset in group_id, and if so set d to point to a char** with a copy of name. */ static herr_t find_dataset(hid_t group_id, const char *name, void *d) { char **dname = (char **) d; H5G_stat_t info; H5Gget_objinfo(group_id, name, 1, &info); if (info.type == H5G_DATASET) { CHK_MALLOC(*dname, char, strlen(name) + 1); strcpy(*dname, name); return 1; } return 0; } #endif /*****************************************************************************/ /* Read real data from the file/group 'id', from the dataset 'name'. If name is NULL, reads from the first dataset in 'id'. If data is non-NULL, then data must have dimensions given in rank and dims (* stride); actually, what is read in is the hyperslab given by the local_dim0* parameters. The dataset is read into 'data' with the given 'stride'. Returns the data pointer. If data is NULL, then upon output rank and dims point to the size of the array, and a pointer to the (malloc'ed) data is returned. On input, *rank should point to the maximum allowed rank (e.g. the length of the dims array)! The local_dim* and stride parameters are ignored here. Returns NULL if the dataset could not be found in id. */ real *matrixio_read_real_data(matrixio_id id, const char *name, int *rank, int *dims, int local_dim0, int local_dim0_start, int stride, real *data) { #if defined(HAVE_HDF5) hid_t space_id, type_id, data_id, mem_space_id; hsize_t *dims_copy, *maxdims; char *dname; int i; CHECK(*rank > 0, "non-positive rank"); /*******************************************************************/ /* Open the data set and check the dimensions: */ if (name) { CHK_MALLOC(dname, char, strlen(name) + 1); strcpy(dname, name); } else { if (H5Giterate(id, "/", NULL, find_dataset, &dname) < 0) return NULL; } SUPPRESS_HDF5_ERRORS(data_id = H5Dopen(id, dname)); free(dname); if (data_id < 0) return NULL; CHECK((space_id = H5Dget_space(data_id)) >= 0, "error in H5Dget_space"); { int filerank = H5Sget_simple_extent_ndims(space_id); if (data) { CHECK(*rank == filerank, "rank in HDF5 file doesn't match expected rank"); } else { CHECK(*rank >= filerank, "rank in HDF5 file is too big"); *rank = filerank; } } CHK_MALLOC(dims_copy, hsize_t, *rank); CHK_MALLOC(maxdims, hsize_t, *rank); H5Sget_simple_extent_dims(space_id, dims_copy, maxdims); free(maxdims); if (data) for (i = 0; i < *rank; ++i) { CHECK(dims_copy[i] == dims[i], "array size in HDF5 file doesn't match expected size"); } else for (i = 0; i < *rank; ++i) dims[i] = dims_copy[i]; #ifdef SCALAR_SINGLE_PREC type_id = H5T_NATIVE_FLOAT; #else type_id = H5T_NATIVE_DOUBLE; #endif /*******************************************************************/ /* Before we can read the data from the data set, we must define the dimensions and "selections" of the arrays to be read & written: */ if (data) { hssize_t *start; hsize_t *strides, *count; CHK_MALLOC(start, hssize_t, *rank); CHK_MALLOC(strides, hsize_t, *rank); CHK_MALLOC(count, hsize_t, *rank); for (i = 0; i < *rank; ++i) { start[i] = 0; strides[i] = 1; count[i] = dims[i]; } dims_copy[0] = local_dim0; dims_copy[*rank - 1] *= stride; start[0] = 0; strides[*rank - 1] = stride; count[0] = local_dim0; mem_space_id = H5Screate_simple(*rank, dims_copy, NULL); H5Sselect_hyperslab(mem_space_id, H5S_SELECT_SET, start, strides, count, NULL); start[0] = local_dim0_start; count[0] = local_dim0; H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL); free(count); free(strides); free(start); } else { int N = 1; for (i = 0; i < *rank; ++i) N *= dims[i]; CHK_MALLOC(data, real, N); mem_space_id = H5S_ALL; H5Sclose(space_id); space_id = H5S_ALL; } /*******************************************************************/ /* Read the data, then free all the H5 identifiers. */ CHECK(H5Dread(data_id, type_id, mem_space_id, space_id, H5P_DEFAULT, (void*) data) >= 0, "error reading HDF5 dataset"); if (mem_space_id != H5S_ALL) H5Sclose(mem_space_id); free(dims_copy); if (space_id != H5S_ALL) H5Sclose(space_id); H5Dclose(data_id); return data; #else CHECK(0, "no matrixio implementation is linked"); return NULL; #endif } mpb-1.4.2/src/matrixio/matrixio.h0000644000175400001440000000655707441753311012427 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MATRIXIO_H #define MATRIXIO_H #include #if defined(HAVE_HDF5) # include typedef hid_t matrixio_id; #else /* no HDF */ typedef int matrixio_id; /* dummy */ #endif extern matrixio_id matrixio_create(const char *fname); extern matrixio_id matrixio_open(const char *fname, int read_only); extern void matrixio_close(matrixio_id id); extern matrixio_id matrixio_create_sub(matrixio_id id, const char *name, const char *description); extern void matrixio_close_sub(matrixio_id id); extern matrixio_id matrixio_open_dataset(matrixio_id id, const char *name, int rank, const int *dims); extern matrixio_id matrixio_create_dataset(matrixio_id id, const char *name, const char *description, int rank, const int *dims); extern void matrixio_close_dataset(matrixio_id data_id); extern int matrixio_dataset_exists(matrixio_id id, const char *name); extern void matrixio_dataset_delete(matrixio_id id, const char *name); extern void matrixio_write_real_data(matrixio_id data_id, const int *local_dims, const int *local_start, int stride, real *data); extern real *matrixio_read_real_data(matrixio_id id, const char *name, int *rank, int *dims, int local_dim0, int local_dim0_start, int stride, real *data); extern void matrixio_write_string_attr(matrixio_id id, const char *name, const char *val); extern void matrixio_write_data_attr(matrixio_id id, const char *name, const real *val, int rank, const int *dims); extern char *matrixio_read_string_attr(matrixio_id id, const char *name); extern real *matrixio_read_data_attr(matrixio_id id, const char *name, int *rank, int max_rank, int *dims); extern void evectmatrixio_writeall_raw(const char *filename, evectmatrix a); extern void evectmatrixio_readall_raw(const char *filename, evectmatrix a); extern void fieldio_write_complex_field(scalar_complex *field, int rank, const int dims[3], const int local_dims[3], const int start[3], int which_component, const real kvector[3], matrixio_id file_id, int append, matrixio_id data_id[6]); extern void fieldio_write_real_vals(real *vals, int rank, const int dims[3], const int local_dims[3], const int start[3], matrixio_id file_id, int append, const char *dataname, matrixio_id *data_id); #endif /* MATRIXIO_H */ mpb-1.4.2/src/maxwell/0002755000175400001440000000000007631010727010302 5mpb-1.4.2/src/maxwell/Makefile.in0000644000175400001440000000103707540733107012271 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I../util -I../matrices @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ AR = ar all: libs OBJECTS = maxwell.o maxwell_op.o maxwell_pre.o maxwell_eps.o \ maxwell_constraints.o LIBNAME = maxwell.a libs: $(LIBNAME) maxwell.a: $(OBJECTS) rm -f $@ $(AR) r $@ $(OBJECTS) $(RANLIB) $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ clean: rm -f $(OBJECTS) core $(LIBNAME) mpb-1.4.2/src/maxwell/README0000644000175400001440000000073506654241115011106 This directory contains code for operating the Maxwell operator on a vector field: MaxwellOp(V) = curl(1/eps * curl(V)) We store V in a Fourier basis, so that the curl operation is diagonal. To multiply by epsilon-inverse, we use a pair of FFTs to transform to and from position space. Also included are initialization routines for the auxiliary data and storage required by MaxwellOp, as well as subsidiary routines to compute things like the curl and the energy density. mpb-1.4.2/src/maxwell/maxwell.c0000644000175400001440000002660507441753311012050 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include "maxwell.h" /* This file is has too many #ifdef's...blech. */ #define MIN2(a,b) ((a) < (b) ? (a) : (b)) #define MAX2(a,b) ((a) > (b) ? (a) : (b)) maxwell_data *create_maxwell_data(int nx, int ny, int nz, int *local_N, int *N_start, int *alloc_N, int num_bands, int max_fft_bands) { int n[3], rank = (nz == 1) ? (ny == 1 ? 1 : 2) : 3; maxwell_data *d = 0; int fft_data_size; n[0] = nx; n[1] = ny; n[2] = nz; #ifndef HAVE_FFTW # error Non-FFTW FFTs are not currently supported. #endif #ifdef HAVE_FFTW CHECK(sizeof(fftw_real) == sizeof(real), "floating-point type is inconsistent with FFTW!"); #endif CHK_MALLOC(d, maxwell_data, 1); d->nx = nx; d->ny = ny; d->nz = nz; d->max_fft_bands = MIN2(num_bands, max_fft_bands); maxwell_set_num_bands(d, num_bands); d->current_k[0] = d->current_k[1] = d->current_k[2] = 0.0; d->parity = NO_PARITY; d->last_dim_size = d->last_dim = n[rank - 1]; /* ----------------------------------------------------- */ #ifndef HAVE_MPI d->local_nx = nx; d->local_ny = ny; d->local_x_start = d->local_y_start = 0; *local_N = *alloc_N = nx * ny * nz; *N_start = 0; d->other_dims = *local_N / d->last_dim; d->fft_data = 0; /* initialize it here for use in specific planner? */ # ifdef HAVE_FFTW # ifdef SCALAR_COMPLEX d->fft_output_size = fft_data_size = nx * ny * nz; d->plan = fftwnd_create_plan_specific(rank, n, FFTW_BACKWARD, FFTW_ESTIMATE | FFTW_IN_PLACE, (fftw_complex*) d->fft_data, 3 * d->num_fft_bands, (fftw_complex*) d->fft_data, 3 * d->num_fft_bands); d->iplan = fftwnd_create_plan_specific(rank, n, FFTW_FORWARD, FFTW_ESTIMATE | FFTW_IN_PLACE, (fftw_complex*) d->fft_data, 3 * d->num_fft_bands, (fftw_complex*) d->fft_data, 3 * d->num_fft_bands); # else /* not SCALAR_COMPLEX */ d->last_dim_size = 2 * (d->last_dim / 2 + 1); d->fft_output_size = (fft_data_size = d->other_dims * d->last_dim_size)/2; d->plan = rfftwnd_create_plan_specific(rank, n, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE | FFTW_IN_PLACE, (fftw_real*) d->fft_data, 3 * d->num_fft_bands, (fftw_real*) d->fft_data, 3 * d->num_fft_bands); d->iplan = rfftwnd_create_plan_specific(rank, n, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE | FFTW_IN_PLACE, (fftw_real*) d->fft_data, 3 * d->num_fft_bands, (fftw_real*) d->fft_data, 3 * d->num_fft_bands); # endif /* not SCALAR_COMPLEX */ # endif /* HAVE_FFTW */ #else /* HAVE_MPI */ /* ----------------------------------------------------- */ # ifdef HAVE_FFTW CHECK(rank > 1, "rank < 2 MPI computations are not supported"); # ifdef SCALAR_COMPLEX d->iplan = fftwnd_mpi_create_plan(MPI_COMM_WORLD, rank, n, FFTW_FORWARD, FFTW_ESTIMATE | FFTW_IN_PLACE); { int nt[3]; /* transposed dimensions for reverse FFT */ nt[0] = n[1]; nt[1] = n[0]; nt[2] = n[2]; d->plan = fftwnd_mpi_create_plan(MPI_COMM_WORLD, rank, nt, FFTW_BACKWARD, FFTW_ESTIMATE | FFTW_IN_PLACE); } fftwnd_mpi_local_sizes(d->iplan, &d->local_nx, &d->local_x_start, &d->local_ny, &d->local_y_start, &fft_data_size); d->fft_output_size = nx * d->local_ny * nz; # else /* not SCALAR_COMPLEX */ CHECK(rank > 1, "rank < 2 MPI computations are not supported"); d->iplan = rfftwnd_mpi_create_plan(MPI_COMM_WORLD, rank, n, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE | FFTW_IN_PLACE); /* Unlike fftwnd_mpi, we do *not* pass transposed dimensions for the reverse transform here--we always pass the dimensions of the original real array, and rfftwnd_mpi assumes that if one transform is transposed, then the other is as well. */ d->plan = rfftwnd_mpi_create_plan(MPI_COMM_WORLD, rank, n, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE | FFTW_IN_PLACE); rfftwnd_mpi_local_sizes(d->iplan, &d->local_nx, &d->local_x_start, &d->local_ny, &d->local_y_start, &fft_data_size); d->last_dim_size = 2 * (d->last_dim / 2 + 1); if (rank == 2) d->fft_output_size = nx * d->local_ny * nz; else d->fft_output_size = nx * d->local_ny * (d->last_dim_size / 2); # endif /* not SCALAR_COMPLEX */ *local_N = d->local_nx * ny * nz; *N_start = d->local_x_start * ny * nz; *alloc_N = *local_N; d->other_dims = *local_N / d->last_dim; # endif /* HAVE_FFTW */ #endif /* HAVE_MPI */ /* ----------------------------------------------------- */ #ifdef HAVE_FFTW CHECK(d->plan && d->iplan, "FFTW plan creation failed"); #endif CHK_MALLOC(d->eps_inv, symmetric_matrix, d->fft_output_size); /* A scratch output array is required because the "ordinary" arrays are not in a cartesian basis (or even a constant basis). */ fft_data_size *= d->max_fft_bands; CHK_MALLOC(d->fft_data, scalar, 3 * fft_data_size); CHK_MALLOC(d->k_plus_G, k_data, *local_N); CHK_MALLOC(d->k_plus_G_normsqr, real, *local_N); d->eps_inv_mean = 1.0; d->local_N = *local_N; d->N_start = *N_start; d->alloc_N = *alloc_N; d->N = nx * ny * nz; return d; } void destroy_maxwell_data(maxwell_data *d) { if (d) { #ifdef HAVE_FFTW # ifdef HAVE_MPI # ifdef SCALAR_COMPLEX fftwnd_mpi_destroy_plan(d->plan); fftwnd_mpi_destroy_plan(d->iplan); # else /* not SCALAR_COMPLEX */ rfftwnd_mpi_destroy_plan(d->plan); rfftwnd_mpi_destroy_plan(d->iplan); # endif /* not SCALAR_COMPLEX */ # else /* not HAVE_MPI */ # ifdef SCALAR_COMPLEX fftwnd_destroy_plan(d->plan); fftwnd_destroy_plan(d->iplan); # else /* not SCALAR_COMPLEX */ rfftwnd_destroy_plan(d->plan); rfftwnd_destroy_plan(d->iplan); # endif /* not SCALAR_COMPLEX */ # endif /* not HAVE_MPI */ #endif /* HAVE FFTW */ free(d->eps_inv); free(d->fft_data); free(d->k_plus_G); free(d->k_plus_G_normsqr); free(d); } } void maxwell_set_num_bands(maxwell_data *d, int num_bands) { d->num_bands = num_bands; d->num_fft_bands = MIN2(num_bands, d->max_fft_bands); } /* compute a = b x c */ static void compute_cross(real *a0, real *a1, real *a2, real b0, real b1, real b2, real c0, real c1, real c2) { *a0 = b1 * c2 - b2 * c1; *a1 = b2 * c0 - b0 * c2; *a2 = b0 * c1 - b1 * c0; } /* Set the current k point for the Maxwell solver. k is given in the basis of the reciprocal lattice vectors, G1, G2, and G3. */ void update_maxwell_data_k(maxwell_data *d, real k[3], real G1[3], real G2[3], real G3[3]) { int nx = d->nx, ny = d->ny, nz = d->nz; int cx = MAX2(1,d->nx/2), cy = MAX2(1,d->ny/2), cz = MAX2(1,d->nz/2); k_data *kpG = d->k_plus_G; real *kpGn2 = d->k_plus_G_normsqr; int x, y, z; real kx, ky, kz; kx = G1[0]*k[0] + G2[0]*k[1] + G3[0]*k[2]; ky = G1[1]*k[0] + G2[1]*k[1] + G3[1]*k[2]; kz = G1[2]*k[0] + G2[2]*k[1] + G3[2]*k[2]; d->zero_k = kx == 0.0 && ky == 0.0 && kz == 0.0; d->current_k[0] = kx; d->current_k[1] = ky; d->current_k[2] = kz; /* make sure current parity is still valid: */ set_maxwell_data_parity(d, d->parity); for (x = d->local_x_start; x < d->local_x_start + d->local_nx; ++x) { int kxi = (x >= cx) ? (x - nx) : x; for (y = 0; y < ny; ++y) { int kyi = (y >= cy) ? (y - ny) : y; for (z = 0; z < nz; ++z, kpG++, kpGn2++) { int kzi = (z >= cz) ? (z - nz) : z; real kpGx, kpGy, kpGz, a, b, c, leninv; /* Compute k+G (noting that G is negative because of the choice of sign in the FFTW Fourier transform): */ kpGx = kx - (G1[0]*kxi + G2[0]*kyi + G3[0]*kzi); kpGy = ky - (G1[1]*kxi + G2[1]*kyi + G3[1]*kzi); kpGz = kz - (G1[2]*kxi + G2[2]*kyi + G3[2]*kzi); a = kpGx*kpGx + kpGy*kpGy + kpGz*kpGz; kpG->kmag = sqrt(a); *kpGn2 = a; /* Now, compute the two normal vectors: */ /* (Note that we choose them so that m has odd/even parity in z/y, and n is even/odd in z/y.) */ if (a == 0) { kpG->nx = 0.0; kpG->ny = 1.0; kpG->nz = 0.0; kpG->mx = 0.0; kpG->my = 0.0; kpG->mz = 1.0; } else { if (kpGx == 0.0 && kpGy == 0.0) { /* put n in the y direction if k+G is in z: */ kpG->nx = 0.0; kpG->ny = 1.0; kpG->nz = 0.0; } else { /* otherwise, let n = z x (k+G), normalized: */ compute_cross(&a, &b, &c, 0.0, 0.0, 1.0, kpGx, kpGy, kpGz); leninv = 1.0 / sqrt(a*a + b*b + c*c); kpG->nx = a * leninv; kpG->ny = b * leninv; kpG->nz = c * leninv; } /* m = n x (k+G), normalized */ compute_cross(&a, &b, &c, kpG->nx, kpG->ny, kpG->nz, kpGx, kpGy, kpGz); leninv = 1.0 / sqrt(a*a + b*b + c*c); kpG->mx = a * leninv; kpG->my = b * leninv; kpG->mz = c * leninv; } #ifdef DEBUG #define DOT(u0,u1,u2,v0,v1,v2) ((u0)*(v0) + (u1)*(v1) + (u2)*(v2)) /* check orthogonality */ CHECK(fabs(DOT(kpGx, kpGy, kpGz, kpG->nx, kpG->ny, kpG->nz)) < 1e-6, "vectors not orthogonal!"); CHECK(fabs(DOT(kpGx, kpGy, kpGz, kpG->mx, kpG->my, kpG->mz)) < 1e-6, "vectors not orthogonal!"); CHECK(fabs(DOT(kpG->mx, kpG->my, kpG->mz, kpG->nx, kpG->ny, kpG->nz)) < 1e-6, "vectors not orthogonal!"); /* check normalization */ CHECK(fabs(DOT(kpG->nx, kpG->ny, kpG->nz, kpG->nx, kpG->ny, kpG->nz) - 1.0) < 1e-6, "vectors not unit vectors!"); CHECK(fabs(DOT(kpG->mx, kpG->my, kpG->mz, kpG->mx, kpG->my, kpG->mz) - 1.0) < 1e-6, "vectors not unit vectors!"); #endif } } } } void set_maxwell_data_parity(maxwell_data *d, int parity) { if ((parity & EVEN_Z_PARITY) && (parity & ODD_Z_PARITY)) parity &= ~(EVEN_Z_PARITY | ODD_Z_PARITY); if (d->current_k[2] != 0.0) parity &= ~(EVEN_Z_PARITY | ODD_Z_PARITY); if ((parity & EVEN_Y_PARITY) && (parity & ODD_Y_PARITY)) parity &= ~(EVEN_Y_PARITY | ODD_Y_PARITY); if (d->current_k[1] != 0.0) parity &= ~(EVEN_Y_PARITY | ODD_Y_PARITY); d->parity = parity; } maxwell_target_data *create_maxwell_target_data(maxwell_data *md, real target_frequency) { maxwell_target_data *d; CHK_MALLOC(d, maxwell_target_data, 1); d->d = md; d->target_frequency = target_frequency; return d; } void destroy_maxwell_target_data(maxwell_target_data *d) { if (d) { free(d); } } mpb-1.4.2/src/maxwell/maxwell.h0000644000175400001440000001703407441753311012051 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MAXWELL_H #define MAXWELL_H #include #include #if defined(HAVE_LIBFFTW) # include # include # ifdef HAVE_MPI # include # include # endif #elif defined(HAVE_LIBDFFTW) # include # include # ifdef HAVE_MPI # include # include # endif #elif defined(HAVE_LIBSFFTW) # include # include # ifdef HAVE_MPI # include # include # endif #endif #if defined(HAVE_LIBFFTW) || defined(HAVE_LIBDFFTW) || defined(HAVE_LIBSFFTW) # define HAVE_FFTW 1 #endif /* This data structure is designed to hold k+G related data at a given point. kmag is the length of the k+G vector. The m and n vectors are orthonormal vectors orthogonal to (kx,ky,kz). These are used as the basis for the H vector (to maintain transversality). */ typedef struct { real kmag; real mx, my, mz; real nx, ny, nz; } k_data; /* Data structure to hold the upper triangle of a symmetric real matrix or possibly a Hermitian complex matrix (e.g. the dielectric tensor). */ typedef struct { #ifdef WITH_HERMITIAN_EPSILON real m00, m11, m22; scalar_complex m01, m02, m12; #else real m00, m01, m02, m11, m12, m22; #endif } symmetric_matrix; #ifdef WITH_HERMITIAN_EPSILON # define DIAG_SYMMETRIC_MATRIX(m) ((m).m01.re == 0.0 && (m).m01.im == 0.0 && \ (m).m02.re == 0.0 && (m).m02.im == 0.0 && \ (m).m12.re == 0.0 && (m).m12.im == 0.0) #else # define DIAG_SYMMETRIC_MATRIX(m) ((m).m01 == 0.0 && \ (m).m02 == 0.0 && \ (m).m12 == 0.0) #endif #define NO_PARITY (0) #define EVEN_Z_PARITY (1<<0) #define ODD_Z_PARITY (1<<1) #define EVEN_Y_PARITY (1<<2) #define ODD_Y_PARITY (1<<3) typedef struct { int nx, ny, nz; int local_nx, local_ny; int local_x_start, local_y_start; int last_dim, last_dim_size, other_dims; int num_bands; int N, local_N, N_start, alloc_N; int fft_output_size; int max_fft_bands, num_fft_bands; real current_k[3]; /* (in cartesian basis) */ int parity; #ifdef HAVE_FFTW # ifdef HAVE_MPI # ifdef SCALAR_COMPLEX fftwnd_mpi_plan plan, iplan; # else rfftwnd_mpi_plan plan, iplan; # endif # else # ifdef SCALAR_COMPLEX fftwnd_plan plan, iplan; # else rfftwnd_plan plan, iplan; # endif # endif #endif scalar *fft_data; int zero_k; /* non-zero if k is zero (handled specially) */ k_data *k_plus_G; real *k_plus_G_normsqr; symmetric_matrix *eps_inv; real eps_inv_mean; } maxwell_data; extern maxwell_data *create_maxwell_data(int nx, int ny, int nz, int *local_N, int *N_start, int *alloc_N, int num_bands, int num_fft_bands); extern void destroy_maxwell_data(maxwell_data *d); extern void maxwell_set_num_bands(maxwell_data *d, int num_bands); extern void update_maxwell_data_k(maxwell_data *d, real k[3], real G1[3], real G2[3], real G3[3]); extern void set_maxwell_data_parity(maxwell_data *d, int parity); typedef void (*maxwell_dielectric_function) (symmetric_matrix *eps, symmetric_matrix *eps_inv, real r[3], void *epsilon_data); extern void set_maxwell_dielectric(maxwell_data *md, const int mesh_size[3], real R[3][3], real G[3][3], maxwell_dielectric_function epsilon, void *epsilon_data); extern void maxwell_sym_matrix_eigs(real eigs[3], const symmetric_matrix *V); extern void maxwell_sym_matrix_invert(symmetric_matrix *Vinv, const symmetric_matrix *V); extern void maxwell_compute_fft(int dir, maxwell_data *d, scalar *array, int howmany, int stride, int dist); extern void maxwell_compute_d_from_H(maxwell_data *d, evectmatrix Xin, scalar_complex *dfield, int cur_band_start, int cur_num_bands); extern void maxwell_compute_h_from_H(maxwell_data *d, evectmatrix Hin, scalar_complex *hfield, int cur_band_start, int cur_num_bands); extern void maxwell_compute_e_from_d(maxwell_data *d, scalar_complex *dfield, int cur_num_bands); extern void maxwell_vectorfield_otherhalf(maxwell_data *d, scalar_complex *field, real phasex,real phasey,real phasez); extern void maxwell_scalarfield_otherhalf(maxwell_data *d, real *field); void assign_symmatrix_vector(scalar_complex *newv, const symmetric_matrix matrix, const scalar_complex *oldv); extern void maxwell_operator(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work); extern void maxwell_simple_precondition(evectmatrix X, void *data, real *eigenvals); extern void maxwell_preconditioner(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void maxwell_preconditioner2(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void maxwell_ucross_op(evectmatrix Xin, evectmatrix Xout, maxwell_data *d, const real u[3]); extern void maxwell_parity_constraint(evectmatrix X, void *data); extern void maxwell_zparity_constraint(evectmatrix X, void *data); extern void maxwell_yparity_constraint(evectmatrix X, void *data); extern int maxwell_zero_k_num_const_bands(evectmatrix X, maxwell_data *d); extern void maxwell_zero_k_set_const_bands(evectmatrix X, maxwell_data *d); extern void maxwell_zero_k_constraint(evectmatrix X, void *data); extern real *maxwell_zparity(evectmatrix X, maxwell_data *d); extern real *maxwell_yparity(evectmatrix X, maxwell_data *d); typedef struct { maxwell_data *d; real target_frequency; } maxwell_target_data; extern maxwell_target_data *create_maxwell_target_data(maxwell_data *d, real target_frequency); extern void destroy_maxwell_target_data(maxwell_target_data *d); extern void maxwell_target_operator1(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work); extern void maxwell_target_operator(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work); extern void maxwell_target_preconditioner(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void maxwell_target_preconditioner2(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void spherical_quadrature_points(real *x, real *y, real *z, real *weight, int num_sq_pts); extern int check_maxwell_dielectric(maxwell_data *d, int negative_epsilon_okp); #endif /* MAXWELL_H */ mpb-1.4.2/src/maxwell/maxwell_constraints.c0000644000175400001440000003002707441753311014470 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include "maxwell.h" /**************************************************************************/ /* function to call z and y parity constraints, if necessary */ void maxwell_parity_constraint(evectmatrix X, void *data) { maxwell_data *d = (maxwell_data *) data; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); if (d->parity & (EVEN_Z_PARITY | ODD_Z_PARITY)) maxwell_zparity_constraint(X, data); if (d->parity & (EVEN_Y_PARITY | ODD_Y_PARITY)) maxwell_yparity_constraint(X, data); } /**************************************************************************/ /* In 3d dielectric structures having a z=0 mirror plane (symmetric under z -> -z), the states will exhibit an analogue of TM and TE polarizations (when k has no z-component to break the symmetry). In this case, the states can be classified as "even" or "odd" with respect to mirror-flips through z=0. This is referred to as the "parity" of the state, where even is parity +1 and odd is parity -1 (the state is an eigenvector of the mirror flip operator with this eigenvalue). Even/odd states are the analogues of TE/TM states, respectively (and in the mirror plane itself they are truly TE/TM polarized). Note that the magnetic field is a pseudo-vector, so the mirror operation acts specially on it. Also, because of the way the m,n transverse basis for H is chosen, the basis vectors transform in a very simple way (just flip sign). */ /* Project X to its even or odd component, so that we can solve for only one parity of states (the projection operator, like the mirror flip operator, commutes with the Maxwell operator, so this projection should not slow convergence). */ void maxwell_zparity_constraint(evectmatrix X, void *data) { maxwell_data *d = (maxwell_data *) data; int i, j, b, nxy, nz; int zparity = ((d->parity & EVEN_Z_PARITY) ? +1 : ((d->parity & ODD_Z_PARITY) ? -1 : 0)); if (zparity == 0) return; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); if (d->nz > 1) { nxy = d->other_dims; nz = d->last_dim; } else { /* common case (2d system): even/odd == TE/TM */ nxy = d->other_dims * d->last_dim; if (zparity == +1) for (i = 0; i < nxy; ++i) for (b = 0; b < X.p; ++b) { ASSIGN_ZERO(X.data[(i * X.c + 1) * X.p + b]); } else if (zparity == -1) for (i = 0; i < nxy; ++i) for (b = 0; b < X.p; ++b) { ASSIGN_ZERO(X.data[(i * X.c) * X.p + b]); } return; } for (i = 0; i < nxy; ++i) { for (j = 0; 2*j <= nz; ++j) { int ij = i * nz + j; int ij2 = i * nz + (j > 0 ? nz - j : 0); for (b = 0; b < X.p; ++b) { scalar u,v, u2,v2; u = X.data[(ij * 2) * X.p + b]; v = X.data[(ij * 2 + 1) * X.p + b]; u2 = X.data[(ij2 * 2) * X.p + b]; v2 = X.data[(ij2 * 2 + 1) * X.p + b]; ASSIGN_SCALAR(X.data[(ij * 2) * X.p + b], 0.5*(SCALAR_RE(u) + zparity*SCALAR_RE(u2)), 0.5*(SCALAR_IM(u) + zparity*SCALAR_IM(u2))); ASSIGN_SCALAR(X.data[(ij * 2 + 1) * X.p + b], 0.5*(SCALAR_RE(v) - zparity*SCALAR_RE(v2)), 0.5*(SCALAR_IM(v) - zparity*SCALAR_IM(v2))); ASSIGN_SCALAR(X.data[(ij2 * 2) * X.p + b], 0.5*(SCALAR_RE(u2) + zparity*SCALAR_RE(u)), 0.5*(SCALAR_IM(u2) + zparity*SCALAR_IM(u))); ASSIGN_SCALAR(X.data[(ij2 * 2 + 1) * X.p + b], 0.5*(SCALAR_RE(v2) - zparity*SCALAR_RE(v)), 0.5*(SCALAR_IM(v2) - zparity*SCALAR_IM(v))); } } } } /* Compute the parity of all of the states in X, returning an array of the parities (which the caller should deallocate with free). The parity of an arbitrary state is defined as the expectation value of the mirror flip operator, and will be +1/-1 for even/odd eigenstates and something in between for everything else. Assumes that the columns of X are normalized to 1. */ real *maxwell_zparity(evectmatrix X, maxwell_data *d) { int i, j, b, nxy, nz; real *zparity, *zp_scratch; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); CHK_MALLOC(zparity, real, X.p); CHK_MALLOC(zp_scratch, real, X.p); for (b = 0; b < X.p; ++b) zp_scratch[b] = 0.0; if (d->nz > 1) { nxy = d->other_dims; nz = d->last_dim; } else { nxy = d->other_dims * d->last_dim; nz = 1; } for (i = 0; i < nxy; ++i) for (j = 0; 2*j <= nz; ++j) { int ij = i * nz + j; int ij2 = i * nz + (j > 0 ? nz - j : 0); for (b = 0; b < X.p; ++b) { scalar u,v, u2,v2; u = X.data[(ij * 2) * X.p + b]; v = X.data[(ij * 2 + 1) * X.p + b]; u2 = X.data[(ij2 * 2) * X.p + b]; v2 = X.data[(ij2 * 2 + 1) * X.p + b]; zp_scratch[b] += (ij == ij2 ? 1.0 : 2.0) * (SCALAR_RE(u) * SCALAR_RE(u2) + SCALAR_IM(u) * SCALAR_IM(u2) - SCALAR_RE(v) * SCALAR_RE(v2) - SCALAR_IM(v) * SCALAR_IM(v2)); } } mpi_allreduce(zp_scratch, zparity, X.p, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); free(zp_scratch); return zparity; } /**************************************************************************/ /* Similar to the zparity functions above, but for the y -> -y mirror flip. */ /* Project X to its even or odd component, so that we can solve for only one parity of states (the projection operator, like the mirror flip operator, commutes with the Maxwell operator, so this projection should not slow convergence). */ void maxwell_yparity_constraint(evectmatrix X, void *data) { maxwell_data *d = (maxwell_data *) data; int i, j, k, b, nx, ny, nz; int yparity = ((d->parity & EVEN_Y_PARITY) ? +1 : ((d->parity & ODD_Y_PARITY) ? -1 : 0)); if (yparity == 0) return; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); nx = d->local_nx; ny = d->ny; nz = d->nz; for (i = 0; i < nx; ++i) { for (j = 0; 2*j <= ny; ++j) { int ij = i * ny + j; int ij2 = i * ny + (j > 0 ? ny - j : 0); for (k = 0; k < nz; ++k) { int ijk = ij * nz + k; int ijk2 = ij2 * nz + k; for (b = 0; b < X.p; ++b) { scalar u,v, u2,v2; u = X.data[(ijk * 2) * X.p + b]; v = X.data[(ijk * 2 + 1) * X.p + b]; u2 = X.data[(ijk2 * 2) * X.p + b]; v2 = X.data[(ijk2 * 2 + 1) * X.p + b]; ASSIGN_SCALAR(X.data[(ijk * 2) * X.p + b], 0.5*(SCALAR_RE(u) - yparity*SCALAR_RE(u2)), 0.5*(SCALAR_IM(u) - yparity*SCALAR_IM(u2))); ASSIGN_SCALAR(X.data[(ijk * 2 + 1) * X.p + b], 0.5*(SCALAR_RE(v) + yparity*SCALAR_RE(v2)), 0.5*(SCALAR_IM(v) + yparity*SCALAR_IM(v2))); ASSIGN_SCALAR(X.data[(ijk2 * 2) * X.p + b], 0.5*(SCALAR_RE(u2) - yparity*SCALAR_RE(u)), 0.5*(SCALAR_IM(u2) - yparity*SCALAR_IM(u))); ASSIGN_SCALAR(X.data[(ijk2 * 2 + 1) * X.p + b], 0.5*(SCALAR_RE(v2) + yparity*SCALAR_RE(v)), 0.5*(SCALAR_IM(v2) + yparity*SCALAR_IM(v))); } } } } } /* Compute the parity of all of the states in X, returning an array of the parities (which the caller should deallocate with free). The parity of an arbitrary state is defined as the expectation value of the mirror flip operator, and will be +1/-1 for even/odd eigenstates and something in between for everything else. Assumes that the columns of X are normalized to 1. */ real *maxwell_yparity(evectmatrix X, maxwell_data *d) { int i, j, k, b, nx, ny, nz; real *yparity, *yp_scratch; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); CHK_MALLOC(yparity, real, X.p); CHK_MALLOC(yp_scratch, real, X.p); for (b = 0; b < X.p; ++b) yp_scratch[b] = 0.0; nx = d->local_nx; ny = d->ny; nz = d->nz; for (i = 0; i < nx; ++i) { for (j = 0; 2*j <= ny; ++j) { int ij = i * ny + j; int ij2 = i * ny + (j > 0 ? ny - j : 0); for (k = 0; k < nz; ++k) { int ijk = ij * nz + k; int ijk2 = ij2 * nz + k; for (b = 0; b < X.p; ++b) { scalar u,v, u2,v2; u = X.data[(ijk * 2) * X.p + b]; v = X.data[(ijk * 2 + 1) * X.p + b]; u2 = X.data[(ijk2 * 2) * X.p + b]; v2 = X.data[(ijk2 * 2 + 1) * X.p + b]; yp_scratch[b] += (ijk == ijk2 ? 1.0 : 2.0) * (SCALAR_RE(v) * SCALAR_RE(v2) + SCALAR_IM(v) * SCALAR_IM(v2) - SCALAR_RE(u) * SCALAR_RE(u2) - SCALAR_IM(u) * SCALAR_IM(u2)); } } } } mpi_allreduce(yp_scratch, yparity, X.p, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); free(yp_scratch); return yparity; } /**************************************************************************/ /* to fix problems with slow convergence for k ~ 0, manually "put in" the k = 0 solution: first two bands are constant and higher bands are orthogonal. Note that in the TE/TM case, only one band is constant. Also note that, in Fourier space, a constant field corresponds to 1 in the DC component and 0 elsewhere. */ /* return the number of constant (zero-frequency) bands: */ int maxwell_zero_k_num_const_bands(evectmatrix X, maxwell_data *d) { int num_const_bands, m_band = 1, n_band = 1; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); if (d->parity & (ODD_Z_PARITY | EVEN_Y_PARITY)) m_band = 0; if (d->parity & (ODD_Y_PARITY | EVEN_Z_PARITY)) n_band = 0; num_const_bands = m_band + n_band; if (num_const_bands > X.p) num_const_bands = X.p; return num_const_bands; } void maxwell_zero_k_set_const_bands(evectmatrix X, maxwell_data *d) { int i, j, num_const_bands, m_band = 1, n_band = 1; CHECK(d, "null maxwell data pointer!"); CHECK(X.c == 2, "fields don't have 2 components!"); if (X.p < 1) return; num_const_bands = maxwell_zero_k_num_const_bands(X, d); /* Initialize num_const_bands to zero: */ for (i = 0; i < X.n; ++i) for (j = 0; j < num_const_bands; ++j) { ASSIGN_ZERO(X.data[i * X.p + j]); } if (X.Nstart > 0) return; /* DC frequency is not on this process */ /* Set DC components to 1 (in two parities) for num_const_bands: */ if (d->parity & (ODD_Z_PARITY | EVEN_Y_PARITY)) m_band = 0; if (d->parity & (ODD_Y_PARITY | EVEN_Z_PARITY)) n_band = 0; if (m_band) { ASSIGN_SCALAR(X.data[0], 1.0, 0.0); ASSIGN_SCALAR(X.data[X.p], 0.0, 0.0); } if (n_band && (!m_band || X.p >= 2)) { ASSIGN_SCALAR(X.data[m_band], 0.0, 0.0); ASSIGN_SCALAR(X.data[X.p + m_band], 1.0, 0.0); } } /* during eigensolution (for upper bands), their DC components are constrained to be zero */ void maxwell_zero_k_constraint(evectmatrix X, void *data) { int j; if (X.Nstart > 0) return; /* DC frequency is not on this process */ for (j = 0; j < X.p; ++j) { ASSIGN_ZERO(X.data[j]); ASSIGN_ZERO(X.data[X.p + j]); } (void)data; /* avoid warning about unused parameter */ } /**************************************************************************/ mpb-1.4.2/src/maxwell/maxwell_eps.c0000644000175400001440000007430307446176566012735 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include #include "maxwell.h" /**************************************************************************/ /* Lapack eigenvalue functions */ #ifdef SCALAR_SINGLE_PREC # define HEEV F77_FUNC(cheev,CHEEV) # define SYEV F77_FUNC(ssyev,SSYEV) #else # define HEEV F77_FUNC(zheev,ZHEEV) # define SYEV F77_FUNC(dsyev,DSYEV) #endif extern void HEEV(char *, char *, int *, scalar *, int *, real *, scalar *, int *, real *, int *); extern void SYEV(char *, char *, int *, real *, int *, real *, real *, int *, int *); /* compute the 3 real eigenvalues of the matrix V */ void maxwell_sym_matrix_eigs(real eigs[3], const symmetric_matrix *V) { int n = 3, nw = 9, info; #if defined(WITH_HERMITIAN_EPSILON) scalar_complex Vm[3][3], W[9], W2[9]; CASSIGN_SCALAR(Vm[0][0], V->m00, 0); CASSIGN_SCALAR(Vm[1][1], V->m11, 0); CASSIGN_SCALAR(Vm[2][2], V->m22, 0); Vm[0][1] = V->m01; CASSIGN_CONJ(Vm[1][0], V->m01); Vm[0][2] = V->m02; CASSIGN_CONJ(Vm[2][0], V->m02); Vm[1][2] = V->m12; CASSIGN_CONJ(Vm[2][1], V->m12); HEEV("V", "U", &n, &Vm[0][0], &n, eigs, W, &nw, W2, &info); #else real Vm[3][3], W[9]; Vm[0][0] = V->m00; Vm[1][1] = V->m11; Vm[2][2] = V->m22; Vm[0][1] = Vm[1][0] = V->m01; Vm[0][2] = Vm[2][0] = V->m02; Vm[1][2] = Vm[2][1] = V->m12; SYEV("V", "U", &n, &Vm[0][0], &n, eigs, W, &nw, &info); #endif CHECK(info >= 0, "invalid argument in heev"); CHECK(info <= 0, "failure to converge in heev"); } /* Set Vinv = inverse of V, where both V and Vinv are real-symmetric (or possibly complex-Hermitian) matrices. */ void maxwell_sym_matrix_invert(symmetric_matrix *Vinv, const symmetric_matrix *V) { real m00 = V->m00, m11 = V->m11, m22 = V->m22; #if defined(WITH_HERMITIAN_EPSILON) scalar_complex m01 = V->m01, m02 = V->m02, m12 = V->m12; if (m01.re == 0.0 && m01.im == 0.0 && m02.re == 0.0 && m02.im == 0.0 && m12.re == 0.0 && m12.im == 0.0) { /* optimize common case of a diagonal matrix: */ Vinv->m00 = 1.0 / m00; Vinv->m11 = 1.0 / m11; Vinv->m22 = 1.0 / m22; CASSIGN_ZERO(Vinv->m01); CASSIGN_ZERO(Vinv->m02); CASSIGN_ZERO(Vinv->m12); } else { double detinv; /* compute the determinant: */ detinv = m00*m11*m22 - m11*CSCALAR_NORMSQR(m02) - CSCALAR_NORMSQR(m01)*m22 - CSCALAR_NORMSQR(m12)*m00 + 2.0 * ((m01.re * m12.re - m01.im * m12.im) * m02.re + (m01.re * m12.im + m01.im * m12.re) * m02.im); CHECK(detinv != 0.0, "singular 3x3 matrix"); detinv = 1.0/detinv; Vinv->m00 = detinv * (m11*m22 - CSCALAR_NORMSQR(m12)); Vinv->m11 = detinv * (m00*m22 - CSCALAR_NORMSQR(m02)); Vinv->m22 = detinv * (m11*m00 - CSCALAR_NORMSQR(m01)); CASSIGN_SCALAR(Vinv->m02, detinv * (m01.re*m12.re-m01.im*m12.im - m11*m02.re), -detinv*(-m01.re*m12.im-m01.im*m12.re + m11*m02.im)); CASSIGN_SCALAR(Vinv->m01, detinv * (m12.re*m02.re+m12.im*m02.im - m22*m01.re), -detinv * (m12.im*m02.re-m12.re*m02.im + m22*m01.im)); CASSIGN_SCALAR(Vinv->m12, detinv * (m01.re*m02.re+m01.im*m02.im - m00*m12.re), -detinv * (m01.im*m02.re-m01.re*m02.im + m00*m12.im)); } #else /* real matrix */ real m01 = V->m01, m02 = V->m02, m12 = V->m12; if (m01 == 0.0 && m02 == 0.0 && m12 == 0.0) { /* optimize common case of a diagonal matrix: */ Vinv->m00 = 1.0 / m00; Vinv->m11 = 1.0 / m11; Vinv->m22 = 1.0 / m22; Vinv->m01 = Vinv->m02 = Vinv->m12 = 0.0; } else { double detinv; /* compute the determinant: */ detinv = m00*m11*m22 - m02*m11*m02 + 2.0 * m01*m12*m02 - m01*m01*m22 - m12*m12*m00; CHECK(detinv != 0.0, "singular 3x3 matrix"); detinv = 1.0/detinv; Vinv->m00 = detinv * (m11*m22 - m12*m12); Vinv->m11 = detinv * (m00*m22 - m02*m02); Vinv->m22 = detinv * (m11*m00 - m01*m01); Vinv->m02 = detinv * (m01*m12 - m11*m02); Vinv->m01 = detinv * (m12*m02 - m01*m22); Vinv->m12 = detinv * (m01*m02 - m00*m12); } #endif /* real matrix */ } /* Returns whether or not V is positive-definite. */ static int sym_matrix_positive_definite(symmetric_matrix *V) { real det2, det3; real m00 = V->m00, m11 = V->m11, m22 = V->m22; #if defined(WITH_HERMITIAN_EPSILON) scalar_complex m01 = V->m01, m02 = V->m02, m12 = V->m12; det2 = m00*m11 - CSCALAR_NORMSQR(m01); det3 = det2*m22 - m11*CSCALAR_NORMSQR(m02) - CSCALAR_NORMSQR(m12)*m00 + 2.0 * ((m01.re * m12.re - m01.im * m12.im) * m02.re + (m01.re * m12.im + m01.im * m12.re) * m02.im); #else /* real matrix */ real m01 = V->m01, m02 = V->m02, m12 = V->m12; det2 = m00*m11 - m01*m01; det3 = det2*m22 - m02*m11*m02 + 2.0 * m01*m12*m02 - m12*m12*m00; #endif /* real matrix */ return (m00 > 0.0 && det2 > 0.0 && det3 > 0.0); } /**************************************************************************/ int check_maxwell_dielectric(maxwell_data *d, int negative_epsilon_okp) { int i, require_2d; require_2d = d->nz == 1 && (d->parity & (EVEN_Z_PARITY | ODD_Z_PARITY)); for (i = 0; i < d->fft_output_size; ++i) { if (!negative_epsilon_okp && !sym_matrix_positive_definite(d->eps_inv + i)) return 1; if (require_2d) { #if defined(WITH_HERMITIAN_EPSILON) if (d->eps_inv[i].m02.re != 0.0 || d->eps_inv[i].m02.im != 0.0 || d->eps_inv[i].m12.re != 0.0 || d->eps_inv[i].m12.im != 0.0) return 2; #else /* real matrix */ if (d->eps_inv[i].m02 != 0.0 || d->eps_inv[i].m12 != 0.0) return 2; #endif /* real matrix */ } } return 0; } /**************************************************************************/ #define SHIFT3(x,y,z) {real SHIFT3_dummy = z; z = y; y = x; x = SHIFT3_dummy;} /* Compute quadrature points and weights for integrating on the unit sphere. x, y, z, and weight should be arrays of num_sq_pts values to hold the coordinates and weights of the quadrature points on output. Currently, num_sq_pts = 12, 50, and 72 are supported. */ void spherical_quadrature_points(real *x, real *y, real *z, real *weight, int num_sq_pts) { int i,j,k,l, n = 0; real x0, y0, z0, w; if (num_sq_pts == 50) { /* Computes quadrature points and weights for 50-point 11th degree integration formula on a unit sphere. This particular quadrature formula has the advantage, for our purposes, of preserving the symmetry group of an octahedraon (i.e. simple cubic symmetry, with respect to the Cartesian xyz axes). References: A. D. McLaren, "Optimal Numerical Integration on a Sphere," Math. Comp. 17, pp. 361-383 (1963). Also in: Arthur H. Stroud, "Approximate Calculation of Multiple Integrals" (Prentice Hall, 1971) (formula number U3:11-1). This code was written with the help of example code by John Burkardt: http://www.psc.edu/~burkardt/src/stroud/stroud.html */ x0 = 1; y0 = z0 = 0; w = 9216 / 725760.0; for (i = 0; i < 2; ++i) { x0 = -x0; for (j = 0; j < 3; ++j) { SHIFT3(x0,y0,z0); x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } x0 = y0 = sqrt(0.5); z0 = 0; w = 16384 / 725760.0; for (i = 0; i < 2; ++i) { x0 = -x0; for (j = 0; j < 2; ++j) { y0 = -y0; for (k = 0; k < 3; ++k) { SHIFT3(x0,y0,z0); x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } } x0 = y0 = z0 = sqrt(1.0 / 3.0); w = 15309 / 725760.0; for (i = 0; i < 2; ++i) { x0 = -x0; for (j = 0; j < 2; ++j) { y0 = -y0; for (k = 0; k < 2; ++k) { z0 = -z0; x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } } x0 = y0 = sqrt(1.0 / 11.0); z0 = 3 * x0; w = 14641 / 725760.0; for (i = 0; i < 2; ++i) { x0 = -x0; for (j = 0; j < 2; ++j) { y0 = -y0; for (k = 0; k < 2; ++k) { z0 = -z0; for (l = 0; l < 3; ++l) { SHIFT3(x0,y0,z0); x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } } } } else if (num_sq_pts == 72 || num_sq_pts == 12) { /* As above (same references), but with a 72-point 14th degree formula, this time with the symmetry group of an icosohedron. (Stroud formula number U3:14-1.) Alternatively, just use the 12-point 5th degree formula consisting of the vertices of a regular icosohedron. */ /* first, the vertices of an icosohedron: */ x0 = sqrt(0.5 - sqrt(0.05)); y0 = sqrt(0.5 + sqrt(0.05)); z0 = 0; if (num_sq_pts == 72) w = 125 / 10080.0; else w = 1 / 12.0; for (i = 0; i < 2; ++i) { x0 = -x0; for (j = 0; j < 2; ++j) { y0 = -y0; for (k = 0; k < 3; ++k) { SHIFT3(x0,y0,z0); x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } } if (num_sq_pts == 72) { /* it would be nice, for completeness, to have more digits here: */ real coords[3][5] = { { -0.151108275, 0.315838353, 0.346307112, -0.101808787, -0.409228403 }, { 0.155240600, 0.257049387, 0.666277790, 0.817386065, 0.501547712 }, { 0.976251323, 0.913330032, 0.660412970, 0.567022920, 0.762221757 } }; w = 143 / 10080.0; for (l = 0; l < 5; ++l) { x0 = coords[0][l]; y0 = coords[1][l]; z0 = coords[2][l]; for (i = 0; i < 3; ++i) { double dummy = x0; x0 = z0; z0 = -y0; y0 = -dummy; for (j = 0; j < 3; ++j) { SHIFT3(x0,y0,z0); x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } y0 = -y0; z0 = -z0; x[n] = x0; y[n] = y0; z[n] = z0; weight[n++] = w; } } } } else mpi_die("spherical_quadrature_points: passed unknown # points!"); CHECK(n == num_sq_pts, "bug in spherical_quadrature_points: wrong number of points!"); } #define K_PI 3.141592653589793238462643383279502884197 #define SMALL 1.0e-6 #define MAX2(a,b) ((a) > (b) ? (a) : (b)) #define MIN2(a,b) ((a) < (b) ? (a) : (b)) #define NUM_SQ_PTS 50 /* number of spherical quadrature points to use */ #define MAX_MOMENT_MESH NUM_SQ_PTS /* max # of moment-mesh vectors */ #define MOMENT_MESH_R 0.5 /* A function to set up the mesh given the grid dimensions, mesh size, and lattice/reciprocal vectors. (Any mesh sizes < 1 are taken to be 1.) The returned values are: mesh_center: the center of the mesh, relative to the integer mesh coordinates; e.g. the mesh_center for a 3x3x3 mesh is the point (1,1,1). mesh_prod: the product of the mesh sizes. moment_mesh: an array of size_moment_mesh vectors, in lattice coordinates, of a "spherically-symmetric" mesh of points centered on the origin, designed to be used for averaging the first moment of epsilon at a grid point (for finding the local surface normal). moment_mesh_weights: an array of size_moment_mesh weights to multiply the integrand values by. */ static void get_mesh(int nx, int ny, int nz, const int mesh_size[3], real R[3][3], real G[3][3], real mesh_center[3], int *mesh_prod, real moment_mesh[MAX_MOMENT_MESH][3], real moment_mesh_weights[MAX_MOMENT_MESH], int *size_moment_mesh) { int i,j; real min_diam = 1e20; real mesh_total[3] = { 0, 0, 0 }; int rank = nz > 1 ? 3 : (ny > 1 ? 2 : 1); real weight_sum = 0.0; *mesh_prod = 1; for (i = 0; i < 3; ++i) { int ms = MAX2(mesh_size[i], 1); mesh_center[i] = (ms - 1) * 0.5; *mesh_prod *= ms; } /* Set the mesh to compute the "dipole moment" of epsilon over, in Cartesian coordinates (used to compute the normal vector at surfaces). Ideally, a spherically-symmetrical distribution of points on the radius MOMENT_MESH_R sphere. */ if (rank == 1) { /* one-dimensional: just two points (really, normal vector is always along x): */ *size_moment_mesh = 2; moment_mesh[0][0] = -MOMENT_MESH_R; moment_mesh[0][1] = 0.0; moment_mesh[0][2] = 0.0; moment_mesh[1][0] = MOMENT_MESH_R; moment_mesh[1][1] = 0.0; moment_mesh[1][2] = 0.0; moment_mesh_weights[0] = moment_mesh_weights[1] = 0.5; } else if (rank == 2) { /* two-dimensional: 12 points at 30-degree intervals: */ *size_moment_mesh = 12; for (i = 0; i < *size_moment_mesh; ++i) { moment_mesh[i][0] = cos(2*i * K_PI / *size_moment_mesh) * MOMENT_MESH_R; moment_mesh[i][1] = sin(2*i * K_PI / *size_moment_mesh) * MOMENT_MESH_R; moment_mesh[i][2] = 0.0; moment_mesh_weights[i] = 1.0 / *size_moment_mesh; } } else { real x[NUM_SQ_PTS], y[NUM_SQ_PTS], z[NUM_SQ_PTS]; *size_moment_mesh = NUM_SQ_PTS; spherical_quadrature_points(x,y,z, moment_mesh_weights, NUM_SQ_PTS); for (i = 0; i < *size_moment_mesh; ++i) { moment_mesh[i][0] = x[i] * MOMENT_MESH_R; moment_mesh[i][1] = y[i] * MOMENT_MESH_R; moment_mesh[i][2] = z[i] * MOMENT_MESH_R; } } CHECK(*size_moment_mesh <= MAX_MOMENT_MESH, "yikes, moment mesh too big"); for (i = 0; i < *size_moment_mesh; ++i) weight_sum += moment_mesh_weights[i]; CHECK(fabs(weight_sum - 1.0) < SMALL, "bug, incorrect moment weights"); /* scale the moment-mesh vectors so that the sphere has a diameter of 2*MOMENT_MESH_R times the diameter of the smallest grid direction: */ /* first, find the minimum distance between grid points along the lattice directions (should we use the maximum instead?): */ for (i = 0; i < rank; ++i) { real ri = R[i][0] * R[i][0] + R[i][1] * R[i][1] + R[i][2] * R[i][2]; ri = sqrt(ri) / (i == 0 ? nx : (i == 1 ? ny : nz)); min_diam = MIN2(min_diam, ri); } /* scale moment_mesh by this diameter: */ for (i = 0; i < *size_moment_mesh; ++i) { real len = 0; for (j = 0; j < 3; ++j) { moment_mesh[i][j] *= min_diam; len += moment_mesh[i][j] * moment_mesh[i][j]; mesh_total[j] += moment_mesh[i][j]; } CHECK(fabs(len - min_diam*min_diam*(MOMENT_MESH_R*MOMENT_MESH_R)) < SMALL, "bug in get_mesh: moment_mesh vector is wrong length"); } CHECK(fabs(mesh_total[0]) + fabs(mesh_total[1]) + fabs(mesh_total[2]) < SMALL, "bug in get_mesh: moment_mesh does not average to zero"); /* Now, convert the moment_mesh vectors to lattice/grid coordinates; to do this, we multiply by the G matrix (inverse of R transposed) */ for (i = 0; i < *size_moment_mesh; ++i) { real v[3]; for (j = 0; j < 3; ++j) /* make a copy of moment_mesh[i] */ v[j] = moment_mesh[i][j]; for (j = 0; j < 3; ++j) moment_mesh[i][j] = G[j][0]*v[0] + G[j][1]*v[1] + G[j][2]*v[2]; } } /**************************************************************************/ /* The following function initializes the dielectric tensor md->eps_inv, using the dielectric function epsilon(&eps, &eps_inv, r, epsilon_data). epsilon is averaged over a rectangular mesh spanning the space between grid points; the size of the mesh is given by mesh_size. R[0..2] are the spatial lattice vectors, and are used to convert the discretization grid into spatial coordinates (with the origin at the (0,0,0) grid element. In most places, the dielectric tensor is equal to eps_inv, but at dielectric interfaces it varies depending upon the polarization of the field (for faster convergence). In particular, it depends upon the direction of the field relative to the surface normal vector, so we must compute the latter. The surface normal is approximated by the "dipole moment" of the dielectric function over a spherical mesh. Implementation note: md->eps_inv is chosen to have dimensions matching the output of the FFT. Thus, its dimensions depend upon whether we are doing a real or complex and serial or parallel FFT. */ void set_maxwell_dielectric(maxwell_data *md, const int mesh_size[3], real R[3][3], real G[3][3], maxwell_dielectric_function epsilon, void *epsilon_data) { real s1, s2, s3, m1, m2, m3; /* grid/mesh steps */ real mesh_center[3]; real moment_mesh[MAX_MOMENT_MESH][3]; real moment_mesh_weights[MAX_MOMENT_MESH]; real eps_inv_total = 0.0; int i, j, k; int mesh_prod; real mesh_prod_inv; int size_moment_mesh = 0; int n1, n2, n3; #ifdef HAVE_MPI int local_n2, local_y_start, local_n3; #endif #ifndef SCALAR_COMPLEX int n_other, n_last, rank; #endif n1 = md->nx; n2 = md->ny; n3 = md->nz; get_mesh(n1, n2, n3, mesh_size, R, G, mesh_center, &mesh_prod, moment_mesh, moment_mesh_weights, &size_moment_mesh); mesh_prod_inv = 1.0 / mesh_prod; #ifdef DEBUG mpi_one_printf("Using moment mesh (%d):\n", size_moment_mesh); for (i = 0; i < size_moment_mesh; ++i) mpi_one_printf(" (%g, %g, %g) (%g)\n", moment_mesh[i][0], moment_mesh[i][1], moment_mesh[i][2], moment_mesh_weights[i]); #endif s1 = 1.0 / n1; s2 = 1.0 / n2; s3 = 1.0 / n3; m1 = s1 / MAX2(1, mesh_size[0] - 1); m2 = s2 / MAX2(1, mesh_size[1] - 1); m3 = s3 / MAX2(1, mesh_size[2] - 1); /* Here we have different loops over the coordinates, depending upon whether we are using complex or real and serial or parallel transforms. Each loop must define, in its body, variables (i2,j2,k2) describing the coordinate of the current point, and eps_index describing the corresponding index in the array md->eps_inv[]. */ #ifdef SCALAR_COMPLEX # ifndef HAVE_MPI for (i = 0; i < n1; ++i) for (j = 0; j < n2; ++j) for (k = 0; k < n3; ++k) { # define i2 i # define j2 j # define k2 k int eps_index = ((i * n2 + j) * n3 + k); # else /* HAVE_MPI */ local_n2 = md->local_ny; local_y_start = md->local_y_start; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < n3; ++k) { # define i2 i int j2 = j + local_y_start; # define k2 k int eps_index = ((j * n1 + i) * n3 + k); # endif /* HAVE_MPI */ #else /* not SCALAR_COMPLEX */ # ifndef HAVE_MPI n_other = md->other_dims; n_last = md->last_dim_size / 2; rank = (n3 == 1) ? (n2 == 1 ? 1 : 2) : 3; for (i = 0; i < n_other; ++i) for (j = 0; j < n_last; ++j) { int eps_index = i * n_last + j; int i2, j2, k2; switch (rank) { case 2: i2 = i; j2 = j; k2 = 0; break; case 3: i2 = i / n2; j2 = i % n2; k2 = j; break; default: i2 = j; j2 = k2 = 0; break; } # else /* HAVE_MPI */ local_n2 = md->local_ny; local_y_start = md->local_y_start; /* For a real->complex transform, the last dimension is cut in half. For a 2d transform, this is taken into account in local_ny already, but for a 3d transform we must compute the new n3: */ if (n3 > 1) local_n3 = md->last_dim_size / 2; else local_n3 = 1; /* first two dimensions are transposed in MPI output: */ for (j = 0; j < local_n2; ++j) for (i = 0; i < n1; ++i) for (k = 0; k < local_n3; ++k) { # define i2 i int j2 = j + local_y_start; # define k2 k int eps_index = ((j * n1 + i) * local_n3 + k); # endif /* HAVE_MPI */ #endif /* not SCALAR_COMPLEX */ { int mi, mj, mk; #ifdef WITH_HERMITIAN_EPSILON symmetric_matrix eps_mean = {0,0,0,{0,0},{0,0},{0,0}}, eps_inv_mean = {0,0,0,{0,0},{0,0},{0,0}}, eps_mean_inv; #else symmetric_matrix eps_mean = {0,0,0,0,0,0}, eps_inv_mean = {0,0,0,0,0,0}, eps_mean_inv; #endif real norm_len; real norm0, norm1, norm2; short means_different_p, diag_eps_p; for (mi = 0; mi < mesh_size[0]; ++mi) for (mj = 0; mj < mesh_size[1]; ++mj) for (mk = 0; mk < mesh_size[2]; ++mk) { real r[3]; symmetric_matrix eps, eps_inv; r[0] = i2 * s1 + (mi - mesh_center[0]) * m1; r[1] = j2 * s2 + (mj - mesh_center[1]) * m2; r[2] = k2 * s3 + (mk - mesh_center[2]) * m3; epsilon(&eps, &eps_inv, r, epsilon_data); eps_mean.m00 += eps.m00; eps_mean.m11 += eps.m11; eps_mean.m22 += eps.m22; eps_inv_mean.m00 += eps_inv.m00; eps_inv_mean.m11 += eps_inv.m11; eps_inv_mean.m22 += eps_inv.m22; #ifdef WITH_HERMITIAN_EPSILON CACCUMULATE_SUM(eps_mean.m01, eps.m01); CACCUMULATE_SUM(eps_mean.m02, eps.m02); CACCUMULATE_SUM(eps_mean.m12, eps.m12); CACCUMULATE_SUM(eps_inv_mean.m01, eps_inv.m01); CACCUMULATE_SUM(eps_inv_mean.m02, eps_inv.m02); CACCUMULATE_SUM(eps_inv_mean.m12, eps_inv.m12); #else eps_mean.m01 += eps.m01; eps_mean.m02 += eps.m02; eps_mean.m12 += eps.m12; eps_inv_mean.m01 += eps_inv.m01; eps_inv_mean.m02 += eps_inv.m02; eps_inv_mean.m12 += eps_inv.m12; #endif } diag_eps_p = DIAG_SYMMETRIC_MATRIX(eps_mean); if (diag_eps_p) { /* handle the common case of diagonal matrices: */ eps_mean_inv.m00 = mesh_prod / eps_mean.m00; eps_mean_inv.m11 = mesh_prod / eps_mean.m11; eps_mean_inv.m22 = mesh_prod / eps_mean.m22; #ifdef WITH_HERMITIAN_EPSILON CASSIGN_ZERO(eps_mean_inv.m01); CASSIGN_ZERO(eps_mean_inv.m02); CASSIGN_ZERO(eps_mean_inv.m12); #else eps_mean_inv.m01 = eps_mean_inv.m02 = eps_mean_inv.m12 = 0.0; #endif eps_inv_mean.m00 *= mesh_prod_inv; eps_inv_mean.m11 *= mesh_prod_inv; eps_inv_mean.m22 *= mesh_prod_inv; means_different_p = fabs(eps_mean_inv.m00 - eps_inv_mean.m00) > SMALL || fabs(eps_mean_inv.m11 - eps_inv_mean.m11) > SMALL || fabs(eps_mean_inv.m22 - eps_inv_mean.m22) > SMALL; } else { eps_inv_mean.m00 *= mesh_prod_inv; eps_inv_mean.m11 *= mesh_prod_inv; eps_inv_mean.m22 *= mesh_prod_inv; eps_mean.m00 *= mesh_prod_inv; eps_mean.m11 *= mesh_prod_inv; eps_mean.m22 *= mesh_prod_inv; #ifdef WITH_HERMITIAN_EPSILON eps_mean.m01.re *= mesh_prod_inv; eps_mean.m01.im *= mesh_prod_inv; eps_mean.m02.re *= mesh_prod_inv; eps_mean.m02.im *= mesh_prod_inv; eps_mean.m12.re *= mesh_prod_inv; eps_mean.m12.im *= mesh_prod_inv; eps_inv_mean.m01.re *= mesh_prod_inv; eps_inv_mean.m01.im *= mesh_prod_inv; eps_inv_mean.m02.re *= mesh_prod_inv; eps_inv_mean.m02.im *= mesh_prod_inv; eps_inv_mean.m12.re *= mesh_prod_inv; eps_inv_mean.m12.im *= mesh_prod_inv; #else eps_mean.m01 *= mesh_prod_inv; eps_mean.m02 *= mesh_prod_inv; eps_mean.m12 *= mesh_prod_inv; eps_inv_mean.m01 *= mesh_prod_inv; eps_inv_mean.m02 *= mesh_prod_inv; eps_inv_mean.m12 *= mesh_prod_inv; #endif maxwell_sym_matrix_invert(&eps_mean_inv, &eps_mean); means_different_p = fabs(eps_mean_inv.m00 - eps_inv_mean.m00) > SMALL || fabs(eps_mean_inv.m11 - eps_inv_mean.m11) > SMALL || fabs(eps_mean_inv.m22 - eps_inv_mean.m22) > SMALL; #ifdef WITH_HERMITIAN_EPSILON means_different_p = means_different_p || fabs(eps_mean_inv.m01.re - eps_inv_mean.m01.re) > SMALL || fabs(eps_mean_inv.m02.re - eps_inv_mean.m02.re) > SMALL || fabs(eps_mean_inv.m12.re - eps_inv_mean.m12.re) > SMALL || fabs(eps_mean_inv.m01.im - eps_inv_mean.m01.im) > SMALL || fabs(eps_mean_inv.m02.im - eps_inv_mean.m02.im) > SMALL || fabs(eps_mean_inv.m12.im - eps_inv_mean.m12.im) > SMALL; #else means_different_p = means_different_p || fabs(eps_mean_inv.m01 - eps_inv_mean.m01) > SMALL || fabs(eps_mean_inv.m02 - eps_inv_mean.m02) > SMALL || fabs(eps_mean_inv.m12 - eps_inv_mean.m12) > SMALL; #endif } /* if the two averaging methods yielded different results, which usually happens if epsilon is not constant, then we need to find the normal vector to the dielectric interface: */ if (means_different_p) { real moment0 = 0, moment1 = 0, moment2 = 0; for (mi = 0; mi < size_moment_mesh; ++mi) { real r[3], eps_trace; symmetric_matrix eps, eps_inv; r[0] = i2 * s1 + moment_mesh[mi][0]; r[1] = j2 * s2 + moment_mesh[mi][1]; r[2] = k2 * s3 + moment_mesh[mi][2]; epsilon(&eps, &eps_inv, r, epsilon_data); eps_trace = eps.m00 + eps.m11 + eps.m22; eps_trace *= moment_mesh_weights[mi]; moment0 += eps_trace * moment_mesh[mi][0]; moment1 += eps_trace * moment_mesh[mi][1]; moment2 += eps_trace * moment_mesh[mi][2]; } /* need to convert moment from lattice to cartesian coords: */ norm0 = R[0][0]*moment0 + R[1][0]*moment1 + R[2][0]*moment2; norm1 = R[0][1]*moment0 + R[1][1]*moment1 + R[2][1]*moment2; norm2 = R[0][2]*moment0 + R[1][2]*moment1 + R[2][2]*moment2; norm_len = sqrt(norm0*norm0 + norm1*norm1 + norm2*norm2); } if (means_different_p && norm_len > SMALL) { real x0, x1, x2; norm_len = 1.0/norm_len; norm0 *= norm_len; norm1 *= norm_len; norm2 *= norm_len; /* Compute the effective inverse dielectric tensor. We define this as: 1/2 ( {eps_inv_mean, P} + {eps_mean_inv, 1-P} ) where P is the projection matrix onto the normal direction (P = norm ^ norm), and {a,b} is the anti-commutator ab+ba. = 1/2 {eps_inv_mean - eps_mean_inv, P} + eps_mean_inv = 1/2 (n_i conj(x_j) + x_i n_j) + (eps_mean_inv)_ij where n_k is the kth component of the normal vector and x_i = (eps_inv_mean - eps_mean_inv)_ik n_k Note the implied summations (Einstein notation). Note that the resulting matrix is symmetric, and we get just eps_inv_mean if eps_inv_mean == eps_mean_inv, as desired. Note that P is idempotent, so for scalar epsilon this is just eps_inv_mean * P + eps_mean_inv * (1-P) = (1/eps_inv_mean * P + eps_mean * (1-P)) ^ (-1), which corresponds to the expression in the Meade paper. */ x0 = (eps_inv_mean.m00 - eps_mean_inv.m00) * norm0; x1 = (eps_inv_mean.m11 - eps_mean_inv.m11) * norm1; x2 = (eps_inv_mean.m22 - eps_mean_inv.m22) * norm2; if (diag_eps_p) { #ifdef WITH_HERMITIAN_EPSILON md->eps_inv[eps_index].m01.re = 0.5*(x0*norm1 + x1*norm0); md->eps_inv[eps_index].m01.im = 0.0; md->eps_inv[eps_index].m02.re = 0.5*(x0*norm2 + x2*norm0); md->eps_inv[eps_index].m02.im = 0.0; md->eps_inv[eps_index].m12.re = 0.5*(x1*norm2 + x2*norm1); md->eps_inv[eps_index].m12.im = 0.0; #else md->eps_inv[eps_index].m01 = 0.5*(x0*norm1 + x1*norm0); md->eps_inv[eps_index].m02 = 0.5*(x0*norm2 + x2*norm0); md->eps_inv[eps_index].m12 = 0.5*(x1*norm2 + x2*norm1); #endif } else { #ifdef WITH_HERMITIAN_EPSILON real x0i, x1i, x2i; x0 += ((eps_inv_mean.m01.re - eps_mean_inv.m01.re)*norm1 + (eps_inv_mean.m02.re - eps_mean_inv.m02.re)*norm2); x1 += ((eps_inv_mean.m01.re - eps_mean_inv.m01.re)*norm0 + (eps_inv_mean.m12.re - eps_mean_inv.m12.re)*norm2); x2 += ((eps_inv_mean.m02.re - eps_mean_inv.m02.re)*norm0 + (eps_inv_mean.m12.re - eps_mean_inv.m12.re)*norm1); x0i = ((eps_inv_mean.m01.im - eps_mean_inv.m01.im)*norm1 + (eps_inv_mean.m02.im - eps_mean_inv.m02.im)*norm2); x1i = (-(eps_inv_mean.m01.im - eps_mean_inv.m01.im)*norm0+ (eps_inv_mean.m12.im - eps_mean_inv.m12.im)*norm2); x2i = -((eps_inv_mean.m02.im - eps_mean_inv.m02.im)*norm0 + (eps_inv_mean.m12.im - eps_mean_inv.m12.im)*norm1); md->eps_inv[eps_index].m01.re = (0.5*(x0*norm1 + x1*norm0) + eps_mean_inv.m01.re); md->eps_inv[eps_index].m02.re = (0.5*(x0*norm2 + x2*norm0) + eps_mean_inv.m02.re); md->eps_inv[eps_index].m12.re = (0.5*(x1*norm2 + x2*norm1) + eps_mean_inv.m12.re); md->eps_inv[eps_index].m01.im = (0.5*(x0i*norm1-x1i*norm0) + eps_mean_inv.m01.im); md->eps_inv[eps_index].m02.im = (0.5*(x0i*norm2-x2i*norm0) + eps_mean_inv.m02.im); md->eps_inv[eps_index].m12.im = (0.5*(x1i*norm2-x2i*norm1) + eps_mean_inv.m12.im); #else x0 += ((eps_inv_mean.m01 - eps_mean_inv.m01) * norm1 + (eps_inv_mean.m02 - eps_mean_inv.m02) * norm2); x1 += ((eps_inv_mean.m01 - eps_mean_inv.m01) * norm0 + (eps_inv_mean.m12 - eps_mean_inv.m12) * norm2); x2 += ((eps_inv_mean.m02 - eps_mean_inv.m02) * norm0 + (eps_inv_mean.m12 - eps_mean_inv.m12) * norm1); md->eps_inv[eps_index].m01 = (0.5*(x0*norm1 + x1*norm0) + eps_mean_inv.m01); md->eps_inv[eps_index].m02 = (0.5*(x0*norm2 + x2*norm0) + eps_mean_inv.m02); md->eps_inv[eps_index].m12 = (0.5*(x1*norm2 + x2*norm1) + eps_mean_inv.m12); #endif } md->eps_inv[eps_index].m00 = x0*norm0 + eps_mean_inv.m00; md->eps_inv[eps_index].m11 = x1*norm1 + eps_mean_inv.m11; md->eps_inv[eps_index].m22 = x2*norm2 + eps_mean_inv.m22; } else { /* undetermined normal vector and/or constant eps */ md->eps_inv[eps_index] = eps_mean_inv; } eps_inv_total += (md->eps_inv[eps_index].m00 + md->eps_inv[eps_index].m11 + md->eps_inv[eps_index].m22); }} /* end of loop body */ mpi_allreduce_1(&eps_inv_total, real, SCALAR_MPI_TYPE, MPI_SUM, MPI_COMM_WORLD); n1 = md->fft_output_size; mpi_allreduce_1(&n1, int, MPI_INT, MPI_SUM, MPI_COMM_WORLD); md->eps_inv_mean = eps_inv_total / (3 * n1); } mpb-1.4.2/src/maxwell/maxwell_op.c0000644000175400001440000007451707441753311012553 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include "maxwell.h" /**************************************************************************/ /* assign a = v going from transverse to cartesian coordinates. Here, a = (a[0],a[1],a[2]) is in cartesian coordinates. (v[0],v[vstride]) is in the transverse basis of k.m and k.n. */ static void assign_t2c(scalar *a, const k_data k, const scalar *v, int vstride) { scalar v0 = v[0], v1 = v[vstride]; ASSIGN_SCALAR(a[0], SCALAR_RE(v0)*k.mx + SCALAR_RE(v1)*k.nx, SCALAR_IM(v0)*k.mx + SCALAR_IM(v1)*k.nx); ASSIGN_SCALAR(a[1], SCALAR_RE(v0)*k.my + SCALAR_RE(v1)*k.ny, SCALAR_IM(v0)*k.my + SCALAR_IM(v1)*k.ny); ASSIGN_SCALAR(a[2], SCALAR_RE(v0)*k.mz + SCALAR_RE(v1)*k.nz, SCALAR_IM(v0)*k.mz + SCALAR_IM(v1)*k.nz); } /* assign a = k x v (cross product), going from transverse to cartesian coordinates. Here, a = (a[0],a[1],a[2]) and k = (k.kx,k.ky,k.kz) are in cartesian coordinates. (v[0],v[vstride]) is in the transverse basis of k.m and k.n. */ static void assign_cross_t2c(scalar *a, const k_data k, const scalar *v, int vstride) { scalar v0 = v[0], v1 = v[vstride]; /* Note that k x m = |k| n, k x n = - |k| m. Therefore, k x v = k x (v0 m + v1 n) = (v0 n - v1 m) * |k|. */ ASSIGN_SCALAR(a[0], (SCALAR_RE(v0)*k.nx - SCALAR_RE(v1)*k.mx) * k.kmag, (SCALAR_IM(v0)*k.nx - SCALAR_IM(v1)*k.mx) * k.kmag); ASSIGN_SCALAR(a[1], (SCALAR_RE(v0)*k.ny - SCALAR_RE(v1)*k.my) * k.kmag, (SCALAR_IM(v0)*k.ny - SCALAR_IM(v1)*k.my) * k.kmag); ASSIGN_SCALAR(a[2], (SCALAR_RE(v0)*k.nz - SCALAR_RE(v1)*k.mz) * k.kmag, (SCALAR_IM(v0)*k.nz - SCALAR_IM(v1)*k.mz) * k.kmag); #ifdef DEBUG { real num; num = SCALAR_NORMSQR(a[0])+SCALAR_NORMSQR(a[1])+SCALAR_NORMSQR(a[2]); CHECK(!BADNUM(num), "yikes, crazy number!"); } #endif } /* assign v = scale * k x a (cross product), going from cartesian to transverse coordinates. Here, a = (a[0],a[1],a[2]) and k = (k.kx,k.ky,k.kz) are in cartesian coordinates. (v[0],v[vstride]) is in the transverse basis of k.m and k.n. */ static void assign_cross_c2t(scalar *v, int vstride, const k_data k, const scalar *a, real scale) { scalar a0 = a[0], a1 = a[1], a2 = a[2]; scalar at0, at1; /* First, compute at0 = a*m and at1 = a*n. (Components of a that are parallel to k are killed anyway by the cross product.) */ ASSIGN_SCALAR(at0, SCALAR_RE(a0)*k.mx + SCALAR_RE(a1)*k.my + SCALAR_RE(a2)*k.mz, SCALAR_IM(a0)*k.mx + SCALAR_IM(a1)*k.my + SCALAR_IM(a2)*k.mz); ASSIGN_SCALAR(at1, SCALAR_RE(a0)*k.nx + SCALAR_RE(a1)*k.ny + SCALAR_RE(a2)*k.nz, SCALAR_IM(a0)*k.nx + SCALAR_IM(a1)*k.ny + SCALAR_IM(a2)*k.nz); /* Now, k x a = k x (at0*m + at1*n) = (at0*n - at1*m) * |k|. */ scale *= k.kmag; /* combine scale factor and |k|*/ ASSIGN_SCALAR(v[0], - scale * SCALAR_RE(at1), - scale * SCALAR_IM(at1)); ASSIGN_SCALAR(v[vstride], scale * SCALAR_RE(at0), scale * SCALAR_IM(at0)); #ifdef DEBUG { real dummy = SCALAR_NORMSQR(v[0]) + SCALAR_NORMSQR(v[vstride]); CHECK(!BADNUM(dummy), "yikes, crazy number!"); } #endif } /* compute a = u x v, where a and u are in cartesian coordinates and v is in transverse coordinates. */ static void assign_ucross_t2c(scalar *a, const real u[3], const k_data k, const scalar *v, int vstride) { scalar v0 = v[0], v1 = v[vstride]; real vx_r, vy_r, vz_r; #ifdef SCALAR_COMPLEX real vx_i, vy_i, vz_i; #endif /* Note that v = (vx,vy,vz) = (v0 m + v1 n). */ vx_r = SCALAR_RE(v0)*k.mx + SCALAR_RE(v1)*k.nx; vy_r = SCALAR_RE(v0)*k.my + SCALAR_RE(v1)*k.ny; vz_r = SCALAR_RE(v0)*k.mz + SCALAR_RE(v1)*k.nz; #ifdef SCALAR_COMPLEX vx_i = SCALAR_IM(v0)*k.mx + SCALAR_IM(v1)*k.nx; vy_i = SCALAR_IM(v0)*k.my + SCALAR_IM(v1)*k.ny; vz_i = SCALAR_IM(v0)*k.mz + SCALAR_IM(v1)*k.nz; #endif ASSIGN_SCALAR(a[0], u[1] * vz_r - u[2] * vy_r, u[1] * vz_i - u[2] * vy_i); ASSIGN_SCALAR(a[1], u[2] * vx_r - u[0] * vz_r, u[2] * vx_i - u[0] * vz_i); ASSIGN_SCALAR(a[2], u[0] * vy_r - u[1] * vx_r, u[0] * vy_i - u[1] * vx_i); } /**************************************************************************/ void maxwell_compute_fft(int dir, maxwell_data *d, scalar *array, int howmany, int stride, int dist) { #ifdef HAVE_FFTW # ifdef SCALAR_COMPLEX # ifndef HAVE_MPI fftwnd(dir < 0 ? d->plan : d->iplan, howmany, (fftw_complex *) array, stride, dist, 0, 0, 0); # else /* HAVE_MPI */ CHECK(stride == howmany && dist == 1, "weird strides and dists don't work with fftwnd_mpi"); fftwnd_mpi(dir < 0 ? d->plan : d->iplan, howmany, (fftw_complex *) array, (fftw_complex *) NULL, FFTW_TRANSPOSED_ORDER); # endif /* HAVE_MPI */ # else /* not SCALAR_COMPLEX */ # ifndef HAVE_MPI if (dir > 0) rfftwnd_real_to_complex(d->iplan, howmany, (fftw_real *) array, stride, dist, 0, 0, 0); else rfftwnd_complex_to_real(d->plan, howmany, (fftw_complex *) array, stride, dist, 0, 0, 0); # else /* HAVE_MPI */ CHECK(stride == howmany && dist == 1, "weird strides and dists don't work with rfftwnd_mpi"); rfftwnd_mpi(dir < 0 ? d->plan : d->iplan, howmany, array, (scalar *) NULL, FFTW_TRANSPOSED_ORDER); # endif /* HAVE_MPI */ # endif /* not SCALAR_COMPLEX */ #else /* not HAVE_FFTW */ # error only FFTW ffts are supported #endif /* not HAVE_FFTW */ } /**************************************************************************/ /* assigns newv = matrix * oldv. matrix is symmetric and so is stored in "packed" format. */ void assign_symmatrix_vector(scalar_complex *newv, const symmetric_matrix matrix, const scalar_complex *oldv) { scalar_complex v0 = oldv[0], v1 = oldv[1], v2 = oldv[2]; #if defined(WITH_HERMITIAN_EPSILON) newv[0].re = matrix.m00 * v0.re; newv[0].im = matrix.m00 * v0.im; CACCUMULATE_SUM_MULT(newv[0], matrix.m01, v1); CACCUMULATE_SUM_MULT(newv[0], matrix.m02, v2); newv[1].re = matrix.m11 * v1.re; newv[1].im = matrix.m11 * v1.im; CACCUMULATE_SUM_CONJ_MULT(newv[1], matrix.m01, v0); CACCUMULATE_SUM_MULT(newv[1], matrix.m12, v2); newv[2].re = matrix.m22 * v2.re; newv[2].im = matrix.m22 * v2.im; CACCUMULATE_SUM_CONJ_MULT(newv[2], matrix.m02, v0); CACCUMULATE_SUM_CONJ_MULT(newv[2], matrix.m12, v1); #else newv[0].re = matrix.m00 * v0.re + matrix.m01 * v1.re + matrix.m02 * v2.re; newv[0].im = matrix.m00 * v0.im + matrix.m01 * v1.im + matrix.m02 * v2.im; newv[1].re = matrix.m01 * v0.re + matrix.m11 * v1.re + matrix.m12 * v2.re; newv[1].im = matrix.m01 * v0.im + matrix.m11 * v1.im + matrix.m12 * v2.im; newv[2].re = matrix.m02 * v0.re + matrix.m12 * v1.re + matrix.m22 * v2.re; newv[2].im = matrix.m02 * v0.im + matrix.m12 * v1.im + matrix.m22 * v2.im; #endif #ifdef DEBUG { real dummy; dummy = CSCALAR_NORMSQR(newv[0]) + CSCALAR_NORMSQR(newv[1]) + CSCALAR_NORMSQR(newv[2]); CHECK(!BADNUM(dummy), "yikes, crazy number!"); } #endif } /* compute the D field in position space from Hin, which holds the H field in Fourier space, for the specified bands; this amounts to taking the curl and then Fourier transforming. The output array, dfield, is fft_output_size x cur_num_bands x 3, where fft_output_size is the local spatial indices and 3 is the field components. Note: actually, this computes just (k+G) x H, whereas the actual D field is i/omega i(k+G) x H...so, we are really computing -omega*D, here. */ void maxwell_compute_d_from_H(maxwell_data *d, evectmatrix Hin, scalar_complex *dfield, int cur_band_start, int cur_num_bands) { scalar *fft_data = (scalar *) dfield; int i, j, b; CHECK(Hin.c == 2, "fields don't have 2 components!"); CHECK(d, "null maxwell data pointer!"); CHECK(dfield, "null field output data!"); CHECK(cur_band_start >= 0 && cur_band_start + cur_num_bands <= Hin.p, "invalid range of bands for computing fields"); /* first, compute fft_data = curl(Hin) (really (k+G) x H) : */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_cross_t2c(&fft_data[3 * (ij2*cur_num_bands + b)], cur_k, &Hin.data[ij * 2 * Hin.p + b + cur_band_start], Hin.p); } /* now, convert to position space via FFT: */ maxwell_compute_fft(+1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); } /* Compute E (output in dfield) from D (input in dfield); this amounts to just dividing by the dielectric tensor. dfield is in position space and corresponds to the output from maxwell_compute_d_from_H, above. */ void maxwell_compute_e_from_d(maxwell_data *d, scalar_complex *dfield, int cur_num_bands) { int i, b; CHECK(d, "null maxwell data pointer!"); CHECK(dfield, "null field input/output data!"); for (i = 0; i < d->fft_output_size; ++i) { symmetric_matrix eps_inv = d->eps_inv[i]; for (b = 0; b < cur_num_bands; ++b) { int ib = 3 * (i * cur_num_bands + b); assign_symmatrix_vector(&dfield[ib], eps_inv, &dfield[ib]); } } } /* Compute the magnetic (H) field in Fourier space from the electric field (e) in position space; this amouns to Fourier transforming and then taking the curl. Also, multiply by scale. Other parameters are as in compute_d_from_H. Note: we actually compute (k+G) x E, whereas the actual H field is -i/omega i(k+G) x E...so, we are actually computing omega*H, here. */ void maxwell_compute_H_from_e(maxwell_data *d, evectmatrix Hout, scalar_complex *efield, int cur_band_start, int cur_num_bands, real scale) { scalar *fft_data = (scalar *) efield; int i, j, b; CHECK(Hout.c == 2, "fields don't have 2 components!"); CHECK(d, "null maxwell data pointer!"); CHECK(efield, "null field output data!"); CHECK(cur_band_start >= 0 && cur_band_start + cur_num_bands <= Hout.p, "invalid range of bands for computing fields"); /* convert back to Fourier space */ maxwell_compute_fft(-1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); /* then, compute Hout = curl(fft_data) (* scale factor): */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_cross_c2t(&Hout.data[ij * 2 * Hout.p + b + cur_band_start], Hout.p, cur_k, &fft_data[3 * (ij2*cur_num_bands + b)], scale); } } /* Compute H field in position space from Hin. Parameters and output formats are the same as for compute_d_from_H, above. */ void maxwell_compute_h_from_H(maxwell_data *d, evectmatrix Hin, scalar_complex *hfield, int cur_band_start, int cur_num_bands) { scalar *fft_data = (scalar *) hfield; int i, j, b; CHECK(Hin.c == 2, "fields don't have 2 components!"); CHECK(d, "null maxwell data pointer!"); CHECK(hfield, "null field output data!"); CHECK(cur_band_start >= 0 && cur_band_start + cur_num_bands <= Hin.p, "invalid range of bands for computing fields"); /* first, compute fft_data = Hin, with the vector field converted from transverse to cartesian basis: */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_t2c(&fft_data[3 * (ij2*cur_num_bands + b)], cur_k, &Hin.data[ij * 2 * Hin.p + b + cur_band_start], Hin.p); } /* now, convert to position space via FFT: */ maxwell_compute_fft(+1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); } /**************************************************************************/ /* The following functions take a complex or real vector field in position space, as output by rfftwnd (or rfftwnd_mpi), and compute the "other half" of the array. That is, rfftwnd outputs only half of the logical FFT output, since the other half is redundant (see the FFTW manual). This is fine for computation, but for visualization/output we want the whole array, redundant or not. So, we output the array in two stages, first outputting the array we are given, then using the functions below to compute the other half and outputting that. Given an array A(i,j,k), the redundant half is given by the following identity for transforms of real data: A(nx-i,ny-j,nz-k) = A(i,j,k)* where nx-i/ny-j/nz-k are interpreted modulo nx/ny/nz. (This means that zero coordinates are handled specially: nx-0 = 0.) Note that actually, the other "half" is actually slightly less than half of the array. Note also that the other half, in the case of distributed MPI transforms, is not necessarily contiguous, due to special handling of zero coordinates. There is an additional complication. The array with the symmetry above may have been multiplied by exp(ikx) phases to get its Bloch state. In this case, we must use the identity: A(R-x)*exp(ik(R-x)) = ( A(x) exp(ikx) exp(-ikR) )* where R is a lattice vector. That is, we not only must conjugate and reverse the order, but we also may need to multiply by exp(-ikR) before conjugating. Unfortunately, R depends upon where we are in the array, because of the fact that the indices are interpreted modulo n (i.e. the zero indices aren't reordered). e.g. for the point (nx-i,ny-j,nz-k), R = Rx*(i!=0) + Ry*(j!=0) + Rz*(k!=0). Another complication is that, for 2d rfftwnd_mpi transforms, the truncated dimension (in the transformed, transposed array) is the *first* dimension rather than the last. This code is a little too subtle for my tastes; real FFTs are a pain. */ #define TWOPI 6.2831853071795864769252867665590057683943388 /* This function takes a complex vector field and replaces it with its other "half." phase{x,y,z} is the phase k*R{x,y,z}, in "units" of 2*pi. (Equivalently, phase{x,y,z} is the k vector in the reciprocal lattice basis.) */ void maxwell_vectorfield_otherhalf(maxwell_data *d, scalar_complex *field, real phasex, real phasey, real phasez) { #ifndef SCALAR_COMPLEX int i, j, jmin = 1; int rank, n_other, n_last, n_last_stored, n_last_new, nx, ny, nz, nxmax; # ifdef HAVE_MPI int local_x_start; # endif scalar_complex pz, pxz, pyz, pxyz; nxmax = nx = d->nx; ny = d->ny; nz = d->nz; n_other = d->other_dims; n_last = d->last_dim; n_last_stored = d->last_dim_size / 2; n_last_new = n_last - n_last_stored; /* < n_last_stored always */ rank = (nz == 1) ? (ny == 1 ? 1 : 2) : 3; # ifdef HAVE_MPI local_x_start = d->local_y_start; CHECK(rank == 2 || rank == 3, "unsupported rfftwnd_mpi rank!"); if (rank == 2) { n_other = nx; n_last_new = ny = d->local_ny; if (local_x_start == 0) --n_last_new; /* DC frequency should not be in other half */ else jmin = 0; if (local_x_start + ny == n_last_stored && n_last % 2 == 0) --n_last_new; /* Nyquist freq. should not be in other half */ n_last_stored = ny; } else { /* rank == 3 */ ny = nx; nx = d->local_ny; nxmax = local_x_start ? nx - 1 : nx; n_other = nx * ny; } # endif /* HAVE_MPI */ /* compute p = exp(i*phase) factors: */ phasex *= -TWOPI; phasey *= -TWOPI; phasez *= -TWOPI; switch (rank) { /* treat z as the last/truncated dimension always */ case 3: break; # if defined(HAVE_MPI) && ! defined(SCALAR_COMPLEX) case 2: phasez = phasex; phasex = phasey; phasey = 0; break; # else case 2: phasez = phasey; phasey = 0; break; # endif case 1: phasez = phasex; phasex = phasey = 0; break; } CASSIGN_SCALAR(pz, cos(phasez), sin(phasez)); phasex += phasez; CASSIGN_SCALAR(pxz, cos(phasex), sin(phasex)); phasex += phasey; CASSIGN_SCALAR(pxyz, cos(phasex), sin(phasex)); phasey += phasez; CASSIGN_SCALAR(pyz, cos(phasey), sin(phasey)); /* convenience macros to copy vectors, vectors times phases, and conjugated vectors: */ # define ASSIGN_V(f,k,f2,k2) { f[3*(k)+0] = f2[3*(k2)+0]; \ f[3*(k)+1] = f2[3*(k2)+1]; \ f[3*(k)+2] = f2[3*(k2)+2]; } # define ASSIGN_VP(f,k,f2,k2,p) { CASSIGN_MULT(f[3*(k)+0], f2[3*(k2)+0], p); \ CASSIGN_MULT(f[3*(k)+1], f2[3*(k2)+1], p); \ CASSIGN_MULT(f[3*(k)+2], f2[3*(k2)+2], p); } # define ASSIGN_CV(f,k,f2,k2) { CASSIGN_CONJ(f[3*(k)+0], f2[3*(k2)+0]); \ CASSIGN_CONJ(f[3*(k)+1], f2[3*(k2)+1]); \ CASSIGN_CONJ(f[3*(k)+2], f2[3*(k2)+2]); } /* First, swap the order of elements and multiply by exp(ikR) phase factors. We have to be careful here not to double-swap any element pair; this is prevented by never swapping with a "conjugated" point that is earlier in the array. */ if (rank == 3) { int ix, iy; for (ix = 0; 2*ix <= nxmax; ++ix) { int xdiff, ixc; # ifdef HAVE_MPI if (local_x_start == 0) { xdiff = ix != 0; ixc = (nx - ix) % nx; } else { xdiff = 1; ixc = nx-1 - ix; } # else xdiff = ix != 0; ixc = (nx - ix) % nx; # endif for (iy = 0; iy < ny; ++iy) { int ydiff = iy != 0; int i = ix * ny + iy, ic = ixc * ny + (ny - iy) % ny, jmax; if (ic < i) continue; jmax = n_last_new; if (ic == i) jmax = (jmax + 1) / 2; for (j = 1; j <= jmax; ++j) { int jc = n_last_new + 1 - j; int ij = i*n_last_stored + j; int ijc = ic*n_last_stored + jc; scalar_complex f_tmp[3]; switch (xdiff*2 + ydiff) { /* pick exp(-ikR) phase */ case 3: /* xdiff && ydiff */ ASSIGN_VP(f_tmp, 0, field, ijc, pxyz); ASSIGN_VP(field, ijc, field, ij, pxyz); ASSIGN_V(field, ij, f_tmp, 0); break; case 2: /* xdiff && !ydiff */ ASSIGN_VP(f_tmp, 0, field, ijc, pxz); ASSIGN_VP(field, ijc, field, ij, pxz); ASSIGN_V(field, ij, f_tmp, 0); break; case 1: /* !xdiff && ydiff */ ASSIGN_VP(f_tmp, 0, field, ijc, pyz); ASSIGN_VP(field, ijc, field, ij, pyz); ASSIGN_V(field, ij, f_tmp, 0); break; case 0: /* !xdiff && !ydiff */ ASSIGN_VP(f_tmp, 0, field, ijc, pz); ASSIGN_VP(field, ijc, field, ij, pz); ASSIGN_V(field, ij, f_tmp, 0); break; } } } } /* Next, conjugate, and remove the holes from the array corresponding to the DC and Nyquist frequencies (which were in the first half already): */ for (i = 0; i < n_other; ++i) for (j = 1; j < n_last_new + 1; ++j) { int ij = i*n_last_stored + j, ijnew = i*n_last_new + j-1; ASSIGN_CV(field, ijnew, field, ij); } } else /* if (rank <= 2) */ { int i; if (rank == 1) /* (note that 1d MPI transforms are not allowed) */ nx = 1; /* x dimension is handled by j (last dimension) loop */ # ifdef HAVE_MPI for (i = 0; i < nx; ++i) # else for (i = 0; 2*i <= nx; ++i) # endif { int xdiff = i != 0, ic = (nx - i) % nx; int jmax = n_last_new + (jmin - 1); # ifndef HAVE_MPI if (ic == i) jmax = (jmax + 1) / 2; # endif for (j = jmin; j <= jmax; ++j) { scalar_complex f_tmp[3]; # ifdef HAVE_MPI int jc = jmax + jmin - j; int ij = j * nx + i; int ijc = jc * nx + ic; if (ijc < ij) break; # else /* ! HAVE_MPI */ int jc = n_last_new + 1 - j; int ij = i*n_last_stored + j; int ijc = ic*n_last_stored + jc; # endif /* ! HAVE_MPI */ if (xdiff) { ASSIGN_VP(f_tmp, 0, field, ijc, pxz); ASSIGN_VP(field, ijc, field, ij, pxz); ASSIGN_V(field, ij, f_tmp, 0); } else { ASSIGN_VP(f_tmp, 0, field, ijc, pz); ASSIGN_VP(field, ijc, field, ij, pz); ASSIGN_V(field, ij, f_tmp, 0); } } } /* Next, conjugate, and remove the holes from the array corresponding to the DC and Nyquist frequencies (which were in the first half already): */ for (i = 0; i < nx; ++i) for (j = jmin; j < n_last_new + jmin; ++j) { # ifdef HAVE_MPI int ij = j*nx + i, ijnew = (j-jmin)*nx + i; # else int ij = i*n_last_stored + j, ijnew = i*n_last_new + j-1; # endif ASSIGN_CV(field, ijnew, field, ij); } } # undef ASSIGN_V # undef ASSIGN_VP # undef ASSIGN_CV #endif /* ! SCALAR_COMPLEX */ } /* Similar to vectorfield_otherhalf, above, except that it operates on a real scalar field, which is assumed to have come from e.g. the absolute values of a complex field (and thus no phase factors or conjugations are necessary). */ void maxwell_scalarfield_otherhalf(maxwell_data *d, real *field) { #ifndef SCALAR_COMPLEX int i, j, jmin = 1; int rank, n_other, n_last, n_last_stored, n_last_new, nx, ny, nz, nxmax; # ifdef HAVE_MPI int local_x_start; # endif nxmax = nx = d->nx; ny = d->ny; nz = d->nz; n_other = d->other_dims; n_last = d->last_dim; n_last_stored = d->last_dim_size / 2; n_last_new = n_last - n_last_stored; /* < n_last_stored always */ rank = (nz == 1) ? (ny == 1 ? 1 : 2) : 3; # ifdef HAVE_MPI local_x_start = d->local_y_start; CHECK(rank == 2 || rank == 3, "unsupported rfftwnd_mpi rank!"); if (rank == 2) { n_other = nx; n_last_new = ny = d->local_ny; if (local_x_start == 0) --n_last_new; /* DC frequency should not be in other half */ else jmin = 0; if (local_x_start + ny == n_last_stored && n_last % 2 == 0) --n_last_new; /* Nyquist freq. should not be in other half */ n_last_stored = ny; } else { /* rank == 3 */ ny = nx; nx = d->local_ny; nxmax = local_x_start ? nx - 1 : nx; n_other = nx * ny; } # endif /* HAVE_MPI */ /* First, swap the order of elements and multiply by exp(ikR) phase factors. We have to be careful here not to double-swap any element pair; this is prevented by never swapping with a "conjugated" point that is earlier in the array. */ if (rank == 3) { int ix, iy; for (ix = 0; 2*ix <= nxmax; ++ix) { int ixc; # ifdef HAVE_MPI if (local_x_start == 0) ixc = (nx - ix) % nx; else ixc = nx-1 - ix; # else ixc = (nx - ix) % nx; # endif for (iy = 0; iy < ny; ++iy) { int i = ix * ny + iy, ic = ixc * ny + (ny - iy) % ny, jmax; if (ic < i) continue; jmax = n_last_new; if (ic == i) jmax = (jmax + 1) / 2; for (j = 1; j <= jmax; ++j) { int jc = n_last_new + 1 - j; int ij = i*n_last_stored + j; int ijc = ic*n_last_stored + jc; real f_tmp; f_tmp = field[ijc]; field[ijc] = field[ij]; field[ij] = f_tmp; } } } /* Next, conjugate, and remove the holes from the array corresponding to the DC and Nyquist frequencies (which were in the first half already): */ for (i = 0; i < n_other; ++i) for (j = 1; j < n_last_new + 1; ++j) { int ij = i*n_last_stored + j, ijnew = i*n_last_new + j-1; field[ijnew] = field[ij]; } } else /* if (rank <= 2) */ { int i; if (rank == 1) /* (note that 1d MPI transforms are not allowed) */ nx = 1; /* x dimension is handled by j (last dimension) loop */ # ifdef HAVE_MPI for (i = 0; i < nx; ++i) # else for (i = 0; 2*i <= nx; ++i) # endif { int ic = (nx - i) % nx; int jmax = n_last_new + (jmin - 1); # ifndef HAVE_MPI if (ic == i) jmax = (jmax + 1) / 2; # endif for (j = jmin; j <= jmax; ++j) { real f_tmp; # ifdef HAVE_MPI int jc = jmax + jmin - j; int ij = j * nx + i; int ijc = jc * nx + ic; if (ijc < ij) break; # else /* ! HAVE_MPI */ int jc = n_last_new + 1 - j; int ij = i*n_last_stored + j; int ijc = ic*n_last_stored + jc; # endif /* ! HAVE_MPI */ f_tmp = field[ijc]; field[ijc] = field[ij]; field[ij] = f_tmp; } } /* Next, remove the holes from the array corresponding to the DC and Nyquist frequencies (which were in the first half already): */ for (i = 0; i < nx; ++i) for (j = jmin; j < n_last_new + jmin; ++j) { # ifdef HAVE_MPI int ij = j*nx + i, ijnew = (j-jmin)*nx + i; # else int ij = i*n_last_stored + j, ijnew = i*n_last_new + j-1; # endif field[ijnew] = field[ij]; } } #endif /* ! SCALAR_COMPLEX */ } /**************************************************************************/ #define MIN2(a,b) ((a) < (b) ? (a) : (b)) /* Compute Xout = curl(1/epsilon * curl(Xin)) */ void maxwell_operator(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work) { maxwell_data *d = (maxwell_data *) data; int cur_band_start; scalar_complex *cdata; real scale; CHECK(d, "null maxwell data pointer!"); CHECK(Xin.c == 2, "fields don't have 2 components!"); (void) is_current_eigenvector; /* unused */ (void) Work; cdata = (scalar_complex *) d->fft_data; scale = -1.0 / Xout.N; /* scale factor to normalize FFT; negative sign comes from 2 i's from curls */ /* compute the operator, num_fft_bands at a time: */ for (cur_band_start = 0; cur_band_start < Xin.p; cur_band_start += d->num_fft_bands) { int cur_num_bands = MIN2(d->num_fft_bands, Xin.p - cur_band_start); maxwell_compute_d_from_H(d, Xin, cdata, cur_band_start, cur_num_bands); maxwell_compute_e_from_d(d, cdata, cur_num_bands); maxwell_compute_H_from_e(d, Xout, cdata, cur_band_start, cur_num_bands, scale); } } /* Compute the operation Xout = (M - w^2) Xin, where M is the Maxwell operator and w is the target frequency. This shifts the eigenvalue spectrum so that the smallest magnitude eigenvalues are those nearest to w. However, there are negative eigenvalues (the operator is not positive-definite), and the smallest eigenvectors (not taking the absolute value) are the same as those of M. */ void maxwell_target_operator1(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work) { maxwell_target_data *d = (maxwell_target_data *) data; real omega_sqr = d->target_frequency * d->target_frequency; maxwell_operator(Xin, Xout, d->d, is_current_eigenvector, Work); evectmatrix_aXpbY(1.0, Xout, -omega_sqr, Xin); } /* Compute the operation Xout = (M - w^2)^2 Xin, where M is the Maxwell operator and w is the target frequency. This shifts the eigenvalue spectrum so that the smallest eigenvalues are those nearest to w. */ void maxwell_target_operator(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work) { if (Xin.n != 0) CHECK(Work.data && Work.data != Xin.data && Work.data != Xout.data, "maxwell_target_operator must have distinct workspace!"); maxwell_target_operator1(Xin, Work, data, is_current_eigenvector, Xout); /* N.B. maxwell_operator(), and thus maxwell_target_operator1(), doesn't actually need the workspace, so we can safely pass Work here for the scratch parameter: */ maxwell_target_operator1(Work, Xout, data, is_current_eigenvector, Work); } /* Compute the operation Xout = curl 1/epsilon * i u x Xin, which is useful operation in computing the group velocity (derivative of the maxwell operator). u is a vector in cartesian coordinates. */ void maxwell_ucross_op(evectmatrix Xin, evectmatrix Xout, maxwell_data *d, const real u[3]) { scalar *fft_data; scalar_complex *cdata; real scale; int cur_band_start; int i, j, b; CHECK(d, "null maxwell data pointer!"); CHECK(Xin.c == 2, "fields don't have 2 components!"); cdata = (scalar_complex *) (fft_data = d->fft_data); scale = -1.0 / Xout.N; /* scale factor to normalize FFT; negative sign comes from 2 i's from curls */ /* compute the operator, num_fft_bands at a time: */ for (cur_band_start = 0; cur_band_start < Xin.p; cur_band_start += d->num_fft_bands) { int cur_num_bands = MIN2(d->num_fft_bands, Xin.p - cur_band_start); /* first, compute fft_data = u x Xin: */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_ucross_t2c(&fft_data[3 * (ij2*cur_num_bands + b)], u, cur_k, &Xin.data[ij * 2 * Xin.p + b + cur_band_start], Xin.p); } /* now, convert to position space via FFT: */ maxwell_compute_fft(+1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); maxwell_compute_e_from_d(d, cdata, cur_num_bands); maxwell_compute_H_from_e(d, Xout, cdata, cur_band_start, cur_num_bands, scale); } } mpb-1.4.2/src/maxwell/maxwell_pre.c0000644000175400001440000002266007441753311012713 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include "maxwell.h" #define PRECOND_SUBTR_EIGS 0 #define PRECOND_MIN_DENOM 5e-3 #define MIN2(a,b) ((a) < (b) ? (a) : (b)) #define MAX2(a,b) ((a) > (b) ? (a) : (b)) /* used to be: MAX2(x, PRECOND_MIN_DENOM) but now zero k-point is handled specially */ #define FIX_DENOM(x) ((x) == 0 ? 1.0 : (x)) void maxwell_simple_precondition(evectmatrix X, void *data, real *eigenvals) { maxwell_data *d = (maxwell_data *) data; int i, c, b; real *kpGn2 = d->k_plus_G_normsqr; for (i = 0; i < X.localN; ++i) { for (c = 0; c < X.c; ++c) { for (b = 0; b < X.p; ++b) { int index = (i * X.c + c) * X.p + b; real scale = kpGn2[i] * d->eps_inv_mean; #if PRECOND_SUBTR_EIGS if (eigenvals) { scale -= eigenvals[b]; scale = 1.0 / (scale + copysign(PRECOND_MIN_DENOM, scale)); } else #else { scale = 1.0 / FIX_DENOM(scale); } #endif ASSIGN_SCALAR(X.data[index], scale * SCALAR_RE(X.data[index]), scale * SCALAR_IM(X.data[index])); } } } } void maxwell_preconditioner(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { evectmatrix_XeYS(Xout, Xin, YtY, 1); maxwell_simple_precondition(Xout, data, eigenvals); } void maxwell_target_preconditioner(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { maxwell_target_data *td = (maxwell_target_data *) data; maxwell_data *d = td->d; real omega_sqr = td->target_frequency * td->target_frequency; int i, c, b; real *kpGn2 = d->k_plus_G_normsqr; evectmatrix_XeYS(Xout, Xin, YtY, 1); for (i = 0; i < Xout.localN; ++i) { for (c = 0; c < Xout.c; ++c) { for (b = 0; b < Xout.p; ++b) { int index = (i * Xout.c + c) * Xout.p + b; real scale = kpGn2[i] * d->eps_inv_mean; #if PRECOND_SUBTR_EIGS scale -= omega_sqr; #endif scale = scale * scale; #if PRECOND_SUBTR_EIGS if (eigenvals) { scale -= eigenvals[b]; scale = 1.0 / (scale + copysign(PRECOND_MIN_DENOM, scale)); } else #else { scale = 1.0 / FIX_DENOM(scale); } #endif ASSIGN_SCALAR(Xout.data[index], scale * SCALAR_RE(Xout.data[index]), scale * SCALAR_IM(Xout.data[index])); } } } } /**************************************************************************/ /* Fancy preconditioners */ /* Compute 'a' where v = k x a (cross product). Here, a = (a[0],a[1],a[2]) and k = (k.kx,k.ky,k.kz) are in cartesian coordinates. (v[0],v[vstride]) is in the transverse basis of k.m and k.n. We can't compute 'a' exactly, since there is no way to find the component of a parallel to k. So, we only compute the transverse component of 'a'--this is the main approximation in our preconditioner. */ static void assign_crossinv_t2c(scalar *a, const k_data k, const scalar *v, int vstride) { /* k x v = k x (k x a) = (k*a)k - k^2 a = -(a_transverse) * k^2 ==> a_transverse = -1/k^2 * k x v */ /* Thus, we just do the same thing as assign_cross_t2c in maxwell_op.c, except that we divide by -k^2: */ scalar v0 = v[0], v1 = v[vstride]; real kmag_inv = -1.0 / FIX_DENOM(k.kmag); ASSIGN_SCALAR(a[0], (SCALAR_RE(v0)*k.nx - SCALAR_RE(v1)*k.mx) * kmag_inv, (SCALAR_IM(v0)*k.nx - SCALAR_IM(v1)*k.mx) * kmag_inv); ASSIGN_SCALAR(a[1], (SCALAR_RE(v0)*k.ny - SCALAR_RE(v1)*k.my) * kmag_inv, (SCALAR_IM(v0)*k.ny - SCALAR_IM(v1)*k.my) * kmag_inv); ASSIGN_SCALAR(a[2], (SCALAR_RE(v0)*k.nz - SCALAR_RE(v1)*k.mz) * kmag_inv, (SCALAR_IM(v0)*k.nz - SCALAR_IM(v1)*k.mz) * kmag_inv); } /* Compute 'v' * scale, where a = k x v, going from cartesian to transverse coordinates. Since v is tranvserse to k, we can compute this inverse exactly. */ static void assign_crossinv_c2t(scalar *v, int vstride, const k_data k, const scalar *a, real scale) { /* As in assign_crossinv_t2c above, we find: v = v_transverse = -1/k^2 * k x a So, we do the same thing as in assign_cross_c2t of maxwell_op.c, with the additional -1/k^2 factor. */ scalar a0 = a[0], a1 = a[1], a2 = a[2]; scalar at0, at1; ASSIGN_SCALAR(at0, SCALAR_RE(a0)*k.mx + SCALAR_RE(a1)*k.my + SCALAR_RE(a2)*k.mz, SCALAR_IM(a0)*k.mx + SCALAR_IM(a1)*k.my + SCALAR_IM(a2)*k.mz); ASSIGN_SCALAR(at1, SCALAR_RE(a0)*k.nx + SCALAR_RE(a1)*k.ny + SCALAR_RE(a2)*k.nz, SCALAR_IM(a0)*k.nx + SCALAR_IM(a1)*k.ny + SCALAR_IM(a2)*k.nz); /* combine scale factor and k * (-1/k^2) */ scale = -scale / FIX_DENOM(k.kmag); ASSIGN_SCALAR(v[0], - scale * SCALAR_RE(at1), - scale * SCALAR_IM(at1)); ASSIGN_SCALAR(v[vstride], scale * SCALAR_RE(at0), scale * SCALAR_IM(at0)); } /* Fancy preconditioner. This is very similar to maxwell_op, except that the steps are (approximately) inverted: */ void maxwell_preconditioner2(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { maxwell_data *d = (maxwell_data *) data; int cur_band_start; scalar *fft_data; scalar_complex *cdata; real scale; int i, j, b; CHECK(d, "null maxwell data pointer!"); CHECK(Xin.c == 2, "fields don't have 2 components!"); if (Xout.data != Xin.data) evectmatrix_XeYS(Xout, Xin, YtY, 1); fft_data = d->fft_data; cdata = (scalar_complex *) fft_data; scale = -1.0 / Xout.N; /* scale factor to normalize FFT; negative sign comes from 2 i's from curls */ for (cur_band_start = 0; cur_band_start < Xout.p; cur_band_start += d->num_fft_bands) { int cur_num_bands = MIN2(d->num_fft_bands, Xout.p - cur_band_start); /********************************************/ /* Compute approx. inverse of curl (inverse cross product with k): */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_crossinv_t2c(&fft_data[3 * (ij2*cur_num_bands + b)], cur_k, &Xout.data[ij * 2 * Xout.p + b + cur_band_start], Xout.p); } /********************************************/ /* Multiply by epsilon: */ /* convert to position space via FFT: */ maxwell_compute_fft(+1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); /* multiply by epsilon in position space. Don't bother to invert the whole epsilon-inverse tensor; just take the inverse of the average epsilon-inverse (= trace / 3). */ for (i = 0; i < d->fft_output_size; ++i) { symmetric_matrix eps_inv = d->eps_inv[i]; real eps = 3.0 / (eps_inv.m00 + eps_inv.m11 + eps_inv.m22); for (b = 0; b < cur_num_bands; ++b) { int ib = 3 * (i * cur_num_bands + b); cdata[ib].re *= eps; cdata[ib].im *= eps; cdata[ib+1].re *= eps; cdata[ib+1].im *= eps; cdata[ib+2].re *= eps; cdata[ib+2].im *= eps; } } /* convert back to Fourier space */ maxwell_compute_fft(-1, d, fft_data, cur_num_bands*3, cur_num_bands*3, 1); /********************************************/ /* Finally, do second inverse curl (inverse cross product with k): */ for (i = 0; i < d->other_dims; ++i) for (j = 0; j < d->last_dim; ++j) { int ij = i * d->last_dim + j; int ij2 = i * d->last_dim_size + j; k_data cur_k = d->k_plus_G[ij]; for (b = 0; b < cur_num_bands; ++b) assign_crossinv_c2t(&Xout.data[ij * 2 * Xout.p + b + cur_band_start], Xout.p, cur_k, &fft_data[3 * (ij2*cur_num_bands + b)], scale); } /********************************************/ } /* end of cur_band_start loop */ } void maxwell_target_preconditioner2(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { maxwell_target_data *d = (maxwell_target_data *) data; maxwell_preconditioner2(Xin, Xout, d->d, Y, eigenvals, YtY); maxwell_preconditioner2(Xout, Xout, d->d, Y, eigenvals, YtY); } mpb-1.4.2/src/util/0002755000175400001440000000000007631010727007606 5mpb-1.4.2/src/util/Makefile.in0000644000175400001440000000072207540733107011575 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I. @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ AR = ar all: libs OBJECTS = debug_malloc.o mpi_utils.o LIBNAME = util.a libs: $(LIBNAME) util.a: $(OBJECTS) rm -f $@ $(AR) r $@ $(OBJECTS) $(RANLIB) $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ clean: rm -f $(OBJECTS) core $(LIBNAME) mpb-1.4.2/src/util/check.h0000644000175400001440000000453307446555440010771 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef CHECK_H #define CHECK_H #ifdef CHECK_DISABLE #define CHECK(condition, message) /* do nothing */ #else /* not CHECK_DISABLE */ #include #ifdef DEBUG extern void check_breakpoint(void); #define CHECK_BREAKPOINT check_breakpoint() /* defined in debug_malloc.c */ #else #define CHECK_BREAKPOINT /* nothing */ #endif #define CHECK(condition, message) do { \ if (!(condition)) { \ CHECK_BREAKPOINT; \ mpi_die("CHECK failure on line %d of " __FILE__ ": " \ message "\n", __LINE__); \ } \ } while (0) #endif /* not CHECK_DISABLE */ extern void* (*my_malloc_hook) (size_t); #ifdef DEBUG_MALLOC extern void *debug_malloc(size_t n); extern void debug_free(void *p); # define malloc debug_malloc # define free debug_free #endif /* Macro to check whether a floating-point number contains a ridiculous value. Note that x != x if and only if x is a NaN. */ #define BADNUM(x) ((x) != (x) || (x) > 1e50 || (x) < -1e50) extern void debug_output_malloc_count(void); extern void debug_check_memory_leaks(void); #define CHK_MALLOC(p, t, n) { \ size_t CHK_MALLOC_n_tmp = (n); \ if (my_malloc_hook) \ (p) = (t *) my_malloc_hook(sizeof(t) * CHK_MALLOC_n_tmp); \ else \ (p) = (t *) malloc(sizeof(t) * CHK_MALLOC_n_tmp); \ CHECK((p) || CHK_MALLOC_n_tmp == 0, "out of memory!"); \ } #endif /* CHECK_H */ mpb-1.4.2/src/util/debug_malloc.c0000644000175400001440000001071007446555440012316 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ /* Debugging versions of malloc & free, to help catch common errors. The routines in this file were adapted from similar routines in the FFTW library (www.fftw.org), written by Matteo Frigo and Steven G. Johnson. FFTW is also GPLed and is also copyrighted by MIT. */ #include #include #include "../config.h" #ifdef HAVE_MALLOC_H #include #endif #include "mpi_utils.h" #include "check.h" extern void* (*my_malloc_hook) (size_t) = 0; /********************************************************** * DEBUGGING CODE **********************************************************/ #ifdef DEBUG void check_breakpoint(void) { /* this function is only here so that we can drop into a breakpoint in a debugger when a CHECK macro fails... */ } #endif #ifdef DEBUG_MALLOC # undef malloc # undef free /* * debugging malloc/free. Initialize every malloced and freed area to * random values, just to make sure we are not using uninitialized * pointers. Also check for writes past the ends of allocated blocks, * and a couple of other things. * */ static int debug_malloc_cnt = 0; static int debug_malloc_total = 0; #define MAGIC 0xABadCafe #define MMAGIC (((int) MAGIC) < 0 ? ((int) MAGIC) : -((int) MAGIC)) #define PAD_FACTOR 2 #define TWOINTS (2 * sizeof(int)) #define VERBOSE_ALLOCATION 0 #if VERBOSE_ALLOCATION #define WHEN_VERBOSE(a) a #else #define WHEN_VERBOSE(a) #endif void *debug_malloc(size_t n) { char *p; int i; WHEN_VERBOSE(mpi_one_fprintf(stdout,"DEBUG_MALLOC %d\n", n)); if (n == 0) mpi_one_fprintf(stderr, "(Allocating a block of zero size.)\n"); debug_malloc_total += n; p = (char *) malloc(PAD_FACTOR * n + TWOINTS); CHECK(p, "debug_malloc: out of memory\n"); /* store the size in a known position */ ((int *) p)[0] = n; ((int *) p)[1] = MAGIC; for (i = 0; i < PAD_FACTOR * n; ++i) p[i + TWOINTS] = (char) (i ^ 0xDEADBEEF); ++debug_malloc_cnt; /* skip the size we stored previously */ return (void *) (p + TWOINTS); } void debug_free(void *p) { char *q = ((char *) p) - TWOINTS; CHECK(p, "debug_free: tried to free NULL pointer!\n"); CHECK(q, "debug_free: tried to free NULL+TWOINTS pointer!\n"); { int n = ((int *) q)[0]; int magic = ((int *) q)[1]; int i; WHEN_VERBOSE(mpi_one_fprintf(stdout,"DEBUG_FREE %d\n", n)); CHECK(n != MMAGIC, "Tried to free a freed pointer!\n"); *((int *) q) = MMAGIC; /* to detect duplicate free's */ CHECK(magic == MAGIC, "Wrong magic in debug_free()!\n"); ((int *) q)[1] = ~MAGIC; CHECK(n >= 0, "Tried to free block with corrupt size descriptor!\n"); debug_malloc_total -= n; CHECK(debug_malloc_total >= 0, "debug_malloc_total went negative!\n"); /* check for writing past end of array: */ for (i = n; i < PAD_FACTOR * n; ++i) if (q[i + TWOINTS] != (char) (i ^ 0xDEADBEEF)) mpi_die("Byte %d past end of array has changed!\n" "Array bounds overwritten!\n", i - n + 1); for (i = 0; i < PAD_FACTOR * n; ++i) q[i + TWOINTS] = (char) (i ^ 0xBEEFDEAD); --debug_malloc_cnt; free(q); } } #endif /* DEBUG */ /* output current memory usage: */ void debug_output_malloc_count(void) { #ifdef DEBUG_MALLOC mpi_one_fprintf(stderr, "malloc: %d blocks, %g kB\n", debug_malloc_cnt, debug_malloc_total / 1024.0); #endif } /* check for memory leaks when debugging */ void debug_check_memory_leaks(void) { #ifdef DEBUG_MALLOC if (debug_malloc_cnt || debug_malloc_total) mpi_die("MEMORY LEAK!!!\n" "number of unbalanced malloc calls = %d\n" "total leaked bytes = %d\n", debug_malloc_cnt, debug_malloc_total); #endif } mpb-1.4.2/src/util/mpi_utils.c0000644000175400001440000000663307441753311011707 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../config.h" #include #include #include "mpi_utils.h" /* die when fatal errors occur */ void mpi_die(const char *template, ...) { va_list ap; va_start(ap, template); vfprintf(stderr, template, ap); va_end(ap); MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE); } /* Like printf, except only does anything on master process. */ void mpi_one_printf(const char *template, ...) { if (mpi_is_master()) { va_list ap; va_start(ap, template); vprintf(template, ap); va_end(ap); } } /* Like fprintf, except only does anything on master process. */ void mpi_one_fprintf(FILE *f, const char *template, ...) { if (mpi_is_master()) { va_list ap; va_start(ap, template); vfprintf(f, template, ap); va_end(ap); } } /* Return whether we are the master process (rank == 0). */ int mpi_is_master(void) { int process_rank; MPI_Comm_rank(MPI_COMM_WORLD, &process_rank); return (process_rank == 0); } /* When debugging, checks to see that x is the same over all processes, and abort the program if it is not. */ void mpi_assert_equal(double x) { #ifdef DEBUG double xmin, xmax; mpi_allreduce(&x, &xmin, 1, double, MPI_DOUBLE, MPI_MIN, MPI_COMM_WORLD); mpi_allreduce(&x, &xmax, 1, double, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); CHECK(xmin == x && xmax == x, "mpi_assert_equal failure"); #endif } /* The following functions bracket a "critical section," a region of code that should be executed by only one process at a time. They work by having each process wait for a message from the previous process before starting. Each critical section is passed an integer "tag"...ideally, this should be a unique identifier for each critical section so that messages from different critical sections don't get mixed up somehow. */ void mpi_begin_critical_section(int tag) { int process_rank; MPI_Comm_rank(MPI_COMM_WORLD, &process_rank); if (process_rank > 0) { /* wait for a message before continuing */ MPI_Status status; int recv_tag = tag - 1; /* initialize to wrong value */ MPI_Recv(&recv_tag, 1, MPI_INT, process_rank - 1, tag, MPI_COMM_WORLD, &status); CHECK(recv_tag == tag, "invalid tag received"); } } void mpi_end_critical_section(int tag) { int process_rank, num_procs; MPI_Comm_rank(MPI_COMM_WORLD, &process_rank); MPI_Comm_size(MPI_COMM_WORLD, &num_procs); if (process_rank != num_procs - 1) { /* send a message to next process */ MPI_Send(&tag, 1, MPI_INT, process_rank + 1, tag, MPI_COMM_WORLD); } } mpb-1.4.2/src/util/mpi_utils.h0000644000175400001440000000314407441753311011706 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MPI_UTILS_H #define MPI_UTILS_H #include extern void mpi_die(const char *template, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; extern void mpi_one_fprintf(FILE *f, const char *template, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif ; extern void mpi_one_printf(const char *template, ...) #ifdef __GNUC__ __attribute__ ((format (printf, 1, 2))) #endif ; extern int mpi_is_master(void); extern void mpi_assert_equal(double x); extern void mpi_begin_critical_section(int tag); extern void mpi_end_critical_section(int tag); /* "in-place" Allreduce wrapper for reducing a single value */ #define mpi_allreduce_1(b, ctype, t, op, comm) { \ ctype bbbb = *(b); \ mpi_allreduce(&bbbb, (b), 1, ctype, t, op, comm); \ } #endif /* MPI_UTILS_H */ mpb-1.4.2/src/util/mpiglue.h0000644000175400001440000000525507441753311011350 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #ifndef MPIGLUE_H #define MPIGLUE_H /* This header file stands between our code and MPI. If MPI is present, we just #include . Otherwise, we use no-op stubs for MPI routines. */ #ifdef HAVE_MPI #include typedef double mpiglue_clock_t; #define MPIGLUE_CLOCK MPI_Wtime() #define MPIGLUE_CLOCK_DIFF(t2, t1) ((t2) - (t1)) #define mpi_allreduce(sb, rb, n, ctype, t, op, comm) \ MPI_Allreduce(sb,rb,n,t,op,comm) #else /* don't have MPI */ #include #include #include #define MPI_Init(argc,argv) 0 #define MPI_Finalize() 0 /* Stub for the MPI_Allreduce function, differing only by the addition of a "ctype" parameter that is the C type for the buffers. This routine just loops over the buffers and assigns sb to rb, since all of the MPI reduce operations become simple assignments on a single processor. (Our original implementation required rb == sb, but it seems that MPI implementations do not allow this. The MPI 2.0 specification supports an MPI_IN_PLACE constant that you can pass for sb in order to be in-place, but I don't want to require that. */ #define mpi_allreduce(sb, rb, n, ctype, t, op, comm) { \ CHECK((sb) != (rb), "MPI_Allreduce doesn't work for sendbuf == recvbuf");\ memcpy((rb), (sb), (n) * sizeof(ctype)); \ } #define MPI_Bcast(b, n, t, root, comm) 0 #define MPI_Abort(comm, errcode) exit(errcode) #define MPI_Barrier(comm) 0 #define MPI_Comm_rank(comm, rankp) *(rankp) = 0 #define MPI_Comm_size(comm, sizep) *(sizep) = 1 #define MPI_Send(sb,n,t, r,tag, comm) \ CHECK(0, "MPI_Send stub is non-functional"); #define MPI_Recv(sb,n,t, r,tag, comm,statp) \ CHECK(0, "MPI_Recv stub is non-functional"); typedef int MPI_Status; typedef clock_t mpiglue_clock_t; #define MPIGLUE_CLOCK clock() #define MPIGLUE_CLOCK_DIFF(t2, t1) (((t2) - (t1)) * 1.0 / CLOCKS_PER_SEC) #endif /* HAVE_MPI */ #endif /* MPIGLUE_H */ mpb-1.4.2/src/config.h.in0000644000175400001440000001174207631010734010575 /* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to disable sanity checks in code */ #undef CHECK_DISABLE /* Define to turn on debugging checks */ #undef DEBUG /* Define to use debugging malloc/free */ #undef DEBUG_MALLOC /* Define when using the profiler tool */ #undef ENABLE_PROF /* Define to dummy `main' function (if any) required to link to the Fortran 77 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 you have a BLAS library. */ #undef HAVE_BLAS /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `H5Pset_fapl_mpio' function. */ #undef HAVE_H5PSET_FAPL_MPIO /* Define to 1 if you have the `H5Pset_mpi' function. */ #undef HAVE_H5PSET_MPI /* Define if we have & link HDF5 */ #undef HAVE_HDF5 /* Define to 1 if you have the header file. */ #undef HAVE_HDF5_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have LAPACK library. */ #undef HAVE_LAPACK /* Define to 1 if you have the `ctl' library (-lctl). */ #undef HAVE_LIBCTL /* Define to 1 if you have the `dfftw' library (-ldfftw). */ #undef HAVE_LIBDFFTW /* Define to 1 if you have the `dfftw_mpi' library (-ldfftw_mpi). */ #undef HAVE_LIBDFFTW_MPI /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `drfftw' library (-ldrfftw). */ #undef HAVE_LIBDRFFTW /* Define to 1 if you have the `drfftw_mpi' library (-ldrfftw_mpi). */ #undef HAVE_LIBDRFFTW_MPI /* Define to 1 if you have the `efence' library (-lefence). */ #undef HAVE_LIBEFENCE /* Define to 1 if you have the `fftw' library (-lfftw). */ #undef HAVE_LIBFFTW /* Define to 1 if you have the `fftw_mpi' library (-lfftw_mpi). */ #undef HAVE_LIBFFTW_MPI /* Define to 1 if you have the `guile' library (-lguile). */ #undef HAVE_LIBGUILE /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `rfftw' library (-lrfftw). */ #undef HAVE_LIBRFFTW /* Define to 1 if you have the `rfftw_mpi' library (-lrfftw_mpi). */ #undef HAVE_LIBRFFTW_MPI /* Define to 1 if you have the `sfftw' library (-lsfftw). */ #undef HAVE_LIBSFFTW /* Define to 1 if you have the `sfftw_mpi' library (-lsfftw_mpi). */ #undef HAVE_LIBSFFTW_MPI /* Define to 1 if you have the `srfftw' library (-lsrfftw). */ #undef HAVE_LIBSRFFTW /* Define to 1 if you have the `srfftw_mpi' library (-lsrfftw_mpi). */ #undef HAVE_LIBSRFFTW_MPI /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define if you have & link an MPI library. */ #undef HAVE_MPI /* Define to 1 if you have the `scm_make_smob_type' function. */ #undef HAVE_SCM_MAKE_SMOB_TYPE /* define if we have SCM_NEWSMOB */ #undef HAVE_SCM_NEWSMOB /* define if we have SCM_SMOB_DATA */ #undef HAVE_SCM_SMOB_DATA /* define if we have SCM_SMOB_PREDICATE */ #undef HAVE_SCM_SMOB_PREDICATE /* 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 `strncmp' function. */ #undef HAVE_STRNCMP /* 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 if calling Fortran functions directly doesn't work. */ #undef NO_FORTRAN_FUNCTIONS /* 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 use complex fields and not to require inversion symmetry */ #undef SCALAR_COMPLEX /* Define to use single precision */ #undef SCALAR_SINGLE_PREC /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to support Hermitian/complex dielectric tensors. */ #undef WITH_HERMITIAN_EPSILON /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define as `__inline' if that's what the C compiler calls it, or to nothing if it is not supported. */ #undef inline mpb-1.4.2/tests/0002755000175400001440000000000007631010730007176 5mpb-1.4.2/tests/Makefile.in0000644000175400001440000000306507540733107011176 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I../src/util -I../src/matrices -I../src/maxwell @CPPFLAGS@ DEFS = @DEFS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ MYLIBS = ../src/maxwell/maxwell.a \ ../src/matrices/matrices.a \ ../src/util/util.a all: blastest eigs_test maxwell_test malloctest normal_vectors libs: check: all rm -f blastest.out.test ./blastest | sed 's/\-0\.000\([ ,)]\)/ 0.000\1/g' | sed 's/\-0\.000$$/ 0.000/g' > blastest.out.test diff blastest.@SCALAR_TYPE@.out blastest.out.test ./maxwell_test -1 -c 1e-9 -x 256 -E 1e-3 @echo "**********************************************************" @echo " PASSED tests." @echo "**********************************************************" malloctest: malloctest.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) malloctest.o $(MYLIBS) $(LIBS) -o $@ blastest: blastest.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) blastest.o $(MYLIBS) $(LIBS) -o $@ eigs_test: eigs_test.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) eigs_test.o $(MYLIBS) $(LIBS) -o $@ maxwell_test: maxwell_test.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) maxwell_test.o $(MYLIBS) $(LIBS) -o $@ normal_vectors: normal_vectors.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) normal_vectors.o $(MYLIBS) $(LIBS) -o $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ clean: rm -f blastest eigs_test maxwell_test normal_vectors blastest.o \ eigs_test.o maxwell_test.o normal_vectors.o malloctest.o \ malloctest core mpb-1.4.2/tests/blastest.c0000644000175400001440000001202207446273552011117 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../src/config.h" #include #include extern void debug_check_memory_leaks(void); void printmat(scalar *A, int m, int n) { int i, j; for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { #ifdef SCALAR_COMPLEX printf(" (%6.3f,%6.3f)", A[i*n + j].re, A[i*n + j].im); #else printf(" %6.3f", A[i*n + j]); #endif } printf("\n"); } } void printmat_matlab(scalar *A, int m, int n) { int i, j; printf("["); for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { #ifdef SCALAR_COMPLEX printf(" %g+%gi", A[i*n + j].re, A[i*n + j].im); #else printf(" %g", A[i*n + j]); #endif } printf(";\n"); } printf("]\n"); } int main(void) { const int N = 4; int i,j; #ifndef SCALAR_COMPLEX scalar A[] = { 3.3, 6.2, 7.1, 9.1, -2.3, 3.6, 0.3, 9.7, 6.7, -0.1, 1.1, 4.8, 8.4, 7.7, 5.9, -1.8 }; scalar B[] = { 1.1, 2.2, 3.3, 4.4, 8.8, 7.7, 6.6, 5.5, 6.1, 8.2, 9.7, 3.6, 6.3, 2.9, 5.5, 8.1 }; #else scalar A[] = { {3.3, 6.2} , {7.1, 9.1}, {2.3, 8.2}, {-3.2, 6.6}, {-2.3, 3.6}, {0.3, 9.7}, {1.9,-4.9}, {7.1, 7.1}, {6.7, -0.1}, {1.1, 4.8}, {-9.7, 3.7}, {-0.01, -0.2}, {8.4, 7.7}, {5.9, -1.8}, {8.8, 9.9}, {0.0, 0.1} }; scalar B[] = { {1.1, 2.2}, {3.3, 4.4}, {1.2, 2.3}, {3.4, 4.5}, {8.8, 7.7}, {6.6, 5.5}, {3.5, 7.2}, {-0.3, 6.1}, {6.1, 8.2}, {9.7, 3.6}, {-5.1, 6.1}, {2.3, 8.1}, {6.3, 2.9}, {5.5, 8.1}, {8.5, 6.7}, {9.0, 2.4} }; #endif scalar C[16], D[16], E[16]; real eigvals[4], wrk[20]; printf("A = "); printmat_matlab(A,N,N); printf("B = "); printmat_matlab(B,N,N); blasglue_gemm('N', 'N', N, N, N, 1.0, A, N, B, N, 0.0, C, N); printf("\nC = A * B\n"); printmat(C,N,N); blasglue_gemm('N', 'N', N, N, N, 1.0, C, N, B, N, 0.0, D, N); printf("\nC * B\n"); printmat(D,N,N); blasglue_herk('U', 'C', N, N, 1.0, A, N, 0.0, D, N); /* Now, copy the conjugate of the upper half onto the lower half of D */ for (i = 0; i < N; ++i) for (j = i + 1; j < N; ++j) { ASSIGN_CONJ(D[j * N + i], D[i * N + j]); } printf("\nD = A' * A\n"); printmat(D,N,N); lapackglue_potrf('U', N, D, N); lapackglue_potri('U', N, D, N); /* Now, copy the conjugate of the upper half onto the lower half of D */ for (i = 0; i < N; ++i) for (j = i + 1; j < N; ++j) { ASSIGN_CONJ(D[j * N + i], D[i * N + j]); } printf("\ninverse(D)\n"); printmat(D,N,N); /* D = At * A, again */ blasglue_herk('U', 'C', N, N, 1.0, A, N, 0.0, D, N); /* Compute eigenvectors and eigenvalues: */ lapackglue_heev('V', 'U', N, D, N, eigvals, E, 16, wrk); /* Choose a deterministic phase for each row/eigenvector: */ for (i = 0; i < N; ++i) { scalar phase; real len; for (j = 0; (len = sqrt(SCALAR_NORMSQR(D[i*N + j]))) < 1e-6; ++j) ; /* phase to make D[i*N+j] purely real: */ ASSIGN_SCALAR(phase, SCALAR_RE(D[i*N+j])/len, -SCALAR_IM(D[i*N+j])/len); ASSIGN_MULT(D[i*N+j], D[i*N+j], phase); if (SCALAR_RE(D[i*N+j]) < 0) { /* pick deterministic (positive) sign */ ASSIGN_SCALAR(phase, -SCALAR_RE(phase), -SCALAR_IM(phase)); ASSIGN_SCALAR(D[i*N+j], -SCALAR_RE(D[i*N+j]),-SCALAR_IM(D[i*N+j])); } for (j = j + 1; j < N; ++j) ASSIGN_MULT(D[i*N + j], D[i*N + j], phase); } printf("\n[v,d] = eig(D);\n"); printf("\ndiag(d)\n "); for (i = 0; i < 4; ++i) printf(" %6.3f", eigvals[i]); printf("\nv'\n"); printmat(D,N,N); blasglue_gemm('C', 'N', N, N, N, 1.0, D, N, D, N, 0.0, C, N); printf("\nv * v'\n"); printmat(C,N,N); /* Compute E = diag(sqrt(eigenvals)) * D; i.e. the rows of E become the rows of D times sqrt(corresponding eigenvalue) */ for (i = 0; i < N; ++i) { CHECK(eigvals[i] > 0, "non-positive eigenvalue"); blasglue_copy(N, D + i*N, 1, E + i*N, 1); blasglue_rscal(N, sqrt(eigvals[i]), E + i*N, 1); } /* compute C = adjoint(D) * E == sqrt (At * A) */ blasglue_gemm('C', 'N', N, N, N, 1.0, D, N, E, N, 0.0, C, N); printf("\nsqrtm(D)\n"); printmat(C,N,N); blasglue_gemm('C', 'N', N, N, N, 1.0, E, N, E, N, 0.0, C, N); printf("\nsqrtm(D) * sqrtm(D)\n"); printmat(C,N,N); debug_check_memory_leaks(); return EXIT_SUCCESS; } mpb-1.4.2/tests/blastest.complex.out0000644000175400001440000000544707245270454013162 A = [ 3.3+6.2i 7.1+9.1i 2.3+8.2i -3.2+6.6i; -2.3+3.6i 0.3+9.7i 1.9+-4.9i 7.1+7.1i; 6.7+-0.1i 1.1+4.8i -9.7+3.7i -0.01+-0.2i; 8.4+7.7i 5.9+-1.8i 8.8+9.9i 0+0.1i; ] B = [ 1.1+2.2i 3.3+4.4i 1.2+2.3i 3.4+4.5i; 8.8+7.7i 6.6+5.5i 3.5+7.2i -0.3+6.1i; 6.1+8.2i 9.7+3.6i -5.1+6.1i 2.3+8.1i; 6.3+2.9i 5.5+8.1i 8.5+6.7i 9+2.4i; ] C = A * B (-110.110,250.010) (-97.850,232.290) (-184.140,104.870) (-180.090,165.720) (-6.590,137.580) (-57.190,123.300) (-46.850,179.640) ( 7.640,85.870) (-108.683, 7.081) (-102.435,66.669) ( 5.715,-39.797) (-58.270,-36.804) (30.290,189.720) (91.590,211.200) (-79.960,68.780) (-57.070,195.460) C * B (-6919.199,975.010) (-7883.329,1142.554) (-5063.800,-1300.820) (-6178.540,-503.102) (-3722.331,2056.288) (-3437.379,3032.270) (-2779.525,-251.145) (-3076.656,877.121) (-1449.081,-1030.123) (-1256.229,-1618.081) (-1020.338,-1211.081) (-877.937,-1626.178) (-3182.440,3668.914) (-4212.248,3649.090) (-3406.522,2136.486) (-3790.311,2409.382) D = A' * A (242.330, 0.000) (156.670,-65.660) (121.210,56.450) (40.313,-0.771) (156.670,65.660) (289.700, 0.000) (85.180,142.270) (107.189, 9.658) (121.210,-56.450) (85.180,-142.270) (383.380, 0.000) (25.807,92.557) (40.313, 0.771) (107.189,-9.658) (25.807,-92.557) (154.670, 0.000) inverse(D) ( 0.008, 0.000) (-0.006, 0.001) (-0.001, 0.002) ( 0.003, 0.001) (-0.006,-0.001) ( 0.018, 0.000) (-0.001,-0.010) (-0.017, 0.002) (-0.001,-0.002) (-0.001, 0.010) ( 0.010, 0.000) ( 0.000,-0.012) ( 0.003,-0.001) (-0.017,-0.002) ( 0.000, 0.012) ( 0.024, 0.000) [v,d] = eig(D); diag(d) 21.695 114.964 297.042 636.378 v' ( 0.167, 0.000) (-0.581,-0.074) (-0.005, 0.394) ( 0.688, 0.029) ( 0.829, 0.000) (-0.302, 0.197) (-0.172,-0.198) (-0.327, 0.086) ( 0.236, 0.000) ( 0.420,-0.151) (-0.582,-0.143) ( 0.381,-0.491) ( 0.479, 0.000) ( 0.518,-0.241) ( 0.584, 0.275) ( 0.139, 0.083) v * v' ( 1.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 1.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 1.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 1.000, 0.000) sqrtm(D) (14.249, 0.000) ( 4.839,-1.835) ( 3.176, 1.293) ( 0.852,-0.206) ( 4.839, 1.835) (14.680, 0.000) ( 2.138, 4.539) ( 4.715,-0.063) ( 3.176,-1.293) ( 2.138,-4.539) (18.171, 0.000) ( 0.469, 4.007) ( 0.852, 0.206) ( 4.715, 0.063) ( 0.469,-4.007) (10.742, 0.000) sqrtm(D) * sqrtm(D) (242.330, 0.000) (156.670,-65.660) (121.210,56.450) (40.313,-0.771) (156.670,65.660) (289.700, 0.000) (85.180,142.270) (107.189, 9.658) (121.210,-56.450) (85.180,-142.270) (383.380, 0.000) (25.807,92.557) (40.313, 0.771) (107.189,-9.658) (25.807,-92.557) (154.670, 0.000) mpb-1.4.2/tests/blastest.real.out0000644000175400001440000000264107245270454012427 A = [ 3.3 6.2 7.1 9.1; -2.3 3.6 0.3 9.7; 6.7 -0.1 1.1 4.8; 8.4 7.7 5.9 -1.8; ] B = [ 1.1 2.2 3.3 4.4; 8.8 7.7 6.6 5.5; 6.1 8.2 9.7 3.6; 6.3 2.9 5.5 8.1; ] C = A * B 158.830 139.610 170.730 147.890 92.090 53.250 72.430 89.330 43.440 36.910 58.520 71.770 101.650 120.930 125.870 85.970 C * B 3376.441 3253.290 3915.041 3279.244 1574.501 1465.606 1849.233 1682.392 1181.715 1067.772 1349.337 1186.150 2485.417 2436.238 2827.357 2261.864 D = A' * A 131.630 76.190 79.670 24.760 76.190 110.700 90.420 77.000 79.670 90.420 86.520 62.180 24.760 77.000 62.180 203.180 inverse(D) 0.020 0.006 -0.027 0.004 0.006 0.067 -0.073 -0.004 -0.027 -0.073 0.116 -0.005 0.004 -0.004 -0.005 0.007 [v,d] = eig(D); diag(d) 5.781 35.665 149.952 340.633 v' 0.166 0.566 -0.807 0.013 0.662 -0.622 -0.295 0.297 0.589 0.159 0.220 -0.761 0.433 0.518 0.461 0.576 v * v' 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 0.000 0.000 0.000 0.000 1.000 sqrtm(D) 10.390 3.048 3.783 0.293 3.048 8.333 4.828 2.943 3.783 4.828 6.603 2.302 0.293 2.943 2.302 13.753 sqrtm(D) * sqrtm(D) 131.630 76.190 79.670 24.760 76.190 110.700 90.420 77.000 79.670 90.420 86.520 62.180 24.760 77.000 62.180 203.180 mpb-1.4.2/tests/eigs_test.c0000644000175400001440000002456007441753311011265 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include #include "../src/config.h" #include #include #include #include static sqmatrix A, Ainv; #define MAX(a,b) ((a) > (b) ? (a) : (b)) #define MIN(a,b) ((a) < (b) ? (a) : (b)) extern void Aop(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work); extern void Ainvop(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void Cop(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY); extern void printmat(scalar *A, int m, int n, int ldn); extern void printmat_matlab(scalar *A, int m, int n); extern void debug_check_memory_leaks(void); real norm_diff(scalar *a, scalar *b, int n) { real bmag = 0.0, diffmag = 0.0; int i; for (i = 0; i < n; ++i) { scalar d; ASSIGN_SCALAR(d, SCALAR_RE(b[i]) - SCALAR_RE(a[i]), SCALAR_IM(b[i]) - SCALAR_IM(a[i])); bmag += SCALAR_NORMSQR(b[i]); diffmag += SCALAR_NORMSQR(d); } return sqrt(diffmag / bmag); } #define NWORK 3 int main(int argc, char **argv) { int i, j, n = 0, p; sqmatrix X, U, YtY; evectmatrix Y, Y2, Ystart, W[NWORK]; real *eigvals, *eigvals_dense, sum = 0.0; int num_iters; if (argc >= 2) n = atoi(argv[1]); srand(argc >= 3 ? atoi(argv[2]) : time(NULL)); CHECK(n > 0, "illegal argument\nSyntax: eigs_test []"); X = create_sqmatrix(n); A = create_sqmatrix(n); Ainv = create_sqmatrix(n); U = create_sqmatrix(n); /* fill X with random data */ for (i = 0; i < n*n; ++i) ASSIGN_SCALAR(X.data[i], rand() * 1.0 / RAND_MAX, rand() * 1.0 / RAND_MAX); /* assign A = adjoint(X) * X to get a Hermitian matrix: */ sqmatrix_AeBC(A, X, 1, X, 0); /* increase diagonal elements of A so that our preconditioner has a chance of being useful: */ for (i = 0; i < n; ++i) ASSIGN_SCALAR(A.data[i * n + i], n * SCALAR_RE(A.data[i * n + i]), n * SCALAR_IM(A.data[i * n + i])); sqmatrix_copy(U, A); sqmatrix_copy(Ainv, A); sqmatrix_invert(Ainv, 1, X); if (n <= 10) { printf("Solving for eigenvalues of %d x %d matrix: \nA = ", n, n); printmat_matlab(A.data, n, n); } CHK_MALLOC(eigvals_dense, real, n); sqmatrix_eigensolve(U, eigvals_dense, X); /* The eigenvectors are actually the columns of U'. Assign U = U': */ for (i = 0; i < n; ++i) for (j = i + 1; j < n; ++j) { scalar dummy; dummy = U.data[i*n + j]; U.data[i*n + j] = U.data[j*n + i]; U.data[j*n + i] = dummy; } for (i = 0; i < n * n; ++i) ASSIGN_CONJ(U.data[i], U.data[i]); p = MIN(MIN(5, MAX(n/4, 2)), n); printf("\nSolving for %d eigenvals out of %d.\n", p, n); printf("\nSolved A by dense eigensolver.\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals_dense[i]; printf(" %f", eigvals_dense[i]); } printf("\nEigenvalue sum = %f\n", sum); printf("\nEigenvectors are (by column): \n"); printmat(U.data, n, p, n); YtY = create_sqmatrix(p); Y = create_evectmatrix(n, 1, p, n, 0, n); Y2 = create_evectmatrix(n, 1, p, n, 0, n); Ystart = create_evectmatrix(n, 1, p, n, 0, n); for (i = 0; i < NWORK; ++i) W[i] = create_evectmatrix(n, 1, p, n, 0, n); CHK_MALLOC(eigvals, real, p); for (i = 0; i < n*p; ++i) ASSIGN_REAL(Ystart.data[i], rand() * 1.0 / RAND_MAX); /* Check inverse Ainvop: */ Aop(Ystart, Y, NULL, 0, Y2); Ainvop(Y, Y2, NULL, Ystart, NULL, U); printf("\nDifference |Y - (1/A)*A*Y| / |Y| = %g\n", norm_diff(Ystart.data, Y2.data, Y.n * Y.p)); evectmatrix_copy(Y, Ystart); eigensolver(Y, eigvals, Aop, NULL, Cop, NULL, NULL, NULL, W, NWORK, 1e-10,&num_iters, EIGS_DEFAULT_FLAGS); printf("\nSolved for eigenvectors after %d iterations.\n", num_iters); printf("\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals[i]; printf(" %f", eigvals[i]); } printf("\nEigenvalue sum = %f\n", sum); /* Change phase of eigenvectors to match those solved for previously: */ for (i = 0; i < p; ++i) { scalar phase; ASSIGN_DIV(phase, U.data[i], Y.data[i]); for (j = 0; j < n; ++j) { ASSIGN_MULT(Y.data[j*p + i], Y.data[j*p + i], phase); } } printf("Eigenvectors are (by column): \n"); printmat(Y.data, n, p, p); evectmatrix_XtX(YtY, Y, U); printf("adjoint(Y) * Y:\n"); printmat(YtY.data, p, p, p); printf("\nSolving with exact inverse preconditioner...\n"); evectmatrix_copy(Y, Ystart); eigensolver(Y, eigvals, Aop, NULL, Ainvop, NULL, NULL, NULL, W, NWORK, 1e-10, &num_iters, EIGS_DEFAULT_FLAGS); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals[i]; printf(" %f", eigvals[i]); } printf("\nEigenvalue sum = %f\n", sum); printf("\nSolving without conjugate-gradient...\n"); evectmatrix_copy(Y, Ystart); eigensolver(Y, eigvals, Aop, NULL, Cop, NULL, NULL, NULL, W, NWORK - 1, 1e-10, &num_iters, EIGS_DEFAULT_FLAGS); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals[i]; printf(" %f", eigvals[i]); } printf("\nEigenvalue sum = %f\n", sum); printf("\nSolving without preconditioning...\n"); evectmatrix_copy(Y, Ystart); eigensolver(Y, eigvals, Aop, NULL, NULL, NULL, NULL, NULL, W, NWORK, 1e-10, &num_iters, EIGS_DEFAULT_FLAGS); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals[i]; printf(" %f", eigvals[i]); } printf("\nEigenvalue sum = %f\n", sum); printf("\nSolving without conjugate-gradient or preconditioning...\n"); evectmatrix_copy(Y, Ystart); eigensolver(Y, eigvals, Aop, NULL, NULL, NULL, NULL, NULL, W, NWORK - 1, 1e-10, &num_iters, EIGS_DEFAULT_FLAGS); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("\nEigenvalues = "); for (sum = 0.0, i = 0; i < p; ++i) { sum += eigvals[i]; printf(" %f", eigvals[i]); } printf("\nEigenvalue sum = %f\n", sum); destroy_sqmatrix(A); destroy_sqmatrix(Ainv); destroy_sqmatrix(X); destroy_sqmatrix(U); destroy_sqmatrix(YtY); destroy_evectmatrix(Y); destroy_evectmatrix(Y2); destroy_evectmatrix(Ystart); for (i = 0; i < NWORK; ++i) destroy_evectmatrix(W[i]); free(eigvals); free(eigvals_dense); debug_check_memory_leaks(); return EXIT_SUCCESS; } void Aop(evectmatrix Xin, evectmatrix Xout, void *data, int is_current_eigenvector, evectmatrix Work) { CHECK(A.p == Xin.n && A.p == Xout.n && Xin.p == Xout.p, "matrices not conformant"); blasglue_gemm('N', 'N', Xout.n, Xout.p, Xin.n, 1.0, A.data, A.p, Xin.data, Xin.p, 0.0, Xout.data, Xout.p); } void Ainvop(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { CHECK(Ainv.p == Xin.n && Ainv.p == Xout.n && Xin.p == Xout.p, "matrices not conformant"); blasglue_gemm('N', 'N', Xout.n, Xout.p, Xin.n, 1.0, Ainv.data, Ainv.p, Xin.data, Xin.p, 0.0, Xout.data, Xout.p); } void Cop_old(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { int in, ip; CHECK(A.p == Xin.n && A.p == Xout.n && Xin.p == Xout.p, "matrices not conformant"); evectmatrix_XeYS(Xout, Xin, YtY, 1); for (in = 0; in < Xout.n; ++in) { real diag; diag = SCALAR_NORMSQR(A.data[in * A.p + in]); diag = (diag == 0.0) ? 1.0 : 1.0 / sqrt(diag); for (ip = 0; ip < Xout.p; ++ip) { scalar xin = Xout.data[in * Xout.p + ip]; ASSIGN_SCALAR(Xout.data[in * Xout.p + ip], diag * SCALAR_RE(xin), diag * SCALAR_IM(xin)); } } } void Cop(evectmatrix Xin, evectmatrix Xout, void *data, evectmatrix Y, real *eigenvals, sqmatrix YtY) { int in, ip; CHECK(A.p == Xin.n && A.p == Xout.n && Xin.p == Xout.p, "matrices not conformant"); evectmatrix_XeYS(Xout, Xin, YtY, 1); for (in = 0; in < Xout.n; ++in) { scalar diag = A.data[in * A.p + in]; for (ip = 0; ip < Xout.p; ++ip) { scalar scale; if (eigenvals) { ASSIGN_SCALAR(scale, SCALAR_RE(diag) - 0*eigenvals[ip], SCALAR_IM(diag)); } else scale = diag; ASSIGN_DIV(Xout.data[in * Xout.p + ip], Xout.data[in * Xout.p + ip], scale); } } } void printmat(scalar *A, int m, int n, int ldn) { int i, j; for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { #ifdef SCALAR_COMPLEX printf(" (%6.3f,%6.3f)", A[i*ldn + j].re, A[i*ldn + j].im); #else printf(" %6.3f", A[i*ldn + j]); #endif if (j > 7) { printf(" ..."); break; } } printf("\n"); if (i > 7) { printf(" ...\n"); break; } } } void printmat_matlab(scalar *A, int m, int n) { int i, j; printf("["); for (i = 0; i < m; ++i) { for (j = 0; j < n; ++j) { #ifdef SCALAR_COMPLEX printf(" %g+%gi", A[i*n + j].re, A[i*n + j].im); #else printf(" %g", A[i*n + j]); #endif } printf(";\n"); } printf("]\n"); } mpb-1.4.2/tests/malloctest.c0000644000175400001440000000437407441753311011447 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include "../src/config.h" #include #define NUM_POINTERS 1000 #define MAX_SIZE 65536 #define NUM_MALLOCS 3000000 int main(void) { char *pointers[NUM_POINTERS]; int i, iter; clock_t start_time; double elapsed_time; #ifdef DEBUG_MALLOC printf("Using debug_malloc and debug_free routines.\n"); #else fprintf(stderr, "***** NOTE: malloctest is designed to be run when the package\n" " is configured with --enable-debug, to test the\n" " debugging malloc/free routines.\n"); #endif srand(time(NULL)); for (i = 0; i < NUM_POINTERS; ++i) pointers[i] = NULL; printf("Doing %d malloc/free calls...\n", NUM_MALLOCS); start_time = clock(); for (iter = 0; iter < NUM_MALLOCS; ++iter) { i = rand() % NUM_POINTERS; if (pointers[i]) free(pointers[i]); CHK_MALLOC(pointers[i], char, rand() % MAX_SIZE + 1); if ((iter + 1) % (NUM_MALLOCS / 20) == 0) printf("...completed %d...\n", iter + 1); } elapsed_time = (clock() - start_time) * 1.0 / CLOCKS_PER_SEC; printf("Done.\n"); printf("Total time = %g seconds, %g us per iteration\n", elapsed_time, elapsed_time * 1e6 / NUM_MALLOCS); for (i = 0; i < NUM_POINTERS; ++i) if (pointers[i]) free(pointers[i]); #ifdef DEBUG_MALLOC debug_check_memory_leaks(); #endif printf("Okay.\n"); return EXIT_SUCCESS; } mpb-1.4.2/tests/maxwell_test.c0000644000175400001440000003741607441753311012013 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include #include "../src/config.h" #include #include #include #include #include #if defined(HAVE_GETOPT_H) # include #endif #if defined(HAVE_UNISTD_H) # include #endif #define NX 32 #define NY 1 #define NZ 1 #define NUM_BANDS 8 #define NUM_FFT_BANDS 5 #define NWORK 3 #define KX 0.5 #define EPS_LOW 1.00 #define EPS_HIGH 9.00 #define EPS_HIGH_X 0.25 #define ERROR_TOL 1e-4 #ifdef ENABLE_PROF # define PROF_ITERS 10 #else # define PROF_ITERS 1 #endif #define MESH_SIZE 7 /*************************************************************************/ typedef struct { real eps_high, eps_low, eps_high_x; } epsilon_data; #define INVERSION_SYM 1 static void epsilon(symmetric_matrix *eps, symmetric_matrix *eps_inv, real r[3], void *edata_v) { epsilon_data *edata = (epsilon_data *) edata_v; real eps_val; #if INVERSION_SYM if (fabs(r[0]) < 0.5*edata->eps_high_x || fabs(r[0]-1.0) < 0.5*edata->eps_high_x) eps_val = edata->eps_high; #else if ((r[0] < edata->eps_high_x && r[0] >= 0.0) || (r[0] >= 1.0 && r[0] - 1.0 < edata->eps_high_x)) eps_val = edata->eps_high; #endif else eps_val = edata->eps_low; eps->m00 = eps->m11 = eps->m22 = eps_val; eps_inv->m00 = eps_inv->m11 = eps_inv->m22 = 1.0 / eps_val; #ifdef WITH_HERMITIAN_EPSILON CASSIGN_ZERO(eps->m01); CASSIGN_ZERO(eps->m02); CASSIGN_ZERO(eps->m12); CASSIGN_ZERO(eps_inv->m01); CASSIGN_ZERO(eps_inv->m02); CASSIGN_ZERO(eps_inv->m12); #else eps->m01 = eps->m02 = eps->m12 = 0.0; eps_inv->m01 = eps_inv->m02 = eps_inv->m12 = 0.0; #endif } /*************************************************************************/ /* routines for analytic calculation of Bragg bands: */ static const double TWOPI = 6.2831853071795864769252867665590057683943388; /* We have an analytic expression for k as a function of omega for Bragg mirrors. This will have to be numerically inverted to find omega as a function of k. n1 and n2 are the indices of the two dielectrics, and f1 and f2 are their thicknesses as a fraction of the lattice constant (we should have f1 + f2 == 1). */ real analytic_bragg_k(real omega, real n1, real f1, real n2, real f2) { real phase1, phase2, c1, s1, c2, s2, b; CHECK(fabs(f1 + f2 - 1) < 1e-6, "invalid params to analytic_bragg_k"); phase1 = TWOPI * n1 * f1 * omega; phase2 = TWOPI * n2 * f2 * omega; c1 = cos(phase1); s1 = sin(phase1); c2 = cos(phase2); s2 = sin(phase2); b = c1*c2 - 0.5 * (n1/n2 + n2/n1) * s1*s2; if (fabs(b) > 1) return (-1.0); return fabs(atan2(sqrt(1-b*b), b) / TWOPI); } /* Solve for Bragg omega for the given k and other parameters, using omega_guess as a starting guess. We can't do anything clever like Newton's method or even an ordinary bisection search because there are regions of omega in which analytic_bragg_k is not defined (i.e. in the band gap). */ real bragg_omega(real omega_guess, real k, real n1, real f1, real n2, real f2, real tolerance) { real omega_guess_low = omega_guess - 0.2, omega_guess_high = omega_guess + 0.2; real k_cur; real k_best = -1.0, omega_best = 0.0; real tol; if (omega_guess_low < 0.0) omega_guess_low = 0.0; for (tol = (omega_guess_high - omega_guess_low) / 10.0; tol > tolerance; tol *= 0.25) { for (omega_guess = omega_guess_low + tol; omega_guess < omega_guess_high; omega_guess += tol) { k_cur = analytic_bragg_k(omega_guess, n1, f1, n2, f2); if (fabs(k_cur - k) < fabs(k_best - k)) { k_best = k_cur; omega_best = omega_guess; } } CHECK(k_best > 0.0, "No valid omega values in guess range!"); omega_guess_low = omega_best - tol; omega_guess_high = omega_best + tol; } return omega_best; } /*************************************************************************/ real norm_diff(scalar *a, scalar *b, int n) { real bmag = 0.0, diffmag = 0.0; int i; for (i = 0; i < n; ++i) { scalar d; ASSIGN_SCALAR(d, SCALAR_RE(b[i]) - SCALAR_RE(a[i]), SCALAR_IM(b[i]) - SCALAR_IM(a[i])); bmag += SCALAR_NORMSQR(b[i]); diffmag += SCALAR_NORMSQR(d); } return sqrt(diffmag / bmag); } /*************************************************************************/ void usage(void) { printf("Syntax: maxwell_test [options]\n" "Options:\n" " -h Print this help\n" " -s Set random seed\n" " -k Set kx wavevector component [dflt. = %f]\n" " -b Compute n bands [default = %d]\n" " -n Specify high-dielectric index [dflt. = %f]\n" " -f Specify high-index fill fraction [dflt. = %f]\n" " -x Use nx points in x direction [dflt. = %d]\n" " -y Use ny points in y direction [dflt. = %d]\n" " -z Use nz points in z direction [dflt. = %d]\n" " -e Solve for TE polarization only.\n" " -m Solve for TM polarization only.\n" " -t Set target frequency [dflt. none].\n" " -c Set convergence tolerance [dflt. %e].\n" " -g Set mesh size [dflt. %d].\n" " -1 Stop after first computation.\n" " -p Use simple preconditioner.\n" " -E Exit with error if the error exceeds \n" " -v Verbose output.\n", KX, NUM_BANDS, sqrt(EPS_HIGH), EPS_HIGH_X, NX, NY, NZ, ERROR_TOL, MESH_SIZE); } /*************************************************************************/ int main(int argc, char **argv) { maxwell_data *mdata; maxwell_target_data *mtdata = NULL; int local_N, N_start, alloc_N; real R[3][3] = { {1,0,0}, {0,0.01,0}, {0,0,0.01} }; real G[3][3] = { {1,0,0}, {0,100,0}, {0,0,100} }; real kvector[3] = {KX,0,0}; evectmatrix H, Hstart, W[NWORK]; real *eigvals; int i, iters; int num_iters; int parity = NO_PARITY; int nx = NX, ny = NY, nz = NZ; int num_bands = NUM_BANDS; real target_freq = 0.0; int do_target = 0; evectoperator op; evectpreconditioner pre_op; void *op_data, *pre_op_data; real error_tol = ERROR_TOL; int mesh_size = MESH_SIZE, mesh[3]; epsilon_data ed; int stop1 = 0; int verbose = 0; int which_preconditioner = 2; double max_err = 1e20; srand(time(NULL)); ed.eps_high = EPS_HIGH; ed.eps_low = EPS_LOW; ed.eps_high_x = EPS_HIGH_X; #ifdef HAVE_GETOPT { extern char *optarg; extern int optind; int c; while ((c = getopt(argc, argv, "hs:k:b:n:f:x:y:z:emt:c:g:1pvE:")) != -1) switch (c) { case 'h': usage(); exit(EXIT_SUCCESS); break; case 's': srand(atoi(optarg)); break; case 'k': kvector[0] = atof(optarg); break; case 'b': num_bands = atoi(optarg); CHECK(num_bands > 0, "num_bands must be positive"); break; case 'n': ed.eps_high = atof(optarg); CHECK(ed.eps_high > 0.0, "index must be positive"); ed.eps_high = ed.eps_high * ed.eps_high; break; case 'f': ed.eps_high_x = atof(optarg); CHECK(ed.eps_high_x > 0.0, "fill must be positive"); break; case 'x': nx = atoi(optarg); CHECK(nx > 0, "x size must be positive"); break; case 'y': ny = atoi(optarg); CHECK(ny > 0, "y size must be positive"); break; case 'z': nz = atoi(optarg); CHECK(nz > 0, "z size must be positive"); break; case 'e': parity = EVEN_Z_PARITY; break; case 'm': parity = ODD_Z_PARITY; break; case 't': target_freq = fabs(atof(optarg)); do_target = 1; break; case 'E': max_err = fabs(atof(optarg)); CHECK(max_err > 0, "maximum error must be positive"); break; case 'c': error_tol = fabs(atof(optarg)); break; case 'g': mesh_size = atoi(optarg); CHECK(mesh_size > 0, "mesh size must be positive"); break; case '1': stop1 = 1; break; case 'p': which_preconditioner = 1; break; case 'v': verbose = 1; break; default: usage(); exit(EXIT_FAILURE); } if (argc != optind) { usage(); exit(EXIT_FAILURE); } } #endif #ifdef ENABLE_PROF stop1 = 1; #endif mesh[0] = mesh[1] = mesh[2] = mesh_size; printf("Creating Maxwell data...\n"); mdata = create_maxwell_data(nx, ny, nz, &local_N, &N_start, &alloc_N, num_bands, NUM_FFT_BANDS); CHECK(mdata, "NULL mdata"); set_maxwell_data_parity(mdata, parity); printf("Setting k vector to (%g, %g, %g)...\n", kvector[0], kvector[1], kvector[2]); update_maxwell_data_k(mdata, kvector, G[0], G[1], G[2]); printf("Initializing dielectric...\n"); /* set up dielectric function (a simple Bragg mirror) */ set_maxwell_dielectric(mdata, mesh, R, G, epsilon, &ed); if (verbose && ny == 1 && nz == 1) { printf("dielectric function:\n"); for (i = 0; i < nx; ++i) { if (mdata->eps_inv[i].m00 == mdata->eps_inv[i].m11) printf(" eps(%g) = %g\n", i * 1.0 / nx, 1.0/mdata->eps_inv[i].m00); else printf(" eps(%g) = x: %g OR y: %g\n", i * 1.0 / nx, 1.0/mdata->eps_inv[i].m00, 1.0/mdata->eps_inv[i].m11); } printf("\n"); } printf("Allocating fields...\n"); H = create_evectmatrix(nx * ny * nz, 2, num_bands, local_N, N_start, alloc_N); Hstart = create_evectmatrix(nx * ny * nz, 2, num_bands, local_N, N_start, alloc_N); for (i = 0; i < NWORK; ++i) W[i] = create_evectmatrix(nx * ny * nz, 2, num_bands, local_N, N_start, alloc_N); CHK_MALLOC(eigvals, real, num_bands); for (iters = 0; iters < PROF_ITERS; ++iters) { printf("Initializing fields...\n"); for (i = 0; i < H.n * H.p; ++i) ASSIGN_REAL(Hstart.data[i], rand() * 1.0 / RAND_MAX); /*****************************************/ if (do_target) { printf("\nSolving for eigenvectors close to %f...\n", target_freq); mtdata = create_maxwell_target_data(mdata, target_freq); op = maxwell_target_operator; if (which_preconditioner == 1) pre_op = maxwell_target_preconditioner; else pre_op = maxwell_target_preconditioner2; op_data = (void *) mtdata; pre_op_data = (void *) mtdata; } else { op = maxwell_operator; if (which_preconditioner == 1) pre_op = maxwell_preconditioner; else pre_op = maxwell_preconditioner2; op_data = (void *) mdata; pre_op_data = (void *) mdata; } /*****************************************/ printf("\nSolving for eigenvectors with preconditioning...\n"); evectmatrix_copy(H, Hstart); eigensolver(H, eigvals, op, op_data, pre_op, pre_op_data, maxwell_parity_constraint, (void *) mdata, W, NWORK, error_tol, &num_iters, EIGS_DEFAULT_FLAGS); if (do_target) eigensolver_get_eigenvals(H, eigvals, maxwell_operator, mdata, W[0], W[1]); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("%15s%15s%15s%15s\n","eigenval", "frequency", "exact freq.", "error"); for (i = 0; i < num_bands; ++i) { double err; real freq = sqrt(eigvals[i]); real exact_freq = bragg_omega(freq, kvector[0], sqrt(ed.eps_high), ed.eps_high_x, sqrt(ed.eps_low), 1.0 - ed.eps_high_x, 1.0e-7); printf("%15f%15f%15f%15e\n", eigvals[i], freq, exact_freq, err = fabs(freq - exact_freq) / exact_freq); CHECK(err <= max_err, "error exceeds tolerance"); } printf("\n"); } if (!stop1) { /*****************************************/ printf("\nSolving for eigenvectors without preconditioning...\n"); evectmatrix_copy(H, Hstart); eigensolver(H, eigvals, op, op_data, NULL, NULL, maxwell_parity_constraint, (void *) mdata, W, NWORK, error_tol, &num_iters, EIGS_DEFAULT_FLAGS); if (do_target) eigensolver_get_eigenvals(H, eigvals, maxwell_operator, mdata, W[0], W[1]); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("%15s%15s%15s%15s\n","eigenval", "frequency", "exact freq.", "error"); for (i = 0; i < num_bands; ++i) { double err; real freq = sqrt(eigvals[i]); real exact_freq = bragg_omega(freq, kvector[0], sqrt(ed.eps_high), ed.eps_high_x, sqrt(ed.eps_low), 1.0 - ed.eps_high_x, 1.0e-7); printf("%15f%15f%15f%15e\n", eigvals[i], freq, exact_freq, err = fabs(freq - exact_freq) / exact_freq); CHECK(err <= max_err, "error exceeds tolerance"); } printf("\n"); /*****************************************/ printf("\nSolving for eigenvectors without conj. grad...\n"); evectmatrix_copy(H, Hstart); eigensolver(H, eigvals, op, op_data, pre_op, pre_op_data, maxwell_parity_constraint, (void *) mdata, W, NWORK - 1, error_tol, &num_iters, EIGS_DEFAULT_FLAGS); if (do_target) eigensolver_get_eigenvals(H, eigvals, maxwell_operator, mdata, W[0], W[1]); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("%15s%15s%15s%15s\n","eigenval", "frequency", "exact freq.", "error"); for (i = 0; i < num_bands; ++i) { double err; real freq = sqrt(eigvals[i]); real exact_freq = bragg_omega(freq, kvector[0], sqrt(ed.eps_high), ed.eps_high_x, sqrt(ed.eps_low), 1.0 - ed.eps_high_x, 1.0e-7); printf("%15f%15f%15f%15e\n", eigvals[i], freq, exact_freq, err = fabs(freq - exact_freq) / exact_freq); CHECK(err <= max_err, "error exceeds tolerance"); } printf("\n"); /*****************************************/ printf("\nSolving for eigenvectors without precond. or conj. grad...\n"); evectmatrix_copy(H, Hstart); eigensolver(H, eigvals, op, op_data, NULL, NULL, maxwell_parity_constraint, (void *) mdata, W, NWORK - 1, error_tol, &num_iters, EIGS_DEFAULT_FLAGS); if (do_target) eigensolver_get_eigenvals(H, eigvals, maxwell_operator, mdata, W[0], W[1]); printf("Solved for eigenvectors after %d iterations.\n", num_iters); printf("%15s%15s%15s%15s\n","eigenval", "frequency", "exact freq.", "error"); for (i = 0; i < num_bands; ++i) { double err; real freq = sqrt(eigvals[i]); real exact_freq = bragg_omega(freq, kvector[0], sqrt(ed.eps_high), ed.eps_high_x, sqrt(ed.eps_low), 1.0 - ed.eps_high_x, 1.0e-7); printf("%15f%15f%15f%15e\n", eigvals[i], freq, exact_freq, err = fabs(freq - exact_freq) / exact_freq); CHECK(err <= max_err, "error exceeds tolerance"); } printf("\n"); /*****************************************/ } destroy_evectmatrix(H); destroy_evectmatrix(Hstart); for (i = 0; i < NWORK; ++i) destroy_evectmatrix(W[i]); destroy_maxwell_target_data(mtdata); destroy_maxwell_data(mdata); free(eigvals); debug_check_memory_leaks(); return EXIT_SUCCESS; } mpb-1.4.2/tests/normal_vectors.c0000644000175400001440000000742707177211056012340 #include #include #include #include #include "../src/config.h" #include #include #include /* return a random number in [0,1]: */ double mydrand(void) { double d = rand(); return (d / (double) RAND_MAX); } #define MAX_NSQ_PTS 72 #define NUM_PLANES 100000 #define K_PI 3.141592653589793238462643383279502884197 /* return the angle, in degrees, between two unit-normalized vectors */ double angle(vector3 v1, vector3 v2) { return 180/K_PI * acos(vector3_dot(v1,v2)); } /* return a random unit vector, uniformly distributed over a sphere */ vector3 random_unit_vector3(void) { double z, t, r; vector3 v; z = 2*mydrand() - 1; t = 2*K_PI*mydrand(); r = sqrt(1 - z*z); v.x = r * cos(t); v.y = r * sin(t); v.z = z; return v; } int main(void) { int i, j, nsq, num_sq_pts[] = { 12, 50, 72 }; real x[MAX_NSQ_PTS], y[MAX_NSQ_PTS], z[MAX_NSQ_PTS], w[MAX_NSQ_PTS]; srand(time(NULL)); printf("Testing spherical quadratures to find normals to %d surfaces.\n", NUM_PLANES); for (nsq = 0; nsq < sizeof(num_sq_pts) / sizeof(int); ++nsq) { double err_mean, err_std; double min_angle = 360; spherical_quadrature_points(x,y,z,w, num_sq_pts[nsq]); /* compute the minimum angle between pairs of points: */ for (i = 0; i < num_sq_pts[nsq]; ++i) for (j = i + 1; j < num_sq_pts[nsq]; ++j) { vector3 v1, v2; double a; v1.x = x[i]; v1.y = y[i]; v1.z = z[i]; v2.x = x[j]; v2.y = y[j]; v2.z = z[j]; a = angle(v1,v2); if (a < min_angle) min_angle = a; } printf("%d-point formula: minimum angle is %g degrees.\n", num_sq_pts[nsq], min_angle); /* Normals to planes: */ err_mean = err_std = 0.0; for (i = 0; i < NUM_PLANES; ++i) { vector3 n, nsum = {0,0,0}; double d; n = random_unit_vector3(); d = mydrand(); for (j = 0; j < num_sq_pts[nsq]; ++j) { vector3 v; real val; v.x = x[j]; v.y = y[j]; v.z = z[j]; val = vector3_dot(v,n) >= d ? 12.0 : 1.0; val *= w[j]; nsum = vector3_plus(nsum, vector3_scale(val, v)); } nsum = unit_vector3(nsum); { /* stable one-pass formula for mean and std. deviation: */ double e, dev; e = angle(n, nsum); dev = (e - err_mean) / (i + 1); err_mean += dev; err_std += i*(i+1) * dev*dev; } } err_std = sqrt(err_std / (NUM_PLANES - 1)); printf("planes: mean error angle for %d-pt formula = " "%g +/- %g degrees\n", num_sq_pts[nsq], err_mean, err_std); /* Normals to spheres: */ err_mean = err_std = 0.0; for (i = 0; i < NUM_PLANES; ++i) { vector3 n, nsum = {0,0,0}, c; double r, d; int j; n = random_unit_vector3(); d = mydrand(); do { r = mydrand() * 10; /* radius of the sphere */ } while (r + d < 1.0); /* require sphere to intersect surface */ c = vector3_scale(r + d, n); /* center of the sphere */ for (j = 0; j < num_sq_pts[nsq]; ++j) { vector3 v; real val; v.x = x[j]; v.y = y[j]; v.z = z[j]; val = vector3_norm(vector3_minus(c,v)) <= r ? 12.0 : 1.0; val *= w[j]; nsum = vector3_plus(nsum, vector3_scale(val, v)); } nsum = unit_vector3(nsum); { /* stable one-pass formula for mean and std. deviation: */ double e, dev; e = angle(n, nsum); dev = (e - err_mean) / (i + 1); err_mean += dev; err_std += i*(i+1) * dev*dev; } } err_std = sqrt(err_std / (NUM_PLANES - 1)); printf("spheres: mean error angle for %d-pt formula = " "%g +/- %g degrees\n", num_sq_pts[nsq], err_mean, err_std); } return EXIT_SUCCESS; } mpb-1.4.2/utils/0002755000175400001440000000000007631010730007174 5mpb-1.4.2/utils/Makefile.in0000644000175400001440000000202007540733107011162 # Variables substituted by the autoconf configure script: SHELL = @SHELL@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = -I../src/util -I../src/matrices -I../src/matrixio @CPPFLAGS@ DEFS = @DEFS@ -DMPB_VERSION='"'"@MPB_VERSION@"'"' LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ RANLIB = @RANLIB@ @SET_MAKE@ INSTALL = @INSTALL@ prefix = @prefix@ mandir = @mandir@ # c.f. AC_ARG_PROGRAM autoconf docs: transform=@program_transform_name@ MYLIBS = ../src/matrixio/matrixio.a ../src/matrices/matrices.a \ ../src/util/util.a all: @BUILD_MPB_DATA@ libs: mpb-data: mpb-data.o $(MYLIBS) $(CC) $(CFLAGS) $(LDFLAGS) mpb-data.o $(MYLIBS) $(LIBS) -o $@ .c.o: $(CC) $(DEFS) $(CPPFLAGS) -c $(CFLAGS) $< -o $@ install: install-@BUILD_MPB_DATA@ install-: # dummy target for when BUILD_MPB_DATA is "" install-mpb-data: mpb-data $(INSTALL) -d $(prefix)/bin $(INSTALL) -m 0755 -s mpb-data $(prefix)/bin/`echo mpb-data|sed '$(transform)'` $(INSTALL) -d $(mandir)/man1 $(INSTALL) -m 0644 mpb-data.1 $(mandir)/man1 clean: rm -f mpb-data mpb-data.o core mpb-1.4.2/utils/mpb-data.10000644000175400001440000001216107443766434010706 .\" Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. .\" .\" 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 .\" .TH MPB-DATA 1 "January 27, 2000" "MPB" "MIT Photonic-Bands Package" .SH NAME mpb-data \- transformations of HDF5 files output by MPB .SH SYNOPSIS .B mpb-data [\fIOPTION\fR]... [\fIHDF5FILE\fR]... .SH DESCRIPTION .PP ." Add any additional description here mpb-data is a utility to perform additional processing and transformations of HDF5 files output by MPB, the MIT Photonic-Bands program. In particular, it is designed to make the output more amenable to visualization by reformatting it into a rectangular grid, extending it to multiple periods, and rescaling the data. .PP MIT Photonic Bands (MPB) is a free program to compute the band structures (dispersion relations) and electromagnetic modes of periodic dielectric structures. .PP HDF5 is a free, portable binary format and supporting library developed by the National Center for Supercomputing Applications at the University of Illinois in Urbana-Champaign. A single .I h5 file can contain multiple data sets; by default, .I mpb-data operates on all of the MPB-produced datasets in the file, but this can be changed via the .B -d option, or by using the syntax \fIHDF5FILE:DATASET\fR. .PP .I mpb-data writes its output datasets as additional datasets in the input file(s), with "-new" appended to the dataset names. Alternatively, it can write its output to a separate file, specified by the .B -o option. .PP Note also that, by default, the output datasets are identical to the input datasets; you must use one or more of the options below to specify a transformation (e.g. the \fB\-r\fR/\fB\-e\fR and .B -n options are very useful). .SH OPTIONS .TP .B -h Display help on the command-line options and usage. .TP .B -V Print the version number and copyright info for mpb-data. .TP .B -v Verbose output. .TP \fB\-o\fR \fIfile\fR Write output datasets to .I file (for the first input file only) rather than as additional datasets in the input file(s) (the default). .TP .B -r Output a rectangular cell with the same volume as the cell of the input data. This option is particularly useful for visualizing data from non-orthogonal unit cells (e.g. a triangular lattice), as otherwise the data will appear skewed or warped in most graphics programs. This option should almost always be accompanied by the \fB\-n\fR option to ensure a uniform resolution. .TP \fB\-e\fR \fIx,y,z\fR As the \fB\-r\fR option, but also make the first axis of the output along the \fIx,y,z\fR direction (in Cartesian coordinates) instead of along the first lattice vector as for \fB\-r\fR. .TP \fB\-n\fR \fIn\fR Output .I n grid points per lattice unit ("a"). This is useful not only for interpolating to finer (or coarser) resolutions, but also to ensure that the resolution is uniform in each direction (to prevent the data from looking distorted when you visualize it). .TP \fB\-x\fR \fImx\fR, \fB\-y\fR \fImy\fR, \fB\-z\fR \fImz\fR This tells .I mpb-data to output multiple periods in the corresponding lattice directions. to use a particular slice of a two- or three-dimensional dataset. e.g. .B -x 3.2 causes the output of 3.2 periods in the first lattice direction. The default is to output only a single period. .TP \fB\-m\fR \fIs\fR Output .I s periods in each lattice direction; equivalent to: \fB\-x\fR \fIs\fR \fB\-y\fR \fIs\fR \fB\-z\fR \fIs\fR. .TP .B -T The output has the first two dimensions (x and y) transposed. This is useful in conjunction with the parallel (MPI) version of MPB, which for performance reasons outputs all arrays with the first two dimensions transposed. .B -T can undo this transposition. .TP .B -p Pixellized output. Normally, the input data is linearly interpolated to the output grid, but the .B -p option causes it to instead use the nearest grid point in the input data. This is useful, for example, if you want to study the discretization of the dielectric-function representation. .TP \fB\-d\fR \fIname\fR Use dataset .I name from the input files; otherwise, the first dataset from each file is used. Alternatively, use the syntax \fIHDF5FILE:DATASET\fR, which allows you to specify a different dataset for each file. You can use the .I h5ls command (included with hdf5) to find the names of datasets within a file. .SH BUGS Send bug reports to S. G. Johnson, stevenj@alum.mit.edu. .SH AUTHORS Written by Steven G. Johnson. Copyright (c) 1999, 2000, 2001, 2002 by the Massachusetts Institute of Technology. .SH "SEE ALSO" mpb(1) mpb-1.4.2/utils/mpb-data.c0000644000175400001440000005334407441753311010764 /* Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology. * * 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 */ #include #include #include #include #include #include #include "../src/config.h" #include #include int verbose = 0; /* A macro to set x = fractional part of x input, xi = integer part, with 0 <= x < 1.0. Note that we need the second test (if x >= 1.0) below, because x may start out as -0 or -1e-23 or something so that it is < 0 but x + 1.0 == 1.0, thanks to the wonders of floating point. (This has actually happened, on an Alpha.) */ #define MODF_POSITIVE(x, xi) { \ x=modf(x, &xi); \ if (x < 0) { x += 1.0; if (x >= 1.0) x = 0; else xi -= 1.0; } \ } #define ADJ_POINT(i1, i2, nx, dx, xi, xi2) { \ if (dx >= 0.0) { \ i2 = i1 + 1; \ if (i2 >= nx) { \ i2 -= nx; \ xi2 = xi + 1.0; \ } \ else \ xi2 = xi; \ } \ else { \ i2 = i1 - 1; \ if (i2 < 0) { \ i2 += nx; \ xi2 = xi - 1.0; \ } \ else \ xi2 = xi; \ dx = -dx; \ } \ } void add_cmplx_times_phase(real *sum_re, real *sum_im, real d_re, real d_im, double ix, double iy, double iz, real *s, real scale_by) { static real phase = 0.0, p_re = 1.0, p_im = 0.0; real new_phase; new_phase = ix * s[0] + iy * s[1] + iz * s[2]; if (new_phase != phase) { phase = new_phase; p_re = cos(phase); p_im = sin(phase); } *sum_re += (d_re * p_re - d_im * p_im) * scale_by; *sum_im += (d_re * p_im + d_im * p_re) * scale_by; } #define TWOPI 6.2831853071795864769252867665590057683943388 #define MAX2(a,b) ((a) >= (b) ? (a) : (b)) #define MIN2(a,b) ((a) < (b) ? (a) : (b)) void map_data(real *d_in_re, real *d_in_im, int n_in[3], real *d_out_re, real *d_out_im, int n_out[3], matrix3x3 coord_map, real *kvector, short pick_nearest, short transpose) { int i, j, k; real s[3]; /* phase difference per cell in each lattice direction */ real min_out_re = 1e20, max_out_re = -1e20, min_out_im = 1e20, max_out_im = -1e20; real shiftx, shifty, shiftz; CHECK(d_in_re && d_out_re, "invalid arguments"); CHECK((d_out_im && d_in_im) || (!d_out_im && !d_in_im), "both input and output must be real or complex"); coord_map.c0 = vector3_scale(1.0 / n_out[0], coord_map.c0); coord_map.c1 = vector3_scale(1.0 / n_out[1], coord_map.c1); coord_map.c2 = vector3_scale(1.0 / n_out[2], coord_map.c2); for (i = 0; i < 3; ++i) { if (kvector) s[i] = kvector[i] * TWOPI; else s[i] = 0; } /* Compute shift so that the origin of the output cell is mapped to the origin of the original primitive cell: */ shiftx = 0.5 - (coord_map.c0.x*0.5*n_out[0] + coord_map.c1.x*0.5*n_out[1] + coord_map.c2.x*0.5*n_out[2]); shifty = 0.5 - (coord_map.c0.y*0.5*n_out[0] + coord_map.c1.y*0.5*n_out[1] + coord_map.c2.y*0.5*n_out[2]); shiftz = 0.5 - (coord_map.c0.z*0.5*n_out[0] + coord_map.c1.z*0.5*n_out[1] + coord_map.c2.z*0.5*n_out[2]); for (i = 0; i < n_out[0]; ++i) for (j = 0; j < n_out[1]; ++j) for (k = 0; k < n_out[2]; ++k) { real x, y, z; double xi, yi, zi, xi2, yi2, zi2; double dx, dy, dz, mdx, mdy, mdz; int i1, j1, k1, i2, j2, k2; int ijk; if (transpose) ijk = (j * n_out[0] + i) * n_out[2] + k; else ijk = (i * n_out[1] + j) * n_out[2] + k; /* find the point corresponding to d_out[i,j,k] in the input array, and also find the next-nearest points. */ x = coord_map.c0.x*i + coord_map.c1.x*j + coord_map.c2.x*k + shiftx; y = coord_map.c0.y*i + coord_map.c1.y*j + coord_map.c2.y*k + shifty; z = coord_map.c0.z*i + coord_map.c1.z*j + coord_map.c2.z*k + shiftz; MODF_POSITIVE(x, xi); MODF_POSITIVE(y, yi); MODF_POSITIVE(z, zi); i1 = x * n_in[0]; j1 = y * n_in[1]; k1 = z * n_in[2]; dx = x * n_in[0] - i1; dy = y * n_in[1] - j1; dz = z * n_in[2] - k1; ADJ_POINT(i1, i2, n_in[0], dx, xi, xi2); ADJ_POINT(j1, j2, n_in[1], dy, yi, yi2); ADJ_POINT(k1, k2, n_in[2], dz, zi, zi2); /* dx, mdx, etcetera, are the weights for the various points in the input data, which we use for linearly interpolating to get the output point. */ if (pick_nearest) { /* don't interpolate */ dx = dx <= 0.5 ? 0.0 : 1.0; dy = dy <= 0.5 ? 0.0 : 1.0; dz = dz <= 0.5 ? 0.0 : 1.0; } mdx = 1.0 - dx; mdy = 1.0 - dy; mdz = 1.0 - dz; /* Now, linearly interpolate the input to get the output. If the input/output are complex, we also need to multiply by the appropriate phase factor, depending upon which unit cell we are in. */ #define IN_INDEX(i,j,k) ((i * n_in[1] + j) * n_in[2] + k) if (d_out_im) { d_out_re[ijk] = 0.0; d_out_im[ijk] = 0.0; add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i1,j1,k1)], d_in_im[IN_INDEX(i1,j1,k1)], xi, yi, zi, s, mdx * mdy * mdz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i1,j1,k2)], d_in_im[IN_INDEX(i1,j1,k2)], xi, yi, zi2, s, mdx * mdy * dz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i1,j2,k1)], d_in_im[IN_INDEX(i1,j2,k1)], xi, yi2, zi, s, mdx * dy * mdz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i1,j2,k2)], d_in_im[IN_INDEX(i1,j2,k2)], xi, yi2, zi2, s, mdx * dy * dz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i2,j1,k1)], d_in_im[IN_INDEX(i2,j1,k1)], xi2, yi, zi, s, dx * mdy * mdz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i2,j1,k2)], d_in_im[IN_INDEX(i2,j1,k2)], xi2, yi, zi2, s, dx * mdy * dz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i2,j2,k1)], d_in_im[IN_INDEX(i2,j2,k1)], xi2, yi2, zi, s, dx * dy * mdz); add_cmplx_times_phase(d_out_re + ijk, d_out_im + ijk, d_in_re[IN_INDEX(i2,j2,k2)], d_in_im[IN_INDEX(i2,j2,k2)], xi2, yi2, zi2, s, dx * dy * dz); min_out_im = MIN2(min_out_im, d_out_im[ijk]); max_out_im = MAX2(max_out_im, d_out_im[ijk]); } else { d_out_re[ijk] = d_in_re[IN_INDEX(i1,j1,k1)] * mdx * mdy * mdz + d_in_re[IN_INDEX(i1,j1,k2)] * mdx * mdy * dz + d_in_re[IN_INDEX(i1,j2,k1)] * mdx * dy * mdz + d_in_re[IN_INDEX(i1,j2,k2)] * mdx * dy * dz + d_in_re[IN_INDEX(i2,j1,k1)] * dx * mdy * mdz + d_in_re[IN_INDEX(i2,j1,k2)] * dx * mdy * dz + d_in_re[IN_INDEX(i2,j2,k1)] * dx * dy * mdz + d_in_re[IN_INDEX(i2,j2,k2)] * dx * dy * dz; } min_out_re = MIN2(min_out_re, d_out_re[ijk]); max_out_re = MAX2(max_out_re, d_out_re[ijk]); #undef IN_INDEX } if (verbose) { printf("real part range: %g .. %g\n", min_out_re, max_out_re); if (d_out_im) printf("imag part range: %g .. %g\n", min_out_im, max_out_im); } } void handle_dataset(matrixio_id in_file, matrixio_id out_file, const char *name_re, const char *name_im, matrix3x3 Rout, matrix3x3 coord_map, real *kvector, int resolution, real multiply_size[3], int pick_nearest, int transpose) { real *d_in_re = NULL, *d_in_im = NULL, *d_out_re = NULL, *d_out_im = NULL; int in_dims[3] = {1,1,1}, out_dims[3] = {1,1,1}, out_dims2[3], rank = 3; int i, N; int start[3] = {0,0,0}; matrixio_id data_id; char out_name[1000]; d_in_re = matrixio_read_real_data(in_file, name_re, &rank, in_dims, 0, 0, 0, NULL); if (!d_in_re) goto done; if (verbose) printf("Found dataset %s...\n", name_re); if (name_im) { d_in_im = matrixio_read_real_data(in_file, name_im, &rank, out_dims, 0, 0, 0, NULL); if (!d_in_im) { fprintf(stderr, "mpb-data: found %s dataset but not %s\n", name_re, name_im); goto done; } for (i = 0; i < 3; ++i) { CHECK(out_dims[i] == in_dims[i], "re/im datasets must have same size!"); } if (verbose) printf(" and imaginary part dataset %s...\n", name_im); } if (verbose) printf("Input data is rank %d, size %dx%dx%d.\n", rank, in_dims[0], in_dims[1], in_dims[2]); if (resolution > 0) { out_dims[0] = vector3_norm(Rout.c0) * resolution + 0.5; out_dims[1] = vector3_norm(Rout.c1) * resolution + 0.5; out_dims[2] = vector3_norm(Rout.c2) * resolution + 0.5; } else { for (i = 0; i < 3; ++i) out_dims[i] = in_dims[i] * multiply_size[i]; } for (i = rank; i < 3; ++i) out_dims[i] = 1; for (N = 1, i = 0; i < 3; ++i) N *= (out_dims[i] = MAX2(out_dims[i], 1)); if (transpose) { out_dims2[0] = out_dims[1]; out_dims2[1] = out_dims[0]; out_dims2[2] = out_dims[2]; } else { out_dims2[0] = out_dims[0]; out_dims2[1] = out_dims[1]; out_dims2[2] = out_dims[2]; } if (verbose) printf("Output data %dx%dx%d.\n", out_dims2[0], out_dims2[1], out_dims2[2]); CHK_MALLOC(d_out_re, real, N); if (d_in_im) { CHK_MALLOC(d_out_im, real, N); } map_data(d_in_re, d_in_im, in_dims, d_out_re, d_out_im, out_dims, coord_map, kvector, pick_nearest, transpose); strcpy(out_name, name_re); if (out_file == in_file) strcat(out_name, "-new"); if (verbose) printf("Writing dataset to %s...\n", out_name); data_id = matrixio_create_dataset(out_file, out_name,"", rank, out_dims2); matrixio_write_real_data(data_id, out_dims2, start, 1, d_out_re); matrixio_close_dataset(data_id); if (d_out_im) { strcpy(out_name, name_im); if (out_file == in_file) strcat(out_name, "-new"); if (verbose) printf("Writing dataset to %s...\n", out_name); data_id = matrixio_create_dataset(out_file, out_name, "", rank, out_dims2); matrixio_write_real_data(data_id, out_dims2, start, 1, d_out_im); matrixio_close_dataset(data_id); } if (verbose) printf("Successfully wrote out data.\n"); done: free(d_in_re); free(d_in_im); free(d_out_re); free(d_out_im); } void handle_file(const char *fname, const char *out_fname, const char *data_name, int rectify, int have_ve, vector3 ve, int resolution, real multiply_size[3], int pick_nearest, int transpose) { matrixio_id in_file, out_file; real *R, *kvector, *copies; int dims[2], rank; matrix3x3 Rin = {{1,0,0},{0,1,0},{0,0,1}}, Rout, coord_map; #define NUM_DATANAMES 16 char datanames[NUM_DATANAMES][30] = { "data", "x", "y", "z", "epsilon.xx", "epsilon.xy", "epsilon.xz", "epsilon.yy", "epsilon.yz", "epsilon.zz", "epsilon_inverse.xx", "epsilon_inverse.xy", "epsilon_inverse.xz", "epsilon_inverse.yy", "epsilon_inverse.yz", "epsilon_inverse.zz" }; int i; if (verbose) printf("Reading file %s...\n", fname); in_file = matrixio_open(fname, out_fname != NULL); if (data_name && !data_name[0]) data_name = NULL; R = matrixio_read_data_attr(in_file, "lattice vectors", &rank, 2, dims); if (R && rank == 2 && dims[0] == 3 && dims[1] == 3) { Rin.c0.x = R[0*3+0]; Rin.c0.y = R[0*3+1]; Rin.c0.z = R[0*3+2]; Rin.c1.x = R[1*3+0]; Rin.c1.y = R[1*3+1]; Rin.c1.z = R[1*3+2]; Rin.c2.x = R[2*3+0]; Rin.c2.y = R[2*3+1]; Rin.c2.z = R[2*3+2]; if (verbose) printf("Read lattice vectors.\n"); } free(R); kvector = matrixio_read_data_attr(in_file, "Bloch wavevector", &rank, 1, dims); if (rank != 1 || dims[0] != 3) { free(kvector); kvector = NULL; } else if (verbose) printf("Read Bloch wavevector (%g, %g, %g)\n", kvector[0], kvector[1], kvector[2]); copies = matrixio_read_data_attr(in_file, "lattice copies", &rank, 1, dims); if (copies && rank == 1 && dims[0] == 3) { Rin.c0 = vector3_scale(copies[0], Rin.c0); Rin.c1 = vector3_scale(copies[1], Rin.c1); Rin.c2 = vector3_scale(copies[2], Rin.c2); if (kvector) { kvector[0] *= copies[0]; kvector[1] *= copies[1]; kvector[2] *= copies[2]; } if (verbose) printf("Read lattice copies (%g, %g, %g)\n", copies[0], copies[1], copies[2]); } free(copies); if (verbose) printf("Input lattice = (%g,%g,%g), (%g,%g,%g), (%g,%g,%g)\n", Rin.c0.x, Rin.c0.y, Rin.c0.z, Rin.c1.x, Rin.c1.y, Rin.c1.z, Rin.c2.x, Rin.c2.y, Rin.c2.z); Rout = Rin; if (rectify) { double V; /* Orthogonalize the output lattice vectors. If have_ve is true, then the first new lattice vector should be in the direction of the ve unit vector; otherwise, the first new lattice vector is the first original lattice vector. Note that we do this in such a way as to preserve the volume of the unit cell, and so that our first vector (in the direction of ve) smoothly interpolates between the original lattice vectors. */ if (have_ve) ve = unit_vector3(ve); else ve = unit_vector3(Rout.c0); /* First, compute c0 in the direction of ve by smoothly interpolating the old c0/c1/c2 (formula is slightly tricky): */ V = vector3_dot(vector3_cross(Rout.c0, Rout.c1), Rout.c2); Rout.c1 = vector3_minus(Rout.c1,Rout.c0); Rout.c2 = vector3_minus(Rout.c2,Rout.c0); Rout.c0 = vector3_scale(V / vector3_dot(vector3_cross(Rout.c1, Rout.c2), ve), ve); /* Now, orthogonalize c1 and c2: */ Rout.c1 = vector3_minus(Rout.c1, vector3_scale(vector3_dot(ve, Rout.c1), ve)); Rout.c2 = vector3_minus(Rout.c2, vector3_scale(vector3_dot(ve, Rout.c2), ve)); Rout.c2 = vector3_minus(Rout.c2, vector3_scale(vector3_dot(Rout.c1, Rout.c2) / vector3_dot(Rout.c1, Rout.c1), Rout.c1)); } Rout.c0 = vector3_scale(multiply_size[0], Rout.c0); Rout.c1 = vector3_scale(multiply_size[1], Rout.c1); Rout.c2 = vector3_scale(multiply_size[2], Rout.c2); if (verbose) printf("Output lattice = (%g,%g,%g), (%g,%g,%g), (%g,%g,%g)\n", Rout.c0.x, Rout.c0.y, Rout.c0.z, Rout.c1.x, Rout.c1.y, Rout.c1.z, Rout.c2.x, Rout.c2.y, Rout.c2.z); coord_map = matrix3x3_mult(matrix3x3_inverse(Rin), Rout); if (out_fname) { if (verbose) printf("Creating output file %s...\n", out_fname); out_file = matrixio_create(out_fname); } else { if (verbose) printf("Writing output datasets to input file %s...\n", fname); out_file = in_file; } for (i = 0; i < NUM_DATANAMES; ++i) { const char *dname = datanames[i]; char name_re[300], name_im[300]; if (data_name) dname = data_name; strcpy(name_re, dname); handle_dataset(in_file, out_file, name_re, NULL, Rout, coord_map, kvector, resolution, multiply_size, pick_nearest, transpose); sprintf(name_re, "%s.r", dname); sprintf(name_im, "%s.i", dname); handle_dataset(in_file, out_file, name_re, name_im, Rout, coord_map, kvector, resolution, multiply_size, pick_nearest, transpose); if (data_name) break; } free(kvector); matrixio_close(in_file); if (out_file != in_file) matrixio_close(out_file); } void usage(FILE *f) { fprintf(f, "Usage: mpb-data [options] []\n" "Options:\n" " -h : this help message\n" " -V : print version number and copyright\n" " -v : verbose output\n" " -o : output to (first input file only)\n" " -r : output rectangular cell\n" " -e : as -r, but first axis of cell is along \n" " -n : output resolution of n grid points per a\n" " -x \n" " -y \n" " -z : output mx/my/mz periods in the x/y/z directions\n" " -m : same as -x -y -z \n" " -T : transpose first two dimensions (x & y) of data\n" " -p : pixellized output (no grid interpolation)\n" " -d : use dataset in the input files (default: all mpb datasets)\n" " -- you can also specify a dataset via :\n" ); } /* given an fname of the form :, return a pointer to a newly-allocated string containing , and point data_name to the position of in fname. The user must free() the string. */ static char *split_fname(char *fname, char **data_name) { int fname_len; char *colon, *filename; fname_len = strlen(fname); colon = strchr(fname, ':'); if (colon) { int colon_len = strlen(colon); filename = (char*) malloc(sizeof(char) * (fname_len-colon_len+1)); CHECK(filename, "out of memory"); strncpy(filename, fname, fname_len-colon_len+1); filename[fname_len-colon_len] = 0; *data_name = colon + 1; } else { /* treat as if ":" were at the end of fname */ filename = (char*) malloc(sizeof(char) * (fname_len + 1)); CHECK(filename, "out of memory"); strcpy(filename, fname); *data_name = fname + fname_len; } return filename; } int main(int argc, char **argv) { char *out_fname = NULL, *data_name = NULL; int rectify = 0, resolution = 0, have_ve = 0; vector3 ve = {1,0,0}; real multiply_size[3] = {1,1,1}; int pick_nearest = 0, transpose = 0; int ifile, c; extern char *optarg; extern int optind; while ((c = getopt(argc, argv, "hVvo:x:y:z:m:d:n:prTe:")) != -1) switch (c) { case 'h': usage(stdout); return EXIT_SUCCESS; case 'V': printf("mpb-data " MPB_VERSION " by Steven G. Johnson.\n" "Copyright (C) 1999, 2000, 2001, 2002, Massachusetts Institute of Technology.\n" "This is free software, and you are welcome to redistribute it under the\n" "terms of the GNU General Public License (GPL). mpb-data comes with\n" "ABSOLUTELY NO WARRANTY; see the GPL for more details.\n"); return EXIT_SUCCESS; case 'v': verbose = 1; break; case 'o': free(out_fname); out_fname = (char*) malloc(sizeof(char) * (strlen(optarg) + 1)); CHECK(out_fname, "out of memory"); strcpy(out_fname, optarg); break; case 'd': free(data_name); data_name = (char*) malloc(sizeof(char) * (strlen(optarg) + 1)); CHECK(data_name, "out of memory"); strcpy(data_name, optarg); break; case 'x': multiply_size[0] = atof(optarg); break; case 'y': multiply_size[1] = atof(optarg); break; case 'z': multiply_size[2] = atof(optarg); break; case 'm': multiply_size[0] = atof(optarg); multiply_size[1] = atof(optarg); multiply_size[2] = atof(optarg); break; case 'n': resolution = atoi(optarg); CHECK(resolution > 0, "invalid resolution for -n (must be positive)"); break; case 'p': pick_nearest = 1; break; case 'T': transpose = 1; break; case 'e': have_ve = 1; if (3 != sscanf(optarg, "%lf,%lf,%lf", &ve.x, &ve.y, &ve.z)) { fprintf(stderr, "Invalid -e argument \"%s\"\n", optarg); usage(stderr); return EXIT_FAILURE; } rectify = 1; break; case 'r': rectify = 1; break; default: fprintf(stderr, "Invalid argument -%c\n", c); usage(stderr); return EXIT_FAILURE; } if (optind == argc) { /* no parameters left */ usage(stderr); return EXIT_FAILURE; } for (ifile = optind; ifile < argc; ++ifile) { char *dname, *h5_fname; h5_fname = split_fname(argv[ifile], &dname); if (!dname[0]) dname = data_name; handle_file(h5_fname, out_fname, dname, rectify, have_ve, ve, resolution, multiply_size, pick_nearest, transpose); if (out_fname) free(out_fname); out_fname = NULL; free(h5_fname); } free(data_name); return EXIT_SUCCESS; } mpb-1.4.2/config.guess0000755000175400001440000011265307631010731010303 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-11-08' # This file 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; sparc*) machine=`uname -p`-unknown ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*X-MP:*:*:*) echo xmp-cray-unicos exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. ld_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 printf ("%s-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mpb-1.4.2/config.sub0000755000175400001440000006737407631010731007757 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-11-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file 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. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale | xstormy16 \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* | xstormy16-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | ymp) basic_machine=ymp-cray os=-unicos ;; cray2) basic_machine=cray2-cray os=-unicos ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsel*-linux*) basic_machine=mipsel-unknown os=-linux-gnu ;; mips*-linux*) basic_machine=mips-unknown os=-linux-gnu ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xmp) basic_machine=xmp-cray os=-unicos ;; xps | xps100) basic_machine=xps100-honeywell ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; mips) if [ x$os = x-linux-gnu ]; then basic_machine=mips-unknown else basic_machine=mips-mips fi ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: mpb-1.4.2/install-sh0000755000175400001440000001273607631010731007770 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 mpb-1.4.2/autom4te.cache/0002755000175400001440000000000007631010734010644 5mpb-1.4.2/autom4te.cache/requests0000644000175400001440000001145707631010735012371 # This file was created by autom4te. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/local/autotools/share/autoconf' ], [ '/usr/local/autotools/share/autoconf/autoconf/autoconf.m4f', 'configure.ac' ], { 'AC_CANONICAL_SYSTEM' => 1, 'AC_HEADER_STAT' => 1, 'AC_FUNC_STRFTIME' => 1, 'AC_PROG_RANLIB' => 1, 'AC_C_VOLATILE' => 1, 'AC_FUNC_WAIT3' => 1, 'AC_CONFIG_AUX_DIR' => 1, 'AC_REPLACE_FNMATCH' => 1, 'AC_FUNC_SETPGRP' => 1, 'AC_HEADER_TIME' => 1, 'AC_FUNC_SETVBUF_REVERSED' => 1, 'AC_HEADER_SYS_WAIT' => 1, 'AC_TYPE_UID_T' => 1, 'AC_CHECK_LIB' => 1, 'AM_CONDITIONAL' => 1, 'AC_PROG_LN_S' => 1, 'AC_FUNC_MEMCMP' => 1, 'AM_PROG_CC_C_O' => 1, 'AC_FUNC_FORK' => 1, 'AC_FUNC_GETGROUPS' => 1, 'AC_HEADER_MAJOR' => 1, 'AC_FUNC_STRNLEN' => 1, 'AC_FUNC_STRTOD' => 1, 'AC_HEADER_DIRENT' => 1, 'AC_FUNC_UTIME_NULL' => 1, 'AC_FUNC_MBRTOWC' => 1, 'AC_CONFIG_FILES' => 1, 'AC_FUNC_ALLOCA' => 1, 'AC_C_CONST' => 1, 'AC_CHECK_MEMBERS' => 1, 'AC_FUNC_REALLOC' => 1, 'AC_FUNC_OBSTACK' => 1, 'include' => 1, 'AC_FUNC_LSTAT' => 1, 'AC_STRUCT_TIMEZONE' => 1, 'AC_FUNC_GETPGRP' => 1, 'AC_CHECK_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'AC_CHECK_TYPES' => 1, 'AC_TYPE_MODE_T' => 1, 'AC_PROG_YACC' => 1, 'AC_FUNC_STRERROR_R' => 1, 'AC_TYPE_PID_T' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AC_STRUCT_ST_BLOCKS' => 1, 'AC_FUNC_SELECT_ARGTYPES' => 1, 'AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK' => 1, 'AC_TYPE_SIGNAL' => 1, 'AC_PROG_GCC_TRADITIONAL' => 1, 'AC_PROG_CPP' => 1, 'AC_FUNC_STAT' => 1, 'AC_PROG_INSTALL' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_FUNC_STRCOLL' => 1, 'AC_LIBSOURCE' => 1, 'AC_C_INLINE' => 1, 'AC_FUNC_CHOWN' => 1, 'AC_FUNC_GETMNTENT' => 1, 'AC_INIT' => 1, 'AC_PROG_LEX' => 1, 'AH_OUTPUT' => 1, 'AC_HEADER_STDC' => 1, 'AC_FUNC_GETLOADAVG' => 1, 'AC_TYPE_SIZE_T' => 1, 'AC_CHECK_FUNCS' => 1, 'AC_DECL_SYS_SIGLIST' => 1, 'AC_FUNC_MKTIME' => 1, 'AC_PROG_MAKE_SET' => 1, 'AC_PROG_CXX' => 1, 'AC_CANONICAL_HOST' => 1, 'm4_pattern_allow' => 1, 'AC_FUNC_CLOSEDIR_VOID' => 1, 'm4_include' => 1, 'AC_PROG_AWK' => 1, 'm4_pattern_forbid' => 1, 'AC_FUNC_VPRINTF' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_PATH_X' => 1, 'AC_TYPE_OFF_T' => 1, 'AC_FUNC_MALLOC' => 1, 'AC_FUNC_ERROR_AT_LINE' => 1, 'AM_MAINTAINER_MODE' => 1, 'AC_FUNC_FSEEKO' => 1, 'AC_FUNC_MMAP' => 1, 'AC_STRUCT_TM' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_SUBST' => 1, 'AC_PROG_CC' => 1, 'AC_PROG_LIBTOOL' => 1 } ], 'Request' ) ); mpb-1.4.2/autom4te.cache/output.00000644000175400001440000105703207631010734012213 @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.57. @%:@ @%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 @%:@ 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 Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # 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` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/matrices/matrices.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MPB_VERSION F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE BUILD_MPB_DATA INSTALL_MPB_SPLIT SCALAR_TYPE FLIBS BLAS_LIBS LAPACK_LIBS MPICC MPILIBS CPP EGREP guile_ok HAVE_GUILE_CONFIG ACTIVATE_READLINE LIBCTL_DIR gen_ctl_io_ok GEN_CTL_IO EIGS_FLAGS_SCM SH_JOB LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=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 ;; -*) { 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 && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 this package 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-single compile for single precision --enable-debug compile for debugging --enable-debug-malloc use debug malloc/free --enable-prof compile for profiling --disable-checks disable runtime checks Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-inv-symmetry take advantage of (and require) inv. sym. --with-hermitian-eps allow complex-Hermitian dielectric tensors --with-efence use ElectricFence library --with-blas= use BLAS library --with-lapack= use LAPACK library --with-mpi enable MPI parallelization --without-hdf5 do not use HDF5 output --with-libctl= specify libctl directory 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 CC C compiler command CFLAGS C compiler flags CPPFLAGS C/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. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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=. echo "PATH: $as_dir" done } >&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_sep= 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=`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_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. 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, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------- @%:@@%:@ @%:@@%:@ Output files. @%:@@%:@ @%:@@%:@ ------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf 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 -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 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 { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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 { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 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 ac_config_headers="$ac_config_headers src/config.h" MPB_VERSION=1.4.2 echo "$as_me:$LINENO: checking for vendor f77 to be used instead of g77" >&5 echo $ECHO_N "checking for vendor f77 to be used instead of g77... $ECHO_C" >&6 echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 for ac_prog in f77 xlf77 cf77 fort77 f90 xlf90 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break 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 -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:__oline__:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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.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. echo "$as_me:$LINENO: checking for Fortran 77 compiler default output" >&5 echo $ECHO_N "checking for Fortran 77 compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: Fortran 77 compiler cannot create executables See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the Fortran 77 compiler works" >&5 echo $ECHO_N "checking whether the Fortran 77 compiler works... $ECHO_C" >&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' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? 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 { { 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 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 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$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. ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$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 "$G77" = yes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "$G77" = yes; then FFLAGS="-O2" else FFLAGS= fi 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 # Get C compiler. echo "$as_me:$LINENO: checking for vendor cc to be used instead of gcc" >&5 echo $ECHO_N "checking for vendor cc to be used instead of gcc... $ECHO_C" >&6 echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 for ac_prog in cc xlc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done # prefer vendor cc, to stay in sync with Fortran 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 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $@%:@ != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 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. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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; } 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF @%:@ifndef __cplusplus choke me @%:@endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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 programs. if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # check how to transform the name of the installed program: test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # Check whether --enable-single or --disable-single was given. if test "${enable_single+set}" = set; then enableval="$enable_single" enable_single=$enableval else enable_single=no fi; if test "$enable_single" = "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define SCALAR_SINGLE_PREC 1 _ACEOF echo "*********************** SINGLE PRECISION ***********************" fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then CFLAGS="-g" cat >>confdefs.h <<\_ACEOF @%:@define DEBUG 1 _ACEOF fi # Check whether --enable-debug-malloc or --disable-debug-malloc was given. if test "${enable_debug_malloc+set}" = set; then enableval="$enable_debug_malloc" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define DEBUG_MALLOC 1 _ACEOF fi # Check whether --enable-prof or --disable-prof was given. if test "${enable_prof+set}" = set; then enableval="$enable_prof" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then CFLAGS="$CFLAGS -pg" cat >>confdefs.h <<\_ACEOF @%:@define ENABLE_PROF 1 _ACEOF fi # Check whether --enable-checks or --disable-checks was given. if test "${enable_checks+set}" = set; then enableval="$enable_checks" ok=$enableval else ok=yes fi; if test "$ok" = "no"; then cat >>confdefs.h <<\_ACEOF @%:@define CHECK_DISABLE 1 _ACEOF fi BUILD_MPB_DATA=mpb-data # mpb-data program to build, if any INSTALL_MPB_SPLIT=install-mpb-split # mpb-split target to install, if any # Check whether --with-inv-symmetry or --without-inv-symmetry was given. if test "${with_inv_symmetry+set}" = set; then withval="$with_inv_symmetry" inv_sym=$withval else inv_sym=no fi; if test "$inv_sym" = "no"; then cat >>confdefs.h <<\_ACEOF @%:@define SCALAR_COMPLEX 1 _ACEOF SCALAR_TYPE=complex else SCALAR_TYPE=real # Make installed program mpbi instead of mpb, but don't change mpb-data program_transform_name='s,^mpb$$,mpbi,'";$program_transform_name" echo "*********************** INVERSION SYM. ***********************" fi # Check whether --with-hermitian-eps or --without-hermitian-eps was given. if test "${with_hermitian_eps+set}" = set; then withval="$with_hermitian_eps" hermitian_epsilon=$withval else hermitian_epsilon=no fi; if test "$hermitian_epsilon" = "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define WITH_HERMITIAN_EPSILON 1 _ACEOF echo "*********************** HERMITIAN EPS. ***********************" fi # Add lots of compiler warnings to check for if we are using gcc: # (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.) if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic" fi ############################################################################## # Checks for libraries: ############################################################################## # Check whether --with-efence or --without-efence was given. if test "${with_efence+set}" = set; then withval="$with_efence" ok=$withval else ok=no fi; if test "$ok" = "yes"; then echo "$as_me:$LINENO: checking for malloc in -lefence" >&5 echo $ECHO_N "checking for malloc in -lefence... $ECHO_C" >&6 if test "${ac_cv_lib_efence_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_efence_malloc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_efence_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_efence_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_efence_malloc" >&6 if test $ac_cv_lib_efence_malloc = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBEFENCE 1 _ACEOF LIBS="-lefence $LIBS" fi fi ############################################################################## echo "$as_me:$LINENO: checking for sqrt in -lm" >&5 echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); int main () { sqrt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sqrt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sqrt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5 echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6 if test $ac_cv_lib_m_sqrt = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # If we have a Fortran compiler, link to its libraries, since these # are probably needed to link with the BLAS/LAPACK libraries. if test x != x"$F77"; then 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 echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5 echo $ECHO_N "checking how to get verbose linking output from $F77... $ECHO_C" >&6 if test "${ac_cv_prog_f77_v+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do 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 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 77 compiler in order to get # "verbose" output that we can then parse for the Fortran 77 linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" (eval echo $as_me:__oline__: \"$ac_link\") >&5 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'` echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -f conftest* 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 we are using xlf then replace all the commas with spaces. if echo $ac_f77_v_output | grep xlfentry >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` fi # 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" # If we are using Cray Fortran then delete quotes. # Use "\"" instead of '"' for font-lock-mode. # FIXME: a more general fix for quoted arguments with spaces? if echo $ac_f77_v_output | grep cft90 >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` fi # 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 { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5 echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: WARNING: compilation failed" >&5 echo "$as_me: WARNING: compilation failed" >&2;} fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5 echo "${ECHO_T}$ac_cv_prog_f77_v" >&6 echo "$as_me:$LINENO: checking for Fortran 77 libraries" >&5 echo $ECHO_N "checking for Fortran 77 libraries... $ECHO_C" >&6 if test "${ac_cv_flibs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$FLIBS" != "x"; then ac_cv_flibs="$FLIBS" # Let the user override the test. else 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 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 77 compiler in order to get # "verbose" output that we can then parse for the Fortran 77 linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" (eval echo $as_me:__oline__: \"$ac_link\") >&5 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'` echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -f conftest* 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 we are using xlf then replace all the commas with spaces. if echo $ac_f77_v_output | grep xlfentry >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` fi # 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" # If we are using Cray Fortran then delete quotes. # Use "\"" instead of '"' for font-lock-mode. # FIXME: a more general fix for quoted arguments with spaces? if echo $ac_f77_v_output | grep cft90 >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` fi ac_cv_flibs= # 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_flibs; 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_flibs="$ac_cv_flibs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs -Xlinker $ac_link_opt" done else ac_cv_flibs="$ac_cv_flibs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt0.o | -lc | -lgcc | -libmil | -LANG:=*) ;; -lkernel32) test x"$CYGWIN" != xyes && ac_cv_flibs="$ac_cv_flibs $ac_arg" ;; -[LRuY]) # 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 `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs $ac_arg" fi ;; # 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=`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_flibs="$ac_cv_flibs -Xlinker $ac_link_opt" done else ac_cv_flibs="$ac_cv_flibs $ac_ld_run_path" fi ;; esac fi # test "x$FLIBS" = "x" fi echo "$as_me:$LINENO: result: $ac_cv_flibs" >&5 echo "${ECHO_T}$ac_cv_flibs" >&6 FLIBS="$ac_cv_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 echo "$as_me:$LINENO: checking for dummy main to link with Fortran 77 libraries" >&5 echo $ECHO_N "checking for dummy main to link with Fortran 77 libraries... $ECHO_C" >&6 if test "${ac_cv_f77_dummy_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" # First, try linking without a dummy main: cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_f77_dummy_main=none else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_f77_dummy_main=unknown fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_cv_f77_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@define F77_DUMMY_MAIN $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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_f77_dummy_main=$ac_func; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi rm -f conftest* LIBS=$ac_f77_dm_save_LIBS 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 fi echo "$as_me:$LINENO: result: $ac_cv_f77_dummy_main" >&5 echo "${ECHO_T}$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 fi else { { echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&5 echo "$as_me: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for Fortran 77 name-mangling scheme" >&5 echo $ECHO_N "checking for Fortran 77 name-mangling scheme... $ECHO_C" >&6 if test "${ac_cv_f77_mangling+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv conftest.$ac_objext cf77_test.$ac_objext 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_save_LIBS=$LIBS LIBS="cf77_test.$ac_objext $LIBS $FLIBS" 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_success=yes; break 2 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done done 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_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_success_extra=yes; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done 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 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 rm -f cf77_test* conftest* else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compile a simple Fortran program See \`config.log' for more details." >&5 echo "$as_me: error: cannot compile a simple Fortran program See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest.$ac_ext 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 fi echo "$as_me:$LINENO: result: $ac_cv_f77_mangling" >&5 echo "${ECHO_T}$ac_cv_f77_mangling" >&6 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 ;; *) { echo "$as_me:$LINENO: WARNING: unknown Fortran 77 name-mangling scheme" >&5 echo "$as_me: WARNING: unknown Fortran 77 name-mangling scheme" >&2;} ;; esac fi ############################################################################## # In principle, we should abort if some of the following libraries are # missing, or perhaps only compile some of the subdirectories. For now, # though, we do nothing (and wait for the compilation errors). ############################################################################## # Check for FFTW libraries if test "$enable_single" = "yes"; then echo "$as_me:$LINENO: checking for fftw in -lsfftw" >&5 echo $ECHO_N "checking for fftw in -lsfftw... $ECHO_C" >&6 if test "${ac_cv_lib_sfftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sfftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sfftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sfftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_sfftw_fftw" >&6 if test $ac_cv_lib_sfftw_fftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBSFFTW 1 _ACEOF LIBS="-lsfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -lsrfftw" >&5 echo $ECHO_N "checking for rfftw in -lsrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_srfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_srfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_rfftw" >&6 if test $ac_cv_lib_srfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBSRFFTW 1 _ACEOF LIBS="-lsrfftw $LIBS" fi fi else echo "$as_me:$LINENO: checking for fftw in -ldfftw" >&5 echo $ECHO_N "checking for fftw in -ldfftw... $ECHO_C" >&6 if test "${ac_cv_lib_dfftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dfftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dfftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dfftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_dfftw_fftw" >&6 if test $ac_cv_lib_dfftw_fftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBDFFTW 1 _ACEOF LIBS="-ldfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -ldrfftw" >&5 echo $ECHO_N "checking for rfftw in -ldrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_drfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_drfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_drfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_drfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_drfftw_rfftw" >&6 if test $ac_cv_lib_drfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBDRFFTW 1 _ACEOF LIBS="-ldrfftw $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]fftw'`"; then echo "$as_me:$LINENO: checking for fftw in -lfftw" >&5 echo $ECHO_N "checking for fftw in -lfftw... $ECHO_C" >&6 if test "${ac_cv_lib_fftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_fftw_fftw" >&6 if test $ac_cv_lib_fftw_fftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBFFTW 1 _ACEOF LIBS="-lfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -lrfftw" >&5 echo $ECHO_N "checking for rfftw in -lrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_rfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_rfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_rfftw" >&6 if test $ac_cv_lib_rfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBRFFTW 1 _ACEOF LIBS="-lrfftw $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]*fftw'`"; then { { echo "$as_me:$LINENO: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary." >&5 echo "$as_me: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary." >&2;} { (exit 1); exit 1; }; } fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[ds]*rfftw'`"; then { { echo "$as_me:$LINENO: error: The RFFTW libraries, which are required to compile MPB with inversion symmetry, could not be found. These should have been installed as a part of FFTW." >&5 echo "$as_me: error: The RFFTW libraries, which are required to compile MPB with inversion symmetry, could not be found. These should have been installed as a part of FFTW." >&2;} { (exit 1); exit 1; }; } fi fi ############################################################################## # Checks for BLAS and LAPACK libraries: acx_blas_ok=no # Check whether --with-blas or --without-blas was given. if test "${with_blas+set}" = set; then withval="$with_blas" fi; case $with_blas in yes | "") ;; no) acx_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. case $ac_cv_f77_mangling in upper*) ac_val="SGEMM" ;; lower*) ac_val="sgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac sgemm="$ac_val" case $ac_cv_f77_mangling in upper*) ac_val="DGEMM" ;; lower*) ac_val="dgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dgemm="$ac_val" acx_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable if test $acx_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" echo "$as_me:$LINENO: checking for $sgemm in $BLAS_LIBS" >&5 echo $ECHO_N "checking for $sgemm in $BLAS_LIBS... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_blas_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 BLAS_LIBS="" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $acx_blas_ok" >&5 echo "${ECHO_T}$acx_blas_ok" >&6 LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) if test $acx_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" as_ac_var=`echo "ac_cv_func_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm" >&5 echo $ECHO_N "checking for $sgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $sgemm (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); /* 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_$sgemm) || defined (__stub___$sgemm) choke me #else char (*f) () = $sgemm; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $sgemm; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then acx_blas_ok=yes fi LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test $acx_blas_ok = no; then echo "$as_me:$LINENO: checking for ATL_xerbla in -latlas" >&5 echo $ECHO_N "checking for ATL_xerbla in -latlas... $ECHO_C" >&6 if test "${ac_cv_lib_atlas_ATL_xerbla+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ATL_xerbla (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ATL_xerbla (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_atlas_ATL_xerbla=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_atlas_ATL_xerbla=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 echo "${ECHO_T}$ac_cv_lib_atlas_ATL_xerbla" >&6 if test $ac_cv_lib_atlas_ATL_xerbla = yes; then as_ac_Lib=`echo "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lf77blas" >&5 echo $ECHO_N "checking for $sgemm in -lf77blas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lf77blas -latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then echo "$as_me:$LINENO: checking for cblas_dgemm in -lcblas" >&5 echo $ECHO_N "checking for cblas_dgemm in -lcblas... $ECHO_C" >&6 if test "${ac_cv_lib_cblas_cblas_dgemm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcblas -lf77blas -latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char cblas_dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { cblas_dgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cblas_cblas_dgemm=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cblas_cblas_dgemm=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 echo "${ECHO_T}$ac_cv_lib_cblas_cblas_dgemm" >&6 if test $ac_cv_lib_cblas_cblas_dgemm = yes; then acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas" fi fi fi fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5 echo $ECHO_N "checking for $dgemm in -ldgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldgemm -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $dgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5 echo $ECHO_N "checking for $sgemm in -lsgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsgemm -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas" fi fi fi fi # BLAS in Alpha CXML library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_cxml_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lcxml" >&5 echo $ECHO_N "checking for $sgemm in -lcxml... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcxml $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes;BLAS_LIBS="-lcxml" fi fi # BLAS in Alpha DXML library? (now called CXML, see above) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_dxml_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -ldxml" >&5 echo $ECHO_N "checking for $sgemm in -ldxml... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldxml $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes;BLAS_LIBS="-ldxml" fi fi # BLAS in Sun Performance library? if test $acx_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC echo "$as_me:$LINENO: checking for acosp in -lsunmath" >&5 echo $ECHO_N "checking for acosp in -lsunmath... $ECHO_C" >&6 if test "${ac_cv_lib_sunmath_acosp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsunmath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char acosp (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { acosp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sunmath_acosp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sunmath_acosp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sunmath_acosp" >&5 echo "${ECHO_T}$ac_cv_lib_sunmath_acosp" >&6 if test $ac_cv_lib_sunmath_acosp = yes; then as_ac_Lib=`echo "ac_cv_lib_sunperf_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lsunperf" >&5 echo $ECHO_N "checking for $sgemm in -lsunperf... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsunperf -lsunmath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes fi fi fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_scs_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lscs" >&5 echo $ECHO_N "checking for $sgemm in -lscs... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lscs $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lscs" fi fi # BLAS in SGIMATH library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_complib.sgimath_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lcomplib.sgimath" >&5 echo $ECHO_N "checking for $sgemm in -lcomplib.sgimath... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcomplib.sgimath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath" fi fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_essl_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lessl" >&5 echo $ECHO_N "checking for $sgemm in -lessl... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lessl -lblas $FLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas" fi fi fi # Generic BLAS library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lblas" fi fi LIBS="$acx_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_blas_ok" = xyes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_BLAS 1 _ACEOF : else acx_blas_ok=no { { echo "$as_me:$LINENO: error: BLAS was not found!" >&5 echo "$as_me: error: BLAS was not found!" >&2;} { (exit 1); exit 1; }; } fi acx_lapack_ok=no # Check whether --with-lapack or --without-lapack was given. if test "${with_lapack+set}" = set; then withval="$with_lapack" fi; case $with_lapack in yes | "") ;; no) acx_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac # Get fortran linker name of LAPACK function to check for. case $ac_cv_f77_mangling in upper*) ac_val="CHEEV" ;; lower*) ac_val="cheev" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac cheev="$ac_val" # We cannot use LAPACK if BLAS is not found if test "x$acx_blas_ok" != xyes; then acx_lapack_ok=noblas fi # First, check LAPACK_LIBS environment variable if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" echo "$as_me:$LINENO: checking for $cheev in $LAPACK_LIBS" >&5 echo $ECHO_N "checking for $cheev in $LAPACK_LIBS... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $cheev (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_lapack_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LAPACK_LIBS="" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $acx_lapack_ok" >&5 echo "${ECHO_T}$acx_lapack_ok" >&6 LIBS="$save_LIBS" if test acx_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" as_ac_var=`echo "ac_cv_func_$cheev" | $as_tr_sh` echo "$as_me:$LINENO: checking for $cheev" >&5 echo $ECHO_N "checking for $cheev... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $cheev (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); /* 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_$cheev) || defined (__stub___$cheev) choke me #else char (*f) () = $cheev; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $cheev; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then acx_lapack_ok=yes fi LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" as_ac_Lib=`echo "ac_cv_lib_$lapack''_$cheev" | $as_tr_sh` echo "$as_me:$LINENO: checking for $cheev in -l$lapack" >&5 echo $ECHO_N "checking for $cheev in -l$lapack... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$lapack $FLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $cheev (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack" fi LIBS="$save_LIBS" fi done # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_lapack_ok" = xyes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_LAPACK 1 _ACEOF : else acx_lapack_ok=no { { echo "$as_me:$LINENO: error: LAPACK was not found!" >&5 echo "$as_me: error: LAPACK was not found!" >&2;} { (exit 1); exit 1; }; } fi LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" ############################################################################## # Check for MPI library # Check whether --with-mpi or --without-mpi was given. if test "${with_mpi+set}" = set; then withval="$with_mpi" with_mpi=$withval else with_mpi=no fi; if test "x$with_mpi" = "xyes"; then for ac_prog in mpicc hcc mpcc mpcc_r mpxlc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MPICC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MPICC"; then ac_cv_prog_MPICC="$MPICC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MPICC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi MPICC=$ac_cv_prog_MPICC if test -n "$MPICC"; then echo "$as_me:$LINENO: result: $MPICC" >&5 echo "${ECHO_T}$MPICC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$MPICC" && break done test -n "$MPICC" || MPICC="$CC" acx_mpi_save_CC="$CC" CC="$MPICC" if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init" >&5 echo $ECHO_N "checking for MPI_Init... $ECHO_C" >&6 if test "${ac_cv_func_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char MPI_Init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); /* 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_MPI_Init) || defined (__stub___MPI_Init) choke me #else char (*f) () = MPI_Init; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != MPI_Init; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_func_MPI_Init" >&6 if test $ac_cv_func_MPI_Init = yes; then MPILIBS=" " fi fi if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5 echo $ECHO_N "checking for MPI_Init in -lmpi... $ECHO_C" >&6 if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { MPI_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mpi_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpi_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_lib_mpi_MPI_Init" >&6 if test $ac_cv_lib_mpi_MPI_Init = yes; then MPILIBS="-lmpi" fi fi if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5 echo $ECHO_N "checking for MPI_Init in -lmpich... $ECHO_C" >&6 if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpich $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { MPI_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mpich_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpich_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_lib_mpich_MPI_Init" >&6 if test $ac_cv_lib_mpich_MPI_Init = yes; then MPILIBS="-lmpich" fi fi if test x != x"$MPILIBS"; then echo "$as_me:$LINENO: checking for mpi.h" >&5 echo $ECHO_N "checking for mpi.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 MPILIBS="" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext fi CC="$acx_mpi_save_CC" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x = x"$MPILIBS"; then { { echo "$as_me:$LINENO: error: could not find mpi library for --with-mpi" >&5 echo "$as_me: error: could not find mpi library for --with-mpi" >&2;} { (exit 1); exit 1; }; } : else cat >>confdefs.h <<\_ACEOF @%:@define HAVE_MPI 1 _ACEOF : fi CC="$MPICC" LIBS="$MPILIBS $LIBS" # Make installed program mpb_mpi instead of mpb if test x"$inv_sym" = xyes; then program_transform_name='s,^mpb$$,mpbi-mpi,'";$program_transform_name" else program_transform_name='s,^mpb$$,mpb-mpi,'";$program_transform_name" fi # Check for fftw_mpi library. if test "$enable_single" = "yes"; then echo "$as_me:$LINENO: checking for fftwnd_mpi in -lsfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -lsfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_sfftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sfftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sfftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sfftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_sfftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_sfftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBSFFTW_MPI 1 _ACEOF LIBS="-lsfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -lsrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -lsrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_srfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_srfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_srfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBSRFFTW_MPI 1 _ACEOF LIBS="-lsrfftw_mpi $LIBS" fi fi else echo "$as_me:$LINENO: checking for fftwnd_mpi in -ldfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -ldfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_dfftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dfftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dfftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dfftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_dfftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_dfftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBDFFTW_MPI 1 _ACEOF LIBS="-ldfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -ldrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -ldrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_drfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_drfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_drfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_drfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_drfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_drfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBDRFFTW_MPI 1 _ACEOF LIBS="-ldrfftw_mpi $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]fftw_mpi'`"; then echo "$as_me:$LINENO: checking for fftwnd_mpi in -lfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -lfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_fftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_fftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_fftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBFFTW_MPI 1 _ACEOF LIBS="-lfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -lrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -lrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_rfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_rfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_rfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBRFFTW_MPI 1 _ACEOF LIBS="-lrfftw_mpi $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]*fftw_mpi'`"; then { { echo "$as_me:$LINENO: error: couldn't find fftw_mpi library for --with-mpi" >&5 echo "$as_me: error: couldn't find fftw_mpi library for --with-mpi" >&2;} { (exit 1); exit 1; }; } fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[ds]*rfftw_mpi'`"; then { { echo "$as_me:$LINENO: error: couldn't find rfftw_mpi library for --with-mpi --with-inv-symmetry" >&5 echo "$as_me: error: couldn't find rfftw_mpi library for --with-mpi --with-inv-symmetry" >&2;} { (exit 1); exit 1; }; } fi fi cat >>confdefs.h <<\_ACEOF @%:@define HAVE_MPI 1 _ACEOF BUILD_MPB_DATA="" # don't build/install MPI-linked mpb-data INSTALL_MPB_SPLIT="" # don't install mpb-split, since we don't know # how to run mpb-mpi in general fi ############################################################################## # Check for HDF5 library # Check whether --with-hdf5 or --without-hdf5 was given. if test "${with_hdf5+set}" = set; then withval="$with_hdf5" ok=$withval else ok=yes fi; if test "$ok" = "yes"; then echo "$as_me:$LINENO: checking for deflate in -lz" >&5 echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_deflate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char deflate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { deflate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_deflate=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_deflate=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 if test $ac_cv_lib_z_deflate = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { echo "$as_me:$LINENO: WARNING: zlib is required for HDF5!" >&5 echo "$as_me: WARNING: zlib is required for HDF5!" >&2;} fi save_LIBS_0="$LIBS" # save, to check later if we found any library 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 echo $ECHO_N "(cached) $ECHO_C" >&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 #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else 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 echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else 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 { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for H5Pcreate in -lhdf5" >&5 echo $ECHO_N "checking for H5Pcreate in -lhdf5... $ECHO_C" >&6 if test "${ac_cv_lib_hdf5_H5Pcreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhdf5 $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char H5Pcreate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { H5Pcreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_hdf5_H5Pcreate=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_hdf5_H5Pcreate=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_hdf5_H5Pcreate" >&5 echo "${ECHO_T}$ac_cv_lib_hdf5_H5Pcreate" >&6 if test $ac_cv_lib_hdf5_H5Pcreate = yes; then for ac_header in hdf5.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF LIBS="-lhdf5 $LIBS" cat >>confdefs.h <<\_ACEOF @%:@define HAVE_HDF5 1 _ACEOF fi done fi if test x"$save_LIBS_0" = x"$LIBS"; then { echo "$as_me:$LINENO: WARNING: Couldn't find the HDF5 library!! Switching to --without-hdf5." >&5 echo "$as_me: WARNING: Couldn't find the HDF5 library!! Switching to --without-hdf5." >&2;} fi if test x != x"$MPILIBS"; then for ac_func in H5Pset_mpi H5Pset_fapl_mpio do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi ############################################################################## # Check for Guile library and flags: # Extract the first word of "guile", so it can be a program name with args. set dummy guile; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_guile_ok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$guile_ok"; then ac_cv_prog_guile_ok="$guile_ok" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_guile_ok="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_guile_ok" && ac_cv_prog_guile_ok="no" fi fi guile_ok=$ac_cv_prog_guile_ok if test -n "$guile_ok"; then echo "$as_me:$LINENO: result: $guile_ok" >&5 echo "${ECHO_T}$guile_ok" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$guile_ok" = xno; then { { echo "$as_me:$LINENO: error: could not find guile program; check your PATH" >&5 echo "$as_me: error: could not find guile program; check your PATH" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "guile-config", so it can be a program name with args. set dummy guile-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_HAVE_GUILE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_GUILE_CONFIG"; then ac_cv_prog_HAVE_GUILE_CONFIG="$HAVE_GUILE_CONFIG" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_GUILE_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_HAVE_GUILE_CONFIG" && ac_cv_prog_HAVE_GUILE_CONFIG="no" fi fi HAVE_GUILE_CONFIG=$ac_cv_prog_HAVE_GUILE_CONFIG if test -n "$HAVE_GUILE_CONFIG"; then echo "$as_me:$LINENO: result: $HAVE_GUILE_CONFIG" >&5 echo "${ECHO_T}$HAVE_GUILE_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$HAVE_GUILE_CONFIG" = "yes"; then CPPFLAGS="$CPPFLAGS `guile-config compile`" LIBS="`guile-config link` $LIBS" echo "$as_me:$LINENO: checking if linking to guile works" >&5 echo $ECHO_N "checking if linking to guile works... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gh_enter (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gh_enter (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: guile-config is broken or Guile is not working." >&5 echo "$as_me: error: guile-config is broken or Guile is not working." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext else echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 if test $ac_cv_lib_readline_readline = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBREADLINE 1 _ACEOF LIBS="-lreadline $LIBS" fi echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi save_LIBS_0="$LIBS" # save, to check later if we found any library echo "$as_me:$LINENO: checking for gh_eval_str in -lguile" >&5 echo $ECHO_N "checking for gh_eval_str in -lguile... $ECHO_C" >&6 if test "${ac_cv_lib_guile_gh_eval_str+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lguile $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gh_eval_str (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gh_eval_str (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_guile_gh_eval_str=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_guile_gh_eval_str=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_guile_gh_eval_str" >&5 echo "${ECHO_T}$ac_cv_lib_guile_gh_eval_str" >&6 if test $ac_cv_lib_guile_gh_eval_str = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBGUILE 1 _ACEOF LIBS="-lguile $LIBS" fi if test x"$save_LIBS_0" = x"$LIBS"; then { { echo "$as_me:$LINENO: error: Couldn't find the required Guile library." >&5 echo "$as_me: error: Couldn't find the required Guile library." >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in scm_make_smob_type do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for SCM_SMOB_PREDICATE" >&5 echo $ECHO_N "checking for SCM_SMOB_PREDICATE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_SMOB_PREDICATE(1,x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_SCM_SMOB_PREDICATE 1 _ACEOF fi echo "$as_me:$LINENO: checking for SCM_SMOB_DATA" >&5 echo $ECHO_N "checking for SCM_SMOB_DATA... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_SMOB_DATA(x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_SCM_SMOB_DATA 1 _ACEOF fi echo "$as_me:$LINENO: checking for SCM_NEWSMOB" >&5 echo $ECHO_N "checking for SCM_NEWSMOB... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_NEWSMOB(x,1,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_SCM_NEWSMOB 1 _ACEOF fi # Check how to activate Guile readline support: ACTIVATE_READLINE="" echo "$as_me:$LINENO: checking how to activate readline in Guile" >&5 echo $ECHO_N "checking how to activate readline in Guile... $ECHO_C" >&6 ractivate="(use-modules (readline-activator)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then echo "$as_me:$LINENO: result: readline-activator" >&5 echo "${ECHO_T}readline-activator" >&6 ACTIVATE_READLINE="$ractivate" else ractivate="(use-modules (ice-9 readline)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then echo "$as_me:$LINENO: result: ice-9 readline" >&5 echo "${ECHO_T}ice-9 readline" >&6 ACTIVATE_READLINE="$ractivate" else echo "$as_me:$LINENO: result: cannot" >&5 echo "${ECHO_T}cannot" >&6 ACTIVATE_READLINE="" fi fi ############################################################################## # Check for libctl library and files # Check whether --with-libctl or --without-libctl was given. if test "${with_libctl+set}" = set; then withval="$with_libctl" ok=$withval else ok=yes fi; if test "$ok" = "no"; then { { echo "$as_me:$LINENO: error: libctl is required and you may not disable it" >&5 echo "$as_me: error: libctl is required and you may not disable it" >&2;} { (exit 1); exit 1; }; } elif test "$ok" != "yes"; then LIBCTL_DIR="$ok" fi echo "$as_me:$LINENO: checking for libctl dir" >&5 echo $ECHO_N "checking for libctl dir... $ECHO_C" >&6 if test x != x"$LIBCTL_DIR" -a ! -r "$LIBCTL_DIR/base/ctl.scm"; then LIBCTL_DIR="" fi if test x = x"$LIBCTL_DIR" -a -r /usr/local/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/local/share/libctl" fi if test x = x"$LIBCTL_DIR" -a -r /usr/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/share/libctl" fi if test x = x"$LIBCTL_DIR"; then { { echo "$as_me:$LINENO: error: could not find libctl files; use --with-libctl=" >&5 echo "$as_me: error: could not find libctl files; use --with-libctl=" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $LIBCTL_DIR" >&5 echo "${ECHO_T}$LIBCTL_DIR" >&6 # Extract the first word of "gen-ctl-io", so it can be a program name with args. set dummy gen-ctl-io; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gen_ctl_io_ok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$gen_ctl_io_ok"; then ac_cv_prog_gen_ctl_io_ok="$gen_ctl_io_ok" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_gen_ctl_io_ok="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_gen_ctl_io_ok" && ac_cv_prog_gen_ctl_io_ok="no" fi fi gen_ctl_io_ok=$ac_cv_prog_gen_ctl_io_ok if test -n "$gen_ctl_io_ok"; then echo "$as_me:$LINENO: result: $gen_ctl_io_ok" >&5 echo "${ECHO_T}$gen_ctl_io_ok" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$gen_ctl_io_ok" = xno; then { { echo "$as_me:$LINENO: error: could not find gen-ctl-io program; check your PATH" >&5 echo "$as_me: error: could not find gen-ctl-io program; check your PATH" >&2;} { (exit 1); exit 1; }; } fi GEN_CTL_IO=gen-ctl-io # check for -lctl: echo "$as_me:$LINENO: checking for ctl_get_vector3 in -lctl" >&5 echo $ECHO_N "checking for ctl_get_vector3 in -lctl... $ECHO_C" >&6 if test "${ac_cv_lib_ctl_ctl_get_vector3+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lctl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ctl_get_vector3 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ctl_get_vector3 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ctl_ctl_get_vector3=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ctl_ctl_get_vector3=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ctl_ctl_get_vector3" >&5 echo "${ECHO_T}$ac_cv_lib_ctl_ctl_get_vector3" >&6 if test $ac_cv_lib_ctl_ctl_get_vector3 = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_LIBCTL 1 _ACEOF LIBS="-lctl $LIBS" else { { echo "$as_me:$LINENO: error: Couldn't find the required libctl library." >&5 echo "$as_me: error: Couldn't find the required libctl library." >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_header_ctl_h+set}" = set; then echo "$as_me:$LINENO: checking for ctl.h" >&5 echo $ECHO_N "checking for ctl.h... $ECHO_C" >&6 if test "${ac_cv_header_ctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ctl_h" >&5 echo "${ECHO_T}$ac_cv_header_ctl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ctl.h usability" >&5 echo $ECHO_N "checking ctl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default @%:@include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking ctl.h presence" >&5 echo $ECHO_N "checking ctl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: ctl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ctl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ctl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: ctl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ctl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ctl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ctl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for ctl.h" >&5 echo $ECHO_N "checking for ctl.h... $ECHO_C" >&6 if test "${ac_cv_header_ctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ctl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ctl_h" >&5 echo "${ECHO_T}$ac_cv_header_ctl_h" >&6 fi if test $ac_cv_header_ctl_h = yes; then : else { { echo "$as_me:$LINENO: error: Couldn't find the libctl header." >&5 echo "$as_me: error: Couldn't find the libctl header." >&2;} { (exit 1); exit 1; }; } fi # Check libctl version >= LIBCTL_MAJOR.LIBCTL_MINOR.LIBCTL_BUGFIX LIBCTL_MAJOR=2; LIBCTL_MINOR=1; LIBCTL_BUGFIX=1 echo "$as_me:$LINENO: checking whether libctl version is at least ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX}" >&5 echo $ECHO_N "checking whether libctl version is at least ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX}... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ [ #include #if LIBCTL_MAJOR_VERSION > $LIBCTL_MAJOR || (LIBCTL_MAJOR_VERSION == $LIBCTL_MAJOR && (LIBCTL_MINOR_VERSION > $LIBCTL_MINOR || (LIBCTL_MINOR_VERSION == $LIBCTL_MINOR && LIBCTL_BUGFIX_VERSION >= $LIBCTL_BUGFIX))) yes #endif ] _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 else { { echo "$as_me:$LINENO: error: libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required" >&5 echo "$as_me: error: libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* ############################################################################## # Checks for header files. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @%:@define STDC_HEADERS 1 _ACEOF fi for ac_header in unistd.h getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ @%:@include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX @%:@@%:@ ------------------------------------ @%:@@%:@ @%:@@%:@ Report this to bug-autoconf@gnu.org. @%:@@%:@ @%:@@%:@ ------------------------------------ @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* 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"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 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; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @%:@define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; no) cat >>confdefs.h <<\_ACEOF @%:@define inline _ACEOF ;; *) cat >>confdefs.h <<_ACEOF @%:@define inline $ac_cv_c_inline _ACEOF ;; esac # Checks for library functions. for ac_func in getopt strncmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ############################################################################## # Check to see if calling Fortran functions (in particular, the BLAS # complex dot product functions) works from C: echo "$as_me:$LINENO: checking whether calling BLAS zdotc works" >&5 echo $ECHO_N "checking whether calling BLAS zdotc works... $ECHO_C" >&6 case $ac_cv_f77_mangling in upper*) ac_val="ZDOTC" ;; lower*) ac_val="zdotc" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac zdotc="$ac_val" if test "$cross_compiling" = yes; then ok="no" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include typedef struct { double re, im; } cmplx; #ifdef __cplusplus extern "C" #endif extern cmplx $zdotc(int *, cmplx *, int *, cmplx *, int *); int main(void) { cmplx x[2] = { {1,0}, {0,1} }, y[2] = { {1,0}, {1,0} }; int n = 2, inc1 = 1, inc2 = 1; cmplx result = { 0, 0 }; result = $zdotc(&n, x, &inc1, y, &inc2); if (result.re != 1 || result.im != -1) return EXIT_FAILURE; else return EXIT_SUCCESS; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok="yes" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ok="no" fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test "$ok" = "no"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_FORTRAN_FUNCTIONS 1 _ACEOF fi ############################################################################## # grab the various EIGS_ flags from eigensolver.h and substitute them # into mpb.scm.in (are not regular expressions fun?): # (note that autoconf gets unhappy if we have newlines; we must delete them) EIGS_FLAGS_SCM=`grep '#define EIGS_' $srcdir/src/matrices/eigensolver.h |sed 's/#define \([A-Za-z0-9_]*\) (1<<\([0-9]*\))/(define \1 (pow2 \2))/' |sed 's/#define \([A-Za-z0-9_]*\) (\(.*\))/(define \1 (+ \2))/' |sed 's/ *| */ /g' | tr -d '\n'` ############################################################################## # Find a shell that supports job control, for mpb-split: # Extract the first word of "bash ksh ash", so it can be a program name with args. set dummy bash ksh ash; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SH_JOB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SH_JOB in [\\/]* | ?:[\\/]*) ac_cv_path_SH_JOB="$SH_JOB" # Let the user override the test with a path. ;; *) 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SH_JOB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SH_JOB" && ac_cv_path_SH_JOB="sh" ;; esac fi SH_JOB=$ac_cv_path_SH_JOB if test -n "$SH_JOB"; then echo "$as_me:$LINENO: result: $SH_JOB" >&5 echo "${ECHO_T}$SH_JOB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$SH_JOB" = xsh; then { echo "$as_me:$LINENO: WARNING: Couldn't find bash or ksh shell on your system. The mpb-split command may not work if your sh doesn't support job control." >&5 echo "$as_me: WARNING: Couldn't find bash or ksh shell on your system. The mpb-split command may not work if your sh doesn't support job control." >&2;} fi ############################################################################## ac_config_files="$ac_config_files Makefile tests/Makefile src/util/Makefile src/matrices/Makefile src/matrixio/Makefile src/maxwell/Makefile mpb-ctl/Makefile mpb-ctl/mpb.scm mpb-ctl/mpb-split utils/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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!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" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # 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 DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet 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_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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 ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 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" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "src/util/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/util/Makefile" ;; "src/matrices/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/matrices/Makefile" ;; "src/matrixio/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/matrixio/Makefile" ;; "src/maxwell/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/maxwell/Makefile" ;; "mpb-ctl/Makefile" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/Makefile" ;; "mpb-ctl/mpb.scm" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/mpb.scm" ;; "mpb-ctl/mpb-split" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/mpb-split" ;; "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@MPB_VERSION@,$MPB_VERSION,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@BUILD_MPB_DATA@,$BUILD_MPB_DATA,;t t s,@INSTALL_MPB_SPLIT@,$INSTALL_MPB_SPLIT,;t t s,@SCALAR_TYPE@,$SCALAR_TYPE,;t t s,@FLIBS@,$FLIBS,;t t s,@BLAS_LIBS@,$BLAS_LIBS,;t t s,@LAPACK_LIBS@,$LAPACK_LIBS,;t t s,@MPICC@,$MPICC,;t t s,@MPILIBS@,$MPILIBS,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@guile_ok@,$guile_ok,;t t s,@HAVE_GUILE_CONFIG@,$HAVE_GUILE_CONFIG,;t t s,@ACTIVATE_READLINE@,$ACTIVATE_READLINE,;t t s,@LIBCTL_DIR@,$LIBCTL_DIR,;t t s,@gen_ctl_io_ok@,$gen_ctl_io_ok,;t t s,@GEN_CTL_IO@,$GEN_CTL_IO,;t t s,@EIGS_FLAGS_SCM@,$EIGS_FLAGS_SCM,;t t s,@SH_JOB@,$SH_JOB,;t t s,@LIB@&t@OBJS@,$LIB@&t@OBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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 mpb-1.4.2/autom4te.cache/traces.00000644000175400001440000005731307631010734012135 m4trace:configure.ac:2: -1- AC_INIT m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:2: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.ac:2: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:2: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:2: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:2: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:2: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:2: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:2: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:2: -1- AC_SUBST([datadir], ['${prefix}/share']) m4trace:configure.ac:2: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:2: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:2: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:2: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:2: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:2: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:2: -1- AC_SUBST([infodir], ['${prefix}/info']) m4trace:configure.ac:2: -1- AC_SUBST([mandir], ['${prefix}/man']) m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.ac:2: -1- AC_SUBST([build_alias]) m4trace:configure.ac:2: -1- AC_SUBST([host_alias]) m4trace:configure.ac:2: -1- AC_SUBST([target_alias]) m4trace:configure.ac:2: -1- AC_SUBST([DEFS]) m4trace:configure.ac:2: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:2: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:2: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:2: -1- AC_SUBST([LIBS]) m4trace:configure.ac:4: -1- AC_CONFIG_HEADERS([src/config.h]) m4trace:configure.ac:7: -1- AC_SUBST([MPB_VERSION]) m4trace:configure.ac:11: -1- AC_SUBST([F77]) m4trace:configure.ac:12: -1- AC_SUBST([F77]) m4trace:configure.ac:12: -1- AC_SUBST([FFLAGS]) m4trace:configure.ac:12: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:12: -1- AC_SUBST([F77]) m4trace:configure.ac:12: -1- AC_SUBST([ac_ct_F77]) m4trace:configure.ac:12: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.ac:12: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.ac:17: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_PROG_CC m4trace:configure.ac:18: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:18: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:18: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:18: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:18: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:18: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_SUBST([CC]) m4trace:configure.ac:18: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:21: -1- AC_PROG_RANLIB m4trace:configure.ac:21: -1- AC_SUBST([RANLIB]) m4trace:configure.ac:21: -1- AC_SUBST([ac_ct_RANLIB]) m4trace:configure.ac:22: -1- AC_PROG_INSTALL m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:22: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:23: -1- AC_PROG_MAKE_SET m4trace:configure.ac:23: -1- AC_SUBST([SET_MAKE]) m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([SCALAR_SINGLE_PREC]) m4trace:configure.ac:30: -1- AH_OUTPUT([SCALAR_SINGLE_PREC], [/* Define to use single precision */ #undef SCALAR_SINGLE_PREC]) m4trace:configure.ac:37: -1- AC_DEFINE_TRACE_LITERAL([DEBUG]) m4trace:configure.ac:37: -1- AH_OUTPUT([DEBUG], [/* Define to turn on debugging checks */ #undef DEBUG]) m4trace:configure.ac:42: -1- AC_DEFINE_TRACE_LITERAL([DEBUG_MALLOC]) m4trace:configure.ac:42: -1- AH_OUTPUT([DEBUG_MALLOC], [/* Define to use debugging malloc/free */ #undef DEBUG_MALLOC]) m4trace:configure.ac:48: -1- AC_DEFINE_TRACE_LITERAL([ENABLE_PROF]) m4trace:configure.ac:48: -1- AH_OUTPUT([ENABLE_PROF], [/* Define when using the profiler tool */ #undef ENABLE_PROF]) m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([CHECK_DISABLE]) m4trace:configure.ac:53: -1- AH_OUTPUT([CHECK_DISABLE], [/* Define to disable sanity checks in code */ #undef CHECK_DISABLE]) m4trace:configure.ac:57: -1- AC_SUBST([BUILD_MPB_DATA]) m4trace:configure.ac:60: -1- AC_SUBST([INSTALL_MPB_SPLIT]) m4trace:configure.ac:65: -1- AC_DEFINE_TRACE_LITERAL([SCALAR_COMPLEX]) m4trace:configure.ac:65: -1- AH_OUTPUT([SCALAR_COMPLEX], [/* Define to use complex fields and not to require inversion symmetry */ #undef SCALAR_COMPLEX]) m4trace:configure.ac:73: -1- AC_SUBST([SCALAR_TYPE]) m4trace:configure.ac:78: -1- AC_DEFINE_TRACE_LITERAL([WITH_HERMITIAN_EPSILON]) m4trace:configure.ac:78: -1- AH_OUTPUT([WITH_HERMITIAN_EPSILON], [/* Define to support Hermitian/complex dielectric tensors. */ #undef WITH_HERMITIAN_EPSILON]) m4trace:configure.ac:94: -1- AC_CHECK_LIB([efence], [malloc]) m4trace:configure.ac:94: -1- AH_OUTPUT([HAVE_LIBEFENCE], [/* Define to 1 if you have the `efence\' library (-lefence). */ #undef HAVE_LIBEFENCE]) m4trace:configure.ac:94: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBEFENCE]) m4trace:configure.ac:98: -1- AC_CHECK_LIB([m], [sqrt]) m4trace:configure.ac:98: -1- AH_OUTPUT([HAVE_LIBM], [/* Define to 1 if you have the `m\' library (-lm). */ #undef HAVE_LIBM]) m4trace:configure.ac:98: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBM]) m4trace:configure.ac:103: -1- AC_SUBST([FLIBS]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_DUMMY_MAIN]) m4trace:configure.ac:104: -1- AH_OUTPUT([F77_DUMMY_MAIN], [/* Define to dummy `main\' function (if any) required to link to the Fortran 77 libraries. */ #undef F77_DUMMY_MAIN]) m4trace:configure.ac:104: -1- AH_OUTPUT([F77_FUNC], [/* 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]) m4trace:configure.ac:104: -1- AH_OUTPUT([F77_FUNC_], [/* As F77_FUNC, but for C identifiers containing underscores. */ #undef F77_FUNC_]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC(name,NAME)]) m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([F77_FUNC_(name,NAME)]) m4trace:configure.ac:115: -1- AC_CHECK_LIB([sfftw], [fftw]) m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_LIBSFFTW], [/* Define to 1 if you have the `sfftw\' library (-lsfftw). */ #undef HAVE_LIBSFFTW]) m4trace:configure.ac:115: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSFFTW]) m4trace:configure.ac:117: -1- AC_CHECK_LIB([srfftw], [rfftw]) m4trace:configure.ac:117: -1- AH_OUTPUT([HAVE_LIBSRFFTW], [/* Define to 1 if you have the `srfftw\' library (-lsrfftw). */ #undef HAVE_LIBSRFFTW]) m4trace:configure.ac:117: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSRFFTW]) m4trace:configure.ac:120: -1- AC_CHECK_LIB([dfftw], [fftw]) m4trace:configure.ac:120: -1- AH_OUTPUT([HAVE_LIBDFFTW], [/* Define to 1 if you have the `dfftw\' library (-ldfftw). */ #undef HAVE_LIBDFFTW]) m4trace:configure.ac:120: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDFFTW]) m4trace:configure.ac:122: -1- AC_CHECK_LIB([drfftw], [rfftw]) m4trace:configure.ac:122: -1- AH_OUTPUT([HAVE_LIBDRFFTW], [/* Define to 1 if you have the `drfftw\' library (-ldrfftw). */ #undef HAVE_LIBDRFFTW]) m4trace:configure.ac:122: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDRFFTW]) m4trace:configure.ac:127: -1- AC_CHECK_LIB([fftw], [fftw]) m4trace:configure.ac:127: -1- AH_OUTPUT([HAVE_LIBFFTW], [/* Define to 1 if you have the `fftw\' library (-lfftw). */ #undef HAVE_LIBFFTW]) m4trace:configure.ac:127: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBFFTW]) m4trace:configure.ac:129: -1- AC_CHECK_LIB([rfftw], [rfftw]) m4trace:configure.ac:129: -1- AH_OUTPUT([HAVE_LIBRFFTW], [/* Define to 1 if you have the `rfftw\' library (-lrfftw). */ #undef HAVE_LIBRFFTW]) m4trace:configure.ac:129: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRFFTW]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([atlas], [ATL_xerbla], [AC_CHECK_LIB(f77blas, $sgemm, [AC_CHECK_LIB(cblas, cblas_dgemm, [acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas])], [], [-latlas])]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([f77blas], [$sgemm], [AC_CHECK_LIB(cblas, cblas_dgemm, [acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas])], [], [-latlas]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([cblas], [cblas_dgemm], [acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([blas], [$sgemm], [AC_CHECK_LIB(dgemm, $dgemm, [AC_CHECK_LIB(sgemm, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-lblas])]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([dgemm], [$dgemm], [AC_CHECK_LIB(sgemm, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-lblas]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([sgemm], [$sgemm], [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([cxml], [$sgemm], [acx_blas_ok=yes;BLAS_LIBS="-lcxml"]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([dxml], [$sgemm], [acx_blas_ok=yes;BLAS_LIBS="-ldxml"]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([sunmath], [acosp], [AC_CHECK_LIB(sunperf, $sgemm, [BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes],[],[-lsunmath])]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([sunperf], [$sgemm], [BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes], [], [-lsunmath]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([scs], [$sgemm], [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([complib.sgimath], [$sgemm], [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([blas], [$sgemm], [AC_CHECK_LIB(essl, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], [], [-lblas $FLIBS])]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([essl], [$sgemm], [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], [], [-lblas $FLIBS]) m4trace:configure.ac:149: -1- AC_CHECK_LIB([blas], [$sgemm], [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) m4trace:configure.ac:149: -1- AC_SUBST([BLAS_LIBS]) m4trace:configure.ac:149: -2- AC_DEFINE_TRACE_LITERAL([HAVE_BLAS]) m4trace:configure.ac:149: -2- AH_OUTPUT([HAVE_BLAS], [/* Define if you have a BLAS library. */ #undef HAVE_BLAS]) m4trace:configure.ac:150: -1- AC_CHECK_LIB([$lapack], [$cheev], [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) m4trace:configure.ac:150: -1- AC_SUBST([LAPACK_LIBS]) m4trace:configure.ac:150: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LAPACK]) m4trace:configure.ac:150: -2- AH_OUTPUT([HAVE_LAPACK], [/* Define if you have LAPACK library. */ #undef HAVE_LAPACK]) m4trace:configure.ac:161: -1- AC_SUBST([MPICC]) m4trace:configure.ac:161: -1- AC_SUBST([MPICC]) m4trace:configure.ac:161: -1- AC_CHECK_LIB([mpi], [MPI_Init], [MPILIBS="-lmpi"]) m4trace:configure.ac:161: -1- AC_CHECK_LIB([mpich], [MPI_Init], [MPILIBS="-lmpich"]) m4trace:configure.ac:161: -1- AC_SUBST([MPILIBS]) m4trace:configure.ac:161: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MPI]) m4trace:configure.ac:161: -1- AH_OUTPUT([HAVE_MPI], [/* Define if you have the MPI library. */ #undef HAVE_MPI]) m4trace:configure.ac:174: -1- AC_CHECK_LIB([sfftw_mpi], [fftwnd_mpi]) m4trace:configure.ac:174: -1- AH_OUTPUT([HAVE_LIBSFFTW_MPI], [/* Define to 1 if you have the `sfftw_mpi\' library (-lsfftw_mpi). */ #undef HAVE_LIBSFFTW_MPI]) m4trace:configure.ac:174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSFFTW_MPI]) m4trace:configure.ac:176: -1- AC_CHECK_LIB([srfftw_mpi], [rfftwnd_mpi]) m4trace:configure.ac:176: -1- AH_OUTPUT([HAVE_LIBSRFFTW_MPI], [/* Define to 1 if you have the `srfftw_mpi\' library (-lsrfftw_mpi). */ #undef HAVE_LIBSRFFTW_MPI]) m4trace:configure.ac:176: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSRFFTW_MPI]) m4trace:configure.ac:179: -1- AC_CHECK_LIB([dfftw_mpi], [fftwnd_mpi]) m4trace:configure.ac:179: -1- AH_OUTPUT([HAVE_LIBDFFTW_MPI], [/* Define to 1 if you have the `dfftw_mpi\' library (-ldfftw_mpi). */ #undef HAVE_LIBDFFTW_MPI]) m4trace:configure.ac:179: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDFFTW_MPI]) m4trace:configure.ac:181: -1- AC_CHECK_LIB([drfftw_mpi], [rfftwnd_mpi]) m4trace:configure.ac:181: -1- AH_OUTPUT([HAVE_LIBDRFFTW_MPI], [/* Define to 1 if you have the `drfftw_mpi\' library (-ldrfftw_mpi). */ #undef HAVE_LIBDRFFTW_MPI]) m4trace:configure.ac:181: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDRFFTW_MPI]) m4trace:configure.ac:185: -1- AC_CHECK_LIB([fftw_mpi], [fftwnd_mpi]) m4trace:configure.ac:185: -1- AH_OUTPUT([HAVE_LIBFFTW_MPI], [/* Define to 1 if you have the `fftw_mpi\' library (-lfftw_mpi). */ #undef HAVE_LIBFFTW_MPI]) m4trace:configure.ac:185: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBFFTW_MPI]) m4trace:configure.ac:187: -1- AC_CHECK_LIB([rfftw_mpi], [rfftwnd_mpi]) m4trace:configure.ac:187: -1- AH_OUTPUT([HAVE_LIBRFFTW_MPI], [/* Define to 1 if you have the `rfftw_mpi\' library (-lrfftw_mpi). */ #undef HAVE_LIBRFFTW_MPI]) m4trace:configure.ac:187: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRFFTW_MPI]) m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MPI]) m4trace:configure.ac:199: -1- AH_OUTPUT([HAVE_MPI], [/* Define if you have & link an MPI library. */ #undef HAVE_MPI]) m4trace:configure.ac:210: -1- AC_CHECK_LIB([z], [deflate], [], [AC_MSG_WARN([zlib is required for HDF5!])]) m4trace:configure.ac:210: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the `z\' library (-lz). */ #undef HAVE_LIBZ]) m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ]) m4trace:configure.ac:215: -1- AC_CHECK_LIB([hdf5], [H5Pcreate], [ AC_CHECK_HEADERS(hdf5.h, [LIBS="-lhdf5 $LIBS" AC_DEFINE(HAVE_HDF5,1,[Define if we have & link HDF5])])]) m4trace:configure.ac:215: -1- AC_CHECK_HEADERS([hdf5.h], [LIBS="-lhdf5 $LIBS" AC_DEFINE(HAVE_HDF5,1,[Define if we have & link HDF5])]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_HDF5_H], [/* Define to 1 if you have the header file. */ #undef HAVE_HDF5_H]) m4trace:configure.ac:215: -1- AC_HEADER_STDC m4trace:configure.ac:215: -1- AC_PROG_CPP m4trace:configure.ac:215: -1- AC_SUBST([CPP]) m4trace:configure.ac:215: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:215: -1- AC_SUBST([CPP]) m4trace:configure.ac:215: -1- AC_SUBST([EGREP]) m4trace:configure.ac:215: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:215: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.ac:215: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.ac:215: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HDF5]) m4trace:configure.ac:215: -1- AH_OUTPUT([HAVE_HDF5], [/* Define if we have & link HDF5 */ #undef HAVE_HDF5]) m4trace:configure.ac:221: -1- AC_CHECK_FUNCS([H5Pset_mpi H5Pset_fapl_mpio]) m4trace:configure.ac:221: -1- AH_OUTPUT([HAVE_H5PSET_MPI], [/* Define to 1 if you have the `H5Pset_mpi\' function. */ #undef HAVE_H5PSET_MPI]) m4trace:configure.ac:221: -1- AH_OUTPUT([HAVE_H5PSET_FAPL_MPIO], [/* Define to 1 if you have the `H5Pset_fapl_mpio\' function. */ #undef HAVE_H5PSET_FAPL_MPIO]) m4trace:configure.ac:228: -1- AC_SUBST([guile_ok]) m4trace:configure.ac:233: -1- AC_SUBST([HAVE_GUILE_CONFIG]) m4trace:configure.ac:243: -1- AC_CHECK_LIB([readline], [readline]) m4trace:configure.ac:243: -1- AH_OUTPUT([HAVE_LIBREADLINE], [/* Define to 1 if you have the `readline\' library (-lreadline). */ #undef HAVE_LIBREADLINE]) m4trace:configure.ac:243: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBREADLINE]) m4trace:configure.ac:244: -1- AC_CHECK_LIB([dl], [dlopen]) m4trace:configure.ac:244: -1- AH_OUTPUT([HAVE_LIBDL], [/* Define to 1 if you have the `dl\' library (-ldl). */ #undef HAVE_LIBDL]) m4trace:configure.ac:244: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDL]) m4trace:configure.ac:247: -1- AC_CHECK_LIB([guile], [gh_eval_str]) m4trace:configure.ac:247: -1- AH_OUTPUT([HAVE_LIBGUILE], [/* Define to 1 if you have the `guile\' library (-lguile). */ #undef HAVE_LIBGUILE]) m4trace:configure.ac:247: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBGUILE]) m4trace:configure.ac:253: -1- AC_CHECK_FUNCS([scm_make_smob_type]) m4trace:configure.ac:253: -1- AH_OUTPUT([HAVE_SCM_MAKE_SMOB_TYPE], [/* Define to 1 if you have the `scm_make_smob_type\' function. */ #undef HAVE_SCM_MAKE_SMOB_TYPE]) m4trace:configure.ac:261: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SCM_SMOB_PREDICATE]) m4trace:configure.ac:261: -1- AH_OUTPUT([HAVE_SCM_SMOB_PREDICATE], [/* define if we have SCM_SMOB_PREDICATE */ #undef HAVE_SCM_SMOB_PREDICATE]) m4trace:configure.ac:270: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SCM_SMOB_DATA]) m4trace:configure.ac:270: -1- AH_OUTPUT([HAVE_SCM_SMOB_DATA], [/* define if we have SCM_SMOB_DATA */ #undef HAVE_SCM_SMOB_DATA]) m4trace:configure.ac:279: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SCM_NEWSMOB]) m4trace:configure.ac:279: -1- AH_OUTPUT([HAVE_SCM_NEWSMOB], [/* define if we have SCM_NEWSMOB */ #undef HAVE_SCM_NEWSMOB]) m4trace:configure.ac:300: -1- AC_SUBST([ACTIVATE_READLINE]) m4trace:configure.ac:326: -1- AC_SUBST([LIBCTL_DIR]) m4trace:configure.ac:328: -1- AC_SUBST([gen_ctl_io_ok]) m4trace:configure.ac:334: -1- AC_SUBST([GEN_CTL_IO]) m4trace:configure.ac:337: -1- AC_CHECK_LIB([ctl], [ctl_get_vector3], [], [AC_MSG_ERROR([Couldn't find the required libctl library.])]) m4trace:configure.ac:337: -1- AH_OUTPUT([HAVE_LIBCTL], [/* Define to 1 if you have the `ctl\' library (-lctl). */ #undef HAVE_LIBCTL]) m4trace:configure.ac:337: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCTL]) m4trace:configure.ac:353: -1- AC_HEADER_STDC m4trace:configure.ac:353: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:353: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.ac:354: -1- AC_CHECK_HEADERS([unistd.h getopt.h]) m4trace:configure.ac:354: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.ac:354: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H]) m4trace:configure.ac:357: -1- AC_C_CONST m4trace:configure.ac:357: -1- AC_DEFINE_TRACE_LITERAL([const]) m4trace:configure.ac:357: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ #undef const]) m4trace:configure.ac:358: -1- AC_C_INLINE m4trace:configure.ac:358: -1- AC_DEFINE_TRACE_LITERAL([inline]) m4trace:configure.ac:358: -1- AH_OUTPUT([inline], [/* Define as `__inline\' if that\'s what the C compiler calls it, or to nothing if it is not supported. */ #undef inline]) m4trace:configure.ac:358: -1- AC_DEFINE_TRACE_LITERAL([inline]) m4trace:configure.ac:361: -1- AC_CHECK_FUNCS([getopt strncmp]) m4trace:configure.ac:361: -1- AH_OUTPUT([HAVE_GETOPT], [/* Define to 1 if you have the `getopt\' function. */ #undef HAVE_GETOPT]) m4trace:configure.ac:361: -1- AH_OUTPUT([HAVE_STRNCMP], [/* Define to 1 if you have the `strncmp\' function. */ #undef HAVE_STRNCMP]) m4trace:configure.ac:388: -1- AC_DEFINE_TRACE_LITERAL([NO_FORTRAN_FUNCTIONS]) m4trace:configure.ac:388: -1- AH_OUTPUT([NO_FORTRAN_FUNCTIONS], [/* Define if calling Fortran functions directly doesn\'t work. */ #undef NO_FORTRAN_FUNCTIONS]) m4trace:configure.ac:397: -1- AC_SUBST([EIGS_FLAGS_SCM]) m4trace:configure.ac:402: -1- AC_SUBST([SH_JOB], [$ac_cv_path_SH_JOB]) m4trace:configure.ac:410: -1- AC_CONFIG_FILES([Makefile tests/Makefile src/util/Makefile src/matrices/Makefile src/matrixio/Makefile src/maxwell/Makefile mpb-ctl/Makefile mpb-ctl/mpb.scm mpb-ctl/mpb-split utils/Makefile]) m4trace:configure.ac:411: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:411: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) mpb-1.4.2/configure0000755000175400001440000105501207631010735007672 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # 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 Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # 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` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/matrices/matrices.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MPB_VERSION F77 FFLAGS LDFLAGS ac_ct_F77 EXEEXT OBJEXT CC CFLAGS CPPFLAGS ac_ct_CC RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE BUILD_MPB_DATA INSTALL_MPB_SPLIT SCALAR_TYPE FLIBS BLAS_LIBS LAPACK_LIBS MPICC MPILIBS CPP EGREP guile_ok HAVE_GUILE_CONFIG ACTIVATE_READLINE LIBCTL_DIR gen_ctl_io_ok GEN_CTL_IO EIGS_FLAGS_SCM SH_JOB LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=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 ;; -*) { 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 && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_F77_set=${F77+set} ac_env_F77_value=$F77 ac_cv_env_F77_set=${F77+set} ac_cv_env_F77_value=$F77 ac_env_FFLAGS_set=${FFLAGS+set} ac_env_FFLAGS_value=$FFLAGS ac_cv_env_FFLAGS_set=${FFLAGS+set} ac_cv_env_FFLAGS_value=$FFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 this package 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-single compile for single precision --enable-debug compile for debugging --enable-debug-malloc use debug malloc/free --enable-prof compile for profiling --disable-checks disable runtime checks Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-inv-symmetry take advantage of (and require) inv. sym. --with-hermitian-eps allow complex-Hermitian dielectric tensors --with-efence use ElectricFence library --with-blas= use BLAS library --with-lapack= use LAPACK library --with-mpi enable MPI parallelization --without-hdf5 do not use HDF5 output --with-libctl= specify libctl directory 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 CC C compiler command CFLAGS C compiler flags CPPFLAGS C/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. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 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 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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=. echo "PATH: $as_dir" done } >&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_sep= 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=`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_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. 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, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf 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 -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 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 { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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 { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 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 ac_config_headers="$ac_config_headers src/config.h" MPB_VERSION=1.4.2 echo "$as_me:$LINENO: checking for vendor f77 to be used instead of g77" >&5 echo $ECHO_N "checking for vendor f77 to be used instead of g77... $ECHO_C" >&6 echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 for ac_prog in f77 xlf77 cf77 fort77 f90 xlf90 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break 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 -n "$ac_tool_prefix"; then for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then echo "$as_me:$LINENO: result: $F77" >&5 echo "${ECHO_T}$F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 echo "${ECHO_T}$ac_ct_F77" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_F77" && break done F77=$ac_ct_F77 fi # Provide some information about the compiler. echo "$as_me:1433:" \ "checking for Fortran 77 compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 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.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. echo "$as_me:$LINENO: checking for Fortran 77 compiler default output" >&5 echo $ECHO_N "checking for Fortran 77 compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: Fortran 77 compiler cannot create executables See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the Fortran 77 compiler works" >&5 echo $ECHO_N "checking whether the Fortran 77 compiler works... $ECHO_C" >&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' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? 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 { { 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 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 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? 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 | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$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. ac_save_ext=$ac_ext ac_ext=F echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6 if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6 ac_ext=$ac_save_ext G77=`test $ac_compiler_gnu = yes && echo yes` ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_f77_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 echo "${ECHO_T}$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 "$G77" = yes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "$G77" = yes; then FFLAGS="-O2" else FFLAGS= fi 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 # Get C compiler. echo "$as_me:$LINENO: checking for vendor cc to be used instead of gcc" >&5 echo $ECHO_N "checking for vendor cc to be used instead of gcc... $ECHO_C" >&6 echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 for ac_prog in cc xlc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done # prefer vendor cc, to stay in sync with Fortran 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 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 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. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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; } 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 # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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 programs. if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # check how to transform the name of the installed program: test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # Check whether --enable-single or --disable-single was given. if test "${enable_single+set}" = set; then enableval="$enable_single" enable_single=$enableval else enable_single=no fi; if test "$enable_single" = "yes"; then cat >>confdefs.h <<\_ACEOF #define SCALAR_SINGLE_PREC 1 _ACEOF echo "*********************** SINGLE PRECISION ***********************" fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then CFLAGS="-g" cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF fi # Check whether --enable-debug-malloc or --disable-debug-malloc was given. if test "${enable_debug_malloc+set}" = set; then enableval="$enable_debug_malloc" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUG_MALLOC 1 _ACEOF fi # Check whether --enable-prof or --disable-prof was given. if test "${enable_prof+set}" = set; then enableval="$enable_prof" ok=$enableval else ok=no fi; if test "$ok" = "yes"; then CFLAGS="$CFLAGS -pg" cat >>confdefs.h <<\_ACEOF #define ENABLE_PROF 1 _ACEOF fi # Check whether --enable-checks or --disable-checks was given. if test "${enable_checks+set}" = set; then enableval="$enable_checks" ok=$enableval else ok=yes fi; if test "$ok" = "no"; then cat >>confdefs.h <<\_ACEOF #define CHECK_DISABLE 1 _ACEOF fi BUILD_MPB_DATA=mpb-data # mpb-data program to build, if any INSTALL_MPB_SPLIT=install-mpb-split # mpb-split target to install, if any # Check whether --with-inv-symmetry or --without-inv-symmetry was given. if test "${with_inv_symmetry+set}" = set; then withval="$with_inv_symmetry" inv_sym=$withval else inv_sym=no fi; if test "$inv_sym" = "no"; then cat >>confdefs.h <<\_ACEOF #define SCALAR_COMPLEX 1 _ACEOF SCALAR_TYPE=complex else SCALAR_TYPE=real # Make installed program mpbi instead of mpb, but don't change mpb-data program_transform_name='s,^mpb$$,mpbi,'";$program_transform_name" echo "*********************** INVERSION SYM. ***********************" fi # Check whether --with-hermitian-eps or --without-hermitian-eps was given. if test "${with_hermitian_eps+set}" = set; then withval="$with_hermitian_eps" hermitian_epsilon=$withval else hermitian_epsilon=no fi; if test "$hermitian_epsilon" = "yes"; then cat >>confdefs.h <<\_ACEOF #define WITH_HERMITIAN_EPSILON 1 _ACEOF echo "*********************** HERMITIAN EPS. ***********************" fi # Add lots of compiler warnings to check for if we are using gcc: # (The variable $GCC is set to "yes" by AC_PROG_CC if we are using gcc.) if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall -W -Wbad-function-cast -Wcast-qual -Wpointer-arith -Wcast-align -pedantic" fi ############################################################################## # Checks for libraries: ############################################################################## # Check whether --with-efence or --without-efence was given. if test "${with_efence+set}" = set; then withval="$with_efence" ok=$withval else ok=no fi; if test "$ok" = "yes"; then echo "$as_me:$LINENO: checking for malloc in -lefence" >&5 echo $ECHO_N "checking for malloc in -lefence... $ECHO_C" >&6 if test "${ac_cv_lib_efence_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_efence_malloc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_efence_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_efence_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_efence_malloc" >&6 if test $ac_cv_lib_efence_malloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBEFENCE 1 _ACEOF LIBS="-lefence $LIBS" fi fi ############################################################################## echo "$as_me:$LINENO: checking for sqrt in -lm" >&5 echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sqrt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sqrt (); int main () { sqrt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sqrt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_sqrt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5 echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6 if test $ac_cv_lib_m_sqrt = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # If we have a Fortran compiler, link to its libraries, since these # are probably needed to link with the BLAS/LAPACK libraries. if test x != x"$F77"; then 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 echo "$as_me:$LINENO: checking how to get verbose linking output from $F77" >&5 echo $ECHO_N "checking how to get verbose linking output from $F77... $ECHO_C" >&6 if test "${ac_cv_prog_f77_v+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF program main end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do 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 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 77 compiler in order to get # "verbose" output that we can then parse for the Fortran 77 linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" (eval echo $as_me:3003: \"$ac_link\") >&5 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'` echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -f conftest* 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 we are using xlf then replace all the commas with spaces. if echo $ac_f77_v_output | grep xlfentry >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` fi # 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" # If we are using Cray Fortran then delete quotes. # Use "\"" instead of '"' for font-lock-mode. # FIXME: a more general fix for quoted arguments with spaces? if echo $ac_f77_v_output | grep cft90 >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` fi # 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 { echo "$as_me:$LINENO: WARNING: cannot determine how to obtain linking information from $F77" >&5 echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: WARNING: compilation failed" >&5 echo "$as_me: WARNING: compilation failed" >&2;} fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_f77_v" >&5 echo "${ECHO_T}$ac_cv_prog_f77_v" >&6 echo "$as_me:$LINENO: checking for Fortran 77 libraries" >&5 echo $ECHO_N "checking for Fortran 77 libraries... $ECHO_C" >&6 if test "${ac_cv_flibs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$FLIBS" != "x"; then ac_cv_flibs="$FLIBS" # Let the user override the test. else 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 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 77 compiler in order to get # "verbose" output that we can then parse for the Fortran 77 linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" (eval echo $as_me:3083: \"$ac_link\") >&5 ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | grep -v 'Driving:'` echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -f conftest* 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 we are using xlf then replace all the commas with spaces. if echo $ac_f77_v_output | grep xlfentry >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed 's/,/ /g'` fi # 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" # If we are using Cray Fortran then delete quotes. # Use "\"" instead of '"' for font-lock-mode. # FIXME: a more general fix for quoted arguments with spaces? if echo $ac_f77_v_output | grep cft90 >/dev/null 2>&1; then ac_f77_v_output=`echo $ac_f77_v_output | sed "s/\"//g"` fi ac_cv_flibs= # 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_flibs; 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_flibs="$ac_cv_flibs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs -Xlinker $ac_link_opt" done else ac_cv_flibs="$ac_cv_flibs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt0.o | -lc | -lgcc | -libmil | -LANG:=*) ;; -lkernel32) test x"$CYGWIN" != xyes && ac_cv_flibs="$ac_cv_flibs $ac_arg" ;; -[LRuY]) # 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 `echo $ac_arg | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_flibs; 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_flibs="$ac_cv_flibs $ac_arg" fi ;; # 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=`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_flibs="$ac_cv_flibs -Xlinker $ac_link_opt" done else ac_cv_flibs="$ac_cv_flibs $ac_ld_run_path" fi ;; esac fi # test "x$FLIBS" = "x" fi echo "$as_me:$LINENO: result: $ac_cv_flibs" >&5 echo "${ECHO_T}$ac_cv_flibs" >&6 FLIBS="$ac_cv_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 echo "$as_me:$LINENO: checking for dummy main to link with Fortran 77 libraries" >&5 echo $ECHO_N "checking for dummy main to link with Fortran 77 libraries... $ECHO_C" >&6 if test "${ac_cv_f77_dummy_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" # First, try linking without a dummy main: cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_f77_dummy_main=none else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_f77_dummy_main=unknown fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test $ac_cv_f77_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define F77_DUMMY_MAIN $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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_f77_dummy_main=$ac_func; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi rm -f conftest* LIBS=$ac_f77_dm_save_LIBS 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 fi echo "$as_me:$LINENO: result: $ac_cv_f77_dummy_main" >&5 echo "${ECHO_T}$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 fi else { { echo "$as_me:$LINENO: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&5 echo "$as_me: error: linking to Fortran libraries from C fails See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: checking for Fortran 77 name-mangling scheme" >&5 echo $ECHO_N "checking for Fortran 77 name-mangling scheme... $ECHO_C" >&6 if test "${ac_cv_f77_mangling+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv conftest.$ac_objext cf77_test.$ac_objext 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_save_LIBS=$LIBS LIBS="cf77_test.$ac_objext $LIBS $FLIBS" 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_success=yes; break 2 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done done 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_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_success_extra=yes; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done 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 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 rm -f cf77_test* conftest* else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compile a simple Fortran program See \`config.log' for more details." >&5 echo "$as_me: error: cannot compile a simple Fortran program See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest.$ac_ext 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 fi echo "$as_me:$LINENO: result: $ac_cv_f77_mangling" >&5 echo "${ECHO_T}$ac_cv_f77_mangling" >&6 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 ;; *) { echo "$as_me:$LINENO: WARNING: unknown Fortran 77 name-mangling scheme" >&5 echo "$as_me: WARNING: unknown Fortran 77 name-mangling scheme" >&2;} ;; esac fi ############################################################################## # In principle, we should abort if some of the following libraries are # missing, or perhaps only compile some of the subdirectories. For now, # though, we do nothing (and wait for the compilation errors). ############################################################################## # Check for FFTW libraries if test "$enable_single" = "yes"; then echo "$as_me:$LINENO: checking for fftw in -lsfftw" >&5 echo $ECHO_N "checking for fftw in -lsfftw... $ECHO_C" >&6 if test "${ac_cv_lib_sfftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sfftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sfftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sfftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_sfftw_fftw" >&6 if test $ac_cv_lib_sfftw_fftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSFFTW 1 _ACEOF LIBS="-lsfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -lsrfftw" >&5 echo $ECHO_N "checking for rfftw in -lsrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_srfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_srfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_rfftw" >&6 if test $ac_cv_lib_srfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSRFFTW 1 _ACEOF LIBS="-lsrfftw $LIBS" fi fi else echo "$as_me:$LINENO: checking for fftw in -ldfftw" >&5 echo $ECHO_N "checking for fftw in -ldfftw... $ECHO_C" >&6 if test "${ac_cv_lib_dfftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dfftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dfftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dfftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_dfftw_fftw" >&6 if test $ac_cv_lib_dfftw_fftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDFFTW 1 _ACEOF LIBS="-ldfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -ldrfftw" >&5 echo $ECHO_N "checking for rfftw in -ldrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_drfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_drfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_drfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_drfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_drfftw_rfftw" >&6 if test $ac_cv_lib_drfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDRFFTW 1 _ACEOF LIBS="-ldrfftw $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]fftw'`"; then echo "$as_me:$LINENO: checking for fftw in -lfftw" >&5 echo $ECHO_N "checking for fftw in -lfftw... $ECHO_C" >&6 if test "${ac_cv_lib_fftw_fftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fftw_fftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw_fftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fftw_fftw" >&5 echo "${ECHO_T}$ac_cv_lib_fftw_fftw" >&6 if test $ac_cv_lib_fftw_fftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBFFTW 1 _ACEOF LIBS="-lfftw $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftw in -lrfftw" >&5 echo $ECHO_N "checking for rfftw in -lrfftw... $ECHO_C" >&6 if test "${ac_cv_lib_rfftw_rfftw+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftw (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftw (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_rfftw_rfftw=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_rfftw=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_rfftw" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_rfftw" >&6 if test $ac_cv_lib_rfftw_rfftw = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRFFTW 1 _ACEOF LIBS="-lrfftw $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]*fftw'`"; then { { echo "$as_me:$LINENO: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary." >&5 echo "$as_me: error: The FFTW libraries could not be found. Make sure FFTW is installed, and that LDFLAGS and CPPFLAGS are set appropriately if necessary." >&2;} { (exit 1); exit 1; }; } fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[ds]*rfftw'`"; then { { echo "$as_me:$LINENO: error: The RFFTW libraries, which are required to compile MPB with inversion symmetry, could not be found. These should have been installed as a part of FFTW." >&5 echo "$as_me: error: The RFFTW libraries, which are required to compile MPB with inversion symmetry, could not be found. These should have been installed as a part of FFTW." >&2;} { (exit 1); exit 1; }; } fi fi ############################################################################## # Checks for BLAS and LAPACK libraries: acx_blas_ok=no # Check whether --with-blas or --without-blas was given. if test "${with_blas+set}" = set; then withval="$with_blas" fi; case $with_blas in yes | "") ;; no) acx_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. case $ac_cv_f77_mangling in upper*) ac_val="SGEMM" ;; lower*) ac_val="sgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac sgemm="$ac_val" case $ac_cv_f77_mangling in upper*) ac_val="DGEMM" ;; lower*) ac_val="dgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dgemm="$ac_val" acx_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable if test $acx_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" echo "$as_me:$LINENO: checking for $sgemm in $BLAS_LIBS" >&5 echo $ECHO_N "checking for $sgemm in $BLAS_LIBS... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_blas_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 BLAS_LIBS="" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $acx_blas_ok" >&5 echo "${ECHO_T}$acx_blas_ok" >&6 LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) if test $acx_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" as_ac_var=`echo "ac_cv_func_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm" >&5 echo $ECHO_N "checking for $sgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $sgemm (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); /* 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_$sgemm) || defined (__stub___$sgemm) choke me #else char (*f) () = $sgemm; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $sgemm; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then acx_blas_ok=yes fi LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test $acx_blas_ok = no; then echo "$as_me:$LINENO: checking for ATL_xerbla in -latlas" >&5 echo $ECHO_N "checking for ATL_xerbla in -latlas... $ECHO_C" >&6 if test "${ac_cv_lib_atlas_ATL_xerbla+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ATL_xerbla (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ATL_xerbla (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_atlas_ATL_xerbla=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_atlas_ATL_xerbla=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 echo "${ECHO_T}$ac_cv_lib_atlas_ATL_xerbla" >&6 if test $ac_cv_lib_atlas_ATL_xerbla = yes; then as_ac_Lib=`echo "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lf77blas" >&5 echo $ECHO_N "checking for $sgemm in -lf77blas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lf77blas -latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then echo "$as_me:$LINENO: checking for cblas_dgemm in -lcblas" >&5 echo $ECHO_N "checking for cblas_dgemm in -lcblas... $ECHO_C" >&6 if test "${ac_cv_lib_cblas_cblas_dgemm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcblas -lf77blas -latlas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char cblas_dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { cblas_dgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cblas_cblas_dgemm=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cblas_cblas_dgemm=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 echo "${ECHO_T}$ac_cv_lib_cblas_cblas_dgemm" >&6 if test $ac_cv_lib_cblas_cblas_dgemm = yes; then acx_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas" fi fi fi fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $dgemm in -ldgemm" >&5 echo $ECHO_N "checking for $dgemm in -ldgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldgemm -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $dgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lsgemm" >&5 echo $ECHO_N "checking for $sgemm in -lsgemm... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsgemm -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas" fi fi fi fi # BLAS in Alpha CXML library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_cxml_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lcxml" >&5 echo $ECHO_N "checking for $sgemm in -lcxml... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcxml $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes;BLAS_LIBS="-lcxml" fi fi # BLAS in Alpha DXML library? (now called CXML, see above) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_dxml_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -ldxml" >&5 echo $ECHO_N "checking for $sgemm in -ldxml... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldxml $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes;BLAS_LIBS="-ldxml" fi fi # BLAS in Sun Performance library? if test $acx_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC echo "$as_me:$LINENO: checking for acosp in -lsunmath" >&5 echo $ECHO_N "checking for acosp in -lsunmath... $ECHO_C" >&6 if test "${ac_cv_lib_sunmath_acosp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsunmath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char acosp (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { acosp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sunmath_acosp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sunmath_acosp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sunmath_acosp" >&5 echo "${ECHO_T}$ac_cv_lib_sunmath_acosp" >&6 if test $ac_cv_lib_sunmath_acosp = yes; then as_ac_Lib=`echo "ac_cv_lib_sunperf_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lsunperf" >&5 echo $ECHO_N "checking for $sgemm in -lsunperf... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsunperf -lsunmath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes fi fi fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_scs_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lscs" >&5 echo $ECHO_N "checking for $sgemm in -lscs... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lscs $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lscs" fi fi # BLAS in SGIMATH library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_complib.sgimath_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lcomplib.sgimath" >&5 echo $ECHO_N "checking for $sgemm in -lcomplib.sgimath... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcomplib.sgimath $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath" fi fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then as_ac_Lib=`echo "ac_cv_lib_essl_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lessl" >&5 echo $ECHO_N "checking for $sgemm in -lessl... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lessl -lblas $FLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas" fi fi fi # Generic BLAS library? if test $acx_blas_ok = no; then as_ac_Lib=`echo "ac_cv_lib_blas_$sgemm" | $as_tr_sh` echo "$as_me:$LINENO: checking for $sgemm in -lblas" >&5 echo $ECHO_N "checking for $sgemm in -lblas... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $sgemm (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_blas_ok=yes; BLAS_LIBS="-lblas" fi fi LIBS="$acx_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_blas_ok" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_BLAS 1 _ACEOF : else acx_blas_ok=no { { echo "$as_me:$LINENO: error: BLAS was not found!" >&5 echo "$as_me: error: BLAS was not found!" >&2;} { (exit 1); exit 1; }; } fi acx_lapack_ok=no # Check whether --with-lapack or --without-lapack was given. if test "${with_lapack+set}" = set; then withval="$with_lapack" fi; case $with_lapack in yes | "") ;; no) acx_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac # Get fortran linker name of LAPACK function to check for. case $ac_cv_f77_mangling in upper*) ac_val="CHEEV" ;; lower*) ac_val="cheev" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac cheev="$ac_val" # We cannot use LAPACK if BLAS is not found if test "x$acx_blas_ok" != xyes; then acx_lapack_ok=noblas fi # First, check LAPACK_LIBS environment variable if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" echo "$as_me:$LINENO: checking for $cheev in $LAPACK_LIBS" >&5 echo $ECHO_N "checking for $cheev in $LAPACK_LIBS... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $cheev (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then acx_lapack_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LAPACK_LIBS="" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $acx_lapack_ok" >&5 echo "${ECHO_T}$acx_lapack_ok" >&6 LIBS="$save_LIBS" if test acx_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" as_ac_var=`echo "ac_cv_func_$cheev" | $as_tr_sh` echo "$as_me:$LINENO: checking for $cheev" >&5 echo $ECHO_N "checking for $cheev... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $cheev (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); /* 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_$cheev) || defined (__stub___$cheev) choke me #else char (*f) () = $cheev; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $cheev; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then acx_lapack_ok=yes fi LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do if test $acx_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" as_ac_Lib=`echo "ac_cv_lib_$lapack''_$cheev" | $as_tr_sh` echo "$as_me:$LINENO: checking for $cheev in -l$lapack" >&5 echo $ECHO_N "checking for $cheev in -l$lapack... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$lapack $FLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { $cheev (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Lib'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 if test `eval echo '${'$as_ac_Lib'}'` = yes; then acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack" fi LIBS="$save_LIBS" fi done # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_lapack_ok" = xyes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LAPACK 1 _ACEOF : else acx_lapack_ok=no { { echo "$as_me:$LINENO: error: LAPACK was not found!" >&5 echo "$as_me: error: LAPACK was not found!" >&2;} { (exit 1); exit 1; }; } fi LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" ############################################################################## # Check for MPI library # Check whether --with-mpi or --without-mpi was given. if test "${with_mpi+set}" = set; then withval="$with_mpi" with_mpi=$withval else with_mpi=no fi; if test "x$with_mpi" = "xyes"; then for ac_prog in mpicc hcc mpcc mpcc_r mpxlc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MPICC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MPICC"; then ac_cv_prog_MPICC="$MPICC" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MPICC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi MPICC=$ac_cv_prog_MPICC if test -n "$MPICC"; then echo "$as_me:$LINENO: result: $MPICC" >&5 echo "${ECHO_T}$MPICC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$MPICC" && break done test -n "$MPICC" || MPICC="$CC" acx_mpi_save_CC="$CC" CC="$MPICC" if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init" >&5 echo $ECHO_N "checking for MPI_Init... $ECHO_C" >&6 if test "${ac_cv_func_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* System header to define __stub macros and hopefully few prototypes, which can conflict with char MPI_Init (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); /* 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_MPI_Init) || defined (__stub___MPI_Init) choke me #else char (*f) () = MPI_Init; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != MPI_Init; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_func_MPI_Init" >&6 if test $ac_cv_func_MPI_Init = yes; then MPILIBS=" " fi fi if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init in -lmpi" >&5 echo $ECHO_N "checking for MPI_Init in -lmpi... $ECHO_C" >&6 if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { MPI_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mpi_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpi_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_lib_mpi_MPI_Init" >&6 if test $ac_cv_lib_mpi_MPI_Init = yes; then MPILIBS="-lmpi" fi fi if test x = x"$MPILIBS"; then echo "$as_me:$LINENO: checking for MPI_Init in -lmpich" >&5 echo $ECHO_N "checking for MPI_Init in -lmpich... $ECHO_C" >&6 if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpich $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MPI_Init (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { MPI_Init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_mpich_MPI_Init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpich_MPI_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_mpich_MPI_Init" >&5 echo "${ECHO_T}$ac_cv_lib_mpich_MPI_Init" >&6 if test $ac_cv_lib_mpich_MPI_Init = yes; then MPILIBS="-lmpich" fi fi if test x != x"$MPILIBS"; then echo "$as_me:$LINENO: checking for mpi.h" >&5 echo $ECHO_N "checking for mpi.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 MPILIBS="" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext fi CC="$acx_mpi_save_CC" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x = x"$MPILIBS"; then { { echo "$as_me:$LINENO: error: could not find mpi library for --with-mpi" >&5 echo "$as_me: error: could not find mpi library for --with-mpi" >&2;} { (exit 1); exit 1; }; } : else cat >>confdefs.h <<\_ACEOF #define HAVE_MPI 1 _ACEOF : fi CC="$MPICC" LIBS="$MPILIBS $LIBS" # Make installed program mpb_mpi instead of mpb if test x"$inv_sym" = xyes; then program_transform_name='s,^mpb$$,mpbi-mpi,'";$program_transform_name" else program_transform_name='s,^mpb$$,mpb-mpi,'";$program_transform_name" fi # Check for fftw_mpi library. if test "$enable_single" = "yes"; then echo "$as_me:$LINENO: checking for fftwnd_mpi in -lsfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -lsfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_sfftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_sfftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sfftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_sfftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_sfftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_sfftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSFFTW_MPI 1 _ACEOF LIBS="-lsfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -lsrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -lsrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_srfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_srfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_srfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSRFFTW_MPI 1 _ACEOF LIBS="-lsrfftw_mpi $LIBS" fi fi else echo "$as_me:$LINENO: checking for fftwnd_mpi in -ldfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -ldfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_dfftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dfftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dfftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dfftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_dfftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_dfftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDFFTW_MPI 1 _ACEOF LIBS="-ldfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -ldrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -ldrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_drfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_drfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_drfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_drfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_drfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_drfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDRFFTW_MPI 1 _ACEOF LIBS="-ldrfftw_mpi $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]fftw_mpi'`"; then echo "$as_me:$LINENO: checking for fftwnd_mpi in -lfftw_mpi" >&5 echo $ECHO_N "checking for fftwnd_mpi in -lfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_fftw_mpi_fftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char fftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { fftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_fftw_mpi_fftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw_mpi_fftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_fftw_mpi_fftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_fftw_mpi_fftwnd_mpi" >&6 if test $ac_cv_lib_fftw_mpi_fftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBFFTW_MPI 1 _ACEOF LIBS="-lfftw_mpi $LIBS" fi if test x"$inv_sym" = xyes; then echo "$as_me:$LINENO: checking for rfftwnd_mpi in -lrfftw_mpi" >&5 echo $ECHO_N "checking for rfftwnd_mpi in -lrfftw_mpi... $ECHO_C" >&6 if test "${ac_cv_lib_rfftw_mpi_rfftwnd_mpi+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw_mpi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char rfftwnd_mpi (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { rfftwnd_mpi (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_rfftw_mpi_rfftwnd_mpi=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_mpi_rfftwnd_mpi=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_mpi_rfftwnd_mpi" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_mpi_rfftwnd_mpi" >&6 if test $ac_cv_lib_rfftw_mpi_rfftwnd_mpi = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRFFTW_MPI 1 _ACEOF LIBS="-lrfftw_mpi $LIBS" fi fi fi if test x = x"`echo $LIBS | egrep 'l[ds]*fftw_mpi'`"; then { { echo "$as_me:$LINENO: error: couldn't find fftw_mpi library for --with-mpi" >&5 echo "$as_me: error: couldn't find fftw_mpi library for --with-mpi" >&2;} { (exit 1); exit 1; }; } fi if test x"$inv_sym" = xyes; then if test x = x"`echo $LIBS | egrep 'l[ds]*rfftw_mpi'`"; then { { echo "$as_me:$LINENO: error: couldn't find rfftw_mpi library for --with-mpi --with-inv-symmetry" >&5 echo "$as_me: error: couldn't find rfftw_mpi library for --with-mpi --with-inv-symmetry" >&2;} { (exit 1); exit 1; }; } fi fi cat >>confdefs.h <<\_ACEOF #define HAVE_MPI 1 _ACEOF BUILD_MPB_DATA="" # don't build/install MPI-linked mpb-data INSTALL_MPB_SPLIT="" # don't install mpb-split, since we don't know # how to run mpb-mpi in general fi ############################################################################## # Check for HDF5 library # Check whether --with-hdf5 or --without-hdf5 was given. if test "${with_hdf5+set}" = set; then withval="$with_hdf5" ok=$withval else ok=yes fi; if test "$ok" = "yes"; then echo "$as_me:$LINENO: checking for deflate in -lz" >&5 echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 if test "${ac_cv_lib_z_deflate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char deflate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { deflate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_z_deflate=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_deflate=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 if test $ac_cv_lib_z_deflate = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { echo "$as_me:$LINENO: WARNING: zlib is required for HDF5!" >&5 echo "$as_me: WARNING: zlib is required for HDF5!" >&2;} fi save_LIBS_0="$LIBS" # save, to check later if we found any library 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&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 echo $ECHO_N "(cached) $ECHO_C" >&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 #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else 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 echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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 #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else 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 non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else 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 { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 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 echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for H5Pcreate in -lhdf5" >&5 echo $ECHO_N "checking for H5Pcreate in -lhdf5... $ECHO_C" >&6 if test "${ac_cv_lib_hdf5_H5Pcreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhdf5 $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char H5Pcreate (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { H5Pcreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_hdf5_H5Pcreate=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_hdf5_H5Pcreate=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_hdf5_H5Pcreate" >&5 echo "${ECHO_T}$ac_cv_lib_hdf5_H5Pcreate" >&6 if test $ac_cv_lib_hdf5_H5Pcreate = yes; then for ac_header in hdf5.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF LIBS="-lhdf5 $LIBS" cat >>confdefs.h <<\_ACEOF #define HAVE_HDF5 1 _ACEOF fi done fi if test x"$save_LIBS_0" = x"$LIBS"; then { echo "$as_me:$LINENO: WARNING: Couldn't find the HDF5 library!! Switching to --without-hdf5." >&5 echo "$as_me: WARNING: Couldn't find the HDF5 library!! Switching to --without-hdf5." >&2;} fi if test x != x"$MPILIBS"; then for ac_func in H5Pset_mpi H5Pset_fapl_mpio do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi fi ############################################################################## # Check for Guile library and flags: # Extract the first word of "guile", so it can be a program name with args. set dummy guile; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_guile_ok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$guile_ok"; then ac_cv_prog_guile_ok="$guile_ok" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_guile_ok="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_guile_ok" && ac_cv_prog_guile_ok="no" fi fi guile_ok=$ac_cv_prog_guile_ok if test -n "$guile_ok"; then echo "$as_me:$LINENO: result: $guile_ok" >&5 echo "${ECHO_T}$guile_ok" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$guile_ok" = xno; then { { echo "$as_me:$LINENO: error: could not find guile program; check your PATH" >&5 echo "$as_me: error: could not find guile program; check your PATH" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "guile-config", so it can be a program name with args. set dummy guile-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_HAVE_GUILE_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_GUILE_CONFIG"; then ac_cv_prog_HAVE_GUILE_CONFIG="$HAVE_GUILE_CONFIG" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_GUILE_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_HAVE_GUILE_CONFIG" && ac_cv_prog_HAVE_GUILE_CONFIG="no" fi fi HAVE_GUILE_CONFIG=$ac_cv_prog_HAVE_GUILE_CONFIG if test -n "$HAVE_GUILE_CONFIG"; then echo "$as_me:$LINENO: result: $HAVE_GUILE_CONFIG" >&5 echo "${ECHO_T}$HAVE_GUILE_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$HAVE_GUILE_CONFIG" = "yes"; then CPPFLAGS="$CPPFLAGS `guile-config compile`" LIBS="`guile-config link` $LIBS" echo "$as_me:$LINENO: checking if linking to guile works" >&5 echo $ECHO_N "checking if linking to guile works... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gh_enter (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gh_enter (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 { { echo "$as_me:$LINENO: error: guile-config is broken or Guile is not working." >&5 echo "$as_me: error: guile-config is broken or Guile is not working." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext else echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 if test "${ac_cv_lib_readline_readline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readline (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_readline_readline=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_readline=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 if test $ac_cv_lib_readline_readline = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF LIBS="-lreadline $LIBS" fi echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi save_LIBS_0="$LIBS" # save, to check later if we found any library echo "$as_me:$LINENO: checking for gh_eval_str in -lguile" >&5 echo $ECHO_N "checking for gh_eval_str in -lguile... $ECHO_C" >&6 if test "${ac_cv_lib_guile_gh_eval_str+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lguile $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gh_eval_str (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { gh_eval_str (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_guile_gh_eval_str=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_guile_gh_eval_str=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_guile_gh_eval_str" >&5 echo "${ECHO_T}$ac_cv_lib_guile_gh_eval_str" >&6 if test $ac_cv_lib_guile_gh_eval_str = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGUILE 1 _ACEOF LIBS="-lguile $LIBS" fi if test x"$save_LIBS_0" = x"$LIBS"; then { { echo "$as_me:$LINENO: error: Couldn't find the required Guile library." >&5 echo "$as_me: error: Couldn't find the required Guile library." >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in scm_make_smob_type do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for SCM_SMOB_PREDICATE" >&5 echo $ECHO_N "checking for SCM_SMOB_PREDICATE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_SMOB_PREDICATE(1,x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SCM_SMOB_PREDICATE 1 _ACEOF fi echo "$as_me:$LINENO: checking for SCM_SMOB_DATA" >&5 echo $ECHO_N "checking for SCM_SMOB_DATA... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_SMOB_DATA(x); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SCM_SMOB_DATA 1 _ACEOF fi echo "$as_me:$LINENO: checking for SCM_NEWSMOB" >&5 echo $ECHO_N "checking for SCM_NEWSMOB... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { int x; SCM_NEWSMOB(x,1,0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ok=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test $ok = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SCM_NEWSMOB 1 _ACEOF fi # Check how to activate Guile readline support: ACTIVATE_READLINE="" echo "$as_me:$LINENO: checking how to activate readline in Guile" >&5 echo $ECHO_N "checking how to activate readline in Guile... $ECHO_C" >&6 ractivate="(use-modules (readline-activator)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then echo "$as_me:$LINENO: result: readline-activator" >&5 echo "${ECHO_T}readline-activator" >&6 ACTIVATE_READLINE="$ractivate" else ractivate="(use-modules (ice-9 readline)) (activate-readline)" if guile -c "$ractivate" > /dev/null 2>&1; then echo "$as_me:$LINENO: result: ice-9 readline" >&5 echo "${ECHO_T}ice-9 readline" >&6 ACTIVATE_READLINE="$ractivate" else echo "$as_me:$LINENO: result: cannot" >&5 echo "${ECHO_T}cannot" >&6 ACTIVATE_READLINE="" fi fi ############################################################################## # Check for libctl library and files # Check whether --with-libctl or --without-libctl was given. if test "${with_libctl+set}" = set; then withval="$with_libctl" ok=$withval else ok=yes fi; if test "$ok" = "no"; then { { echo "$as_me:$LINENO: error: libctl is required and you may not disable it" >&5 echo "$as_me: error: libctl is required and you may not disable it" >&2;} { (exit 1); exit 1; }; } elif test "$ok" != "yes"; then LIBCTL_DIR="$ok" fi echo "$as_me:$LINENO: checking for libctl dir" >&5 echo $ECHO_N "checking for libctl dir... $ECHO_C" >&6 if test x != x"$LIBCTL_DIR" -a ! -r "$LIBCTL_DIR/base/ctl.scm"; then LIBCTL_DIR="" fi if test x = x"$LIBCTL_DIR" -a -r /usr/local/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/local/share/libctl" fi if test x = x"$LIBCTL_DIR" -a -r /usr/share/libctl/base/ctl.scm; then LIBCTL_DIR="/usr/share/libctl" fi if test x = x"$LIBCTL_DIR"; then { { echo "$as_me:$LINENO: error: could not find libctl files; use --with-libctl=" >&5 echo "$as_me: error: could not find libctl files; use --with-libctl=" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $LIBCTL_DIR" >&5 echo "${ECHO_T}$LIBCTL_DIR" >&6 # Extract the first word of "gen-ctl-io", so it can be a program name with args. set dummy gen-ctl-io; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gen_ctl_io_ok+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$gen_ctl_io_ok"; then ac_cv_prog_gen_ctl_io_ok="$gen_ctl_io_ok" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_gen_ctl_io_ok="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_gen_ctl_io_ok" && ac_cv_prog_gen_ctl_io_ok="no" fi fi gen_ctl_io_ok=$ac_cv_prog_gen_ctl_io_ok if test -n "$gen_ctl_io_ok"; then echo "$as_me:$LINENO: result: $gen_ctl_io_ok" >&5 echo "${ECHO_T}$gen_ctl_io_ok" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$gen_ctl_io_ok" = xno; then { { echo "$as_me:$LINENO: error: could not find gen-ctl-io program; check your PATH" >&5 echo "$as_me: error: could not find gen-ctl-io program; check your PATH" >&2;} { (exit 1); exit 1; }; } fi GEN_CTL_IO=gen-ctl-io # check for -lctl: echo "$as_me:$LINENO: checking for ctl_get_vector3 in -lctl" >&5 echo $ECHO_N "checking for ctl_get_vector3 in -lctl... $ECHO_C" >&6 if test "${ac_cv_lib_ctl_ctl_get_vector3+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lctl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ctl_get_vector3 (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ctl_get_vector3 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ctl_ctl_get_vector3=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ctl_ctl_get_vector3=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ctl_ctl_get_vector3" >&5 echo "${ECHO_T}$ac_cv_lib_ctl_ctl_get_vector3" >&6 if test $ac_cv_lib_ctl_ctl_get_vector3 = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCTL 1 _ACEOF LIBS="-lctl $LIBS" else { { echo "$as_me:$LINENO: error: Couldn't find the required libctl library." >&5 echo "$as_me: error: Couldn't find the required libctl library." >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_header_ctl_h+set}" = set; then echo "$as_me:$LINENO: checking for ctl.h" >&5 echo $ECHO_N "checking for ctl.h... $ECHO_C" >&6 if test "${ac_cv_header_ctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ctl_h" >&5 echo "${ECHO_T}$ac_cv_header_ctl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ctl.h usability" >&5 echo $ECHO_N "checking ctl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking ctl.h presence" >&5 echo $ECHO_N "checking ctl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: ctl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ctl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ctl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: ctl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ctl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ctl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ctl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ctl.h: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for ctl.h" >&5 echo $ECHO_N "checking for ctl.h... $ECHO_C" >&6 if test "${ac_cv_header_ctl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ctl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ctl_h" >&5 echo "${ECHO_T}$ac_cv_header_ctl_h" >&6 fi if test $ac_cv_header_ctl_h = yes; then : else { { echo "$as_me:$LINENO: error: Couldn't find the libctl header." >&5 echo "$as_me: error: Couldn't find the libctl header." >&2;} { (exit 1); exit 1; }; } fi # Check libctl version >= LIBCTL_MAJOR.LIBCTL_MINOR.LIBCTL_BUGFIX LIBCTL_MAJOR=2; LIBCTL_MINOR=1; LIBCTL_BUGFIX=1 echo "$as_me:$LINENO: checking whether libctl version is at least ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX}" >&5 echo $ECHO_N "checking whether libctl version is at least ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX}... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ [ #include #if LIBCTL_MAJOR_VERSION > $LIBCTL_MAJOR || (LIBCTL_MAJOR_VERSION == $LIBCTL_MAJOR && (LIBCTL_MINOR_VERSION > $LIBCTL_MINOR || (LIBCTL_MINOR_VERSION == $LIBCTL_MINOR && LIBCTL_BUGFIX_VERSION >= $LIBCTL_BUGFIX))) yes #endif ] _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: ok" >&5 echo "${ECHO_T}ok" >&6 else { { echo "$as_me:$LINENO: error: libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required" >&5 echo "$as_me: error: libctl version ${LIBCTL_MAJOR}.${LIBCTL_MINOR}.${LIBCTL_BUGFIX} or later is required" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest* ############################################################################## # Checks for header files. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include #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 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* 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 #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in unistd.h getopt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&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 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else 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 echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} ( cat <<\_ASBOX ## ------------------------------------ ## ## Report this to bug-autoconf@gnu.org. ## ## ------------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* 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 () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* 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"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 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; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; no) cat >>confdefs.h <<\_ACEOF #define inline _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define inline $ac_cv_c_inline _ACEOF ;; esac # Checks for library functions. for ac_func in getopt strncmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ 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 #else char (*f) () = $ac_func; #endif #ifdef __cplusplus } #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ############################################################################## # Check to see if calling Fortran functions (in particular, the BLAS # complex dot product functions) works from C: echo "$as_me:$LINENO: checking whether calling BLAS zdotc works" >&5 echo $ECHO_N "checking whether calling BLAS zdotc works... $ECHO_C" >&6 case $ac_cv_f77_mangling in upper*) ac_val="ZDOTC" ;; lower*) ac_val="zdotc" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac zdotc="$ac_val" if test "$cross_compiling" = yes; then ok="no" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include typedef struct { double re, im; } cmplx; #ifdef __cplusplus extern "C" #endif extern cmplx $zdotc(int *, cmplx *, int *, cmplx *, int *); int main(void) { cmplx x[2] = { {1,0}, {0,1} }, y[2] = { {1,0}, {1,0} }; int n = 2, inc1 = 1, inc2 = 1; cmplx result = { 0, 0 }; result = $zdotc(&n, x, &inc1, y, &inc2); if (result.re != 1 || result.im != -1) return EXIT_FAILURE; else return EXIT_SUCCESS; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ok="yes" else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ok="no" fi rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ok" >&5 echo "${ECHO_T}$ok" >&6 if test "$ok" = "no"; then cat >>confdefs.h <<\_ACEOF #define NO_FORTRAN_FUNCTIONS 1 _ACEOF fi ############################################################################## # grab the various EIGS_ flags from eigensolver.h and substitute them # into mpb.scm.in (are not regular expressions fun?): # (note that autoconf gets unhappy if we have newlines; we must delete them) EIGS_FLAGS_SCM=`grep '#define EIGS_' $srcdir/src/matrices/eigensolver.h |sed 's/#define \([A-Za-z0-9_]*\) (1<<\([0-9]*\))/(define \1 (pow2 \2))/' |sed 's/#define \([A-Za-z0-9_]*\) (\(.*\))/(define \1 (+ \2))/' |sed 's/ *| */ /g' | tr -d '\n'` ############################################################################## # Find a shell that supports job control, for mpb-split: # Extract the first word of "bash ksh ash", so it can be a program name with args. set dummy bash ksh ash; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SH_JOB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SH_JOB in [\\/]* | ?:[\\/]*) ac_cv_path_SH_JOB="$SH_JOB" # Let the user override the test with a path. ;; *) 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SH_JOB="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SH_JOB" && ac_cv_path_SH_JOB="sh" ;; esac fi SH_JOB=$ac_cv_path_SH_JOB if test -n "$SH_JOB"; then echo "$as_me:$LINENO: result: $SH_JOB" >&5 echo "${ECHO_T}$SH_JOB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test x"$SH_JOB" = xsh; then { echo "$as_me:$LINENO: WARNING: Couldn't find bash or ksh shell on your system. The mpb-split command may not work if your sh doesn't support job control." >&5 echo "$as_me: WARNING: Couldn't find bash or ksh shell on your system. The mpb-split command may not work if your sh doesn't support job control." >&2;} fi ############################################################################## ac_config_files="$ac_config_files Makefile tests/Makefile src/util/Makefile src/matrices/Makefile src/matrixio/Makefile src/maxwell/Makefile mpb-ctl/Makefile mpb-ctl/mpb.scm mpb-ctl/mpb-split utils/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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!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" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # 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 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_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; 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 || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') 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=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # 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 before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, 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 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.57. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet 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_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.57, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. 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 ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 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" ;; 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 if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "src/util/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/util/Makefile" ;; "src/matrices/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/matrices/Makefile" ;; "src/matrixio/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/matrixio/Makefile" ;; "src/maxwell/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/maxwell/Makefile" ;; "mpb-ctl/Makefile" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/Makefile" ;; "mpb-ctl/mpb.scm" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/mpb.scm" ;; "mpb-ctl/mpb-split" ) CONFIG_FILES="$CONFIG_FILES mpb-ctl/mpb-split" ;; "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 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 to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $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 -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@MPB_VERSION@,$MPB_VERSION,;t t s,@F77@,$F77,;t t s,@FFLAGS@,$FFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@ac_ct_F77@,$ac_ct_F77,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@BUILD_MPB_DATA@,$BUILD_MPB_DATA,;t t s,@INSTALL_MPB_SPLIT@,$INSTALL_MPB_SPLIT,;t t s,@SCALAR_TYPE@,$SCALAR_TYPE,;t t s,@FLIBS@,$FLIBS,;t t s,@BLAS_LIBS@,$BLAS_LIBS,;t t s,@LAPACK_LIBS@,$LAPACK_LIBS,;t t s,@MPICC@,$MPICC,;t t s,@MPILIBS@,$MPILIBS,;t t s,@CPP@,$CPP,;t t s,@EGREP@,$EGREP,;t t s,@guile_ok@,$guile_ok,;t t s,@HAVE_GUILE_CONFIG@,$HAVE_GUILE_CONFIG,;t t s,@ACTIVATE_READLINE@,$ACTIVATE_READLINE,;t t s,@LIBCTL_DIR@,$LIBCTL_DIR,;t t s,@gen_ctl_io_ok@,$gen_ctl_io_ok,;t t s,@GEN_CTL_IO@,$GEN_CTL_IO,;t t s,@EIGS_FLAGS_SCM@,$EIGS_FLAGS_SCM,;t t s,@SH_JOB@,$SH_JOB,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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