Skip to content

Fix bugs in documentation relating to environment variables #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ cd .\cling\
git checkout tags/v1.0
cd ..
git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git
git clone --depth=1 -b cling-llvm18 https://github.com/root-project/llvm-project.git

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronj0 I am already taking care of this bug in #581 . Do you want me to move this fix to this PR, or keep it in the other one?

Copy link
Collaborator Author

@mcbarton mcbarton May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR was more about fixing the bugs in $env:ncpus on Windows, and the environment variables in general.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the PR title and description to reflect this.

$env:ncpus = %NUMBER_OF_PROCESSORS%
$env:ncpus = $([Environment]::ProcessorCount)
$env:PWD_DIR= $PWD.Path
$env:CLING_DIR="$env:PWD_DIR\cling"
mkdir llvm-project\build
Expand Down Expand Up @@ -263,9 +263,22 @@ Regardless of whether you are building CppInterOP with Cling or Clang-REPL you w
```bash
export CB_PYTHON_DIR="$PWD/cppyy-backend/python"
export CPPINTEROP_DIR="$CB_PYTHON_DIR/cppyy_backend"
```

If building CppInterOp against clang-repl you will need to define the following

```bash
export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_DIR}/build/include:${LLVM_DIR}/build/tools/clang/include"
```

and if building against cling you will need to define the following

```bash
export CLING_DIR="$(pwd)/cling"
export CLING_BUILD_DIR="$(pwd)/cling/build"
export CPLUS_INCLUDE_PATH="${CLING_DIR}/tools/cling/include:${CLING_BUILD_DIR}/include:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"
```

If on MacOS you will also need the following environment variable defined

