diff --git a/package/hdf5/1.12.0/install.sh b/package/hdf5/1.12.0/install.sh index f30c860476490bf0b988f887c75086f60789d6fd..bb8b07a65a82de026bac03f7c09f25ec4c693876 100644 --- a/package/hdf5/1.12.0/install.sh +++ b/package/hdf5/1.12.0/install.sh @@ -8,6 +8,12 @@ cd ${JARVIS_TMP} rm -rf hdf5-${hdf5_version} tar -xvf ${JARVIS_DOWNLOAD}/hdf5-${hdf5_version}.tar.gz cd hdf5-${hdf5_version} -./configure --prefix=$1 --enable-fortran --enable-static=yes --enable-parallel --enable-shared --with-zlib=/usr/lib +#获取除了第一个参数之外的参数 +args=${@:2} +if [ -z "$args" ]; then + ./configure --prefix=$1 --enable-fortran --enable-static=yes --enable-parallel --enable-shared --with-zlib=/usr/lib +else + ./configure --prefix=$1 $args +fi make -j make install diff --git a/src/analysisService.py b/src/analysisService.py index b88495bd53dd9a8ab06c4d0dbd6229e329f4bc31..fba62098e58927330b2349ea8bb0be86e0d45cf6 100644 --- a/src/analysisService.py +++ b/src/analysisService.py @@ -74,8 +74,8 @@ class AnalysisService: def env(self): self.jenv.env() - def install(self,software_path, compiler_mpi_info): - self.jinstall.install(software_path, compiler_mpi_info) + def install(self,install_args): + self.jinstall.install(install_args) def get_install_list(self): self.jinstall.list() diff --git a/src/installService.py b/src/installService.py index 5ad7957823bbae01e198c9706660e7b6b1932461..f55556f23deb6e1dd6dcc8e709b064a02d1713e3 100644 --- a/src/installService.py +++ b/src/installService.py @@ -347,7 +347,7 @@ setenv {sname.upper().replace('-','_')}_PATH {install_path} self.tool.write_file(module_file, module_file_content) print(f"module file {module_file} successfully generated") - def install_package(self, abs_software_path, install_path): + def install_package(self, abs_software_path, install_path, other_args): install_script = 'install.sh' install_script_path = os.path.join(abs_software_path, install_script) print("start installing..."+ abs_software_path) @@ -358,11 +358,15 @@ setenv {sname.upper().replace('-','_')}_PATH {install_path} if self.is_installed(install_path): print("already installed, skipping...") return + #argparse无法解析前缀为-的参数,所以参数使用双单引号,这里要去除单引号 + other_args = [x.replace('\'','') for x in other_args] + other_args_uni = ' '.join(other_args) + #print(other_args) install_cmd = f''' source ./init.sh cd {abs_software_path} chmod +x {install_script} -./{install_script} {install_path} +./{install_script} {install_path} {other_args_uni} ''' result = self.exe.exec_raw(install_cmd) if result: @@ -372,7 +376,10 @@ chmod +x {install_script} print("install failed") sys.exit() - def install(self, software_path, compiler_mpi_info): + def install(self, install_args): + software_path = install_args[0] + compiler_mpi_info = install_args[1] + other_args = install_args[2:] self.tool.prt_content("INSTALL " + software_path) compilers = {"GCC":self.get_gcc_info, "CLANG":self.get_clang_info, "NVC":self.get_nvc_info, "ICC":self.get_icc_info, @@ -400,7 +407,7 @@ chmod +x {install_script} install_path = self.get_install_path(software_info, env_info) if not install_path: return # get install script - self.install_package(abs_software_path, install_path) + self.install_package(abs_software_path, install_path, other_args) # gen module file self.gen_module_file( install_path, software_info, env_info) diff --git a/src/jarvis.py b/src/jarvis.py index fb7105091cb27f3f650c0132c7d847bb7490d3c0..4b23a9d3c2b394399c624f3adecf3de36281516d 100644 --- a/src/jarvis.py +++ b/src/jarvis.py @@ -17,7 +17,7 @@ class Jarvis: parser.add_argument("-l","--list", help=f"get installed package info", action="store_true") parser.add_argument("-loop","--loop", help=f"get loop simulation code", action="store_true") #accept software_name/version GCC/GCC+MPI/CLANG/CLANG+MPI - parser.add_argument("-install","--install", help=f"install dependency", nargs=2) + parser.add_argument("-install","--install", help=f"install dependency", nargs='+') #remove parser.add_argument("-remove","--remove", help=f"remove software", nargs=1) #find @@ -74,7 +74,7 @@ class Jarvis: self.analysis.install_deps() if self.args.install: - self.analysis.install(self.args.install[0], self.args.install[1]) + self.analysis.install(self.args.install) if self.args.remove: self.analysis.remove(self.args.remove[0]) diff --git a/templates/openfoam/1906/data.openfoam.arm.cpu.opt.config b/templates/openfoam/1906/data.openfoam.arm.cpu.opt.config index 43d62a54b5d4677343d20abea51a3b005cdcb3cc..92ccb67cc493ecb8bef8a0773b979f4c9a2d6d5a 100644 --- a/templates/openfoam/1906/data.openfoam.arm.cpu.opt.config +++ b/templates/openfoam/1906/data.openfoam.arm.cpu.opt.config @@ -6,35 +6,45 @@ openfoam/v1906 https://sourceforge.net/projects/openfoam/files/v1906/OpenFOAM-v1 ThirdParty/v1906 https://sourceforge.net/projects/openfoam/files/v1906/ThirdParty-v1906.tgz [DEPENDENCY] -./jarvis -install bisheng/2.1.0 com +./jarvis -install bisheng/2.5.0 com module use ./software/modulefiles -module load bisheng2 -./jarvis -install hmpi/1.1.1 clang -module load hmpi/1.1.1 +module load bisheng/2.5.0 +./jarvis -install hmpi/1.2.0 clang +module load hmpi/1.2.0 #release zip files tar -xzvf $JARVIS_DOWNLOAD/OpenFOAM-v1906.tgz tar -zxvf $JARVIS_DOWNLOAD/ThirdParty-v1906.tgz [ENV] -# add gcc/mpi -source $JARVIS_ROOT/OpenFOAM-v1906/etc/bashrc module use ./software/modulefiles -module load bisheng2 -module load hmpi/1.1.1 +module load bisheng/2.5.0 +module load hmpi/1.2.0 +export CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort [APP] app_name = OpenFOAM -build_dir = $JARVIS_ROOT/OpenFOAM-v1906/OpenFOAM-v1906/ +build_dir = $JARVIS_ROOT/OpenFOAM-v1906/ binary_dir = -case_dir = $JARVIS_ROOT/workloads/openfoam/audi/ +case_dir = $JARVIS_ROOT/OpenFOAM-v1906/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/ +#case_dir = $JARVIS_ROOT/workloads/openfoam/audi/ [BUILD] -./Allwmake -j 64 +sed -i "s|export WM_COMPILER=Gcc|export WM_COMPILER=Clang|g" ./etc/bashrc +sed -i '2c cOPT = -O3 -lm -mllvm -unroll-indirect-loads-threshold=2 -mllvm -unroll-indirect-loads-default-runtime-unroll-count=8 -mcpu=tsv110 -fno-range-check -fveclib=MATHLIB -lmathlib -finline-functions -ftree-vectorize -falign-functions -march=armv8-a -mllvm -min-prefetch-stride=2' ./wmake/rules/linuxARM64Clang/cOpt +sed -i '2c c++OPT = -O3 -lm -mllvm -unroll-indirect-loads-threshold=2 -mllvm -unroll-indirect-loads-default-runtime-unroll-count=8 -mcpu=tsv110 -fno-range-check -fveclib=MATHLIB -lmathlib -finline-functions -ftree-vectorize -falign-functions -march=armv8-a -mllvm -min-prefetch-stride=2' ./wmake/rules/linuxARM64Clang/c++Opt +sed -i "/wmake $targetType/a\export WM_COMPILER_OPTION=Opt" ./src/OSspecific/POSIX/Allwmake +#openFoam代码写错了,需要修正以适配clang +sed -i "s| List\&\& buffer,| ::Foam::List\&\& buffer,|g" ./src/OpenFOAM/db/IOstreams/memory/IListStream.H +source ./etc/bashrc +./Allwmake -j 16 >&1 |tee -a build.log [CLEAN] -rm -rf build +source ./etc/bashrc +./Allwmake clean [RUN] -run = mpirun --allow-run-as-root -x PATH -x LD_LIBRARY_PATH -x WM_PROJECT_DIR -x WM_PROJECT_USER_DIR -np 128 -binary = pisoFoam –parallel +run = source $JARVIS_ROOT/OpenFOAM-v1906/etc/bashrc && ./Allclean && ./Allrun +#run = mpirun --allow-run-as-root -x PATH -x LD_LIBRARY_PATH -x WM_PROJECT_DIR -x WM_PROJECT_USER_DIR -np 128 +#binary = pisoFoam –parallel +binary = nodes = 1