@@ -256,20 +256,19 @@ def _cmake_default_args(caseroot):
256
256
# Returns a dictionary of CMake variables based on the Macros.cmake file for
257
257
# the build.
258
258
259
- unlock_file ("env_build.xml" , caseroot )
260
259
build = EnvBuild (case_root = caseroot )
261
260
with Case (caseroot ) as case :
262
261
macro_path = os .path .abspath (os .path .join (caseroot , "cmake_macros" , "" ))
263
262
args = "-DCONVERT_TO_MAKE=ON "
264
- args += "-DCASEROOT={} " . format ( caseroot )
265
- args += "-DCOMPILER={} " . format ( build .get_value (" COMPILER" ))
266
- args += "-DOS={} " . format ( build .get_value ("OS" ))
267
- args += "-DMACH={} " . format ( case .get_value (" MACH" ))
263
+ args += f "-DCASEROOT={ caseroot } "
264
+ args += f "-DCOMPILER={ build .get_value (' COMPILER' ) } "
265
+ args += f "-DOS={ build .get_value ('OS' ) } "
266
+ args += f "-DMACH={ case .get_value (' MACH' ) } "
268
267
args += "-DCMAKE_C_COMPILER_WORKS=1 "
269
268
args += "-DCMAKE_Fortran_COMPILER_WORKS=1 "
270
269
args += "-DCMAKE_CXX_COMPILER_WORKS=1 "
271
- args += "-DDEBUG={} " . format ( build .get_value (" DEBUG" ))
272
- cmd = "cmake {} ." . format ( args )
270
+ args += f "-DDEBUG={ build .get_value (' DEBUG' ) } "
271
+ cmd = f "cmake { args } ."
273
272
rc , out , err = run_cmd (cmd , combine_output = True , from_dir = macro_path )
274
273
expect (rc == 0 , "Command {} failed with rc={} out={} err={}" .format (cmd , rc , out , err ))
275
274
@@ -279,7 +278,6 @@ def _cmake_default_args(caseroot):
279
278
key , val = line .split (":=" )
280
279
arg_dict [key .replace ('CIME_SET_MAKEFILE_VAR' ,'' ).strip ()] = val .strip ()
281
280
282
- unlock_file ("env_build.xml" , caseroot )
283
281
return arg_dict
284
282
285
283
###############################################################################
@@ -298,13 +296,11 @@ def _get_musica_libs(caseroot: str) -> str:
298
296
Returns:
299
297
musica_libs: MUSICA libraries to be linked to CAM
300
298
"""
301
- unlock_file ("env_build.xml" , caseroot )
302
299
build = EnvBuild (case_root = caseroot )
303
300
if build .get_value ("DEBUG" ):
304
301
musica_libs = "-lmusica-fortran -lmusica -lmechanism_configuration -lyaml-cppd -lstdc++"
305
302
else :
306
303
musica_libs = "-lmusica-fortran -lmusica -lmechanism_configuration -lyaml-cpp -lstdc++"
307
- lock_file ("env_build.xml" , caseroot )
308
304
309
305
return musica_libs
310
306
0 commit comments