Skip to content

Commit c4ac956

Browse files
committed
docs: Use build directory for building library
Required because cpptrace prevents in-source builds Also switch to using `subprocess.run` so we can better see errors
1 parent 134c41f commit c4ac956

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

manual/sphinx/conf.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,21 @@ def __getattr__(cls, name):
8282
pwd = "/".join(os.getcwd().split("/")[:-2])
8383
os.system("git submodule update --init --recursive ../../externalpackages/fmt")
8484
cmake = (
85-
"cmake . -DBOUT_USE_FFTW=ON"
86-
+ " -DBOUT_USE_LAPACK=OFF"
87-
+ " -DBOUT_ENABLE_PYTHON=ON"
88-
+ " -DBOUT_UPDATE_GIT_SUBMODULE=OFF"
89-
+ " -DBOUT_TESTS=OFF"
90-
+ " -DBOUT_ALLOW_INSOURCE_BUILD=ON"
91-
+ f" -DPython3_ROOT_DIR={pydir}"
92-
+ f" -Dmpark_variant_DIR={pwd}/externalpackages/mpark.variant/"
93-
+ f" -Dfmt_DIR={pwd}/externalpackages/fmt/"
85+
"cmake . "
86+
" -B build"
87+
" -DBOUT_USE_FFTW=ON"
88+
" -DBOUT_USE_LAPACK=OFF"
89+
" -DBOUT_ENABLE_PYTHON=ON"
90+
" -DBOUT_UPDATE_GIT_SUBMODULE=OFF"
91+
" -DBOUT_TESTS=OFF"
92+
" -DBOUT_ALLOW_INSOURCE_BUILD=ON"
93+
f" -DPython3_ROOT_DIR={pydir}"
94+
f" -Dmpark_variant_DIR={pwd}/externalpackages/mpark.variant/"
95+
f" -Dfmt_DIR={pwd}/externalpackages/fmt/"
9496
)
95-
# os.system("mkdir ../../build")
96-
os.system("echo " + cmake)
97-
x = os.system("cd ../.. ;" + cmake)
98-
assert x == 0
99-
x = os.system("cd ../.. ; make -j 2 -f Makefile")
100-
assert x == 0
97+
subprocess.run(f"echo {cmake}", shell=True)
98+
subprocess.run(f"cd ../../; {cmake}", shell=True, check=True)
99+
subprocess.run("cd ../.. ; cmake --build build -j 2", shell=True, check=True)
101100

102101

103102
# readthedocs currently runs out of memory if we actually dare to try to do this

0 commit comments

Comments
 (0)