Skip to content

[Rust] [package list]

Rust/1.75.0 (Rust-1.75.0.eb)

Install with the EasyBuild-user module:

eb Rust-1.75.0.eb -r
To access module help after installation and get reminded for which stacks and partitions the module is installed, use module spider Rust/1.75.0.

EasyConfig:

# This version of the Rust EasyConfig was developed with buildtools/23.09
# so should be installed in LUMI/23.09. It may work in other versions of 
# the LUMI stacks also.
#
# Rust doesn't seem to like the old gcc compiler on the system.
# I wonder if some problems are due to a too old linker or so.
easyblock = "ConfigureMake"

name =    'Rust'
version = '1.75.0'

local_LUMI_version = '23.09'
local_gcc_version =  '12.2.0'

import os 
local_LUMI_version = os.getenv( "LUMI_STACK_VERSION" )
if local_LUMI_version == None :
    local_LUMI_version = '23.09'

homepage = 'https://www.rust-lang.org'

whatis = [
    "Description: Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety"
]

description = """
Rust is blazingly fast and memory-efficient: with no runtime or garbage collector,
it can power performance-critical services, run on embedded devices, and easily
integrate with other languages. Rust’s rich type system and ownership model
guarantee memory-safety and thread-safety — enabling you to eliminate many
classes of bugs at compile-time.
"""

toolchain = SYSTEM

source_urls = ['https://static.rust-lang.org/dist/']
sources =     ['rustc-%(version)s-src.tar.gz']
patches =     ['Rust-1.75_sysroot-fix-interpreter.patch']
checksums = [
    {'rustc-1.75.0-src.tar.gz':                 '5b739f45bc9d341e2d1c570d65d2375591e22c2d23ef5b8a37711a0386abc088'},
    {'Rust-1.75_sysroot-fix-interpreter.patch': '220129db55e022a98d25028da5dcc9f26b252dd995c3ac92f6312dbb1e362cb1'},
]

builddependencies = [
    ('buildtools', local_LUMI_version),
]

dependencies = [
#    ('OpenSSL', '1.1', '', SYSTEM),
]

osdependencies = [
    ('openssl-devel', 'libssl-dev', 'libopenssl-devel'), # For CMake
]

#
# Configure phase
#

local_module_conf = f'module unload cce gcc aocc amd PrgEnv-gnu PrgEnv-cray PrgEnv-aocc PrgEnv-amd craype perftools-base ; module load gcc/{local_gcc_version} ; module list ; '

# TODO: Double-check if it makes sense to set CFLAGS, figure out how to see the compiler flags
# in the log file which may not be trivial as we do not directly call Make.
preconfigopts  = local_module_conf
#preconfigopts += 'CFLAGS="-macrch=znver1 -O2 -fpic" CXXFLAGS="-march=znver1 -O2 -fpic" '

configopts  = '--enable-extended '                # Used in the new EasyBlock for EasyBuild 4.8
configopts += '--sysconfdir=%(installdir)s/etc '  # Used in the new EasyBlock for EasyBuild 4.8
#configopts += '--set=llvm.ninja=false '           # In case you would want to avoid the use of ninja.
configopts += '--enable-full-tools  '
configopts += '--enable-lld '

#
# Build phase
#

# avoid failure when home directory is an NFS mount or some other file systems
# see https://github.com/rust-lang/cargo/issues/6652
prebuildopts  = local_module_conf
prebuildopts += "export CARGO_HOME=%(builddir)s/cargo && " # Also extracted from the EasyBlock in 4.8."

build_cmd = "./x.py build"

#
# Install phase
#

preinstallopts  = local_module_conf
preinstallopts += "export CARGO_HOME=%(builddir)s/cargo && " # Also extracted from the EasyBlock in 4.8."

install_cmd = "./x.py install -j %(parallel)s"


sanity_check_paths = {
    'files': ['bin/cargo', 'bin/rustc', 'bin/rustdoc'],
    'dirs':  ['lib/rustlib', 'share/doc', 'share/man'],
}

sanity_check_commands = [
    "cargo --version",
    "rustc --version",
]

moduleclass = 'lang'

[Rust] [package list]