Skip to content

Commit

Permalink
Use StrList instead of *FlagList
Browse files Browse the repository at this point in the history
  • Loading branch information
Micket committed Nov 12, 2024
1 parent d7ca466 commit 64ce8d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 8 additions & 8 deletions easybuild/tools/toolchain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
* Kenneth Hoste (Ghent University)
"""

from easybuild.tools.variables import AbsPathList
from easybuild.tools.toolchain.variables import CommandFlagList, CommaSharedLibs, CommaStaticLibs
from easybuild.tools.toolchain.variables import FlagList, IncludePaths, LibraryList, LinkLibraryPaths
from easybuild.tools.variables import AbsPathList, StrList
from easybuild.tools.toolchain.variables import CommaSharedLibs, CommaStaticLibs
from easybuild.tools.toolchain.variables import IncludePaths, LibraryList, LinkLibraryPaths


COMPILER_VARIABLES = [
Expand All @@ -53,7 +53,7 @@
]

COMPILER_MAP_CLASS = {
FlagList: [
StrList: [
('OPTFLAGS', 'Optimization flags'),
('PRECFLAGS', 'FP precision flags'),
] + COMPILER_FLAGS,
Expand All @@ -67,18 +67,18 @@
IncludePaths: [
('CPPFLAGS', 'Precompiler flags'),
],
CommandFlagList: COMPILER_VARIABLES,
StrList: COMPILER_VARIABLES,
}

CO_COMPILER_MAP_CLASS = {
CommandFlagList: [
StrList: [
('CUDA_CC', 'CUDA C compiler command'),
('CUDA_CXX', 'CUDA C++ compiler command'),
('CUDA_F77', 'CUDA Fortran 77 compiler command'),
('CUDA_F90', 'CUDA Fortran 90 compiler command'),
('CUDA_FC', 'CUDA Fortran 77/90 compiler command'),
],
FlagList: [
StrList: [
('CUDA_CFLAGS', 'CUDA C compiler flags'),
('CUDA_CXXFLAGS', 'CUDA C++ compiler flags'),
('CUDA_FCFLAGS', 'CUDA Fortran 77/90 compiler flags'),
Expand All @@ -103,7 +103,7 @@
('MPI_LIB_DIR', 'MPI library directory'),
('MPI_INC_DIR', 'MPI include directory'),
],
CommandFlagList: MPI_COMPILER_VARIABLES + SEQ_COMPILER_VARIABLES,
StrList: MPI_COMPILER_VARIABLES + SEQ_COMPILER_VARIABLES,
}

BLAS_MAP_CLASS = {
Expand Down
5 changes: 3 additions & 2 deletions easybuild/tools/toolchain/toolchainvariables.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@

from easybuild.tools.variables import Variables, join_map_class
from easybuild.tools.toolchain.constants import ALL_MAP_CLASSES
from easybuild.tools.toolchain.variables import LinkerFlagList, FlagList
from easybuild.tools.toolchain.variables import LinkerFlagList
from easybuild.tools.variables import StrList


class ToolchainVariables(Variables):
Expand All @@ -42,7 +43,7 @@ class ToolchainVariables(Variables):
in context of compilers (i.e. the generated string are e.g. compiler options or link flags)
"""
MAP_CLASS = join_map_class(ALL_MAP_CLASSES) # join_map_class strips explanation
DEFAULT_CLASS = FlagList
DEFAULT_CLASS = StrList
LINKER_TOGGLE_START_STOP_GROUP = None
LINKER_TOGGLE_STATIC_DYNAMIC = None

Expand Down

0 comments on commit 64ce8d4

Please sign in to comment.