Skip to content

Commit 0aafb3d

Browse files
committed
updated documentation to include flags for debugging
1 parent 7131f53 commit 0aafb3d

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

docs/tutorials/building_r.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,19 @@ mkdir -p $BUILDDIR
5555
cd $BUILDDIR
5656
```
5757

58-
**5) Configure the build**
58+
**5) Set CFLAGS (Optional—For Debugging C Code)**
59+
60+
- **This step is optional and recommended for those who want to debug C code.**
61+
- Set the `CFLAGS` environment variable before running configure:
62+
63+
```bash
64+
CFLAGS="-g -O0"
65+
```
66+
67+
- After running this command, the CFLAGS setting will apply only to the
68+
current terminal session.
69+
70+
**6) Configure the build**
5971

6072
- After we change directory, we must run the configure script from the source
6173
directory. This step takes ~1 minute on the codespace.
@@ -80,7 +92,7 @@ $TOP_SRCDIR/configure --with-valgrind-instrumentation=1
8092

8193
![alt text](../assets/rdev7.png)
8294

83-
**6) Build R**
95+
**7) Build R**
8496

8597
Having configured R, we run `make` to build R. This take 5-10 minutes on the
8698
codespace.
@@ -89,7 +101,7 @@ codespace.
89101
make
90102
```
91103

92-
**7) Check R**
104+
**8) Check R**
93105

94106
Check that the build of R passes R's standard checks:
95107
@@ -101,7 +113,7 @@ This takes a couple of minutes in the codespace. The check will stop with a
101113
error message if any of the tests fail. If this happens, see [SVN
102114
Help](./svn_help.md) for how to revert to a version that passes check.
103115
104-
**8) Make R terminals use the built R**
116+
**9) Make R terminals use the built R**
105117
106118
Run the `which_r` script to set which R to use for R terminals in VSCode. When
107119
prompted, enter the number corresponding to `r-devel`
@@ -125,7 +137,7 @@ built![^1]
125137
selected version is saved in the VSCode settings, so will be saved when you stop
126138
and restart the codespace.
127139
128-
**9) Make contributions**
140+
**10) Make contributions**
129141
130142
- After having built the current development version of R, we can now make
131143
changes to the source code and contribute to the project.

0 commit comments

Comments
 (0)