mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Move Python API into openmc/ directory and move Python scripts into scripts/
directory.
This commit is contained in:
parent
2f0e89508a
commit
498e07d0bf
39 changed files with 32 additions and 47 deletions
|
|
@ -169,29 +169,29 @@ endif()
|
|||
|
||||
# Only initialize git submodules if it is not there. User is responsible
|
||||
# for future updates of fox xml submodule.
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/xml/fox/.git)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/xml/fox/.git)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||
message("-- Cloning FoX XML git repository...")
|
||||
execute_process(COMMAND git clone https://github.com/mit-crpg/fox.git src/xml/fox
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
execute_process(COMMAND git checkout bdc852f4f43d969fb1b179cba79295c1e095a455
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/xml/fox)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/xml/fox)
|
||||
else()
|
||||
message("-- Initializing/Updating FoX XML submodule...")
|
||||
execute_process(COMMAND git submodule init
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
execute_process(COMMAND git submodule update
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endif()
|
||||
endif()
|
||||
add_subdirectory(xml/fox)
|
||||
add_subdirectory(src/xml/fox)
|
||||
|
||||
#===============================================================================
|
||||
# Build OpenMC executable
|
||||
#===============================================================================
|
||||
|
||||
set(program "openmc")
|
||||
file(GLOB source *.F90 xml/openmc_fox.F90)
|
||||
file(GLOB source src/*.F90 src/xml/openmc_fox.F90)
|
||||
add_executable(${program} ${source})
|
||||
target_link_libraries(${program} ${libraries} fox_dom)
|
||||
set_target_properties(${program} PROPERTIES
|
||||
|
|
@ -203,28 +203,16 @@ set_target_properties(${program} PROPERTIES
|
|||
#===============================================================================
|
||||
|
||||
install(TARGETS ${program} RUNTIME DESTINATION bin)
|
||||
install(PROGRAMS utils/plot_mesh_tally.py
|
||||
DESTINATION bin
|
||||
RENAME plot_mesh_tally)
|
||||
install(PROGRAMS utils/statepoint_histogram.py
|
||||
DESTINATION bin
|
||||
RENAME statepoint_histogram)
|
||||
install(PROGRAMS utils/update_inputs.py
|
||||
DESTINATION bin
|
||||
RENAME update_inputs)
|
||||
install(PROGRAMS utils/xml_validate.py
|
||||
DESTINATION bin
|
||||
RENAME xml_validate)
|
||||
install(DIRECTORY relaxng DESTINATION share)
|
||||
install(FILES ../man/man1/openmc.1 DESTINATION share/man/man1)
|
||||
install(FILES ../LICENSE DESTINATION "share/doc/${program}/copyright")
|
||||
install(FILES man/man1/openmc.1 DESTINATION share/man/man1)
|
||||
install(FILES LICENSE DESTINATION "share/doc/${program}/copyright")
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
install(CODE "execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} setup.py install
|
||||
--prefix=${CMAKE_INSTALL_PREFIX}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils)")
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
|
|
@ -235,7 +223,7 @@ endif()
|
|||
include(CTest)
|
||||
|
||||
# Get a list of all the tests to run
|
||||
file(GLOB_RECURSE TESTS ${CMAKE_CURRENT_SOURCE_DIR}/../tests/test_*.py)
|
||||
file(GLOB_RECURSE TESTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/test_*.py)
|
||||
|
||||
# Check for MEM_CHECK and COVERAGE variables
|
||||
if (DEFINED ENV{MEM_CHECK})
|
||||
|
|
@ -43,8 +43,7 @@ the following commands in a terminal:
|
|||
git clone https://github.com/mit-crpg/openmc.git
|
||||
cd openmc
|
||||
git checkout -b master origin/master
|
||||
mkdir src/build
|
||||
cd src/build
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make
|
||||
sudo make install
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ repository::
|
|||
By default, the cloned repository will be set to the development branch. To
|
||||
switch to the source of the latest stable release, run the following commands::
|
||||
|
||||
cd openmc/src
|
||||
cd openmc
|
||||
git checkout master
|
||||
|
||||
.. _GitHub: https://github.com/mit-crpg/openmc
|
||||
|
|
@ -132,14 +132,13 @@ following
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
mkdir src/build
|
||||
cd src/build
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
Note that first a build directory is created as a subdirectory of the source
|
||||
directory. The Makefile in ``src/`` will automatically perform an out-of-source
|
||||
build with default options.
|
||||
directory. The Makefile in the top-level directory will automatically perform an
|
||||
out-of-source build with default options.
|
||||
|
||||
CMakeLists.txt Options
|
||||
++++++++++++++++++++++
|
||||
|
|
@ -166,7 +165,7 @@ should be used:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
cmake -Ddebug=on /path/to/src
|
||||
cmake -Ddebug=on /path/to/openmc
|
||||
|
||||
Compiling with MPI
|
||||
++++++++++++++++++
|
||||
|
|
@ -177,14 +176,14 @@ the MPI Fortran wrapper. For example, in a bash shell:
|
|||
.. code-block:: sh
|
||||
|
||||
export FC=mpif90
|
||||
cmake /path/to/src
|
||||
cmake /path/to/openmc
|
||||
|
||||
Note that in many shells, an environment variable can be set for a single
|
||||
command, i.e.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=mpif90 cmake /path/to/src
|
||||
FC=mpif90 cmake /path/to/openmc
|
||||
|
||||
Compiling with HDF5
|
||||
+++++++++++++++++++
|
||||
|
|
@ -195,14 +194,14 @@ the HDF5 Fortran wrapper. For example, in a bash shell:
|
|||
.. code-block:: sh
|
||||
|
||||
export FC=h5fc
|
||||
cmake /path/to/src
|
||||
cmake /path/to/openmc
|
||||
|
||||
As noted above, an environment variable can typically be set for a single
|
||||
command, i.e.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=h5fc cmake /path/to/src
|
||||
FC=h5fc cmake /path/to/openmc
|
||||
|
||||
To compile with support for both MPI and HDF5, use the parallel HDF5 wrapper
|
||||
``h5pfc`` instead. Note that this requires that your HDF5 installation be
|
||||
|
|
@ -216,8 +215,7 @@ the root directory of the source code:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
mkdir src/build
|
||||
cd src/build
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make
|
||||
make install
|
||||
|
|
@ -267,7 +265,8 @@ the source code root directory:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
cd src
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
This will build an executable named ``openmc``.
|
||||
|
|
@ -293,7 +292,6 @@ in the root directory of the OpenMC distribution:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
cd src
|
||||
make
|
||||
|
||||
This will build an executable named ``openmc``.
|
||||
|
|
@ -312,7 +310,6 @@ the source directory and run the following:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
cd src
|
||||
make test
|
||||
|
||||
If you want more options for testing you can use ctest_ command. For example,
|
||||
|
|
@ -320,7 +317,7 @@ if we wanted to run only the plot tests with 4 processors, we run:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
cd src/build
|
||||
cd build
|
||||
ctest -j 4 -R plot
|
||||
|
||||
If you want to run the full test suite with different build options please
|
||||
|
|
@ -370,7 +367,7 @@ the following steps must be taken:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
openmc/src/utils/convert_xsdir.py xsdir31 cross_sections.xml
|
||||
openmc/scripts/convert_xsdir.py xsdir31 cross_sections.xml
|
||||
|
||||
3. In the converted ``cross_sections.xml`` file, change the contents of the
|
||||
<directory> element to the absolute path of the directory containing the
|
||||
|
|
@ -416,9 +413,8 @@ Running OpenMC
|
|||
Once you have a model built (see :ref:`usersguide_input`), you can either run
|
||||
the openmc executable directly from the directory containing your XML input
|
||||
files, or you can specify as a command-line argument the directory containing
|
||||
the XML input files. For example, if the path of your OpenMC executable is
|
||||
``/home/username/openmc/src/openmc`` and your XML input files are in the
|
||||
directory ``/home/username/somemodel/``, one way to run the simulation would be:
|
||||
the XML input files. For example, if your XML input files are in the directory
|
||||
``/home/username/somemodel/``, one way to run the simulation would be:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from distutils.core import setup
|
||||
|
||||
setup(name='openmc',
|
||||
|
|
@ -8,4 +9,5 @@ setup(name='openmc',
|
|||
author='Will Boyd',
|
||||
author_email='wbinventor@gmail.com',
|
||||
url='https://github.com/mit-crpg/openmc',
|
||||
packages=['openmc'])
|
||||
packages=['openmc'],
|
||||
scripts=[os.path.join('scripts', f) for f in os.listdir('scripts')])
|
||||
Loading…
Add table
Add a link
Reference in a new issue