Skip to content

Commit

Permalink
Merge pull request #758 from xylar/add-alphabetalab
Browse files Browse the repository at this point in the history
Add optional support for `alphaBetaLab` package
  • Loading branch information
xylar authored Jan 25, 2024
2 parents 3aa57be + d3cf3ff commit 45b8a77
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "jigsaw-python"]
path = jigsaw-python
url = [email protected]:dengwirda/jigsaw-python.git
[submodule "alphaBetaLab"]
path = alphaBetaLab
url = [email protected]:xylar/alphaBetaLab.git
1 change: 1 addition & 0 deletions alphaBetaLab
Submodule alphaBetaLab added at 0b96c3
16 changes: 14 additions & 2 deletions conda/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def get_env_setup(args, config, machine, compiler, mpi, env_type, source_path,
def build_conda_env(env_type, recreate, mpi, conda_mpi, version,
python, source_path, conda_template_path, conda_base,
env_name, env_path, activate_base, use_local,
local_conda_build, logger, local_mache, update_jigsaw):
local_conda_build, logger, local_mache, update_jigsaw,
with_alphabetalab):

if env_type != 'dev':
install_miniforge(conda_base, activate_base, logger)
Expand Down Expand Up @@ -327,6 +328,17 @@ def build_conda_env(env_type, recreate, mpi, conda_mpi, version,
print(f'{env_name} already exists')

if env_type == 'dev':
if with_alphabetalab:
print('Installing AlphaBetaLab\n')
commands = \
f'{activate_env} && ' \
f'cd {source_path} && ' \
f'git submodule update --init alphaBetaLab &&' \
f'cd {source_path}/alphaBetaLab&& ' \
f'conda install -y --file dev-spec.txt && ' \
f'python -m pip install --no-deps -e .'
check_call(commands, logger=logger)

if recreate or update_jigsaw:
# remove conda jigsaw and jigsaw-python
t0 = time.time()
Expand Down Expand Up @@ -1035,7 +1047,7 @@ def main(): # noqa: C901
python, source_path, conda_template_path, conda_base,
conda_env_name, conda_env_path, activate_base, args.use_local,
args.local_conda_build, logger, local_mache,
args.update_jigsaw)
args.update_jigsaw, args.with_alphabetalab)

if local_mache:
print('Install local mache\n')
Expand Down
4 changes: 4 additions & 0 deletions conda/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def parse_args(bootstrap):
help="If this flag is included, OPENMP=false will "
"be added to the load script. By default, MPAS "
"builds will be with OpenMP (OPENMP=true).")
parser.add_argument("--with_alphabetalab", dest="with_alphabetalab",
action='store_true',
help="Whether to install alphaBetaLab from its "
"submodule.")
parser.add_argument("--verbose", dest="verbose",
action='store_true',
help="Print all output to the terminal, rather than "
Expand Down

0 comments on commit 45b8a77

Please sign in to comment.