Skip to content
Snippets Groups Projects
Select Git revision
  • 60e2fe1f8d2c85c38ac3e7f795fe079eecc25aea
  • master default protected
  • eic-dbg-prod
  • packages-all-prefer-require
  • jl
  • clang
  • target-x86_64_v3
  • v25.07-stable protected
  • acts-37.4.0
  • py-tensorflow-cuda
  • eic-dev-cuda
  • v25.06-stable protected
  • test-docker-layer-caching
  • autoload-epic-main-bin-thisepic
  • py-numba
  • py-jsonschema-4.17
  • gcc-14.2.0
  • wdconinc-master-patch-96292
  • root-patch-cling-write-lock
  • highfive-mpi
  • push-builder
  • 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
  • v24.10.0-stable
  • v24.09.0-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)