chgcentre: fix compilation error by using explicit casting (#39315)
Co-authored-by: Cristian Di Pietrantonio <cdipietrantonio@pawsey.org.au>
This commit is contained in:
		 Cristian Di Pietrantonio
					Cristian Di Pietrantonio
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							97d632a161
						
					
				
				
					commit
					7165e70186
				
			
							
								
								
									
										11
									
								
								var/spack/repos/builtin/packages/chgcentre/main.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								var/spack/repos/builtin/packages/chgcentre/main.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | --- a/main.cpp	2022-05-02 15:00:00 +0800 | ||||||
|  | +++ b/main.cpp	2022-05-02 15:01:00 +0800 | ||||||
|  | @@ -415,7 +415,7 @@ | ||||||
|  |  												MDirection::Ref(MDirection::J2000))(); | ||||||
|  |  	std::vector<Muvw> uvws(antennas.size()); | ||||||
|  |  	MEpoch time(MVEpoch(-1.0)); | ||||||
|  | -	for(unsigned row=0; row!=std::min(set.nrow(),50u); ++row) | ||||||
|  | +	for(unsigned row=0; row!=std::min(static_cast<unsigned int>(set.nrow()),50u); ++row) | ||||||
|  |  	{ | ||||||
|  |  		if(fieldIdCol(row) == fieldIndex) | ||||||
|  |  		{ | ||||||
| @@ -18,3 +18,9 @@ class Chgcentre(CMakePackage): | |||||||
| 
 | 
 | ||||||
|     depends_on("casacore") |     depends_on("casacore") | ||||||
|     depends_on("gsl") |     depends_on("gsl") | ||||||
|  | 
 | ||||||
|  |     # this patch is required to fix a programming error that is not acceptable by | ||||||
|  |     # latest compilers. In particular, the `std::min` function was given `int` and | ||||||
|  |     # `unsigned int` arguments. The `int` argument is explicitly casted to `unsigned int`. | ||||||
|  |     # This patch was created by the staff at the Pawsey Supercomputing Research Centre. | ||||||
|  |     patch("main.patch") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user