Skip to content
Snippets Groups Projects
Commit 17d28d75 authored by Philipp Maierhoefer's avatar Philipp Maierhoefer
Browse files

Updated build system to not use functions that will be removed in Python 3.12.

Also made explicit that \$ and \d are meant literal to avoid a warning with 3.12.
parent 894c693d
No related branches found
No related tags found
No related merge requests found
...@@ -387,8 +387,8 @@ env = Environment(tools = ['default', 'textfile'] + [config['fortran_tool']], ...@@ -387,8 +387,8 @@ env = Environment(tools = ['default', 'textfile'] + [config['fortran_tool']],
F90FLAGS = config['f90_flags'] + config['generic_optimisation'], F90FLAGS = config['f90_flags'] + config['generic_optimisation'],
LINKFLAGS = config['link_flags'], LINKFLAGS = config['link_flags'],
LIBPATH = [config['generic_lib_dir']], LIBPATH = [config['generic_lib_dir']],
DOLLAR = '\$$', DOLLAR = '\\$$',
RPATH = [HashableLiteral('\$$ORIGIN')], RPATH = [HashableLiteral('\\$$ORIGIN')],
F90 = config['fortran_compiler'], F90 = config['fortran_compiler'],
FORTRAN = config['fortran_compiler'], FORTRAN = config['fortran_compiler'],
CC = config['cc']) CC = config['cc'])
...@@ -691,7 +691,7 @@ for (loops, process_api, processlib) in process_list: ...@@ -691,7 +691,7 @@ for (loops, process_api, processlib) in process_list:
processes_seen[processlib] = loops processes_seen[processlib] = loops
process_list = process_list_nodup process_list = process_list_nodup
env.Append(RPATH = [HashableLiteral('\$$ORIGIN/../lib')]) env.Append(RPATH = [HashableLiteral('\\$$ORIGIN/../lib')])
for (loops, process_api, processlib) in process_list: for (loops, process_api, processlib) in process_list:
...@@ -768,7 +768,7 @@ for (loops, process_api, processlib) in process_list: ...@@ -768,7 +768,7 @@ for (loops, process_api, processlib) in process_list:
env = env, env = env,
shared = config['shared_libraries'], shared = config['shared_libraries'],
env_mod = [ env_mod = [
('^(virtual_\d|tensorsum_|loop_)', ('^(virtual_\\d|tensorsum_|loop_)',
{'F90FLAGS': config['f90_flags'] + config['loop_optimisation']}), {'F90FLAGS': config['f90_flags'] + config['loop_optimisation']}),
('', ('',
{'F90FLAGS': config['f90_flags'] + config['born_optimisation']})] {'F90FLAGS': config['f90_flags'] + config['born_optimisation']})]
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
import os import os
import sys import sys
if sys.version_info.major == 2: if sys.version_info.major == 2:
import ConfigParser as configparser from ConfigParser import SafeConfigParser as CfgParser
else: else:
import configparser from configparser import ConfigParser as CfgParser
import re import re
# prefix for default_config_file and user_config_file # prefix for default_config_file and user_config_file
...@@ -101,10 +101,13 @@ def get_config(args=[]): ...@@ -101,10 +101,13 @@ def get_config(args=[]):
(if the same option is given more than once, (if the same option is given more than once,
only the last set value is used) only the last set value is used)
""" """
config = configparser.SafeConfigParser() config = CfgParser()
# default configuration # default configuration
with open(os.path.join(prefix, default_config_file), 'r') as fh: with open(os.path.join(prefix, default_config_file), 'r') as fh:
if sys.version_info.major == 2:
config.readfp(fh) config.readfp(fh)
else:
config.read_file(fh)
# override with user configuration # override with user configuration
config.read([os.path.join(prefix, user_config_file)]) config.read([os.path.join(prefix, user_config_file)])
config = dict(config.items('OpenLoops')) config = dict(config.items('OpenLoops'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment