Skip to content

Commit

Permalink
Switch for McStas/McXtrace in env var section, get rid of stale, "pre…
Browse files Browse the repository at this point in the history
…-configured" .py scripts
  • Loading branch information
willend committed Dec 4, 2023
1 parent 429842f commit 14a4de0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 333 deletions.
164 changes: 0 additions & 164 deletions tools/Python/mccodelib/mccode_config.py

This file was deleted.

22 changes: 14 additions & 8 deletions tools/Python/mccodelib/mccode_config.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ def check_env_vars():
global configuration
global compilation

# Initially figure out if this is McStas or McXtrace
MCCODE_OVERRIDE = configuration["MCCODE"].upper() + '_OVERRIDE'
MCCODE_CFLAGS_OVERRIDE = configuration["MCCODE"].upper() + '_CFLAGS_OVERRIDE'
MCCODE_CC_OVERRIDE = configuration["MCCODE"].upper() + '_CC_OVERRIDE'
MCCODE_MPICC_OVERRIDE = configuration["MCCODE"].upper() + '_MPICC_OVERRIDE'

# MCCODE_LIB_DIR
if os.getenv('MCSTAS_OVERRIDE') is not None:
configuration['MCCODE_LIB_DIR'] = os.getenv('MCSTAS_OVERRIDE')
if os.getenv(MCCODE_OVERRIDE) is not None:
configuration['MCCODE_LIB_DIR'] = os.getenv(MCCODE_OVERRIDE)
# CFLAGS
if os.getenv('MCSTAS_CFLAGS_OVERRIDE') is not None:
compilation['CFLAGS'] = os.getenv('MCSTAS_CFLAGS_OVERRIDE')
if os.getenv(MCCODE_CFLAGS_OVERRIDE) is not None:
compilation['CFLAGS'] = os.getenv(MCCODE_CFLAGS_OVERRIDE)
# CC
if os.getenv('MCSTAS_CC_OVERRIDE') is not None:
compilation['CC'] = os.getenv('MCSTAS_CC_OVERRIDE')
if os.getenv(MCCODE_CC_OVERRIDE) is not None:
compilation['CC'] = os.getenv(MCCODE_CC_OVERRIDE)
# MPICC
if os.getenv('MCSTAS_MPICC_OVERRIDE') is not None:
compilation['MPICC'] = os.getenv('MCSTAS_MPICC_OVERRIDE')
if os.getenv(MCCODE_MPICC_OVERRIDE) is not None:
compilation['MPICC'] = os.getenv(MCCODE_MPICC_OVERRIDE)

def load_config(path=None):
''' loads a json user config to the dictionaries in this module '''
Expand Down
161 changes: 0 additions & 161 deletions tools/Python/mccodelib/mccode_config_GPU.py

This file was deleted.

0 comments on commit 14a4de0

Please sign in to comment.