Skip to content

Commit 9d32299

Browse files
committed
Ensure installation of Python modules goes into CMAKE_INSTALL_PREFIX.
Closes #329 on github.
1 parent dc4c7c2 commit 9d32299

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/source/usersguide/install.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,22 @@ the root directory of the source code:
239239

240240
.. code-block:: sh
241241
242-
cd src
242+
mkdir src/build
243+
cd src/build
244+
cmake ..
243245
make
244-
sudo make install
246+
make install
245247
246248
This will build an executable named ``openmc`` and install it (by default in
247249
/usr/local/bin). If you do not have administrative privileges, you can install
248-
OpenMC locally by replacing the last command with:
250+
OpenMC locally by specifying an install prefix when running cmake:
249251

250252
.. code-block:: sh
251253
252-
make install -e prefix=$HOME/.local
254+
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
253255
254-
The ``prefix`` variable can be changed to any path for which you have
255-
write-access.
256+
The ``CMAKE_INSTALL_PREFIX`` variable can be changed to any path for which you
257+
have write-access.
256258

257259
Compiling on Windows
258260
--------------------
@@ -326,7 +328,7 @@ Testing Build
326328
-------------
327329

328330
If you have ENDF/B-VII.1 cross sections from NNDC_ you can test your build.
329-
Make sure the **CROSS_SECTIONS** environmental variable is set to the
331+
Make sure the **CROSS_SECTIONS** environmental variable is set to the
330332
*cross_sections.xml* file in the *data/nndc* directory.
331333
There are two ways to run tests. The first is to use the Makefile present in
332334
the source directory and run the following:

src/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ install(FILES ../LICENSE DESTINATION "share/doc/${program}/copyright")
261261
find_package(PythonInterp)
262262
if(PYTHONINTERP_FOUND)
263263
install(CODE "execute_process(
264-
COMMAND ${PYTHON_EXECUTABLE} setup.py install --user
264+
COMMAND ${PYTHON_EXECUTABLE} setup.py install
265+
--prefix=${CMAKE_INSTALL_PREFIX}
265266
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils)")
266267
endif()
267268

0 commit comments

Comments
 (0)