SINTEF-Geometry / GoTools

GoTools Geometry Toolkit
GNU Affero General Public License v3.0
68 stars 39 forks source link

working branche won't compile #36

Closed PhilipSchmid closed 6 years ago

PhilipSchmid commented 9 years ago

Hi there,

I just ran into another problem while compiling GoTools. Steps to reproduce:

  1. git clone --recursive https://github.com/SINTEF-Geometry/GoTools.git
  2. cd GoTools/
  3. git submodule update --init
  4. git checkout working
  5. mkdir build && cd build
  6. ccmake ../ #hit d and g
  7. make
  8. error appears:
[...]
[ 86%] Built target example_checkGapsAndKinks
[ 86%] Built target mendGap
[ 87%] Built target GoIsogeometricModel
[ 87%] Built target createBlockSfModel
[ 87%] Built target testSfModel
[ 87%] Built target testVolModel
[ 87%] Building CXX object lrsplines2D/CMakeFiles/GoLRspline2D.dir/src/LRSplineEvalGrid.C.o
In file included from /opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface.h:673,
                 from /opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h:44,
                 from /opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C:40:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In function ‘int Go::<unnamed>::consecutives(const std::vector<int, std::allocator<int> >&)’:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before ‘[’ token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before ‘]’ token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before ‘int’
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In function ‘int Go::<unnamed>::predessesors(const std::vector<int, std::allocator<int> >&)’:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before ‘[’ token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before ‘]’ token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before ‘int’
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In static member function ‘static Go::LRSplineSurface::BSKey Go::LRSplineSurface::generate_key(const Go::LRBSpline2D&, const Go::Mesh2D&)’:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:169: warning: unused variable ‘deb_val’
In file included from /opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C:40:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h: In member function ‘int Go::LRSplineEvalGrid::numElements() const’:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h:144: warning: conversion to ‘int’ from ‘size_t’ may alter its value
In file included from /opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C:40:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h: In member function ‘void Go::LRSplineEvalGrid::computeBezCoefs(int, const double*, int, int, double*)’:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineEvalGrid.h:213: warning: unused variable ‘p’
/opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C: In member function ‘void Go::LRSplineEvalGrid::testCoefComputation()’:
/opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C:97: warning: unused variable ‘index’
/opt/GoTools/lrsplines2D/src/LRSplineEvalGrid.C:84: warning: unused variable ‘p’
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h: At global scope:
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h:53: warning: ‘MAXINT’ defined but not used
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h:58: warning: ‘MAXDOUBLE’ defined but not used
make[2]: *** [lrsplines2D/CMakeFiles/GoLRspline2D.dir/src/LRSplineEvalGrid.C.o] Error 1
make[1]: *** [lrsplines2D/CMakeFiles/GoLRspline2D.dir/all] Error 2
make: *** [all] Error 2
[root@workstation build]#

Do you have any suggestions to fix this issue?

Thanks.

Sincerely, Philip

sbriseid commented 9 years ago

Hi,

It seems like your compiler lacks support for lambda expressions (part of c++11).

Which compiler are you using?

For gcc version 4.5 should be sufficient, at least for this construction.

Sincerely, Sverre

PhilipSchmid commented 9 years ago

Alright, thanks. Problem solved by installing gcc-4.7.X via devtoolset (http://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos). Finally run make like this:

CC="/opt/centos/devtoolset-1.1/root/usr/bin/gcc" ccmake ../
CC="/opt/centos/devtoolset-1.1/root/usr/bin/gcc" make

Sincerely, Philip

PhilipSchmid commented 9 years ago

Hi again,

Now I just tried to install the GoTools on another RHEL 6.6 Workstation with the same steps but it fails again:

[root@ws build]# CC="/opt/centos/devtoolset-1.1/root/usr/bin/gcc" make
...
Scanning dependencies of target testVolModel
[ 87%] Building CXX object isogeometric_model/CMakeFiles/testVolModel.dir/app/testVolModel.C.o
/opt/GoTools/isogeometric_model/app/testVolModel.C: In function âint main(int, char**)â:
/opt/GoTools/isogeometric_model/app/testVolModel.C:170: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/isogeometric_model/app/testVolModel.C:238: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/isogeometric_model/app/testVolModel.C:244: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/isogeometric_model/app/testVolModel.C:574: warning: unused variable âgid_wâ
/opt/GoTools/isogeometric_model/app/testVolModel.C:194: warning: unused variable ânmb_cvsâ
Linking CXX executable app/testVolModel
[ 87%] Built target testVolModel
Scanning dependencies of target GoLRspline2D
[ 87%] Building CXX object lrsplines2D/CMakeFiles/GoLRspline2D.dir/src/LRSplineMBA.C.o
In file included from /opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface.h:673,
                 from /opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineMBA.h:43,
                 from /opt/GoTools/lrsplines2D/src/LRSplineMBA.C:40:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In function âint Go::<unnamed>::consecutives(const std::vector<int, std::allocator<int> >&)â:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before â[â token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before â]â token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:74: error: expected primary-expression before âintâ
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In function âint Go::<unnamed>::predessesors(const std::vector<int, std::allocator<int> >&)â:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before â[â token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before â]â token
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:78: error: expected primary-expression before âintâ
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h: In static member function âstatic Go::LRSplineSurface::BSKey Go::LRSplineSurface::generate_key(const Go::LRBSpline2D&, const Go::Mesh2D&)â:
/opt/GoTools/lrsplines2D/include/GoTools/lrsplines2D/LRSplineSurface_impl.h:169: warning: unused variable âdeb_valâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C: In function âvoid Go::LRSplineMBA::MBADistAndUpdate(Go::LRSplineSurface*)â:
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:136: warning: conversion to âlong unsigned intâ from âdoubleâ may alter its value
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:142: warning: unused variable âtotal_squared_invâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:123: warning: unused variable ânmb_ghostâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C: In function âvoid Go::LRSplineMBA::MBADistAndUpdate_omp(Go::LRSplineSurface*)â:
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:352: warning: conversion to âlong unsigned intâ from âdoubleâ may alter its value
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:358: warning: unused variable âtotal_squared_invâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:339: warning: unused variable ânmb_ghostâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:425: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C: In function âvoid Go::LRSplineMBA::MBAUpdate(Go::LRSplineSurface*)â:
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:519: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:519: warning: unused variable âbsplines_sizeâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:549: warning: unused variable âthreadIdâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C: In function âvoid Go::LRSplineMBA::MBAUpdate_omp(Go::LRSplineSurface*)â:
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:734: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:734: warning: unused variable âbsplines_sizeâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:764: warning: unused variable âthreadIdâ
/opt/GoTools/lrsplines2D/src/LRSplineMBA.C:871: warning: conversion to âintâ from âsize_tâ may alter its value
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h: At global scope:
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h:53: warning: âMAXINTâ defined but not used
/opt/GoTools/gotools-core/include/GoTools/utils/Values.h:58: warning: âMAXDOUBLEâ defined but not used
make[2]: *** [lrsplines2D/CMakeFiles/GoLRspline2D.dir/src/LRSplineMBA.C.o] Error 1
make[1]: *** [lrsplines2D/CMakeFiles/GoLRspline2D.dir/all] Error 2
make: *** [all] Error 2

gcc version 4.7.2 is used:

[root@dtchzurlw2000 build]# CC="/opt/centos/devtoolset-1.1/root/usr/bin/gcc" gcc --version
gcc (GCC) 4.7.2 20121015 (Red Hat 4.7.2-5)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Any idea how to fix this problem?

Thanks.

Sincerely, Philip

VikingScientist commented 6 years ago

Today is the 3-year anniversary for this issue :tada: :balloon: Should we resolve it or consider it obsolete?

Did you figure it out @PhilipSchmid or did you move on to other solutions?

sbriseid commented 6 years ago

Yes sorry about that, Philip, the support is somewhat lacking due to other pressing tasks.

It does seem that lambda functions are not supported. This is a requirement introduced by lrsplines2D (which means that the option to run without c++11 support is not really an option). Are you sure that "-std=gnu++0x" was added to CMAKE_CXX_FLAGS? I am suspecting that you also need to provide the correct CXX (possibly also CPP & LD, I use all 4 when switching between compilers).

Again sorry about the lack of support.