From: KIRK, B. (JSC-E. (NASA) <ben...@na...> - 2004-02-24 14:34:47
|
The problem seems to be that gcc 3.0 puts the hash map in the std namespace, while all the other 3.x releases put it in __gnu_cxx. Since 3.1 came out so soon after 3.0 I never ran in to this bug. Thanks! in the file include/mesh/mesh_refinement.h, starting at line 328, change it to: #if defined(HAVE_HASH_MAP) typedef std::hash_multimap<unsigned int, Node*> map_type; #elif defined(HAVE_EXT_HASH_MAP) # if __GNUC__ >= 3 # if __GNUC_MINOR__ == 0 typedef std::hash_multimap<unsigned int, Node*> map_type; # else typedef __gnu_cxx::hash_multimap<unsigned int, Node*> map_type; # endif # else DIE A HORRIBLE DEATH # endif #else typedef std::multimap<unsigned int, Node*> map_type; #endif similarly, in src/mesh/mesh_base.C, starting at line 400, change it to: #if defined(HAVE_HASH_MAP) typedef std::hash_multimap<key_type, val_type> map_type; #elif defined(HAVE_EXT_HASH_MAP) # if __GNUC__ >= 3 # if __GNUC_MINOR__ == 0 typedef std::hash_multimap<key_type, val_type> map_type; # else typedef __gnu_cxx::hash_multimap<key_type, val_type> map_type; # endif # else DIE A HORRIBLE DEATH # endif #else typedef std::multimap<key_type, val_type> map_type; #endif Please let me know if this works for you (I don't have access to gcc-3.0 right now). If it does I'll submit the change to CVS so we don't have this problem in the future. Thanks! -Ben -----Original Message----- From: lib...@li... [mailto:lib...@li...] On Behalf Of Rob van Tol Sent: Tuesday, February 24, 2004 7:17 AM To: lib...@li... Subject: [Libmesh-users] (no subject) Dear libmesh users, I just downloaded the code and I am trying to compile it. I am using Redhat 7 and a GCC-3.0 compiler. I get an error message: ISO C++ forbids declaration of `hash_multimap' with no type. Can anyone tell me how to solve this ?? I have included the configure and make messages below. Thank you in advance, Kind regards, ROB configuring libMesh ------------- --------------------------------------------- checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking target system type... i686-pc-linux-gnu checking for g++... g++ checking for C++ compiler default output... a.out checking whether the C++ compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking for gcc... gcc checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed <<< C++ compiler is gcc-3.0 >>> checking how to run the C++ preprocessor... g++ -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for short int... yes checking size of short int... 2 checking for int... yes checking size of int... 4 checking for long int... yes checking size of long int... 4 checking for float... yes checking size of float... 4 checking for double... yes checking size of double... 8 checking for void *... yes checking size of void *... 4 checking getopt.h usability... yes checking getopt.h presence... yes checking for getopt.h... yes checking whether the compiler implements namespaces... yes checking whether the compiler has locale... yes checking whether the compiler has stringstream... yes checking hash_map usability... no checking hash_map presence... no checking for hash_map... no checking ext/hash_map usability... yes checking ext/hash_map presence... yes checking for ext/hash_map... yes checking hash_set usability... no checking hash_set presence... no checking for hash_set... no checking ext/hash_set usability... yes checking ext/hash_set presence... yes checking for ext/hash_set... yes checking zlib.h usability... yes checking zlib.h presence... yes checking for zlib.h... yes <<< Configuring library with AMR support >>> <<< Configuring library with expensive data structures enabled >>> checking rpc/rpc.h usability... yes checking rpc/rpc.h presence... yes checking for rpc/rpc.h... yes <<< Configuring library with XDR support >>> <<< Configuring library with real number support >>> <<< Configuring library with reference counting support >>> checking for ./contrib/netcdf/lib/i686-pc-linux-gnu/libnetcdf.a... no checking for ./contrib/netcdf/include/netcdf.h... no --------------------------------------------- ----- Configuring for optional packages ----- --------------------------------------------- checking for ./contrib/sfcurves/sfcurves.h... yes <<< Configuring library with SFC support >>> checking for ./contrib/gzstream/gzstream.h... yes <<< Configuring library with gzstreams support >>> checking for ./contrib/tecplot/lib/i686-pc-linux-gnu/tecio.a... yes checking for ./contrib/tecplot/include/TECIO.h... yes <<< Configuring library with Tecplot API support >>> checking for ./contrib/laspack/lastypes.h... yes <<< Configuring library with LASPACK version 1.12.3 support >>> checking for /include/petsc.h... no checking for /include/mpi.h... no checking for /lib/libmpich.a... no checking for ./contrib/metis/Lib/metis.h... yes <<< Configuring library with Metis support >>> checking for doxygen... /usr/bin/doxygen checking for dot... no ---------------------------------------------- --- Done configuring for optional packages --- ---------------------------------------------- checking for perl... /usr/bin/perl configure: creating ./config.status config.status: creating Make.common config.status: creating include/base/libmesh_config.h configure: creating ./config.status config.status: creating Make.common config.status: creating doc/Doxyfile config.status: creating include/base/libmesh_config.h config.status: include/base/libmesh_config.h is unchanged --------------------------------------------- --------- Done Configuring libMesh ---------- --------------------------------------------- [vlr@pc02011 libmesh-0.4.1]$ make Compiling C++ (in optimized mode) src/base/dof_map.C... Compiling C++ (in optimized mode) src/base/dof_map_constraints.C... Compiling C++ (in optimized mode) src/base/dof_object.C... Compiling C++ (in optimized mode) src/base/equation_systems.C... Compiling C++ (in optimized mode) src/base/equation_systems_io.C... Compiling C++ (in optimized mode) src/base/frequency_system.C... Compiling C++ (in optimized mode) src/base/libmesh.C... Compiling C++ (in optimized mode) src/base/newmark_system.C... Compiling C++ (in optimized mode) src/base/node.C... Compiling C++ (in optimized mode) src/base/reference_counted_object.C... Compiling C++ (in optimized mode) src/base/reference_counter.C... Compiling C++ (in optimized mode) src/base/steady_system.C... Compiling C++ (in optimized mode) src/base/system_base.C... Compiling C++ (in optimized mode) src/base/system_base_io.C... Compiling C++ (in optimized mode) src/base/system_base_projection.C... Compiling C++ (in optimized mode) src/base/transient_system.C... Compiling C++ (in optimized mode) src/fe/fe_base.C... Compiling C++ (in optimized mode) src/fe/fe_boundary.C... Compiling C++ (in optimized mode) src/fe/fe.C... Compiling C++ (in optimized mode) src/fe/fe_hierarchic.C... Compiling C++ (in optimized mode) src/fe/fe_hierarchic_shape_1D.C... Compiling C++ (in optimized mode) src/fe/fe_hierarchic_shape_2D.C... Compiling C++ (in optimized mode) src/fe/fe_hierarchic_shape_3D.C... Compiling C++ (in optimized mode) src/fe/fe_interface.C... Compiling C++ (in optimized mode) src/fe/fe_interface_inf_fe.C... Compiling C++ (in optimized mode) src/fe/fe_lagrange.C... Compiling C++ (in optimized mode) src/fe/fe_lagrange_shape_1D.C... Compiling C++ (in optimized mode) src/fe/fe_lagrange_shape_2D.C... Compiling C++ (in optimized mode) src/fe/fe_lagrange_shape_3D.C... Compiling C++ (in optimized mode) src/fe/fe_map.C... Compiling C++ (in optimized mode) src/fe/fe_monomial.C... Compiling C++ (in optimized mode) src/fe/fe_monomial_shape_1D.C... Compiling C++ (in optimized mode) src/fe/fe_monomial_shape_2D.C... Compiling C++ (in optimized mode) src/fe/fe_monomial_shape_3D.C... Compiling C++ (in optimized mode) src/fe/inf_fe_base_radial.C... Compiling C++ (in optimized mode) src/fe/inf_fe_boundary.C... Compiling C++ (in optimized mode) src/fe/inf_fe.C... Compiling C++ (in optimized mode) src/fe/inf_fe_jacobi_20_00_eval.C... Compiling C++ (in optimized mode) src/fe/inf_fe_jacobi_30_00_eval.C... Compiling C++ (in optimized mode) src/fe/inf_fe_lagrange_eval.C... Compiling C++ (in optimized mode) src/fe/inf_fe_legendre_eval.C... Compiling C++ (in optimized mode) src/fe/inf_fe_map.C... Compiling C++ (in optimized mode) src/fe/inf_fe_map_eval.C... Compiling C++ (in optimized mode) src/fe/inf_fe_static.C... Compiling C++ (in optimized mode) src/geom/cell.C... Compiling C++ (in optimized mode) src/geom/cell_hex20.C... Compiling C++ (in optimized mode) src/geom/cell_hex27.C... Compiling C++ (in optimized mode) src/geom/cell_hex8.C... Compiling C++ (in optimized mode) src/geom/cell_hex.C... Compiling C++ (in optimized mode) src/geom/cell_inf.C... Compiling C++ (in optimized mode) src/geom/cell_inf_hex16.C... Compiling C++ (in optimized mode) src/geom/cell_inf_hex18.C... Compiling C++ (in optimized mode) src/geom/cell_inf_hex8.C... Compiling C++ (in optimized mode) src/geom/cell_inf_hex.C... Compiling C++ (in optimized mode) src/geom/cell_inf_prism12.C... Compiling C++ (in optimized mode) src/geom/cell_inf_prism6.C... Compiling C++ (in optimized mode) src/geom/cell_inf_prism.C... Compiling C++ (in optimized mode) src/geom/cell_prism15.C... Compiling C++ (in optimized mode) src/geom/cell_prism18.C... Compiling C++ (in optimized mode) src/geom/cell_prism6.C... Compiling C++ (in optimized mode) src/geom/cell_prism.C... Compiling C++ (in optimized mode) src/geom/cell_pyramid5.C... Compiling C++ (in optimized mode) src/geom/cell_pyramid.C... Compiling C++ (in optimized mode) src/geom/cell_tet10.C... Compiling C++ (in optimized mode) src/geom/cell_tet4.C... Compiling C++ (in optimized mode) src/geom/cell_tet.C... Compiling C++ (in optimized mode) src/geom/edge.C... Compiling C++ (in optimized mode) src/geom/edge_edge2.C... Compiling C++ (in optimized mode) src/geom/edge_edge3.C... Compiling C++ (in optimized mode) src/geom/edge_inf_edge2.C... Compiling C++ (in optimized mode) src/geom/elem.C... Compiling C++ (in optimized mode) src/geom/elem_quality.C... Compiling C++ (in optimized mode) src/geom/elem_refinement.C... In file included from src/geom/elem_refinement.C:30: /home/vlr/libmesh-0.4.1/include/mesh/mesh_refinement.h:332: ISO C++ forbids declaration of `hash_multimap' with no type /home/vlr/libmesh-0.4.1/include/mesh/mesh_refinement.h:332: template-id `hash_multimap<unsigned int, Node*>' used as a declarator /home/vlr/libmesh-0.4.1/include/mesh/mesh_refinement.h:332: parse error before `;' token /home/vlr/libmesh-0.4.1/include/mesh/mesh_refinement.h:340: 'map_type' is used as a type, but is not defined as a type. make: *** [src/geom/elem_refinement.i686-pc-linux-gnu.o] Error 1 dr. R. van Tol Computer Simulations and Foundry Processes tel.:+32 (0)9 2645704 - fax:0032 (0)9 2645848 mailto:rob...@wt... <mailto:rob...@wt...> WTCM-CRIF Belgian Center of the Technological Industry Technologiepark 9, B-9052 Gent-Zwijnaarde (Belgium) tel: +32 (0)9/264 5697 http://www.wtcm.be <http://www.wtcm.be/> WTCM-CRIF "Your Gateway To Innovation". Have a look at the future of materials and manufacturing technology http://techniline.wtcm.be <http://techniline.wtcm.be/> |