diff --git a/Fltk/menuWindow.cpp b/Fltk/menuWindow.cpp index 27a5b12f33a90879e3fc70efeb5d11404bebddef..6b4566ba4cc35e0427b3cc6c13d1c6fc18740ad4 100644 --- a/Fltk/menuWindow.cpp +++ b/Fltk/menuWindow.cpp @@ -2353,7 +2353,7 @@ contextItem menu_mesh[] = { {"Partition", (Fl_Callback *)mesh_partition_cb} , #endif #if defined(HAVE_FOURIER_MODEL) - //{"Reparameterize", (Fl_Callback *)mesh_parameterize_cb} , + {"Reparameterize", (Fl_Callback *)mesh_parameterize_cb} , #endif {"Reclassify", (Fl_Callback *)mesh_classify_cb} , {"Save", (Fl_Callback *)mesh_save_cb} , diff --git a/Fltk/optionWindow.cpp b/Fltk/optionWindow.cpp index c003704dc8da3a051f3ee59fbecbd187153971d0..d7d886091eb6b2d86e99ee8d1aeb4852cc0a50f4 100644 --- a/Fltk/optionWindow.cpp +++ b/Fltk/optionWindow.cpp @@ -1147,7 +1147,7 @@ static void view_options_ok_cb(Fl_Widget *w, void *data) static void view_options_max_recursion_cb(Fl_Widget *w, void *data) { std::string str((const char*)data); - int val = GUI::instance()->options->view.value[33]->value(); + int val = (int)GUI::instance()->options->view.value[33]->value(); if(str == "-" && val > 0) GUI::instance()->options->view.value[33]->value(val - 1); else if(str == "+") diff --git a/Numeric/GmshMatrix.h b/Numeric/GmshMatrix.h index 47335903bcf3b88eae1b1a23fb2e2d7e29266f12..4b60e129cbab09096b839dd8cd223c4c3b06798a 100644 --- a/Numeric/GmshMatrix.h +++ b/Numeric/GmshMatrix.h @@ -14,10 +14,10 @@ class Gmsh_Vector { private: int r; + SCALAR *data; + friend class Gmsh_Matrix; public: inline int size() const { return r; } - SCALAR *data; - ~Gmsh_Vector() { delete [] data; } Gmsh_Vector(int R) : r(R) { data = new SCALAR[r]; @@ -25,9 +25,10 @@ class Gmsh_Vector } Gmsh_Vector(const Gmsh_Vector<SCALAR> &other) : r(other.r) { - data = new double[r]; - for (int i = 0; i < r; ++i) data[i] = other.data[i]; + data = new SCALAR[r]; + for(int i = 0; i < r; ++i) data[i] = other.data[i]; } + ~Gmsh_Vector() { delete [] data; } inline SCALAR operator () (int i) const { return data[i]; @@ -36,26 +37,18 @@ class Gmsh_Vector { return data[i]; } - inline SCALAR operator [] (int i) const + inline SCALAR norm() { - return data[i]; - } - inline SCALAR & operator [] (int i) - { - return data[i]; - } - inline double norm() - { - double n = 0.; + SCALAR n = 0.; for(int i = 0; i < r; ++i) n += data[i] * data[i]; return sqrt(n); } inline void scale(const SCALAR s) { - if (s == 0.) - for (int i = 0; i < r; ++i) data[i] = 0.; + if(s == 0.) + for(int i = 0; i < r; ++i) data[i] = 0.; else - for (int i = 0; i < r; ++i) data[i] *= s; + for(int i = 0; i < r; ++i) data[i] *= s; } }; @@ -64,6 +57,7 @@ class Gmsh_Matrix { private: int r, c; + SCALAR *data; void _back_substitution(int *indx, SCALAR *b) { int i, ii = -1, ip, j; @@ -74,7 +68,7 @@ class Gmsh_Matrix b[ip] = b[i]; if(ii != -1) for(j = ii; j <= i - 1; j++) sum -= (*this)(i, j) * b[j]; - else if (sum) ii = i; + else if(sum) ii = i; b[i] = sum; } for(i = c - 1; i >= 0; i--){ @@ -85,7 +79,7 @@ class Gmsh_Matrix } bool _lu_decomposition(int *indx , SCALAR &determinant) { - if (r != c) + if(r != c) Msg::Fatal("Gmsh_Matrix::_lu_decomposition : cannot lu decompose a non-square matrix"); int i, imax, j, k; SCALAR big, dum, sum, temp; @@ -140,8 +134,6 @@ class Gmsh_Matrix public: inline int size1() const { return r; } inline int size2() const { return c; } - SCALAR *data; - ~Gmsh_Matrix() { delete [] data; } Gmsh_Matrix(int R, int C) : r(R), c(C) { data = new SCALAR[r * c]; @@ -152,9 +144,10 @@ class Gmsh_Matrix data = new SCALAR[r * c]; memcpy(other); } + ~Gmsh_Matrix() { delete [] data; } Gmsh_Matrix & operator=(const Gmsh_Matrix<SCALAR> &other) { - if (this != &other){ + if(this != &other){ r = other.r; c = other.c; data = new SCALAR[r * c]; @@ -165,7 +158,7 @@ class Gmsh_Matrix Gmsh_Matrix() : r(0), c(0), data(0) {} void memcpy(const Gmsh_Matrix &other) { - for (int i = 0; i < r * c; ++i) data[i] = other.data[i]; + for(int i = 0; i < r * c; ++i) data[i] = other.data[i]; } inline SCALAR operator () (int i, int j) const { @@ -175,28 +168,21 @@ class Gmsh_Matrix { return data[i + r * j]; } - inline void mult(const Gmsh_Matrix<SCALAR> &x, Gmsh_Matrix<SCALAR> &b) + inline void mult(const Gmsh_Matrix<SCALAR> &b, Gmsh_Matrix<SCALAR> &c) { - b.scale(0.); + c.scale(0.); for(int i = 0; i < r; i++) - for(int j = 0; j < x.size2(); j++) + for(int j = 0; j < b.size2(); j++) for(int k = 0; k < c; k++) - b.data[i + r * j] += (*this)(i, k) * x(k, j); - } - inline void mult(const Gmsh_Vector<SCALAR> &x, Gmsh_Vector<SCALAR> &b) - { - b.scale(0.); - for(int i = 0; i < r; i++) - for(int j = 0; j < c; j++) - b.data[i] += (*this)(i, j) * x(j); + c.data[i + r * j] += (*this)(i, k) * b(k, j); } - inline void blas_dgemm(const Gmsh_Matrix<SCALAR> &x, Gmsh_Matrix<SCALAR> &b, - const SCALAR c_a = 1.0, const SCALAR c_b = 1.0) + inline void blas_dgemm(const Gmsh_Matrix<SCALAR> &b, Gmsh_Matrix<SCALAR> &c, + const SCALAR alpha=1.0, const SCALAR beta=1.0) { - Gmsh_Matrix<SCALAR> temp (x.size1(), b.size2()); - temp.mult(x, b); - scale(c_b); - temp.scale(c_a); + Gmsh_Matrix<SCALAR> temp(b.size1(), c.size2()); + temp.mult(b, c); + scale(beta); + temp.scale(alpha); add(temp); } inline void set_all(const SCALAR &m) @@ -207,7 +193,7 @@ class Gmsh_Matrix { int *indx = new int [c]; SCALAR d; - if (!_lu_decomposition(indx, d)) + if(!_lu_decomposition(indx, d)) Msg::Fatal("Singular matrix in Gmsh_Matrix::_lu_decomposition"); for(int i = 0; i < c; i++) result[i] = rhs[i]; _back_substitution(indx, result.data); @@ -218,38 +204,29 @@ class Gmsh_Matrix int ni = size1(); int nj = size2(); Gmsh_Matrix<SCALAR> cof(ni - 1, nj - 1); - for (int I = 0; I < ni; I++){ - for (int J = 0; J < nj; J++){ - if (J != j && I != i) - cof (I < i ? I : I - 1, J < j ? J : J - 1) = (*this)(I, J); + for(int I = 0; I < ni; I++){ + for(int J = 0; J < nj; J++){ + if(J != j && I != i) + cof(I < i ? I : I - 1, J < j ? J : J - 1) = (*this)(I, J); } } return cof; } - inline void invert(Gmsh_Matrix& y) + inline void mult(const Gmsh_Vector<SCALAR> &x, Gmsh_Vector<SCALAR> &y) { - SCALAR *col = new SCALAR[c]; - int *indx = new int[c]; - SCALAR d; - if (!_lu_decomposition(indx, d)) - Msg::Fatal("Singular matrix in Gmsh_Matrix::_lu_decomposition"); - for(int j = 0; j < c; j++){ - for(int i = 0; i < c; i++) col[i] = 0.0; - col[j] = 1.0; - _back_substitution(indx, col); - for(int i = 0; i < c; i++) y(i, j) = col[i]; - } - delete [] col; - delete [] indx; + y.scale(0.); + for(int i = 0; i < r; i++) + for(int j = 0; j < c; j++) + y.data[i] += (*this)(i, j) * x(j); } SCALAR determinant() const { Gmsh_Matrix copy = *this; SCALAR factor = 1.0; int *indx = new int[c]; - if (!copy._lu_decomposition(indx, factor)) return 0.0; + if(!copy._lu_decomposition(indx, factor)) return 0.0; SCALAR det = factor; - for (int i = 0; i < c; i++) det *= copy(i, i); + for(int i = 0; i < c; i++) det *= copy(i, i); delete [] indx; return det; } @@ -262,13 +239,13 @@ class Gmsh_Matrix inline void scale(const double s) { if(s == 0.) - for (int i = 0; i < r * c; ++i) data[i] = 0.; + for(int i = 0; i < r * c; ++i) data[i] = 0.; else - for (int i = 0; i < r * c; ++i) data[i] *= s; + for(int i = 0; i < r * c; ++i) data[i] *= s; } inline void add(const double &a) { - for (int i = 0; i < r * c; ++i) data[i] += a; + for(int i = 0; i < r * c; ++i) data[i] += a; } inline void add(const Gmsh_Matrix &m) { @@ -289,10 +266,10 @@ class GSL_Vector { private: int r; + gsl_vector *data; + friend class GSL_Matrix; public: inline int size() const { return r; } - gsl_vector *data; - ~GSL_Vector() { gsl_vector_free(data); } GSL_Vector(int R) : r(R) { data = gsl_vector_calloc(r); @@ -302,6 +279,7 @@ class GSL_Vector data = gsl_vector_calloc(r); gsl_vector_memcpy(data, other.data); } + ~GSL_Vector() { gsl_vector_free(data); } inline double operator () (int i) const { return gsl_vector_get(data, i); @@ -314,10 +292,10 @@ class GSL_Vector { return gsl_blas_dnrm2(data); } - inline void scale(const double &y) + inline void scale(const double s) { - if (y == 0.) gsl_vector_set_zero(data); - else gsl_vector_scale(data, y); + if(s == 0.) gsl_vector_set_zero(data); + else gsl_vector_scale(data, s); } }; @@ -325,10 +303,14 @@ class GSL_Matrix { private: gsl_matrix_view view; + gsl_matrix *data; + inline const gsl_matrix_view _see_submatrix(int i0, int ni, int j0, int nj) const + { + return gsl_matrix_submatrix(data, i0, j0, ni, nj); + } public: inline int size1() const { return data->size1; } inline int size2() const { return data->size2; } - gsl_matrix *data; GSL_Matrix(gsl_matrix_view _data) : view(_data), data(&view.matrix) {} GSL_Matrix(int r, int c) { data = gsl_matrix_calloc(r, c); } GSL_Matrix() : data(0) {} @@ -338,10 +320,10 @@ class GSL_Matrix data = gsl_matrix_calloc(other.data->size1, other.data->size2); gsl_matrix_memcpy(data, other.data); } - virtual ~GSL_Matrix() { if(data && data->owner == 1) gsl_matrix_free(data); } + ~GSL_Matrix() { if(data && data->owner == 1) gsl_matrix_free(data); } GSL_Matrix & operator = (const GSL_Matrix&other) { - if (&other != this){ + if(&other != this){ if(data) gsl_matrix_free(data); data = gsl_matrix_calloc(other.data->size1, other.data->size2); gsl_matrix_memcpy(data, other.data); @@ -360,9 +342,14 @@ class GSL_Matrix { return *gsl_matrix_ptr(data, i, j); } - inline void mult(const GSL_Matrix &x, GSL_Matrix &b) + inline void mult(const GSL_Matrix &b, GSL_Matrix &c) { - gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1., data, x.data, 0., b.data); + gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1., data, b.data, 0., c.data); + } + inline void blas_dgemm(const GSL_Matrix &x, GSL_Matrix &b, + const double alpha = 1.0, const double beta = 1.0) + { + gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, alpha, x.data, b.data, beta, data); } inline void set_all(const double &m) { @@ -376,81 +363,50 @@ class GSL_Matrix gsl_linalg_LU_solve(data, p, rhs.data, result.data); gsl_permutation_free(p); } - inline void invert () - { - int s; - gsl_permutation *p = gsl_permutation_alloc (size1()); - gsl_linalg_LU_decomp(data, p, &s); - gsl_matrix *data_inv = gsl_matrix_calloc(size1(), size2()); - gsl_linalg_LU_invert(data, p, data_inv) ; - gsl_matrix_memcpy(data, data_inv); - gsl_matrix_free(data_inv); - gsl_permutation_free(p); - } - inline bool invertSecure(double &det) - { - int s; - gsl_permutation *p = gsl_permutation_alloc (size1()); - gsl_linalg_LU_decomp(data, p, &s); - det = gsl_linalg_LU_det(data, s); - gsl_matrix *data_inv = gsl_matrix_calloc(size1(), size2()); - gsl_linalg_LU_invert(data, p, data_inv); - gsl_matrix_memcpy(data, data_inv); - gsl_matrix_free(data_inv); - gsl_permutation_free(p); - return (det != 0.); - } - double determinant() const - { - GSL_Matrix copy = *this; - double det; - copy.invertSecure(det); - return det; - } GSL_Matrix cofactor(int i, int j) const { int ni = size1(); int nj = size2(); GSL_Matrix cof(ni - 1, nj - 1); - if (i > 0) { - if (j > 0) + if(i > 0) { + if(j > 0) GSL_Matrix(cof.touchSubmatrix(0, i , 0, j)). - memcpy(GSL_Matrix(seeSubmatrix(0, i, 0, j))); - if (j < nj - 1) + memcpy(GSL_Matrix(_see_submatrix(0, i, 0, j))); + if(j < nj - 1) GSL_Matrix(cof.touchSubmatrix(0, i, j, nj - j - 1)). - memcpy(GSL_Matrix(seeSubmatrix(0, i, j + 1,nj - j - 1))); + memcpy(GSL_Matrix(_see_submatrix(0, i, j + 1,nj - j - 1))); } - if (i < ni - 1) { - if (j < nj - 1) + if(i < ni - 1) { + if(j < nj - 1) GSL_Matrix(cof.touchSubmatrix(i, ni - i - 1, j, nj - j - 1)). - memcpy(GSL_Matrix(seeSubmatrix(i + 1, ni - i - 1, j + 1, nj - j - 1))); - if (j > 0) + memcpy(GSL_Matrix(_see_submatrix(i + 1, ni - i - 1, j + 1, nj - j - 1))); + if(j > 0) GSL_Matrix(cof.touchSubmatrix(i, ni - i - 1, 0, j)). - memcpy(GSL_Matrix(seeSubmatrix(i + 1, ni - i - 1, 0, j))); - } + memcpy(GSL_Matrix(_see_submatrix(i + 1, ni - i - 1, 0, j))); + } return cof; } inline void mult(const GSL_Vector &x, GSL_Vector &b) { gsl_blas_dgemv(CblasNoTrans, 1., data, x.data, 0., b.data); } - inline void blas_dgemm(const GSL_Matrix &x, GSL_Matrix &b, - const double c_a = 1.0, const double c_b = 1.0) - { - gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, c_a, x.data, b.data, c_b, data); - } + double determinant() const + { + GSL_Matrix copy = *this; + gsl_permutation *p = gsl_permutation_alloc(size1()); + int s; + gsl_linalg_LU_decomp(copy.data, p, &s); + gsl_permutation_free(p); + return gsl_linalg_LU_det(copy.data, s); + } inline gsl_matrix_view touchSubmatrix(int i0, int ni, int j0, int nj) { return gsl_matrix_submatrix(data, i0, j0, ni, nj); } - inline const gsl_matrix_view seeSubmatrix(int i0, int ni, int j0, int nj) const - { - return gsl_matrix_submatrix(data, i0, j0, ni, nj); - } - inline void scale(const double &m) + inline void scale(const double s) { - if (m == 0.) gsl_matrix_set_zero(data); - else gsl_matrix_scale(data, m); + if(s == 0.) gsl_matrix_set_zero(data); + else gsl_matrix_scale(data, s); } inline void add(const double &a) { diff --git a/Post/adaptiveData.cpp b/Post/adaptiveData.cpp index fc0363825bda8e6aceb774f91292b844f955b9d6..e28a8d9fc98c34e7bd21e4c37baaf94e496cf85e 100644 --- a/Post/adaptiveData.cpp +++ b/Post/adaptiveData.cpp @@ -9,6 +9,9 @@ #include "adaptiveData.h" #include "Plugin.h" #include "ListUtils.h" +#include "OS.h" + +//#define TIMER std::set<adaptivePoint> adaptiveLine::allPoints; std::set<adaptivePoint> adaptiveTriangle::allPoints; @@ -852,6 +855,10 @@ adaptiveElements<T>::~adaptiveElements() template <class T> void adaptiveElements<T>::init(int level) { +#ifdef TIMER + double t1 = GetTimeInSeconds(); +#endif + T::create(level); int numVals = _coeffsVal ? _coeffsVal->size1() : T::numNodes; int numNodes = _coeffsGeom ? _coeffsGeom->size1() : T::numNodes; @@ -892,6 +899,11 @@ void adaptiveElements<T>::init(int level) if(tmpv) delete tmpv; if(tmpg) delete tmpg; + +#ifdef TIMER + adaptiveData::timerInit += GetTimeInSeconds() - t1; + return; +#endif } template <class T> @@ -920,6 +932,10 @@ void adaptiveElements<T>::adapt(double tol, int numComp, numVals, values.size()); return; } + +#ifdef TIMER + double t1 = GetTimeInSeconds(); +#endif Double_Vector val(numVals), res(numPoints); if(numComp == 1){ @@ -941,20 +957,16 @@ void adaptiveElements<T>::adapt(double tol, int numComp, } if(onlyComputeMinMax) return; - Double_Vector *resx = 0, *resy = 0, *resz = 0; + Double_Matrix *resxyz = 0; if(numComp == 3){ - Double_Vector valx(numVals), valy(numVals), valz(numVals); - resx = new Double_Vector(numPoints); - resy = new Double_Vector(numPoints); - resz = new Double_Vector(numPoints); + Double_Matrix valxyz(numVals, 3); + resxyz = new Double_Matrix(numPoints, 3); for(int i = 0; i < numVals; i++){ - valx(i) = values[i].v[0]; - valy(i) = values[i].v[1]; - valz(i) = values[i].v[2]; + valxyz(i, 0) = values[i].v[0]; + valxyz(i, 1) = values[i].v[1]; + valxyz(i, 2) = values[i].v[2]; } - _interpolVal->mult(valx, *resx); - _interpolVal->mult(valy, *resy); - _interpolVal->mult(valz, *resz); + _interpolVal->mult(valxyz, *resxyz); } int numNodes = _coeffsGeom ? _coeffsGeom->size1() : T::numNodes; @@ -971,17 +983,22 @@ void adaptiveElements<T>::adapt(double tol, int numComp, xyz(i, 2) = coords[i].c[2]; } _interpolGeom->mult(xyz, XYZ); - + +#ifdef TIMER + adaptiveData::timerAdapt += GetTimeInSeconds() - t1; + return; +#endif + int i = 0; for(std::set<adaptivePoint>::iterator it = T::allPoints.begin(); it != T::allPoints.end(); ++it){ // ok because we know this will not change the set ordering adaptivePoint *p = (adaptivePoint*)&(*it); p->val = res(i); - if(resx){ - p->valx = (*resx)(i); - p->valy = (*resy)(i); - p->valz = (*resz)(i); + if(resxyz){ + p->valx = (*resxyz)(i, 0); + p->valy = (*resxyz)(i, 1); + p->valz = (*resxyz)(i, 2); } p->X = XYZ(i, 0); p->Y = XYZ(i, 1); @@ -989,9 +1006,7 @@ void adaptiveElements<T>::adapt(double tol, int numComp, i++; } - if(resx) delete resx; - if(resy) delete resy; - if(resz) delete resz; + if(resxyz) delete resxyz; for(typename std::list<T*>::iterator it = T::all.begin(); it != T::all.end(); it++) @@ -1157,9 +1172,14 @@ adaptiveData::~adaptiveData() delete _outData; } +double adaptiveData::timerInit = 0.; +double adaptiveData::timerAdapt = 0.; + void adaptiveData::changeResolution(int step, int level, double tol, GMSH_Post_Plugin *plug) { + timerInit = timerAdapt = 0.; + if(_level != level){ if(_lines) _lines->init(level); if(_triangles) _triangles->init(level); @@ -1181,4 +1201,9 @@ void adaptiveData::changeResolution(int step, int level, double tol, _step = step; _level = level; _tol = tol; + +#ifdef TIMER + printf("init time = %g\n", timerInit); + printf("adapt time = %g\n", timerAdapt); +#endif } diff --git a/Post/adaptiveData.h b/Post/adaptiveData.h index ba2fee41750cb8124682efab560de0478354cc52..29abb809fed5b38cce84d341a644c5d233db8490 100644 --- a/Post/adaptiveData.h +++ b/Post/adaptiveData.h @@ -319,6 +319,7 @@ class adaptiveData { adaptiveElements<adaptiveHexahedron> *_hexahedra; adaptiveElements<adaptivePrism> *_prisms; public: + static double timerInit, timerAdapt; adaptiveData(PViewData *data); ~adaptiveData(); PViewData *getData(){ return (PViewData*)_outData; } diff --git a/configure b/configure index e0d8d60878e913fe840dbd743d06059bc202ae25..af9139e0e9b7a2cac681738e5931536cc51c5c98 100755 --- a/configure +++ b/configure @@ -1290,6 +1290,7 @@ Optional Features: --enable-native-file-chooser enable native file chooser (default=yes, except on Linux) + --enable-mpi enable MPI support (default=no) --enable-minimal build minimal standalone version (default=no) Optional Packages: @@ -1312,6 +1313,7 @@ Optional Packages: located --with-hdf5-prefix=PFX prefix where HDF5 is installed --with-med-prefix=PFX prefix where MED is installed + --with-mpi-prefix=PFX prefix where MPI is installed --with-fftw3-prefix=PFX prefix where FFTW3 is installed --with-fm-prefix=PFX prefix where FourierModel is installed --with-blas-lapack-prefix=PFX @@ -1822,6 +1824,12 @@ if test "${with_med_prefix+set}" = set; then fi +# Check whether --with-mpi-prefix was given. +if test "${with_mpi_prefix+set}" = set; then + withval=$with_mpi_prefix; MPI_PREFIX=$withval +fi + + # Check whether --with-fftw3-prefix was given. if test "${with_fftw3_prefix+set}" = set; then withval=$with_fftw3_prefix; FFTW3_PREFIX=$withval @@ -1960,6 +1968,11 @@ if test "${enable_native_file_chooser+set}" = set; then enableval=$enable_native_file_chooser; fi +# Check whether --enable-mpi was given. +if test "${enable_mpi+set}" = set; then + enableval=$enable_mpi; +fi + # Check whether --enable-minimal was given. if test "${enable_minimal+set}" = set; then enableval=$enable_minimal; @@ -4706,18 +4719,22 @@ fi fi -if test "x$enable_gsl" != "xno"; then - if test "x${GSL_PREFIX}" != "x"; then - LDFLAGS="-L${GSL_PREFIX} -L${GSL_PREFIX}/lib ${LDFLAGS}" +if test "x${OCC_PREFIX}" != "x"; then + if test "x$enable_occ" != "xno"; then + enable_occ="yes" fi - -{ echo "$as_me:$LINENO: checking for main in -lgslcblas" >&5 -echo $ECHO_N "checking for main in -lgslcblas... $ECHO_C" >&6; } -if test "${ac_cv_lib_gslcblas_main+set}" = set; then +fi +if test "x$enable_occ" = "xyes"; then + if test "x${OCC_PREFIX}" != "x"; then + LDFLAGS="-L${OCC_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lTKernel" >&5 +echo $ECHO_N "checking for main in -lTKernel... $ECHO_C" >&6; } +if test "${ac_cv_lib_TKernel_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lgslcblas $LIBS" +LIBS="-lTKernel $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4752,36 +4769,96 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_gslcblas_main=yes + ac_cv_lib_TKernel_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gslcblas_main=no + ac_cv_lib_TKernel_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_gslcblas_main" >&5 -echo "${ECHO_T}$ac_cv_lib_gslcblas_main" >&6; } -if test $ac_cv_lib_gslcblas_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGSLCBLAS 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_lib_TKernel_main" >&5 +echo "${ECHO_T}$ac_cv_lib_TKernel_main" >&6; } +if test $ac_cv_lib_TKernel_main = yes; then + OCC="yes" +else + OCC="no" +fi - LIBS="-lgslcblas $LIBS" + if test "x${OCC}" = "xyes"; then + # DataExchange (subset; see occ/ros/adm/make/Makefile for more info) + OCC_LIBS="-lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKIGES -lTKXSBase" + # ModelingAlgorithms + OCC_LIBS="${OCC_LIBS} -lTKOffset -lTKFeat -lTKFillet -lTKBool -lTKShHealing" + OCC_LIBS="${OCC_LIBS} -lTKMesh -lTKHLR -lTKBO -lTKPrim -lTKTopAlgo -lTKGeomAlgo" + # ModelingData + OCC_LIBS="${OCC_LIBS} -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d" + # FoundationClasses + OCC_LIBS="${OCC_LIBS} -lTKAdvTools -lTKMath -lTKernel" + if test "x${OCC_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} ${OCC_LIBS}" + FLAGS="${FLAGS} -DHAVE_OCC" + else + GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib ${OCC_LIBS}" + FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/inc" + fi + fi +fi + +if test "x${OCC}" = "xyes"; then + if test "x${OCC_MESH_CONTRAINTS_PREFIX}" != "x"; then + as_ac_File=`echo "ac_cv_file_${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" >&5 +echo $ECHO_N "checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx... $ECHO_C" >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +ac_res=`eval echo '${'$as_ac_File'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_File'}'` = yes; then + OMC="yes" +else + OMC="no" +fi + if test "x${OMC}" = "xyes"; then + FLAGS="${FLAGS} -DHAVE_OCC_MESH_CONSTRAINTS -I${OCC_MESH_CONTRAINTS_PREFIX}" + fi + fi fi - { echo "$as_me:$LINENO: checking for main in -lgsl" >&5 -echo $ECHO_N "checking for main in -lgsl... $ECHO_C" >&6; } -if test "${ac_cv_lib_gsl_main+set}" = set; then +if test "x${HDF5_PREFIX}" != "x" -a "x$enable_hdf5" != "xno"; then + enable_hdf5=yes +fi +if test "x${ZLIB}" = "xyes" -a "x$enable_med" != "xno"; then + enable_hdf5=yes +fi +if test "x$enable_hdf5" = "xyes"; then + if test "x${HDF5_PREFIX}" != "x"; then + LDFLAGS="-L${HDF5_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lhdf5" >&5 +echo $ECHO_N "checking for main in -lhdf5... $ECHO_C" >&6; } +if test "${ac_cv_lib_hdf5_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lgsl $LIBS" +LIBS="-lhdf5 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4816,93 +4893,45 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_gsl_main=yes + ac_cv_lib_hdf5_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gsl_main=no + ac_cv_lib_hdf5_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsl_main" >&5 -echo "${ECHO_T}$ac_cv_lib_gsl_main" >&6; } -if test $ac_cv_lib_gsl_main = yes; then - GSL="yes" -else - GSL="no" -fi - - if test "x${GSL}" = "xyes"; then - FLAGS="-DHAVE_GSL ${FLAGS}" - if test "x${GSL_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lgsl -lgslcblas" - else - GMSH_LIBS="${GMSH_LIBS} -L${GSL_PREFIX} -L${GSL_PREFIX}/lib -lgsl -lgslcblas" - FLAGS="${FLAGS} -I${GSL_PREFIX} -I${GSL_PREFIX}/include" - fi - fi -fi -if test "x${GSL}" != "xyes"; then - { echo "$as_me:$LINENO: checking for ./contrib/NR/dsvdcmp.cpp" >&5 -echo $ECHO_N "checking for ./contrib/NR/dsvdcmp.cpp... $ECHO_C" >&6; } -if test "${ac_cv_file___contrib_NR_dsvdcmp_cpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } -if test -r "./contrib/NR/dsvdcmp.cpp"; then - ac_cv_file___contrib_NR_dsvdcmp_cpp=yes -else - ac_cv_file___contrib_NR_dsvdcmp_cpp=no -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_file___contrib_NR_dsvdcmp_cpp" >&5 -echo "${ECHO_T}$ac_cv_file___contrib_NR_dsvdcmp_cpp" >&6; } -if test $ac_cv_file___contrib_NR_dsvdcmp_cpp = yes; then - NR="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_hdf5_main" >&5 +echo "${ECHO_T}$ac_cv_lib_hdf5_main" >&6; } +if test $ac_cv_lib_hdf5_main = yes; then + HDF5="yes" else - NR="no" + HDF5="no" fi - if test "x${NR}" = "xyes"; then - GMSH_DIRS="${GMSH_DIRS} contrib/NR" - GMSH_LIBS="${GMSH_LIBS} -lGmshNR" - echo "********************************************************************" - echo " You are building a non-free version of Gmsh, using code copyright" - echo " (C) 1986-92 Numerical Recipes Software." - echo " To use the GSL instead, run configure again with the --enable-gsl" - echo " option." - echo "********************************************************************" - else - { { echo "$as_me:$LINENO: error: Could not find GSL, aborting." >&5 -echo "$as_me: error: Could not find GSL, aborting." >&2;} - { (exit 1); exit 1; }; } + if test "x${HDF5}" = "xyes"; then + LIBS="-lhdf5 ${LIBS}" # Necessary for CGNS with HDF5 fi fi - -if test "x${OCC_PREFIX}" != "x"; then - if test "x$enable_occ" != "xno"; then - enable_occ="yes" - fi +if test "x${CGNS_PREFIX}" != "x" -a "x$enable_cgns" != "xno"; then + enable_cgns="yes" fi -if test "x$enable_occ" = "xyes"; then - if test "x${OCC_PREFIX}" != "x"; then - LDFLAGS="-L${OCC_PREFIX}/lib ${LDFLAGS}" +if test "x$enable_cgns" = "xyes"; then + if test "x${CGNS_PREFIX}" != "x"; then + LDFLAGS="-L${CGNS_PREFIX}/lib ${LDFLAGS}" fi - { echo "$as_me:$LINENO: checking for main in -lTKernel" >&5 -echo $ECHO_N "checking for main in -lTKernel... $ECHO_C" >&6; } -if test "${ac_cv_lib_TKernel_main+set}" = set; then + { echo "$as_me:$LINENO: checking for main in -lcgns" >&5 +echo $ECHO_N "checking for main in -lcgns... $ECHO_C" >&6; } +if test "${ac_cv_lib_cgns_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lTKernel $LIBS" +LIBS="-lcgns $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4937,88 +4966,490 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_TKernel_main=yes + ac_cv_lib_cgns_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_TKernel_main=no + ac_cv_lib_cgns_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_TKernel_main" >&5 -echo "${ECHO_T}$ac_cv_lib_TKernel_main" >&6; } -if test $ac_cv_lib_TKernel_main = yes; then - OCC="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cgns_main" >&5 +echo "${ECHO_T}$ac_cv_lib_cgns_main" >&6; } +if test $ac_cv_lib_cgns_main = yes; then + CGNS="yes" else - OCC="no" + CGNS="no" fi - if test "x${OCC}" = "xyes"; then - # DataExchange (subset; see occ/ros/adm/make/Makefile for more info) - OCC_LIBS="-lTKSTEP -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKIGES -lTKXSBase" - # ModelingAlgorithms - OCC_LIBS="${OCC_LIBS} -lTKOffset -lTKFeat -lTKFillet -lTKBool -lTKShHealing" - OCC_LIBS="${OCC_LIBS} -lTKMesh -lTKHLR -lTKBO -lTKPrim -lTKTopAlgo -lTKGeomAlgo" - # ModelingData - OCC_LIBS="${OCC_LIBS} -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d" - # FoundationClasses - OCC_LIBS="${OCC_LIBS} -lTKAdvTools -lTKMath -lTKernel" - if test "x${OCC_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} ${OCC_LIBS}" - FLAGS="${FLAGS} -DHAVE_OCC" + if test "x${CGNS}" = "xyes"; then + if test "x${CGNS_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lcgns" + FLAGS="${FLAGS} -DHAVE_LIBCGNS" else - GMSH_LIBS="${GMSH_LIBS} -L${OCC_PREFIX}/lib ${OCC_LIBS}" - FLAGS="${FLAGS} -DHAVE_OCC -I${OCC_PREFIX}/inc" + GMSH_LIBS="${GMSH_LIBS} -L${CGNS_PREFIX}/lib -lcgns" + FLAGS="${FLAGS} -DHAVE_LIBCGNS -I${CGNS_PREFIX}/include" fi fi fi -if test "x${OCC}" = "xyes"; then - if test "x${OCC_MESH_CONTRAINTS_PREFIX}" != "x"; then - as_ac_File=`echo "ac_cv_file_${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx" >&5 -echo $ECHO_N "checking for ${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx... $ECHO_C" >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then +if test "x${HDF5}" = "xyes"; then + if test "x$enable_med" != "xno"; then + if test "x${MED_PREFIX}" != "x"; then + LDFLAGS="-L${MED_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lmed" >&5 +echo $ECHO_N "checking for main in -lmed... $ECHO_C" >&6; } +if test "${ac_cv_lib_med_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } -if test -r "${OCC_MESH_CONTRAINTS_PREFIX}/MeshGmsh_Constrain.hxx"; then - eval "$as_ac_File=yes" -else - eval "$as_ac_File=no" -fi -fi -ac_res=`eval echo '${'$as_ac_File'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_File'}'` = yes; then - OMC="yes" -else - OMC="no" -fi - - if test "x${OMC}" = "xyes"; then - FLAGS="${FLAGS} -DHAVE_OCC_MESH_CONSTRAINTS -I${OCC_MESH_CONTRAINTS_PREFIX}" - fi - 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_check_lib_save_LIBS=$LIBS +LIBS="-lmed $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_med_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_med_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_med_main" >&5 +echo "${ECHO_T}$ac_cv_lib_med_main" >&6; } +if test $ac_cv_lib_med_main = yes; then + MED="yes" +else + MED="no" +fi + + if test "x${MED}" = "xyes"; then + if test "x${MED_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lmed" + FLAGS="${FLAGS} -DHAVE_MED" + else + GMSH_LIBS="${GMSH_LIBS} -L${MED_PREFIX}/lib -lmed" + FLAGS="${FLAGS} -DHAVE_MED -I${MED_PREFIX}/include" + fi + fi + fi +fi + +if test "x${HDF5}" = "xyes"; then + if test "x${HDF5_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lhdf5" + else + GMSH_LIBS="${GMSH_LIBS} -L${HDF5_PREFIX}/lib -lhdf5" + FLAGS="${FLAGS} -I${HDF5_PREFIX}/include" + fi +fi + +if test "x${ZLIB}" = "xyes"; then + if test "x${FL_ZLIB}" = "xyes"; then + FLAGS="-DHAVE_LIBZ ${FLAGS}" + else + FLAGS="-DHAVE_LIBZ ${FLAGS}" + if test "x${ZLIB_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lz" + else + GMSH_LIBS="${GMSH_LIBS} -L${ZLIB_PREFIX} -L${ZLIB_PREFIX}/lib -lz" + FLAGS="${FLAGS} -I${ZLIB_PREFIX} -I${ZLIB_PREFIX}/include" + fi + fi +fi + +if test "x$enable_gsl" != "xno"; then + if test "x${GSL_PREFIX}" != "x"; then + LDFLAGS="-L${GSL_PREFIX} -L${GSL_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lgsl" >&5 +echo $ECHO_N "checking for main in -lgsl... $ECHO_C" >&6; } +if test "${ac_cv_lib_gsl_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gsl_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gsl_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gsl_main" >&5 +echo "${ECHO_T}$ac_cv_lib_gsl_main" >&6; } +if test $ac_cv_lib_gsl_main = yes; then + GSL="yes" +else + GSL="no" +fi + + if test "x${GSL}" = "xyes"; then + FLAGS="-DHAVE_GSL ${FLAGS}" + if test "x${GSL_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lgsl" + else + GMSH_LIBS="${GMSH_LIBS} -L${GSL_PREFIX} -L${GSL_PREFIX}/lib -lgsl" + FLAGS="${FLAGS} -I${GSL_PREFIX} -I${GSL_PREFIX}/include" + fi + fi +fi +if test "x${GSL}" != "xyes"; then + { echo "$as_me:$LINENO: checking for ./contrib/NR/dsvdcmp.cpp" >&5 +echo $ECHO_N "checking for ./contrib/NR/dsvdcmp.cpp... $ECHO_C" >&6; } +if test "${ac_cv_file___contrib_NR_dsvdcmp_cpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + test "$cross_compiling" = yes && + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } +if test -r "./contrib/NR/dsvdcmp.cpp"; then + ac_cv_file___contrib_NR_dsvdcmp_cpp=yes +else + ac_cv_file___contrib_NR_dsvdcmp_cpp=no +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_file___contrib_NR_dsvdcmp_cpp" >&5 +echo "${ECHO_T}$ac_cv_file___contrib_NR_dsvdcmp_cpp" >&6; } +if test $ac_cv_file___contrib_NR_dsvdcmp_cpp = yes; then + NR="yes" +else + NR="no" +fi + + if test "x${NR}" = "xyes"; then + GMSH_DIRS="${GMSH_DIRS} contrib/NR" + GMSH_LIBS="${GMSH_LIBS} -lGmshNR" + echo "********************************************************************" + echo " You are building a non-free version of Gmsh, using code copyright" + echo " (C) 1986-92 Numerical Recipes Software." + echo " To use the GSL instead, run configure again with the --enable-gsl" + echo " option." + echo "********************************************************************" + else + { { echo "$as_me:$LINENO: error: Could not find GSL, aborting." >&5 +echo "$as_me: error: Could not find GSL, aborting." >&2;} + { (exit 1); exit 1; }; } + fi +fi + +if test "x$enable_fm" != "xno"; then + if test "x${FM_PREFIX}" != "x"; then + LDFLAGS="-L${FM_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lFourierModel" >&5 +echo $ECHO_N "checking for main in -lFourierModel... $ECHO_C" >&6; } +if test "${ac_cv_lib_FourierModel_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lFourierModel $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_FourierModel_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_FourierModel_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_FourierModel_main" >&5 +echo "${ECHO_T}$ac_cv_lib_FourierModel_main" >&6; } +if test $ac_cv_lib_FourierModel_main = yes; then + FM="yes" +else + FM="no" +fi + + if test "x${FM}" = "xyes"; then + if test "x${FFTW3_PREFIX}" != "x"; then + LDFLAGS="-L${FFTW3_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lfftw3" >&5 +echo $ECHO_N "checking for main in -lfftw3... $ECHO_C" >&6; } +if test "${ac_cv_lib_fftw3_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfftw3 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_fftw3_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_fftw3_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3_main" >&5 +echo "${ECHO_T}$ac_cv_lib_fftw3_main" >&6; } +if test $ac_cv_lib_fftw3_main = yes; then + FFTW3="yes" +else + FFTW3="no" +fi + + if test "x${FFTW3}" != "xyes"; then + FM=no + { echo "$as_me:$LINENO: WARNING: Could not find FFTW3: disabling FourierModel." >&5 +echo "$as_me: WARNING: Could not find FFTW3: disabling FourierModel." >&2;} + else + if test "x${FM_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lFourierModel" + FLAGS="-DHAVE_FOURIER_MODEL ${FLAGS}" + else + GMSH_LIBS="${GMSH_LIBS} -L${FM_PREFIX}/lib -lFourierModel" + FLAGS="-DHAVE_FOURIER_MODEL -I${FM_PREFIX} ${FLAGS}" + fi + if test "x${FFTW3_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lfftw3" + else + GMSH_LIBS="${GMSH_LIBS} -L${FFTW3_PREFIX}/lib -lfftw3" + FLAGS="${FLAGS} -I${FFTW3_PREFIX}/include" + fi + fi + fi +fi + +BLAS_LIBS="" +BLAS_PATH="" +if test "x${BLAS_LAPACK_PREFIX}" != "x"; then + LDFLAGS="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib ${LDFLAGS}" +fi +{ 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 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -if test "x${BLAS_LAPACK_PREFIX}" != "x"; then - LDFLAGS="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib ${LDFLAGS}" +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char cblas_dgemm (); +int +main () +{ +return cblas_dgemm (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 + CBLAS="yes" +else + CBLAS="no" fi -ac_ext=f + +if test "x$CBLAS" = "xyes"; then + BLAS_LIBS="-lcblas" + if test "x${BLAS_LAPACK_PREFIX}" != "x"; then + BLAS_PATH="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib" + fi +else + if test "x$GSL" = "xyes"; then + BLAS_LIBS="-lgslcblas" + fi +fi + +if test "x${FM}" = "xyes"; 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 @@ -5208,249 +5639,31 @@ rm -f core conftest.err 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 -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 { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_prog_f77_g=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ 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 "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= - fi -fi - -G77=`test $ac_compiler_gnu = yes && echo yes` -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 for dasum in -lblas" >&5 -echo $ECHO_N "checking for dasum in -lblas... $ECHO_C" >&6; } -if test "${ac_cv_lib_blas_dasum+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 - program main - call dasum - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_blas_dasum=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_blas_dasum=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_blas_dasum" >&5 -echo "${ECHO_T}$ac_cv_lib_blas_dasum" >&6; } -if test $ac_cv_lib_blas_dasum = yes; then - BLAS="yes" -else - BLAS="no" -fi - -if test "x$BLAS" != "xyes"; then - { echo "$as_me:$LINENO: checking for dasum_ in -lblas" >&5 -echo $ECHO_N "checking for dasum_ in -lblas... $ECHO_C" >&6; } -if test "${ac_cv_lib_blas_dasum_+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 - program main - call dasum_ - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_blas_dasum_=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_blas_dasum_=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_blas_dasum_" >&5 -echo "${ECHO_T}$ac_cv_lib_blas_dasum_" >&6; } -if test $ac_cv_lib_blas_dasum_ = yes; then - BLAS="yes" -else - BLAS="no" -fi - -fi -{ echo "$as_me:$LINENO: checking for dbdsqr in -llapack" >&5 -echo $ECHO_N "checking for dbdsqr in -llapack... $ECHO_C" >&6; } -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 -lblas $LIBS" -cat >conftest.$ac_ext <<_ACEOF - program main - call dbdsqr - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lapack_dbdsqr=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_lapack_dbdsqr=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lapack_dbdsqr" >&5 -echo "${ECHO_T}$ac_cv_lib_lapack_dbdsqr" >&6; } -if test $ac_cv_lib_lapack_dbdsqr = yes; then - LAPACK="yes" -else - LAPACK="no" -fi - -if test "x$BLAS" != "xyes"; then - { echo "$as_me:$LINENO: checking for dbdsqr_ in -llapack" >&5 -echo $ECHO_N "checking for dbdsqr_ in -llapack... $ECHO_C" >&6; } -if test "${ac_cv_lib_lapack_dbdsqr_+set}" = set; then +{ 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-llapack -lblas $LIBS" + FFLAGS=-g cat >conftest.$ac_ext <<_ACEOF program main - call dbdsqr_ + end _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5459,47 +5672,60 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (exit $ac_status); } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lapack_dbdsqr_=yes + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lapack_dbdsqr_=no + ac_cv_prog_f77_g=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lapack_dbdsqr_" >&5 -echo "${ECHO_T}$ac_cv_lib_lapack_dbdsqr_" >&6; } -if test $ac_cv_lib_lapack_dbdsqr_ = yes; then - LAPACK="yes" +{ 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 "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi else - LAPACK="no" + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi 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' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - -if test "x$enable_fm" != "xno"; then - if test "x${FM_PREFIX}" != "x"; then - LDFLAGS="-L${FM_PREFIX}/lib ${LDFLAGS}" - fi - { echo "$as_me:$LINENO: checking for main in -lFourierModel" >&5 -echo $ECHO_N "checking for main in -lFourierModel... $ECHO_C" >&6; } -if test "${ac_cv_lib_FourierModel_main+set}" = set; then + F77LIB="" + case "${F77}" in + *gfortran*) + F77LIB="-lgfortran" + ;; + *g77*) + F77LIB="-lg2c" + ;; + esac + LDFLAGS="${LDFLAGS} ${F77LIB}" + { echo "$as_me:$LINENO: checking for dgemm in -lblas" >&5 +echo $ECHO_N "checking for dgemm in -lblas... $ECHO_C" >&6; } +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="-lFourierModel $LIBS" +LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5507,11 +5733,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dgemm (); int main () { -return main (); +return dgemm (); ; return 0; } @@ -5534,41 +5766,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_FourierModel_main=yes + ac_cv_lib_blas_dgemm=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_FourierModel_main=no + ac_cv_lib_blas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_FourierModel_main" >&5 -echo "${ECHO_T}$ac_cv_lib_FourierModel_main" >&6; } -if test $ac_cv_lib_FourierModel_main = yes; then - FM="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_blas_dgemm" >&5 +echo "${ECHO_T}$ac_cv_lib_blas_dgemm" >&6; } +if test $ac_cv_lib_blas_dgemm = yes; then + BLAS="yes" else - FM="no" + BLAS="no" fi - if test "x${FM}" = "xyes"; then - if test "x${BLAS}" != "xyes" -o "x${LAPACK}" != "xyes"; then - { echo "$as_me:$LINENO: WARNING: Could not find blas or lapack: disabling FourierModel." >&5 -echo "$as_me: WARNING: Could not find blas or lapack: disabling FourierModel." >&2;} - else - if test "x${FFTW3_PREFIX}" != "x"; then - LDFLAGS="-L${FFTW3_PREFIX}/lib ${LDFLAGS}" - fi - { echo "$as_me:$LINENO: checking for main in -lfftw3" >&5 -echo $ECHO_N "checking for main in -lfftw3... $ECHO_C" >&6; } -if test "${ac_cv_lib_fftw3_main+set}" = set; then + if test "x$BLAS" != "xyes"; then + { echo "$as_me:$LINENO: checking for dgemm_ in -lblas" >&5 +echo $ECHO_N "checking for dgemm_ in -lblas... $ECHO_C" >&6; } +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="-lfftw3 $LIBS" +LIBS="-lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5576,11 +5801,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dgemm_ (); int main () { -return main (); +return dgemm_ (); ; return 0; } @@ -5603,77 +5834,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_fftw3_main=yes + ac_cv_lib_blas_dgemm_=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_fftw3_main=no + ac_cv_lib_blas_dgemm_=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_fftw3_main" >&5 -echo "${ECHO_T}$ac_cv_lib_fftw3_main" >&6; } -if test $ac_cv_lib_fftw3_main = yes; then - FFTW3="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_blas_dgemm_" >&5 +echo "${ECHO_T}$ac_cv_lib_blas_dgemm_" >&6; } +if test $ac_cv_lib_blas_dgemm_ = yes; then + BLAS="yes" else - FFTW3="no" -fi - - if test "x${FFTW3}" != "xyes"; then - { echo "$as_me:$LINENO: WARNING: Could not find FFTW3: disabling FourierModel." >&5 -echo "$as_me: WARNING: Could not find FFTW3: disabling FourierModel." >&2;} - else - if test "x${FM_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lFourierModel" - FLAGS="-DHAVE_FOURIER_MODEL ${FLAGS}" - else - GMSH_LIBS="${GMSH_LIBS} -L${FM_PREFIX}/lib -lFourierModel" - FLAGS="-DHAVE_FOURIER_MODEL -I${FM_PREFIX} ${FLAGS}" - fi - if test "x${FFTW3_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lfftw3" - else - GMSH_LIBS="${GMSH_LIBS} -L${FFTW3_PREFIX}/lib -lfftw3" - FLAGS="${FLAGS} -I${FFTW3_PREFIX}/include" - fi - if test "x${BLAS_LAPACK_PREFIX}" != "x"; then - GMSH_LIBS="${GMSH_LIBS} -L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib" - fi - GMSH_LIBS="${GMSH_LIBS} -llapack -lblas" - case "${F77}" in - *gfortran*) - GMSH_LIBS="${GMSH_LIBS} -lgfortran" - ;; - *g77*) - GMSH_LIBS="${GMSH_LIBS} -lg2c" - ;; - esac - fi - fi - fi + BLAS="no" fi -if test "x${HDF5_PREFIX}" != "x" -a "x$enable_hdf5" != "xno"; then - enable_hdf5=yes -fi -if test "x${ZLIB}" = "xyes" -a "x$enable_med" != "xno"; then - enable_hdf5=yes -fi -if test "x$enable_hdf5" = "xyes"; then - if test "x${HDF5_PREFIX}" != "x"; then - LDFLAGS="-L${HDF5_PREFIX}/lib ${LDFLAGS}" fi - { echo "$as_me:$LINENO: checking for main in -lhdf5" >&5 -echo $ECHO_N "checking for main in -lhdf5... $ECHO_C" >&6; } -if test "${ac_cv_lib_hdf5_main+set}" = set; then + { echo "$as_me:$LINENO: checking for dbdsqr in -llapack" >&5 +echo $ECHO_N "checking for dbdsqr in -llapack... $ECHO_C" >&6; } +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="-lhdf5 $LIBS" +LIBS="-llapack -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5681,11 +5869,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dbdsqr (); int main () { -return main (); +return dbdsqr (); ; return 0; } @@ -5708,45 +5902,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_hdf5_main=yes + ac_cv_lib_lapack_dbdsqr=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_hdf5_main=no + ac_cv_lib_lapack_dbdsqr=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_hdf5_main" >&5 -echo "${ECHO_T}$ac_cv_lib_hdf5_main" >&6; } -if test $ac_cv_lib_hdf5_main = yes; then - HDF5="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lapack_dbdsqr" >&5 +echo "${ECHO_T}$ac_cv_lib_lapack_dbdsqr" >&6; } +if test $ac_cv_lib_lapack_dbdsqr = yes; then + LAPACK="yes" else - HDF5="no" -fi - - if test "x${HDF5}" = "xyes"; then - LIBS="-lhdf5 ${LIBS}" # Necessary for CGNS with HDF5 - fi + LAPACK="no" fi -if test "x${CGNS_PREFIX}" != "x" -a "x$enable_cgns" != "xno"; then - enable_cgns="yes" -fi -if test "x$enable_cgns" = "xyes"; then - if test "x${CGNS_PREFIX}" != "x"; then - LDFLAGS="-L${CGNS_PREFIX}/lib ${LDFLAGS}" - fi - { echo "$as_me:$LINENO: checking for main in -lcgns" >&5 -echo $ECHO_N "checking for main in -lcgns... $ECHO_C" >&6; } -if test "${ac_cv_lib_cgns_main+set}" = set; then + if test "x$LAPACK" != "xyes"; then + { echo "$as_me:$LINENO: checking for dbdsqr_ in -llapack" >&5 +echo $ECHO_N "checking for dbdsqr_ in -llapack... $ECHO_C" >&6; } +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="-lcgns $LIBS" +LIBS="-llapack -lblas $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5754,11 +5937,17 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dbdsqr_ (); int main () { -return main (); +return dbdsqr_ (); ; return 0; } @@ -5781,49 +5970,47 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_cgns_main=yes + ac_cv_lib_lapack_dbdsqr_=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_cgns_main=no + ac_cv_lib_lapack_dbdsqr_=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cgns_main" >&5 -echo "${ECHO_T}$ac_cv_lib_cgns_main" >&6; } -if test $ac_cv_lib_cgns_main = yes; then - CGNS="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lapack_dbdsqr_" >&5 +echo "${ECHO_T}$ac_cv_lib_lapack_dbdsqr_" >&6; } +if test $ac_cv_lib_lapack_dbdsqr_ = yes; then + LAPACK="yes" else - CGNS="no" + LAPACK="no" fi - if test "x${CGNS}" = "xyes"; then - if test "x${CGNS_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lcgns" - FLAGS="${FLAGS} -DHAVE_LIBCGNS" - else - GMSH_LIBS="${GMSH_LIBS} -L${CGNS_PREFIX}/lib -lcgns" - FLAGS="${FLAGS} -DHAVE_LIBCGNS -I${CGNS_PREFIX}/include" - fi + fi + if test "x$LAPACK" = "xyes" -a "x$BLAS" = "xyes"; then + BLAS_LIBS="-llapack ${BLAS_LIBS} -lblas ${F77LIB}" fi fi -if test "x${HDF5}" = "xyes"; then - if test "x$enable_med" != "xno"; then - if test "x${MED_PREFIX}" != "x"; then - LDFLAGS="-L${MED_PREFIX}/lib ${LDFLAGS}" - fi - { echo "$as_me:$LINENO: checking for main in -lmed" >&5 -echo $ECHO_N "checking for main in -lmed... $ECHO_C" >&6; } -if test "${ac_cv_lib_med_main+set}" = set; then +if test "x${BLAS_LIBS}" != "x"; then + GMSH_LIBS="${GMSH_LIBS} ${BLAS_PATH} ${BLAS_LIBS}" +fi + +if test "x$enable_mpi" = "xyes"; then + if test "x${MPI_PREFIX}" != "x"; then + LDFLAGS="-L${MPI_PREFIX}/lib ${LDFLAGS}" + fi + { echo "$as_me:$LINENO: checking for main in -lmpi_cxx" >&5 +echo $ECHO_N "checking for main in -lmpi_cxx... $ECHO_C" >&6; } +if test "${ac_cv_lib_mpi_cxx_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lmed $LIBS" +LIBS="-lmpi_cxx $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5858,57 +6045,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_med_main=yes + ac_cv_lib_mpi_cxx_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_med_main=no + ac_cv_lib_mpi_cxx_main=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_med_main" >&5 -echo "${ECHO_T}$ac_cv_lib_med_main" >&6; } -if test $ac_cv_lib_med_main = yes; then - MED="yes" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpi_cxx_main" >&5 +echo "${ECHO_T}$ac_cv_lib_mpi_cxx_main" >&6; } +if test $ac_cv_lib_mpi_cxx_main = yes; then + MPI="yes" else - MED="no" -fi - - if test "x${MED}" = "xyes"; then - if test "x${MED_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lmed" - FLAGS="${FLAGS} -DHAVE_MED" - else - GMSH_LIBS="${GMSH_LIBS} -L${MED_PREFIX}/lib -lmed" - FLAGS="${FLAGS} -DHAVE_MED -I${MED_PREFIX}/include" - fi - fi - fi -fi - -if test "x${HDF5}" = "xyes"; then - if test "x${HDF5_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lhdf5" - else - GMSH_LIBS="${GMSH_LIBS} -L${HDF5_PREFIX}/lib -lhdf5" - FLAGS="${FLAGS} -I${HDF5_PREFIX}/include" - fi + MPI="no" fi -if test "x${ZLIB}" = "xyes"; then - if test "x${FL_ZLIB}" = "xyes"; then - FLAGS="-DHAVE_LIBZ ${FLAGS}" - else - FLAGS="-DHAVE_LIBZ ${FLAGS}" - if test "x${ZLIB_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lz" + if test "x${MPI}" = "xyes"; then + if test "x${MPI_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lmpi_cxx -lmpi" + FLAGS="${FLAGS} -DHAVE_MPI" else - GMSH_LIBS="${GMSH_LIBS} -L${ZLIB_PREFIX} -L${ZLIB_PREFIX}/lib -lz" - FLAGS="${FLAGS} -I${ZLIB_PREFIX} -I${ZLIB_PREFIX}/include" + GMSH_LIBS="${GMSH_LIBS} -L${MPI_PREFIX}/lib -lmpi_cxx -lmpi" + FLAGS="${FLAGS} -DHAVE_MPI -I${MPI_PREFIX}/include" fi fi fi diff --git a/configure.in b/configure.in index a9bacd213b0f12dfa0198b2377d6ac76650ed1a6..ad0f60798d4a25554b6291d13ccb5f5ce3d93bd6 100644 --- a/configure.in +++ b/configure.in @@ -57,6 +57,10 @@ AC_ARG_WITH(med-prefix, AC_HELP_STRING([--with-med-prefix=PFX], [prefix where MED is installed]), [MED_PREFIX=$withval]) +AC_ARG_WITH(mpi-prefix, + AC_HELP_STRING([--with-mpi-prefix=PFX], + [prefix where MPI is installed]), + [MPI_PREFIX=$withval]) AC_ARG_WITH(fftw3-prefix, AC_HELP_STRING([--with-fftw3-prefix=PFX], [prefix where FFTW3 is installed]), @@ -143,6 +147,9 @@ AC_ARG_ENABLE(universal, AC_ARG_ENABLE(native-file-chooser, AC_HELP_STRING([--enable-native-file-chooser], [enable native file chooser (default=yes, except on Linux)])) +AC_ARG_ENABLE(mpi, + AC_HELP_STRING([--enable-mpi], + [enable MPI support (default=no)])) AC_ARG_ENABLE(minimal, AC_HELP_STRING([--enable-minimal], [build minimal standalone version (default=no)])) @@ -523,41 +530,6 @@ if test "x$enable_contrib" != "xno"; then fi -dnl Check for GSL -if test "x$enable_gsl" != "xno"; then - if test "x${GSL_PREFIX}" != "x"; then - LDFLAGS="-L${GSL_PREFIX} -L${GSL_PREFIX}/lib ${LDFLAGS}" - fi - AC_CHECK_LIB(gslcblas,main) - AC_CHECK_LIB(gsl,main,GSL="yes",GSL="no") - if test "x${GSL}" = "xyes"; then - FLAGS="-DHAVE_GSL ${FLAGS}" - if test "x${GSL_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lgsl -lgslcblas" - else - GMSH_LIBS="${GMSH_LIBS} -L${GSL_PREFIX} -L${GSL_PREFIX}/lib -lgsl -lgslcblas" - FLAGS="${FLAGS} -I${GSL_PREFIX} -I${GSL_PREFIX}/include" - fi - fi -fi -if test "x${GSL}" != "xyes"; then - dnl Check if non-free numerical recipes routines are in the tree - AC_CHECK_FILE(./contrib/NR/dsvdcmp.cpp,NR="yes",NR="no") - if test "x${NR}" = "xyes"; then - GMSH_DIRS="${GMSH_DIRS} contrib/NR" - GMSH_LIBS="${GMSH_LIBS} -lGmshNR" - echo "********************************************************************" - echo " You are building a non-free version of Gmsh, using code copyright" - echo " (C) 1986-92 Numerical Recipes Software." - echo " To use the GSL instead, run configure again with the --enable-gsl" - echo " option." - echo "********************************************************************" - else - AC_MSG_ERROR([Could not find GSL, aborting.]) - fi -fi - - dnl Check for OpenCascade if test "x${OCC_PREFIX}" != "x"; then if test "x$enable_occ" != "xno"; then @@ -599,69 +571,6 @@ if test "x${OCC}" = "xyes"; then fi fi -dnl Check for blas and lapack (used by FourierModel) -AC_LANG_PUSH(Fortran 77) -if test "x${BLAS_LAPACK_PREFIX}" != "x"; then - LDFLAGS="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib ${LDFLAGS}" -fi -AC_CHECK_LIB(blas,dasum,BLAS="yes",BLAS="no") -if test "x$BLAS" != "xyes"; then - AC_CHECK_LIB(blas,dasum_,BLAS="yes",BLAS="no") -fi -AC_CHECK_LIB(lapack,dbdsqr,LAPACK="yes",LAPACK="no",-lblas) -if test "x$BLAS" != "xyes"; then - AC_CHECK_LIB(lapack,dbdsqr_,LAPACK="yes",LAPACK="no",-lblas) -fi -AC_LANG_POP() - -dnl Check for FourierModel -if test "x$enable_fm" != "xno"; then - if test "x${FM_PREFIX}" != "x"; then - LDFLAGS="-L${FM_PREFIX}/lib ${LDFLAGS}" - fi - AC_CHECK_LIB(FourierModel,main,FM="yes",FM="no") - if test "x${FM}" = "xyes"; then - if test "x${BLAS}" != "xyes" -o "x${LAPACK}" != "xyes"; then - AC_MSG_WARN([Could not find blas or lapack: disabling FourierModel.]) - else - dnl Check for FFTW3 - if test "x${FFTW3_PREFIX}" != "x"; then - LDFLAGS="-L${FFTW3_PREFIX}/lib ${LDFLAGS}" - fi - AC_CHECK_LIB(fftw3,main,FFTW3="yes",FFTW3="no") - if test "x${FFTW3}" != "xyes"; then - AC_MSG_WARN([Could not find FFTW3: disabling FourierModel.]) - else - if test "x${FM_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lFourierModel" - FLAGS="-DHAVE_FOURIER_MODEL ${FLAGS}" - else - GMSH_LIBS="${GMSH_LIBS} -L${FM_PREFIX}/lib -lFourierModel" - FLAGS="-DHAVE_FOURIER_MODEL -I${FM_PREFIX} ${FLAGS}" - fi - if test "x${FFTW3_PREFIX}" = "x"; then - GMSH_LIBS="${GMSH_LIBS} -lfftw3" - else - GMSH_LIBS="${GMSH_LIBS} -L${FFTW3_PREFIX}/lib -lfftw3" - FLAGS="${FLAGS} -I${FFTW3_PREFIX}/include" - fi - if test "x${BLAS_LAPACK_PREFIX}" != "x"; then - GMSH_LIBS="${GMSH_LIBS} -L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib" - fi - GMSH_LIBS="${GMSH_LIBS} -llapack -lblas" - case "${F77}" in - *gfortran*) - GMSH_LIBS="${GMSH_LIBS} -lgfortran" - ;; - *g77*) - GMSH_LIBS="${GMSH_LIBS} -lg2c" - ;; - esac - fi - fi - fi -fi - dnl Check for HDF5 (required by MED, needs zlib, and optional for cgns) if test "x${HDF5_PREFIX}" != "x" -a "x$enable_hdf5" != "xno"; then enable_hdf5=yes @@ -745,6 +654,139 @@ if test "x${ZLIB}" = "xyes"; then fi fi +dnl Check for GSL +if test "x$enable_gsl" != "xno"; then + if test "x${GSL_PREFIX}" != "x"; then + LDFLAGS="-L${GSL_PREFIX} -L${GSL_PREFIX}/lib ${LDFLAGS}" + fi + AC_CHECK_LIB(gsl,main,GSL="yes",GSL="no") + if test "x${GSL}" = "xyes"; then + FLAGS="-DHAVE_GSL ${FLAGS}" + if test "x${GSL_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lgsl" + else + GMSH_LIBS="${GMSH_LIBS} -L${GSL_PREFIX} -L${GSL_PREFIX}/lib -lgsl" + FLAGS="${FLAGS} -I${GSL_PREFIX} -I${GSL_PREFIX}/include" + fi + fi +fi +if test "x${GSL}" != "xyes"; then + dnl Check if non-free numerical recipes routines are in the tree + AC_CHECK_FILE(./contrib/NR/dsvdcmp.cpp,NR="yes",NR="no") + if test "x${NR}" = "xyes"; then + GMSH_DIRS="${GMSH_DIRS} contrib/NR" + GMSH_LIBS="${GMSH_LIBS} -lGmshNR" + echo "********************************************************************" + echo " You are building a non-free version of Gmsh, using code copyright" + echo " (C) 1986-92 Numerical Recipes Software." + echo " To use the GSL instead, run configure again with the --enable-gsl" + echo " option." + echo "********************************************************************" + else + AC_MSG_ERROR([Could not find GSL, aborting.]) + fi +fi + +dnl Check for FourierModel +if test "x$enable_fm" != "xno"; then + if test "x${FM_PREFIX}" != "x"; then + LDFLAGS="-L${FM_PREFIX}/lib ${LDFLAGS}" + fi + AC_CHECK_LIB(FourierModel,main,FM="yes",FM="no") + if test "x${FM}" = "xyes"; then + dnl Check for FFTW3 + if test "x${FFTW3_PREFIX}" != "x"; then + LDFLAGS="-L${FFTW3_PREFIX}/lib ${LDFLAGS}" + fi + AC_CHECK_LIB(fftw3,main,FFTW3="yes",FFTW3="no") + if test "x${FFTW3}" != "xyes"; then + FM=no + AC_MSG_WARN([Could not find FFTW3: disabling FourierModel.]) + else + if test "x${FM_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lFourierModel" + FLAGS="-DHAVE_FOURIER_MODEL ${FLAGS}" + else + GMSH_LIBS="${GMSH_LIBS} -L${FM_PREFIX}/lib -lFourierModel" + FLAGS="-DHAVE_FOURIER_MODEL -I${FM_PREFIX} ${FLAGS}" + fi + if test "x${FFTW3_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lfftw3" + else + GMSH_LIBS="${GMSH_LIBS} -L${FFTW3_PREFIX}/lib -lfftw3" + FLAGS="${FLAGS} -I${FFTW3_PREFIX}/include" + fi + fi + fi +fi + +dnl Check for C version of BLAS +BLAS_LIBS="" +BLAS_PATH="" +if test "x${BLAS_LAPACK_PREFIX}" != "x"; then + LDFLAGS="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib ${LDFLAGS}" +fi +AC_CHECK_LIB(cblas,cblas_dgemm,CBLAS="yes",CBLAS="no") +if test "x$CBLAS" = "xyes"; then + BLAS_LIBS="-lcblas" + if test "x${BLAS_LAPACK_PREFIX}" != "x"; then + BLAS_PATH="-L${BLAS_LAPACK_PREFIX} -L${BLAS_LAPACK_PREFIX}/lib" + fi +else + if test "x$GSL" = "xyes"; then + dnl use unoptimized gsl version + BLAS_LIBS="-lgslcblas" + fi +fi + +dnl Check for Fortran version of blas and lapack (only used in +dnl FourierModel at the moment) +if test "x${FM}" = "xyes"; then + AC_PROG_F77 + F77LIB="" + case "${F77}" in + *gfortran*) + F77LIB="-lgfortran" + ;; + *g77*) + F77LIB="-lg2c" + ;; + esac + LDFLAGS="${LDFLAGS} ${F77LIB}" + AC_CHECK_LIB(blas,dgemm,BLAS="yes",BLAS="no") + if test "x$BLAS" != "xyes"; then + AC_CHECK_LIB(blas,dgemm_,BLAS="yes",BLAS="no") + fi + AC_CHECK_LIB(lapack,dbdsqr,LAPACK="yes",LAPACK="no",-lblas) + if test "x$LAPACK" != "xyes"; then + AC_CHECK_LIB(lapack,dbdsqr_,LAPACK="yes",LAPACK="no",-lblas) + fi + if test "x$LAPACK" = "xyes" -a "x$BLAS" = "xyes"; then + BLAS_LIBS="-llapack ${BLAS_LIBS} -lblas ${F77LIB}" + fi +fi + +if test "x${BLAS_LIBS}" != "x"; then + GMSH_LIBS="${GMSH_LIBS} ${BLAS_PATH} ${BLAS_LIBS}" +fi + +dnl Check for MPI +if test "x$enable_mpi" = "xyes"; then + if test "x${MPI_PREFIX}" != "x"; then + LDFLAGS="-L${MPI_PREFIX}/lib ${LDFLAGS}" + fi + AC_CHECK_LIB(mpi_cxx,main,MPI="yes",MPI="no") + if test "x${MPI}" = "xyes"; then + if test "x${MPI_PREFIX}" = "x"; then + GMSH_LIBS="${GMSH_LIBS} -lmpi_cxx -lmpi" + FLAGS="${FLAGS} -DHAVE_MPI" + else + GMSH_LIBS="${GMSH_LIBS} -L${MPI_PREFIX}/lib -lmpi_cxx -lmpi" + FLAGS="${FLAGS} -DHAVE_MPI -I${MPI_PREFIX}/include" + fi + fi +fi + dnl Finish link line GMSH_LIBS="${GMSH_LIBS} -lm" diff --git a/contrib/Netgen/libsrc/interface/nglib.h b/contrib/Netgen/libsrc/interface/nglib.h index 8c6285f619e841fab47ecea858391ce096d6a332..968aeb9179e199e748e64cf780c1f93913689ea8 100644 --- a/contrib/Netgen/libsrc/interface/nglib.h +++ b/contrib/Netgen/libsrc/interface/nglib.h @@ -218,4 +218,4 @@ Ng_Result Ng_ACIS_GenerateSurfaceMesh (Ng_ACIS_Geometry * geom, #endif -#endif \ No newline at end of file +#endif diff --git a/doc/TODO.txt b/doc/TODO.txt index 96d008d2b494476d04e1dca53e04edce99d720b4..382416202bdf0b909774ee3738ddd9419ba861e2 100644 --- a/doc/TODO.txt +++ b/doc/TODO.txt @@ -1,8 +1,4 @@ -$Id: TODO.txt,v 1.11 2008-12-10 14:01:33 geuzaine Exp $ - -******************************************************************** - -move Geo/Gauss* into Numeric/ + cleanup +$Id: TODO.txt,v 1.12 2008-12-21 19:11:21 geuzaine Exp $ ******************************************************************** @@ -105,8 +101,8 @@ introduce Right/Left/Alternate for extruded meshes ******************************************************************** -recode full-quad recombine algo + add full-hexa recombine by simply -doing barycentric subdivision on tets +add full-hexa recombine by simply doing barycentric subdivision on +tets ********************************************************************