Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 8 additions & 52 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,57 +1,25 @@
tags
src/*/tags
/build/
.vscode/
src/*/case.fpp
src/*/autogen/

*.swo
*.swp

*:Zone.Identifier

.vscode/
.nfs*
defaults.yaml

__pycache__

CMakeFiles/
CMakeCache.txt
Makefile
cmake_install.cmake

*.egg-info

/build/
toolchain/build/

src/*/*.mod
src/*/*.o
src/*/autogen/
src/common/case.fpp
src/pre_process/pre_process
src/simulation/simulation
src/post_process/post_process
src/master_scripts/*.pyc
src/*/.build
src/*/case.*
src/master_scripts/__*
make_doc.sh
cases/
.DS_Store

tests/**/*.log
tests/*.txt
tests/*/**
!**/golden.txt

tests_hypoelastic/*/D/*
tests_hypoelastic/*/p*
tests_hypoelastic/*/D_*
tests_hypoelastic/*/*.inp
tests_hypoelastic/*/*.inf
tests_hypoelastic/*/*.dat
tests_hypoelastic/*/silo*
tests_hypoelastic/*/restart*
tests_hypoelastic/*/*.out
tests_hypoelastic/*/binary
/tests/**/*.log
/tests/*.txt
/tests/*/**
!/tests/golden.txt

examples/*batch/*/
examples/*/D/*
Expand All @@ -69,15 +37,3 @@ examples/*/fort.1
examples/*/pre_process.sh
examples/*/simulation.sh
examples/*/post_process.sh

doc/*/MFC_user_guide.bbl
doc/*/MFC_user_guide.blg
doc/*/MFC_user_guide.aux
doc/*/MFC_user_guide.toc
doc/*/MFC_user_guide.fls
doc/*/MFC_user_guide.synctex.gz
doc/*/MFC_user_guide.log
doc/*/MFC_user_guide.fdb_latexmk

doc/Doxygen/*/html
doc/Doxygen/*icon*
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,25 @@ include(CheckFortranCompilerFlag)

# === Check Compiler Support & Tools
# === === Compiler Support
set(__err_msg "\
CMake detected the ${CMAKE_Fortran_COMPILER_ID} Fortran compiler \
v${CMAKE_Fortran_COMPILER_VERSION}. If you intended to use a different \
compiler (or a different version thereof), please:\n\
- Install the compiler or load its module. (e.g. module load gcc/10.1)\n\
- Set/Export the C, CXX, and FC environment variables. (e.g. 'export CC=gcc', \
'export CXX=g++', and 'export FC=gfortran'.\n\
- If using mfc.sh, delete the build/<code name> directory and try again. (e.g. 'rm -rf build/pre_process')\n")

if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5)
message(FATAL_ERROR "GNU v5.0 or newer is required to build MFC. "
"[current: ${CMAKE_Fortran_COMPILER_VERSION}]")
message(FATAL_ERROR "${__err_msg}ERROR: GNU v5.0 or newer is required to build MFC.")
endif()
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 21.7)
message(FATAL_ERROR "NVHPC v21.7 or newer is required to build MFC. "
"[current: ${CMAKE_Fortran_COMPILER_VERSION}]")
message(FATAL_ERROR "${__err_msg}ERROR: NVHPC v21.7 or newer is required to build MFC.")
endif()
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "MFC does not support the Apple Clang compilers. "
"Please consult the README for more details.")
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "${__err_msg}ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.")
endif()

# === === Find Fypp
Expand Down
6 changes: 3 additions & 3 deletions toolchain/mfc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ def build_target(name: str, history: typing.List[str] = None):
common.create_directory(build_dirpath)

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

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

cons.print(no_indent=True)
cons.unindent()
Expand Down
2 changes: 1 addition & 1 deletion toolchain/mfc/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def switch(to: MFCConfig):
state.gCFG = to
write()

for target_name in build.get_target_names():
for target_name in build.get_mfc_target_names():
dirpath = build.get_build_dirpath(build.get_target(target_name))
cons.print(f"[bold red]Removing {os.path.relpath(dirpath)}[/bold red]")
common.delete_directory(dirpath)
6 changes: 3 additions & 3 deletions toolchain/mfc/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def validate_job_options() -> None:
raise common.MFCException(f'RUN: {ARG("email")} is not a valid e-mail address.')


def run_targets(targets: typing.List[str]):
build.build_targets(targets)

def run_targets(targets: typing.List[str]):
cons.print("[bold]Run[/bold]")
cons.indent()

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

build.build_targets(targets)

engine.run(ARG("targets"))


Expand Down