changa: add v3.5 (#45591)
This commit is contained in:
		 Massimiliano Culpo
					Massimiliano Culpo
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							8ded2ddf5e
						
					
				
				
					commit
					f438a33978
				
			
							
								
								
									
										11
									
								
								var/spack/repos/builtin/packages/changa/fix_makefile.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								var/spack/repos/builtin/packages/changa/fix_makefile.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| --- a/Makefile.in	2024-07-17 19:21:06.292521857 +0200 | ||||
| +++ b/Makefile.in	2024-07-17 19:29:45.896742764 +0200 | ||||
| @@ -236,7 +236,7 @@ | ||||
|  	$(compile-c) | ||||
|   | ||||
|  $(build_dir)/cha_commitid.c: force | ||||
| -	$(quiet) VER=`cd $(source_dir) && git describe --long --always` && \ | ||||
| +	$(quiet) VER="3.5" && \ | ||||
|  	         echo "const char * const Cha_CommitID = \"$$VER\";" > $(build_dir)/cha_commitid.c | ||||
|   | ||||
|  $(ci_files): $(build_dir)/settings | ||||
| @@ -6,15 +6,10 @@ | ||||
| from spack.package import * | ||||
| 
 | ||||
| 
 | ||||
| class Changa(AutotoolsPackage): | ||||
| class Changa(AutotoolsPackage, CudaPackage): | ||||
|     """ChaNGa (Charm N-body GrAvity solver) is a code to perform collisionless | ||||
|     N-body simulations. It can perform cosmological simulations with periodic | ||||
|     boundary conditions in comoving coordinates or simulations of isolated | ||||
|     stellar systems. It also can include hydrodynamics using the Smooth | ||||
|     Particle Hydrodynamics (SPH) technique. It uses a Barnes-Hut tree to | ||||
|     calculate gravity, with hexadecapole expansion of nodes and | ||||
|     Ewald summation for periodic forces. Timestepping is done with a leapfrog | ||||
|     integrator with individual timesteps for each particle.""" | ||||
|     N-body simulations. | ||||
|     """ | ||||
| 
 | ||||
|     homepage = "https://faculty.washington.edu/trq/hpcc/tools/changa.html" | ||||
|     url = "https://github.com/N-BodyShop/changa/archive/v3.4.tar.gz" | ||||
| @@ -23,24 +18,50 @@ class Changa(AutotoolsPackage): | ||||
|     license("GPL-2.0-or-later") | ||||
| 
 | ||||
|     version("master", branch="master") | ||||
|     version("3.5", sha256="8c49ab5b540a8adb23d3eaa80942621e5ac83244918e66c87886c9d3fb463d39") | ||||
|     version("3.4", sha256="c2bceb6ac00025dfd704bb6960bc17c6df7c746872185845d1e75f47e6ce2a94") | ||||
| 
 | ||||
|     depends_on("c", type="build")  # generated | ||||
|     depends_on("cxx", type="build")  # generated | ||||
|     depends_on("c", type="build") | ||||
|     depends_on("cxx", type="build") | ||||
| 
 | ||||
|     patch("fix_configure_path.patch") | ||||
|     # Version 3.5 assumes to have a git repository available to compute the current version | ||||
|     # using `git describe ...` Since we are installing from the release tarball, hardcode | ||||
|     # the version to 3.5 | ||||
|     patch("fix_makefile.patch", when="@3.5") | ||||
| 
 | ||||
|     resource( | ||||
|         name="utility", | ||||
|         url="https://github.com/N-BodyShop/utility/archive/v3.4.tar.gz", | ||||
|         sha256="19f9f09023ce9d642e848a36948788fb29cd7deb8e9346cdaac4c945f1416667", | ||||
|         placement="utility", | ||||
|         when="@3.4", | ||||
|     ) | ||||
| 
 | ||||
|     resource( | ||||
|         name="utility", | ||||
|         git="https://github.com/N-BodyShop/utility.git", | ||||
|         commit="f947639f78162a68d697195e6963328f2665bf44", | ||||
|         placement="utility", | ||||
|         when="@3.5", | ||||
|     ) | ||||
| 
 | ||||
|     depends_on("charmpp build-target=ChaNGa") | ||||
|     depends_on("charmpp +cuda", when="+cuda") | ||||
|     depends_on("libjpeg") | ||||
|     depends_on("zlib-api") | ||||
| 
 | ||||
|     parallel = False | ||||
| 
 | ||||
|     def setup_build_environment(self, env): | ||||
|         env.set("CHARM_DIR", self.spec["charmpp"].prefix) | ||||
| 
 | ||||
|     def configure_args(self): | ||||
|         args = [] | ||||
|         args.append("STRUCT_DIR={0}/utility/structures".format(self.stage.source_path)) | ||||
|         args = [f"STRUCT_DIR={self.stage.source_path}/utility/structures"] | ||||
|         if "avx" in self.spec.target: | ||||
|             args.append("--enable-arch=avx") | ||||
|         if self.spec.satisfies("+cuda"): | ||||
|             args.append(f"--with-cuda={self.spec['cuda'].prefix}") | ||||
|         return args | ||||
| 
 | ||||
|     def install(self, spec, prefix): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user