fix dealii dependencies for Clang 9.1.0 C++17 (#7644)
* fix boost and muparser for Clang 9.1.0 with C++17 * muparser: add C++11 flags * dealii: temporary disable python by default * dealii: make CMake find right python
This commit is contained in:
		 Denis Davydov
					Denis Davydov
				
			
				
					committed by
					
						 Adam J. Stewart
						Adam J. Stewart
					
				
			
			
				
	
			
			
			 Adam J. Stewart
						Adam J. Stewart
					
				
			
						parent
						
							17ace14751
						
					
				
				
					commit
					338fa8d7d6
				
			| @@ -0,0 +1,12 @@ | |||||||
|  | diff --git a/boost/graph/detail/array_binary_tree.hpp b/boost/graph/detail/array_binary_tree.hpp | ||||||
|  | index e59da9e..fd403d1 100644 | ||||||
|  | --- a/boost/graph/detail/array_binary_tree.hpp | ||||||
|  | +++ b/boost/graph/detail/array_binary_tree.hpp | ||||||
|  | @@ -14,6 +14,7 @@ | ||||||
|  |  #include <iterator> | ||||||
|  |  #include <functional> | ||||||
|  |  #include <boost/config.hpp> | ||||||
|  | +#include <boost/iterator.hpp> | ||||||
|  |   | ||||||
|  |  namespace boost { | ||||||
|  |   | ||||||
| @@ -46,8 +46,10 @@ class Boost(Package): | |||||||
|             branch='develop', |             branch='develop', | ||||||
|             submodules=True) |             submodules=True) | ||||||
|  |  | ||||||
|  |     version('1.67.0.b1', '3423a4a3ec5297051fd27091864630e2dce4c159', | ||||||
|  |             url='https://dl.bintray.com/boostorg/beta/1.67.0.beta.1/source/boost_1_67_0_b1.tar.gz') | ||||||
|     version('1.66.0', 'b6b284acde2ad7ed49b44e856955d7b1ea4e9459', |     version('1.66.0', 'b6b284acde2ad7ed49b44e856955d7b1ea4e9459', | ||||||
|             url='https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2') |             url='https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2', preferred=True) | ||||||
|     version('1.65.1', '41d7542ce40e171f3f7982aff008ff0d', |     version('1.65.1', '41d7542ce40e171f3f7982aff008ff0d', | ||||||
|             url='https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2') |             url='https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.bz2') | ||||||
|     version('1.65.0', '5512d3809801b0a1b9dd58447b70915d', |     version('1.65.0', '5512d3809801b0a1b9dd58447b70915d', | ||||||
| @@ -151,6 +153,9 @@ class Boost(Package): | |||||||
|  |  | ||||||
|     conflicts('+taggedlayout', when='+versionedlayout') |     conflicts('+taggedlayout', when='+versionedlayout') | ||||||
|  |  | ||||||
|  |     # temporary fix https://svn.boost.org/trac10/ticket/13505 | ||||||
|  |     patch('array_binary_tree.patch', when='@1.67.0.b1') | ||||||
|  |  | ||||||
|     # Patch fix from https://svn.boost.org/trac/boost/ticket/11856 |     # Patch fix from https://svn.boost.org/trac/boost/ticket/11856 | ||||||
|     patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7') |     patch('boost_11856.patch', when='@1.60.0%gcc@4.4.7') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -77,7 +77,7 @@ class Dealii(CMakePackage, CudaPackage): | |||||||
|             description='Compile with Slepc (only with Petsc and MPI)') |             description='Compile with Slepc (only with Petsc and MPI)') | ||||||
|     variant('trilinos', default=True, |     variant('trilinos', default=True, | ||||||
|             description='Compile with Trilinos (only with MPI)') |             description='Compile with Trilinos (only with MPI)') | ||||||
|     variant('python',   default=True, |     variant('python',   default=False, | ||||||
|             description='Compile with Python bindings') |             description='Compile with Python bindings') | ||||||
|     variant('int64',    default=False, |     variant('int64',    default=False, | ||||||
|             description='Compile with 64 bit indices support') |             description='Compile with 64 bit indices support') | ||||||
| @@ -95,12 +95,12 @@ class Dealii(CMakePackage, CudaPackage): | |||||||
|     # https://github.com/dealii/dealii/issues/5262 |     # https://github.com/dealii/dealii/issues/5262 | ||||||
|     # we take the patch from https://github.com/boostorg/serialization/pull/79 |     # we take the patch from https://github.com/boostorg/serialization/pull/79 | ||||||
|     # more precisely its variation https://github.com/dealii/dealii/pull/5572#issuecomment-349742019 |     # more precisely its variation https://github.com/dealii/dealii/pull/5572#issuecomment-349742019 | ||||||
|     depends_on('boost@1.59.0:1.63,1.65.1+thread+system+serialization+iostreams', |     depends_on('boost@1.59.0:1.63,1.65.1,1.67.0:+thread+system+serialization+iostreams', | ||||||
|                patches=patch('boost_1.65.1_singleton.patch', |                patches=patch('boost_1.65.1_singleton.patch', | ||||||
|                        level=1, |                        level=1, | ||||||
|                        when='@1.65.1'), |                        when='@1.65.1'), | ||||||
|                when='~python') |                when='~python') | ||||||
|     depends_on('boost@1.59.0:1.63,1.65.1+thread+system+serialization+iostreams+python', |     depends_on('boost@1.59.0:1.63,1.65.1,1.67.0:+thread+system+serialization+iostreams+python', | ||||||
|                patches=patch('boost_1.65.1_singleton.patch', |                patches=patch('boost_1.65.1_singleton.patch', | ||||||
|                        level=1, |                        level=1, | ||||||
|                        when='@1.65.1'), |                        when='@1.65.1'), | ||||||
| @@ -223,6 +223,15 @@ def cmake_args(self): | |||||||
|                 '-DDEAL_II_COMPONENT_PYTHON_BINDINGS=%s' % |                 '-DDEAL_II_COMPONENT_PYTHON_BINDINGS=%s' % | ||||||
|                 ('ON' if '+python' in spec else 'OFF') |                 ('ON' if '+python' in spec else 'OFF') | ||||||
|             ]) |             ]) | ||||||
|  |             if '+python' in spec: | ||||||
|  |                 python_exe = spec['python'].command.path | ||||||
|  |                 python_library = spec['python'].libs[0] | ||||||
|  |                 python_include = spec['python'].headers.directories[0] | ||||||
|  |                 options.extend([ | ||||||
|  |                     '-DPYTHON_EXECUTABLE=%s' % python_exe, | ||||||
|  |                     '-DPYTHON_INCLUDE_DIR=%s' % python_include, | ||||||
|  |                     '-DPYTHON_LIBRARY=%s' % python_library | ||||||
|  |                 ]) | ||||||
|  |  | ||||||
|         # Set directory structure: |         # Set directory structure: | ||||||
|         if spec.satisfies('@:8.2.1'): |         if spec.satisfies('@:8.2.1'): | ||||||
|   | |||||||
							
								
								
									
										52
									
								
								var/spack/repos/builtin/packages/muparser/auto_ptr.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								var/spack/repos/builtin/packages/muparser/auto_ptr.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,52 @@ | |||||||
