Skip to content
Snippets Groups Projects
Select Git revision
  • 3e193b8e67ed9d47a1b7aaa765ab64c47f12d985
  • master default protected
  • v25.09-stable protected
  • geant4-vecgeom-cuda
  • target-x86_64_v3
  • py-tensorflow-cuda
  • arm64
  • py-numba
  • github-actions-build-chain
  • wdconinc-master-patch-89061
  • unpin-pip
  • jl
  • acts-svg
  • numpy-unpin
  • view-hardlink
  • gaudi-39.4
  • spack-unpin
  • lhapdf-6.5.5
  • pr/snakemake_9_6_3
  • jacamar
  • v25.08-stable protected
  • v25.09.0-stable
  • v25.08.0-stable
  • v25.07.0-stable
  • v25.06.1-stable
  • v25.06.0-stable
  • v25.05.0-stable
  • v25.04.1-stable
  • v25.04.0-stable
  • v25.03.1-stable
  • v25.03.0-stable
  • v25.02.0-stable
  • v25.01.1-stable
  • v25.01.0-stable
  • v24.12.0-stable
  • 24.11.2
  • 24.11.2-stable
  • v24.11.2-stable
  • v24.11.1-stable
  • v24.11.0-stable
  • v24.10.1-stable
41 results

modulefile.py

Blame
  • modulefile.py 1.15 KiB
    #!/usr/bin/env python3
    
    ## eic_container: Argonne Universal EIC Container
    
    '''
    Install modulefile for this container.
    
    Authors:
        - Whitney Armstrong <warmstrong@anl.gov>
        - Sylvester Joosten <sjoosten@anl.gov>
    '''
    
    import os
    
    ## Generic module file
    _MODULEFILE='''#%Module1.0#####################################################################
    ##
    ## for {name} {version}
    ##
    proc ModulesHelp {{ }} {{
        puts stderr "This module sets up the environment for the {name} container"
    }}
    module-whatis "{name} {version}"
    
    # For Tcl script use only
    set version 4.1.4
    
    prepend-path    PATH    {bindir}
    '''
    
    def make_modulefile(project, version, moduledir, bindir):
        '''Configure and install a modulefile for this project.
    
        Arguments:
            - project: project name
            - version: project version
            - moduledir: root modulefile directory
            - bindir: where executables for this project are located
        '''
    
        ## create our modulefile
        content = _MODULEFILE.format(name=project, version=version, bindir=bindir)
        fname = '{}/{}'.format(moduledir, version)
        print(' - creating', fname)
        with open(fname, 'w') as file:
            file.write(content)