|
| 1 | +# Version 10, based on instructions from Esko Järvinen, CSC |
| 2 | +# Updated to version 10 by Orian Louant |
| 3 | +# Updated to version 12 by Stanislau Stasheuski |
| 4 | + |
| 5 | +easyblock = 'Binary' |
| 6 | + |
| 7 | +local_version_tag = 'master' |
| 8 | + |
| 9 | +name = 'OpenFOAM' |
| 10 | +version = '13' |
| 11 | +versionsuffix = f'-{local_version_tag}' |
| 12 | + |
| 13 | +homepage = 'http://www.openfoam.org/' |
| 14 | + |
| 15 | +whatis = [ |
| 16 | + 'Description: The OpenFOAM (CFD software) distribution from the OpenFOAM Foundation' |
| 17 | +] |
| 18 | + |
| 19 | +description = """ |
| 20 | +OpenFOAM is the leading free, open source software for computational fluid dynamics (CFD), |
| 21 | +owned by the OpenFOAM Foundation and distributed exclusively under the General Public Licence (GPL). |
| 22 | +The GPL gives users the freedom to modify and redistribute the software and a guarantee of continued |
| 23 | +free use, within the terms of the licence. |
| 24 | +""" |
| 25 | + |
| 26 | +usage = """ |
| 27 | +To run OpenFOAM solvers on compute nodes use srun command: |
| 28 | +
|
| 29 | + srun foamSolverName -parallel |
| 30 | +
|
| 31 | +in either job script for sbatch or directly within salloc session. |
| 32 | +
|
| 33 | +Allrun scripts require some additional tweaking. |
| 34 | +""" |
| 35 | + |
| 36 | +toolchain = {'name': 'cpeGNU', 'version': '25.03'} |
| 37 | + |
| 38 | + |
| 39 | +source_urls = ['https://github.com/OpenFOAM/OpenFOAM-%(version_major)s/archive/refs/tags'] |
| 40 | +sources = [ |
| 41 | + { |
| 42 | + 'filename': f'OpenFOAM-%(version_major)s-version-%(version)s.tar.gz', |
| 43 | + 'download_filename': 'version-%(version)s.tar.gz', |
| 44 | + }] |
| 45 | +patches = [ |
| 46 | + ('wmake-rules-linux64Cray-gcc13.patch', 0), |
| 47 | +] |
| 48 | + |
| 49 | +builddependencies = [ |
| 50 | + ('buildtools', '%(toolchain_version)s', '', True), |
| 51 | +] |
| 52 | + |
| 53 | +dependencies = [ |
| 54 | + ('cray-fftw', EXTERNAL_MODULE), |
| 55 | + ('SCOTCH', '7.0.8'), |
| 56 | + ('METIS', '5.1.0'), |
| 57 | + ('Zoltan', '3.901'), # depends on ParMETIS |
| 58 | +] |
| 59 | + |
| 60 | +unpack_options = '--strip-components=1' |
| 61 | +extract_sources = True |
| 62 | +buildininstalldir = True |
| 63 | + |
| 64 | +local_project_name = '%(version_major)s-%(toolchain_name)s-%(toolchain_version)s' |
| 65 | + |
| 66 | +install_cmd = ' && '.join([ |
| 67 | + './bin/tools/foamConfigurePaths --projectName %s-%s --dependency PARMETIS=OpenFOAM --dependency ParaView=none' % (local_project_name, local_version_tag), |
| 68 | + 'printf "export PARMETIS_ARCH_PATH=$EBROOTPARMETIS\nexport PARMETIS_VERSION=parmetis-${EBVERSIONPARMETIS}\n" > ./etc/config.sh/parMetis', |
| 69 | + 'sed -i \'125i *cpeGNU*) version=%(version_major)s ;;\' ./bin/foamEtcFile', |
| 70 | + 'source ./etc/bashrc WM_COMPILER=Cray WM_CC=cc WM_CXX=CC WM_MPLIB=CRAY-MPICH MPICH_DIR=${CRAY_MPICH_PREFIX}', |
| 71 | + './Allwmake -j%(parallel)s', |
| 72 | +]) |
| 73 | + |
| 74 | +sanity_check_paths = { |
| 75 | + 'files': [], |
| 76 | + 'dirs': ['platforms/linux64CrayDPInt32Opt/bin', 'platforms/linux64CrayDPInt32Opt/lib'], |
| 77 | +} |
| 78 | + |
| 79 | +modextravars = { |
| 80 | + 'FOAM_BASH' : '%(installdir)s/bashrc', |
| 81 | + 'MPI_BUFFER_SIZE' : '2000000000', |
| 82 | +} |
| 83 | + |
| 84 | +# source_sh fails, use execute as workaround |
| 85 | +modluafooter = """ |
| 86 | +execute {cmd="source " .. pathJoin(root, "etc/bashrc") .. " WM_COMPILER=Cray WM_MPLIB=CRAY-MPICH WM_CC=gcc-13 WM_CXX=g++-13", modeA={"load"}} |
| 87 | +""" |
| 88 | + |
| 89 | +moduleclass = 'cae' |
0 commit comments