|  | diff --git a/include/muParserBase.h b/include/muParserBase.h | ||||||
|  | index beb15bb..685f59f 100644 | ||||||
|  | --- a/include/muParserBase.h | ||||||
|  | +++ b/include/muParserBase.h | ||||||
|  | @@ -288,7 +288,7 @@ private: | ||||||
|  |      mutable stringbuf_type  m_vStringBuf; ///< String buffer, used for storing string function arguments | ||||||
|  |      stringbuf_type  m_vStringVarBuf; | ||||||
|  |   | ||||||
|  | -    std::auto_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. | ||||||
|  | +    std::unique_ptr<token_reader_type> m_pTokenReader; ///< Managed pointer to the token reader object. | ||||||
|  |   | ||||||
|  |      funmap_type  m_FunDef;         ///< Map of function names and pointers. | ||||||
|  |      funmap_type  m_PostOprtDef;    ///< Postfix operator callbacks | ||||||
|  | diff --git a/include/muParserToken.h b/include/muParserToken.h | ||||||
|  | index fc91d78..0cca469 100644 | ||||||
|  | --- a/include/muParserToken.h | ||||||
|  | +++ b/include/muParserToken.h | ||||||
|  | @@ -69,7 +69,7 @@ namespace mu | ||||||
|  |        TString m_strTok;   ///< Token string | ||||||
|  |        TString m_strVal;   ///< Value for string variables | ||||||
|  |        value_type m_fVal;  ///< the value  | ||||||
|  | -      std::auto_ptr<ParserCallback> m_pCallback; | ||||||
|  | +      std::unique_ptr<ParserCallback> m_pCallback; | ||||||
|  |   | ||||||
|  |    public: | ||||||
|  |   | ||||||
|  | diff --git a/src/muParserTest.cpp b/src/muParserTest.cpp | ||||||
|  | index 4006b27..8feaa2c 100644 | ||||||
|  | --- a/src/muParserTest.cpp | ||||||
|  | +++ b/src/muParserTest.cpp | ||||||
|  | @@ -1258,7 +1258,7 @@ namespace mu | ||||||
|  |   | ||||||
|  |        try | ||||||
|  |        { | ||||||
|  | -        std::auto_ptr<Parser> p1; | ||||||
|  | +        std::unique_ptr<Parser> p1; | ||||||
|  |          Parser  p2, p3;   // three parser objects | ||||||
|  |                            // they will be used for testing copy and assignment operators | ||||||
|  |          // p1 is a pointer since i'm going to delete it in order to test if | ||||||
|  | diff --git a/src/muParserTokenReader.cpp b/src/muParserTokenReader.cpp | ||||||
|  | index 8da1e40..49cee68 100644 | ||||||
|  | --- a/src/muParserTokenReader.cpp | ||||||
|  | +++ b/src/muParserTokenReader.cpp | ||||||
|  | @@ -147,7 +147,7 @@ namespace mu | ||||||
|  |    */ | ||||||
|  |    ParserTokenReader* ParserTokenReader::Clone(ParserBase *a_pParent) const | ||||||
|  |    { | ||||||
|  | -    std::auto_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); | ||||||
|  | +    std::unique_ptr<ParserTokenReader> ptr(new ParserTokenReader(*this)); | ||||||
|  |      ptr->SetParent(a_pParent); | ||||||
|  |      return ptr.release(); | ||||||
|  |    } | ||||||
| @@ -32,9 +32,15 @@ class Muparser(Package): | |||||||
|  |  | ||||||
|     version('2.2.5', '02dae671aa5ad955fdcbcd3fee313fb7') |     version('2.2.5', '02dae671aa5ad955fdcbcd3fee313fb7') | ||||||
|  |  | ||||||
|  |     # Replace std::auto_ptr by std::unique_ptr | ||||||
|  |     # https://github.com/beltoforion/muparser/pull/46 | ||||||
|  |     patch('auto_ptr.patch', | ||||||
|  |           when='@2.2.5') | ||||||
|  |  | ||||||
|     def install(self, spec, prefix): |     def install(self, spec, prefix): | ||||||
|         options = ['--disable-debug', |         options = ['--disable-debug', | ||||||
|                    '--disable-dependency-tracking', |                    '--disable-dependency-tracking', | ||||||
|  |                    'CXXFLAGS=-std=c++11', | ||||||
|                    '--prefix=%s' % prefix] |                    '--prefix=%s' % prefix] | ||||||
|  |  | ||||||
|         configure(*options) |         configure(*options) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user