```bash
Expand All @@ -277,9 +290,22 @@ On Windows you define as follows (assumes you have defined $env:PWD_DIR= $PWD.Pa
```powershell
$env:CB_PYTHON_DIR="$env:PWD_DIR\cppyy-backend\python"
$env:CPPINTEROP_DIR="$env:CB_PYTHON_DIR\cppyy_backend"
```

If building against clang-repl you will have the following defined

```powershell
$env:CPLUS_INCLUDE_PATH="$env:CPLUS_INCLUDE_PATH;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_DIR\build\include;$env:LLVM_DIR\build\tools\clang\include"
```

and if building against cling

```powershell
$env:CLING_DIR="$env:PWD_DIR\cling"
$env:CLING_BUILD_DIR="$env:PWD_DIR\cling\build"
$env:CPLUS_INCLUDE_PATH="$env:CLING_DIR\tools\cling\include;$env:CLING_BUILD_DIR\include;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_BUILD_DIR\include;$env:LLVM_BUILD_DIR\tools\clang\include;$env:PWD_DIR\include;"
```

#### Build CppInterOp

Now CppInterOp can be installed. On Linux and MacOS execute
Expand Down
28 changes: 27 additions & 1 deletion docs/DevelopersDocumentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Use the following build instructions to build on Windows
git checkout tags/v1.0
cd ..
git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git
$env:ncpus = %NUMBER_OF_PROCESSORS%
$env:ncpus = $([Environment]::ProcessorCount)
$env:PWD_DIR= $PWD.Path
$env:CLING_DIR="$env:PWD_DIR\cling"
mkdir llvm-project\build
Expand Down Expand Up @@ -209,8 +209,21 @@ define as follows

export CB_PYTHON_DIR="$PWD/cppyy-backend/python"
export CPPINTEROP_DIR="$CB_PYTHON_DIR/cppyy_backend"

If building CppInterOp against clang-repl you will need to define the following

.. code:: bash

export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_DIR}/build/include:${LLVM_DIR}/build/tools/clang/include"

and if building against cling you will need to define the following

.. code:: bash

export CLING_DIR="$(pwd)/cling"
export CLING_BUILD_DIR="$(pwd)/cling/build"
export CPLUS_INCLUDE_PATH="${CLING_DIR}/tools/cling/include:${CLING_BUILD_DIR}/include:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"

If on MacOS you will also need the following environment variable defined

.. code:: bash
Expand All @@ -224,8 +237,21 @@ $PWD.Path )

$env:CB_PYTHON_DIR="$env:PWD_DIR\cppyy-backend\python"
$env:CPPINTEROP_DIR="$env:CB_PYTHON_DIR\cppyy_backend"

If building against clang-repl you will have the following defined

.. code:: powershell

$env:CPLUS_INCLUDE_PATH="$env:CPLUS_INCLUDE_PATH;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_DIR\build\include;$env:LLVM_DIR\build\tools\clang\include"

and if building against cling

.. code:: powershell

$env:CLING_DIR="$env:PWD_DIR\cling"
$env:CLING_BUILD_DIR="$env:PWD_DIR\cling\build"
$env:CPLUS_INCLUDE_PATH="$env:CLING_DIR\tools\cling\include;$env:CLING_BUILD_DIR\include;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_BUILD_DIR\include;$env:LLVM_BUILD_DIR\tools\clang\include;$env:PWD_DIR\include;"

******************
Build CppInterOp
******************
Expand Down
30 changes: 29 additions & 1 deletion docs/InstallationAndUsage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Use the following build instructions to build on Windows
git checkout tags/v1.0
cd ..
git clone --depth=1 -b cling-llvm13 https://github.com/root-project/llvm-project.git
$env:ncpus = %NUMBER_OF_PROCESSORS%
$env:ncpus = $([Environment]::ProcessorCount)
$env:PWD_DIR= $PWD.Path
$env:CLING_DIR="$env:PWD_DIR\cling"
mkdir llvm-project\build
Expand Down Expand Up @@ -209,8 +209,21 @@ define as follows

export CB_PYTHON_DIR="$PWD/cppyy-backend/python"
export CPPINTEROP_DIR="$CB_PYTHON_DIR/cppyy_backend"

If building CppInterOp against clang-repl you will need to define the following

.. code:: bash

export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_DIR}/build/include:${LLVM_DIR}/build/tools/clang/include"

and if building against cling you will need to define the following

.. code:: bash

export CLING_DIR="$(pwd)/cling"
export CLING_BUILD_DIR="$(pwd)/cling/build"
export CPLUS_INCLUDE_PATH="${CLING_DIR}/tools/cling/include:${CLING_BUILD_DIR}/include:${LLVM_DIR}/llvm/include:${LLVM_DIR}/clang/include:${LLVM_BUILD_DIR}/include:${LLVM_BUILD_DIR}/tools/clang/include:$PWD/include"

If on MacOS you will also need the following environment variable defined

.. code:: bash
Expand All @@ -224,8 +237,23 @@ $PWD.Path )

$env:CB_PYTHON_DIR="$env:PWD_DIR\cppyy-backend\python"
$env:CPPINTEROP_DIR="$env:CB_PYTHON_DIR\cppyy_backend"


If building against clang-repl you will have the following defined

.. code:: powershell

$env:CPLUS_INCLUDE_PATH="$env:CPLUS_INCLUDE_PATH;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_DIR\build\include;$env:LLVM_DIR\build\tools\clang\include"

and if building against cling

.. code:: powershell

$env:CLING_DIR="$env:PWD_DIR\cling"
$env:CLING_BUILD_DIR="$env:PWD_DIR\cling\build"
$env:CPLUS_INCLUDE_PATH="$env:CLING_DIR\tools\cling\include;$env:CLING_BUILD_DIR\include;$env:LLVM_DIR\llvm\include;$env:LLVM_DIR\clang\include;$env:LLVM_BUILD_DIR\include;$env:LLVM_BUILD_DIR\tools\clang\include;$env:PWD_DIR\include;"


******************
Build CppInterOp
******************
Expand Down
Loading