diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp index 37e5df6f81ccbd64023330110d90bb34c1913263..da66f4903348186b25ef61dea4383b82e3e8fe07 100644 --- a/Graphics/gl2ps.cpp +++ b/Graphics/gl2ps.cpp @@ -1,7 +1,6 @@ -/* $Id: gl2ps.cpp,v 1.116 2008-09-08 19:34:40 geuzaine Exp $ */ /* * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org> + * Copyright (C) 1999-2009 C. Geuzaine * * This program is free software; you can redistribute it and/or * modify it under the terms of either: @@ -1182,14 +1181,17 @@ static void gl2psCutEdge(GL2PSvertex *a, GL2PSvertex *b, GL2PSplane plane, GL2PSvertex *c) { GL2PSxyz v; - GLfloat sect; + GLfloat sect, psca; v[0] = b->xyz[0] - a->xyz[0]; v[1] = b->xyz[1] - a->xyz[1]; v[2] = b->xyz[2] - a->xyz[2]; - sect = - gl2psComparePointPlane(a->xyz, plane) / gl2psPsca(plane, v); - + if(!GL2PS_ZERO(psca = gl2psPsca(plane, v))) + sect = -gl2psComparePointPlane(a->xyz, plane) / psca; + else + sect = 0.0F; + c->xyz[0] = a->xyz[0] + v[0] * sect; c->xyz[1] = a->xyz[1] + v[1] * sect; c->xyz[2] = a->xyz[2] + v[2] * sect; @@ -1687,17 +1689,22 @@ static void gl2psRescaleAndOffset() (prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]); - dZdX = - ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - - (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; - dZdY = - ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * - (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - - (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * - (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; - maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); + if(!GL2PS_ZERO(area)){ + dZdX = + ((prim->verts[2].xyz[1] - prim->verts[1].xyz[1]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2]) - + (prim->verts[1].xyz[1] - prim->verts[0].xyz[1]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2])) / area; + dZdY = + ((prim->verts[1].xyz[0] - prim->verts[0].xyz[0]) * + (prim->verts[2].xyz[2] - prim->verts[1].xyz[2]) - + (prim->verts[2].xyz[0] - prim->verts[1].xyz[0]) * + (prim->verts[1].xyz[2] - prim->verts[0].xyz[2])) / area; + maxdZ = (GLfloat)sqrt(dZdX * dZdX + dZdY * dZdY); + } + else{ + maxdZ = 0.0F; + } dZ = factor * maxdZ + units; prim->verts[0].xyz[2] += dZ; prim->verts[1].xyz[2] += dZ; @@ -1763,6 +1770,10 @@ static void gl2psAddPlanesInBspTreeImage(GL2PSprimitive *prim, GL2PSbsptree2d *head = NULL, *cur = NULL; if((*tree == NULL) && (prim->numverts > 2)){ + /* don't cull if transparent + for(i = 0; i < prim->numverts - 1; i++) + if(prim->verts[i].rgba[3] < 1.0F) return; + */ head = (GL2PSbsptree2d*)gl2psMalloc(sizeof(GL2PSbsptree2d)); for(i = 0; i < prim->numverts-1; i++){ if(!gl2psGetPlaneFromPoints(prim->verts[i].xyz, @@ -1926,7 +1937,7 @@ static void gl2psSplitPrimitive2D(GL2PSprimitive *prim, if(v1 == prim->numverts){ if(prim->numverts < 3) break; v1 = 0; - v2 = prim->numverts-1; + v2 = prim->numverts - 1; cur = prev0; } else if(flag){ @@ -1969,10 +1980,8 @@ static void gl2psSplitPrimitive2D(GL2PSprimitive *prim, front_count++; front_list = (GL2PSvertex*)gl2psRealloc(front_list, sizeof(GL2PSvertex)*front_count); - gl2psCutEdge(&prim->verts[v2], - &prim->verts[v1], - plane, - &front_list[front_count-1]); + gl2psCutEdge(&prim->verts[v2], &prim->verts[v1], + plane, &front_list[front_count-1]); back_count++; back_list = (GL2PSvertex*)gl2psRealloc(back_list, sizeof(GL2PSvertex)*back_count); @@ -2367,7 +2376,7 @@ static void gl2psParseFeedbackBuffer(GLint used) sizeoffloat = sizeof(GLfloat); v = 2 * sizeoffloat; vtot = node->image->height + node->image->height * - ((node->image->width-1)/8); + ((node->image->width - 1) / 8); node->image->pixels = (GLfloat*)gl2psMalloc(v + vtot); node->image->pixels[0] = prim->verts[0].xyz[0]; node->image->pixels[1] = prim->verts[0].xyz[1]; @@ -2459,7 +2468,7 @@ static void gl2psPrintPostScriptPixmap(GLfloat x, GLfloat y, GL2PSimage *im) else if(nbit == 2){ /* color, 2 bits for r and g and b; rgbs following each other */ nrgb = width * 3; nbits = nrgb * nbit; - nbyte = nbits/8; + nbyte = nbits / 8; if((nbyte * 8) != nbits) nbyte++; gl2psPrintf("/rgbstr %d string def\n", nbyte); gl2psPrintf("%d %d %d\n", width, height, nbit); @@ -2546,7 +2555,7 @@ static void gl2psPrintPostScriptPixmap(GLfloat x, GLfloat y, GL2PSimage *im) else if(nbit == 4){ /* color, 4 bits for r and g and b; rgbs following each other */ nrgb = width * 3; nbits = nrgb * nbit; - nbyte = nbits/8; + nbyte = nbits / 8; if((nbyte * 8) != nbits) nbyte++; gl2psPrintf("/rgbstr %d string def\n", nbyte); gl2psPrintf("%d %d %d\n", width, height, nbit); @@ -2626,7 +2635,7 @@ static void gl2psPrintPostScriptImagemap(GLfloat x, GLfloat y, if((width <= 0) || (height <= 0)) return; - size = height + height * (width-1)/8; + size = height + height * (width - 1) / 8; gl2psPrintf("gsave\n"); gl2psPrintf("%.2f %.2f translate\n", x, y); @@ -4179,7 +4188,7 @@ static int gl2psPrintPDFShaderStreamDataCoord(GL2PSvertex *vertex, /* The Shader stream in PDF requires to be in a 'big-endian' order */ - if(GL2PS_ZERO(dx*dy)){ + if(GL2PS_ZERO(dx * dy)){ offs += (*action)(0, 4); offs += (*action)(0, 4); } @@ -5095,12 +5104,31 @@ static void gl2psPrintSVGPrimitive(void *data) break; case GL2PS_TEXT : gl2psSVGGetColorString(prim->verts[0].rgba, col); - gl2psPrintf("<text fill=\"%s\" x=\"%g\" y=\"%g\" " - "font-size=\"%d\" font-family=\"%s\">%s</text>\n", - col, xyz[0][0], xyz[0][1], - prim->data.text->fontsize, - prim->data.text->fontname, - prim->data.text->str); + gl2psPrintf("<text fill=\"%s\" x=\"%g\" y=\"%g\" font-size=\"%d\" ", + col, xyz[0][0], xyz[0][1], prim->data.text->fontsize); + if(!strcmp(prim->data.text->fontname, "Times-Roman")) + gl2psPrintf("font-family=\"Times\">"); + else if(!strcmp(prim->data.text->fontname, "Times-Bold")) + gl2psPrintf("font-family=\"Times\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Times-Italic")) + gl2psPrintf("font-family=\"Times\" font-style=\"italic\">"); + else if(!strcmp(prim->data.text->fontname, "Times-BoldItalic")) + gl2psPrintf("font-family=\"Times\" font-style=\"italic\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-Bold")) + gl2psPrintf("font-family=\"Helvetica\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-Oblique")) + gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\">"); + else if(!strcmp(prim->data.text->fontname, "Helvetica-BoldOblique")) + gl2psPrintf("font-family=\"Helvetica\" font-style=\"oblique\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-Bold")) + gl2psPrintf("font-family=\"Courier\" font-weight=\"bold\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-Oblique")) + gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\">"); + else if(!strcmp(prim->data.text->fontname, "Courier-BoldOblique")) + gl2psPrintf("font-family=\"Courier\" font-style=\"oblique\" font-weight=\"bold\">"); + else + gl2psPrintf("font-family=\"%s\">", prim->data.text->fontname); + gl2psPrintf("%s</text>\n", prim->data.text->str); break; case GL2PS_SPECIAL : /* alignment contains the format for which the special output text @@ -5550,7 +5578,7 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, gl2ps = (GL2PScontext*)gl2psMalloc(sizeof(GL2PScontext)); - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends)/sizeof(gl2psbackends[0]))){ + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))){ gl2ps->format = format; } else { @@ -5608,9 +5636,9 @@ GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, return GL2PS_ERROR; } - gl2ps->threshold[0] = nr ? 1.0F/(GLfloat)nr : 0.064F; - gl2ps->threshold[1] = ng ? 1.0F/(GLfloat)ng : 0.034F; - gl2ps->threshold[2] = nb ? 1.0F/(GLfloat)nb : 0.100F; + gl2ps->threshold[0] = nr ? 1.0F / (GLfloat)nr : 0.064F; + gl2ps->threshold[1] = ng ? 1.0F / (GLfloat)ng : 0.034F; + gl2ps->threshold[2] = nb ? 1.0F / (GLfloat)nb : 0.100F; gl2ps->colormode = colormode; gl2ps->buffersize = buffersize > 0 ? buffersize : 2048 * 2048; for(i = 0; i < 3; i++){ @@ -5857,7 +5885,7 @@ GL2PSDLL_API GLint gl2psDrawImageMap(GLsizei width, GLsizei height, if((width <= 0) || (height <= 0)) return GL2PS_ERROR; - size = height + height * ((width-1)/8); + size = height + height * ((width - 1) / 8); glPassThrough(GL2PS_IMAGEMAP_TOKEN); glBegin(GL_POINTS); glVertex3f(position[0], position[1],position[2]); @@ -5988,7 +6016,7 @@ GL2PSDLL_API GLint gl2psGetOptions(GLint *options) GL2PSDLL_API const char *gl2psGetFileExtension(GLint format) { - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends)/sizeof(gl2psbackends[0]))) + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) return gl2psbackends[format]->file_extension; else return "Unknown format"; @@ -5996,7 +6024,7 @@ GL2PSDLL_API const char *gl2psGetFileExtension(GLint format) GL2PSDLL_API const char *gl2psGetFormatDescription(GLint format) { - if(format >= 0 && format < (GLint)(sizeof(gl2psbackends)/sizeof(gl2psbackends[0]))) + if(format >= 0 && format < (GLint)(sizeof(gl2psbackends) / sizeof(gl2psbackends[0]))) return gl2psbackends[format]->description; else return "Unknown format"; diff --git a/Graphics/gl2ps.h b/Graphics/gl2ps.h index e3131d4b1be7efd6f97e77f0df64662cf50f1b0c..20b1caf831bcfaa134cad91e3ab0ad03f560ef67 100644 --- a/Graphics/gl2ps.h +++ b/Graphics/gl2ps.h @@ -1,7 +1,6 @@ -/* $Id: gl2ps.h,v 1.72 2009-01-08 23:58:07 geuzaine Exp $ */ /* * GL2PS, an OpenGL to PostScript Printing Library - * Copyright (C) 1999-2007 Christophe Geuzaine <geuz@geuz.org> + * Copyright (C) 1999-2009 C. Geuzaine * * This program is free software; you can redistribute it and/or * modify it under the terms of either: @@ -37,7 +36,6 @@ #include <stdio.h> #include <stdlib.h> -#include "GmshConfig.h" /* Define GL2PSDLL at compile time to build a Windows DLL */ @@ -86,7 +84,7 @@ 0.01 * GL2PS_MINOR_VERSION + \ 0.0001 * GL2PS_PATCH_VERSION) -#define GL2PS_COPYRIGHT "(C) 1999-2007 Christophe Geuzaine (geuz@geuz.org)" +#define GL2PS_COPYRIGHT "(C) 1999-2009 C. Geuzaine" /* Output file formats (the values and the ordering are important!) */ diff --git a/configure b/configure index 2e8ffcf219f087371c0f3e3cf91c188b2079cfcb..e857dbab39b82d8212fb21fe45c994642a27e422 100755 --- a/configure +++ b/configure @@ -664,9 +664,9 @@ CPP RANLIB AR FLTKCONFIG -F77 -FFLAGS -ac_ct_F77 +FC +FCFLAGS +ac_ct_FC CXXCPP GREP EGREP @@ -692,8 +692,8 @@ CXX CXXFLAGS CCC CPP -F77 -FFLAGS +FC +FCFLAGS CXXCPP' @@ -1329,8 +1329,8 @@ Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags + FC Fortran compiler command + FCFLAGS Fortran compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help @@ -5136,22 +5136,22 @@ _ACEOF fi fi -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu +ac_ext=${ac_fc_srcext-f} +ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' +ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 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 +if test "${ac_cv_prog_FC+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. + if test -n "$FC"; then + ac_cv_prog_FC="$FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5160,7 +5160,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + ac_cv_prog_FC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5170,32 +5170,32 @@ IFS=$as_save_IFS fi fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } +FC=$ac_cv_prog_FC +if test -n "$FC"; then + { echo "$as_me:$LINENO: result: $FC" >&5 +echo "${ECHO_T}$FC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - test -n "$F77" && break + test -n "$FC" && break done fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +if test -z "$FC"; then + ac_ct_FC=$FC + for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 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 +if test "${ac_cv_prog_ac_ct_FC+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. + if test -n "$ac_ct_FC"; then + ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -5204,7 +5204,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_F77="$ac_prog" + ac_cv_prog_ac_ct_FC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5214,21 +5214,21 @@ IFS=$as_save_IFS 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; } +ac_ct_FC=$ac_cv_prog_ac_ct_FC +if test -n "$ac_ct_FC"; then + { echo "$as_me:$LINENO: result: $ac_ct_FC" >&5 +echo "${ECHO_T}$ac_ct_FC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - test -n "$ac_ct_F77" && break + test -n "$ac_ct_FC" && break done - if test "x$ac_ct_F77" = x; then - F77="" + if test "x$ac_ct_FC" = x; then + FC="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -5240,13 +5240,13 @@ whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - F77=$ac_ct_F77 + FC=$ac_ct_FC fi fi # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +echo "$as_me:$LINENO: checking for Fortran compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in @@ -5284,9 +5284,9 @@ rm -f a.out # input file. (Note that this only needs to work for GNU compilers.) 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 "$as_me:$LINENO: checking whether we are using the GNU Fortran compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran compiler... $ECHO_C" >&6; } +if test "${ac_cv_fc_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5311,7 +5311,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || + test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes @@ -5323,21 +5323,21 @@ sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu +ac_cv_fc_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; } +{ echo "$as_me:$LINENO: result: $ac_cv_fc_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_fc_compiler_gnu" >&6; } ac_ext=$ac_save_ext -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 +ac_test_FFLAGS=${FCFLAGS+set} +ac_save_FFLAGS=$FCFLAGS +FCFLAGS= +{ echo "$as_me:$LINENO: checking whether $FC accepts -g" >&5 +echo $ECHO_N "checking whether $FC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_fc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - FFLAGS=-g + FCFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main @@ -5357,39 +5357,38 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || + test -z "$ac_fc_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes + ac_cv_prog_fc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_prog_f77_g=no + ac_cv_prog_fc_g=no fi rm -f core conftest.err 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; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_fc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_fc_g" >&6; } if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" + FCFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_fc_g = yes; then + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-g -O2" else - FFLAGS="-g" + FCFLAGS="-g" fi else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" + if test "x$ac_cv_fc_compiler_gnu" = xyes; then + FCFLAGS="-O2" else - FFLAGS= + FCFLAGS= fi fi -G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5397,12 +5396,12 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$UNAME" != "xDarwin"; then - case "${F77}" in + case "${FC}" in *gfortran*) - F77LIB="-lgfortran" + FCLIB="-lgfortran" ;; *g77*) - F77LIB="-lg2c" + FCLIB="-lg2c" ;; esac fi @@ -5415,7 +5414,7 @@ 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 ${F77LIB} $LIBS" +LIBS="-latlas ${FCLIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5481,7 +5480,7 @@ if test "${ac_cv_lib_f77blas_dgemm_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lf77blas -latlas ${F77LIB} $LIBS" +LIBS="-lf77blas -latlas ${FCLIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5548,7 +5547,7 @@ if test "${ac_cv_lib_blas_dgemm_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lblas ${F77LIB} $LIBS" +LIBS="-lblas ${FCLIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5621,7 +5620,7 @@ if test "${ac_cv_lib_lapack_atlas_dbdsqr_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-llapack_atlas ${BLAS_LIBS} ${F77LIB} $LIBS" +LIBS="-llapack_atlas ${BLAS_LIBS} ${FCLIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5688,7 +5687,7 @@ if test "${ac_cv_lib_lapack_dbdsqr_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-llapack ${BLAS_LIBS} ${F77LIB} $LIBS" +LIBS="-llapack ${BLAS_LIBS} ${FCLIB} $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5762,7 +5761,7 @@ if test "x${BLAS_LIBS}" != "x"; then else GMSH_LIBS="${GMSH_LIBS} ${BLAS_LIBS}" fi - GMSH_LIBS="${GMSH_LIBS} ${F77LIB}" + GMSH_LIBS="${GMSH_LIBS} ${FCLIB}" fi if test "x${LAPACK}" = "xyes" -a "x$enable_fm" != "xno"; then @@ -7817,9 +7816,9 @@ CPP!$CPP$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim FLTKCONFIG!$FLTKCONFIG$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim +FC!$FC$ac_delim +FCFLAGS!$FCFLAGS$ac_delim +ac_ct_FC!$ac_ct_FC$ac_delim CXXCPP!$CXXCPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim diff --git a/configure.in b/configure.in index 04afef3223288fa8eec97bc58d9187f75ac5a5e2..2a440c34fa150ad50899971a433c515f4581130b 100644 --- a/configure.in +++ b/configure.in @@ -633,39 +633,39 @@ if test "x${ZLIB}" = "xyes"; then fi dnl Check for blas and lapack -AC_PROG_F77 +AC_PROG_FC if test "x$UNAME" != "xDarwin"; then - case "${F77}" in + case "${FC}" in *gfortran*) - F77LIB="-lgfortran" + FCLIB="-lgfortran" ;; *g77*) - F77LIB="-lg2c" + FCLIB="-lg2c" ;; esac fi if test "x${BLAS_LAPACK_PREFIX}" != "x"; then LDFLAGS="${LDFLAGS} -L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib" fi -AC_CHECK_LIB(atlas,ATL_xerbla,ATLAS="yes",[],${F77LIB}) +AC_CHECK_LIB(atlas,ATL_xerbla,ATLAS="yes",[],${FCLIB}) if test "x${ATLAS}" = "xyes"; then AC_CHECK_LIB(f77blas,dgemm_,[BLAS="yes" BLAS_LIBS="${BLAS_LIBS} -lf77blas -latlas"], - [],[-latlas ${F77LIB}]) + [],[-latlas ${FCLIB}]) fi if test "x${BLAS}" != "xyes"; then AC_CHECK_LIB(blas,dgemm_,[BLAS="yes" BLAS_LIBS="${BLAS_LIBS} -lblas"], - [],${F77LIB}) + [],${FCLIB}) fi if test "x${BLAS}" = "xyes"; then AC_DEFINE(HAVE_BLAS) BO="${BO} Blas" if test "x${ATLAS}" = "xyes"; then AC_CHECK_LIB(lapack_atlas,dbdsqr_,[LAPACK="yes" BLAS_LIBS="-llapack_atlas ${BLAS_LIBS}"], - [],[${BLAS_LIBS} ${F77LIB}]) + [],[${BLAS_LIBS} ${FCLIB}]) fi if test "x${LAPACK}" != "xyes"; then AC_CHECK_LIB(lapack,dbdsqr_,[LAPACK="yes" BLAS_LIBS="-llapack ${BLAS_LIBS}"], - [],[${BLAS_LIBS} ${F77LIB}]) + [],[${BLAS_LIBS} ${FCLIB}]) fi if test "x${LAPACK}" = "xyes"; then AC_DEFINE(HAVE_LAPACK) @@ -678,7 +678,7 @@ if test "x${BLAS_LIBS}" != "x"; then else GMSH_LIBS="${GMSH_LIBS} ${BLAS_LIBS}" fi - GMSH_LIBS="${GMSH_LIBS} ${F77LIB}" + GMSH_LIBS="${GMSH_LIBS} ${FCLIB}" fi dnl Check for FourierModel (if we have lapack)