Skip to content

Commit d7a9389

Browse files
committed
Small fixes
1 parent cf81cd8 commit d7a9389

File tree

5 files changed

+28
-66
lines changed

5 files changed

+28
-66
lines changed

.gitignore

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,25 @@
1-
tags
2-
src/*/tags
1+
/build/
2+
.vscode/
3+
src/*/case.fpp
4+
src/*/autogen/
35

46
*.swo
57
*.swp
68

79
*:Zone.Identifier
810

9-
.vscode/
1011
.nfs*
11-
defaults.yaml
1212

1313
__pycache__
1414

15-
CMakeFiles/
16-
CMakeCache.txt
17-
Makefile
18-
cmake_install.cmake
19-
2015
*.egg-info
2116

22-
/build/
23-
toolchain/build/
24-
25-
src/*/*.mod
26-
src/*/*.o
27-
src/*/autogen/
28-
src/common/case.fpp
29-
src/pre_process/pre_process
30-
src/simulation/simulation
31-
src/post_process/post_process
32-
src/master_scripts/*.pyc
33-
src/*/.build
34-
src/*/case.*
35-
src/master_scripts/__*
36-
make_doc.sh
37-
cases/
3817
.DS_Store
3918

40-
tests/**/*.log
41-
tests/*.txt
42-
tests/*/**
43-
!**/golden.txt
44-
45-
tests_hypoelastic/*/D/*
46-
tests_hypoelastic/*/p*
47-
tests_hypoelastic/*/D_*
48-
tests_hypoelastic/*/*.inp
49-
tests_hypoelastic/*/*.inf
50-
tests_hypoelastic/*/*.dat
51-
tests_hypoelastic/*/silo*
52-
tests_hypoelastic/*/restart*
53-
tests_hypoelastic/*/*.out
54-
tests_hypoelastic/*/binary
19+
/tests/**/*.log
20+
/tests/*.txt
21+
/tests/*/**
22+
!/tests/golden.txt
5523

5624
examples/*batch/*/
5725
examples/*/D/*
@@ -69,15 +37,3 @@ examples/*/fort.1
6937
examples/*/pre_process.sh
7038
examples/*/simulation.sh
7139
examples/*/post_process.sh
72-
73-
doc/*/MFC_user_guide.bbl
74-
doc/*/MFC_user_guide.blg
75-
doc/*/MFC_user_guide.aux
76-
doc/*/MFC_user_guide.toc
77-
doc/*/MFC_user_guide.fls
78-
doc/*/MFC_user_guide.synctex.gz
79-
doc/*/MFC_user_guide.log
80-
doc/*/MFC_user_guide.fdb_latexmk
81-
82-
doc/Doxygen/*/html
83-
doc/Doxygen/*icon*

CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,25 @@ include(CheckFortranCompilerFlag)
3232

3333
# === Check Compiler Support & Tools
3434
# === === Compiler Support
35+
set(__err_msg "\
36+
CMake detected the ${CMAKE_Fortran_COMPILER_ID} Fortran compiler \
37+
v${CMAKE_Fortran_COMPILER_VERSION}. If you intended to use a different \
38+
compiler (or a different version thereof), please:\n\
39+
- Install the compiler or load its module. (e.g. module load gcc/10.1)\n\
40+
- Set/Export the C, CXX, and FC environment variables. (e.g. 'export CC=gcc', \
41+
'export CXX=g++', and 'export FC=gfortran'.\n\
42+
- If using mfc.sh, delete the build/<code name> directory and try again. (e.g. 'rm -rf build/pre_process')\n")
43+
3544
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
3645
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5)
37-
message(FATAL_ERROR "GNU v5.0 or newer is required to build MFC. "
38-
"[current: ${CMAKE_Fortran_COMPILER_VERSION}]")
46+
message(FATAL_ERROR "${__err_msg}ERROR: GNU v5.0 or newer is required to build MFC.")
3947
endif()
4048
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
4149
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 21.7)
42-
message(FATAL_ERROR "NVHPC v21.7 or newer is required to build MFC. "
43-
"[current: ${CMAKE_Fortran_COMPILER_VERSION}]")
50+
message(FATAL_ERROR "${__err_msg}ERROR: NVHPC v21.7 or newer is required to build MFC.")
4451
endif()
45-
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang")
46-
message(FATAL_ERROR "MFC does not support the Apple Clang compilers. "
47-
"Please consult the README for more details.")
52+
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
53+
message(FATAL_ERROR "${__err_msg}ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.")
4854
endif()
4955

5056
# === === Find Fypp

toolchain/mfc/build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ def build_target(name: str, history: typing.List[str] = None):
187187
common.create_directory(build_dirpath)
188188

189189
if common.system(configure, no_exception=True) != 0:
190-
raise common.MFCException("Failed to configure the [bold magenta]{name}[/bold magenta] target.")
190+
raise common.MFCException(f"Failed to configure the [bold magenta]{name}[/bold magenta] target.")
191191

192-
common.system(build, exception_text="Failed to build the [bold magenta]{name}[/bold magenta] target.")
193-
common.system(install, exception_text="Failed to install the [bold magenta]{name}[/bold magenta] target.")
192+
common.system(build, exception_text=f"Failed to build the [bold magenta]{name}[/bold magenta] target.")
193+
common.system(install, exception_text=f"Failed to install the [bold magenta]{name}[/bold magenta] target.")
194194

195195
cons.print(no_indent=True)
196196
cons.unindent()

toolchain/mfc/lock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def switch(to: MFCConfig):
6969
state.gCFG = to
7070
write()
7171

72-
for target_name in build.get_target_names():
72+
for target_name in build.get_mfc_target_names():
7373
dirpath = build.get_build_dirpath(build.get_target(target_name))
7474
cons.print(f"[bold red]Removing {os.path.relpath(dirpath)}[/bold red]")
7575
common.delete_directory(dirpath)

toolchain/mfc/run/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ def validate_job_options() -> None:
2020
raise common.MFCException(f'RUN: {ARG("email")} is not a valid e-mail address.')
2121

2222

23-
def run_targets(targets: typing.List[str]):
24-
build.build_targets(targets)
25-
23+
def run_targets(targets: typing.List[str]):
2624
cons.print("[bold]Run[/bold]")
2725
cons.indent()
2826

@@ -51,6 +49,8 @@ def run_targets(targets: typing.List[str]):
5149
for name in ARG("targets"):
5250
input_file.generate(name)
5351

52+
build.build_targets(targets)
53+
5454
engine.run(ARG("targets"))
5555

5656

0 commit comments

Comments
 (0)