Giter Site home page Giter Site logo

nukehub-dev / nukebox Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 246 KB

Package Manager for Nuclear Engineering Development

Home Page: https://nukebox.readthedocs.io

License: MIT License

Shell 98.17% Python 1.83%
dagmc geant4 nuclear-engineering nuclear-simulation openmc pyne package-manager

nukebox's Introduction

NukeBox

Build and Test Release DOI

This package manager is designed to set up a development environment for nuclear physics simulations and calculations. It automates the installation/update of various packages and libraries (PyNE, OpenMC, DAGMC, and Geant4) required for running nuclear physics simulations and analyses.

Usage

  1. Download the latest release and extract it to your local machine.

    Using wget:

    wget "https://github.com/nukehub-dev/NukeBox/archive/refs/tags/v0.1.3.tar.gz" -O - | tar -xz
    

    Using curl:

    curl -L "https://github.com/nukehub-dev/NukeBox/archive/refs/tags/v0.1.3.tar.gz" | tar -xz

    Using Git: (Download the most recent commit)

    git clone "https://github.com/nukehub-dev/NukeBox.git"
  2. Go to the NukeBox directory.

    cd NukeBox*
  3. Make the install-nukebox.sh script executable.

    chmod +x install-nukebox.sh
  4. Run the script.

    ./install-nukebox.sh

The script will guide you through the installation process and prompt you for necessary configuration options.

Installation Options

During the installation process, you'll be asked for the following configuration options:

  1. Installation Directory Path: Set the path where all the software will be installed. You can use the current directory or specify a custom directory.

  2. Environment Name: Enter a name for the virtual environment that will be created. The default name is nuke, but you can provide a custom name.

  3. Geant4 Data Library Path: If you choose to install Geant4 data, provide the path for the Geant4 data library. The default is a directory within the virtual environment.

  4. Cross Section Library Path: If you choose to install cross sections, provide the path for the cross section library. The default is a directory within the virtual environment.

  5. Auto Download Geant4 Data: Choose whether to automatically download Geant4 data. Enter y for yes or n for no.

  6. Auto Download Cross Sections: Choose whether to automatically download cross sections. Enter y for yes or n for no.

Quick Installation

You can also provide the configuration options directly from the command line.

./install-nukebox.sh -d <installation-directory> \
   -e <environment-name> \
   -g <geant4-data-library-path> \
   -c <cross-section-library-path>

How it Works

  1. Operating System Detection: The script attempts to automatically detect the operating system and its version. It supports systems with /etc/lsb-release, /etc/debian_version, and systems with lsb_release binary. If the detection fails, the script will notify the user that their OS is not supported and provide an option to manually override the OS detection.

  2. Dependencies Installation: The script installs various packages through apt-get. The following packages are installed:

    • software-properties-common
    • python3-dev
    • python3-pip
    • python3-venv
    • wget
    • build-essential
    • git
    • cmake
    • gfortran
    • qtbase5-dev
    • libblas-dev
    • liblapack-dev
    • libeigen3-dev
    • hdf5-tools
    • g++
    • libhdf5-dev
    • libboost-dev
    • libboost-python-dev
    • cython3
  3. Python Environment Setup: The script creates a Python virtual environment using venv in the specified installation directory. It installs the following Python packages using pip3:

    • numpy
    • cython<3
    • setuptools
    • jinja2
    • progress
    • tables
    • future
  4. MOAB (Mesh-Oriented datABase) Installation: MOAB is a software component that provides a flexible, efficient, and easy-to-use interface for storing and accessing mesh data in MOAB-based applications. The script installs MOAB version 5.4.1 with support for HDF5 and Python.

  5. Geant4 (for GEometry ANd Tracking) Installation: Geant4 is a software toolkit that simulates the passage of particles through matter. The script installs version 11.1.2 of Geant4, with the option to install data libraries in a specified path. The geant4-pybind package is used to enable Python support.

  6. DAGMC (Direct Accelerated Geometry Monte Carlo) Installation: DAGMC is an extension of Geant4 that enables direct use of CAD (Computer-Aided Design) geometry in Monte Carlo radiation transport simulations. The script installs DAGMC with support for MOAB and Geant4.

  7. OpenMC (Open Monte Carlo) Installation: OpenMC is an open-source Monte Carlo particle transport simulation code that focuses on neutron criticality and radiation shielding problems. The script installs OpenMC with support for DAGMC.

  8. PyNE (Nuclear Engineering Toolkit) Installation: PyNE is a Python package for nuclear engineering and data processing. It provides various functionalities, including nuclear data, geometry processing, and more. The script installs PyNE with support for MOAB and DAGMC.

  9. Create Program File: The script creates an executable program file (shell script) in the specified installation directory with the given environment name.

  10. Add to Path: The script adds the NukeBox directory to the user's PATH environment variable.

Activation and Usage

Once the installation is complete, the script will create a program file named after the specified environment name (e.g., nuke).

Commands:

  • -h or --help: Display help
  • -V or --version: Display version
  • activate: Activate the NukeBox environment
  • deactivate: Deactivate the NukeBox environment
  • update <module>: Update component
    • core: Update NukeBox
    • geant4: Update Geant4 to the latest version
    • dagmc: Update DAGMC to the latest version
    • openmc: Update OpenMC to the latest version
    • pyne: Update PyNE to the latest version
    • all: Update all components (NukeBox, Geant4, DAGMC, OpenMC, and PyNE)
  • endf <library>: Set the path for cross-section data library:
    • endfb70: ENDF/B-VII.0 (70)
    • endfb71: ENDF/B-VII.1 (71)
    • lib80x: ENDF/B-VIII.0/X (80X)
  • uninstall: Uninstall the NukeBox toolkit

Usage:

nuke <command> [options]

Note:

  • Use activate to activate the NukeBox environment.
  • Use deactivate to deactivate the NukeBox environment.
  • Use update with specific components to update them individually.
  • Use update all to update all components.
  • Use endf <library> to set the cross-section data library path.
  • Use uninstall to completely uninstall the NukeBox toolkit.

Examples:

nuke activate
nuke update geant4
nuke update all
nuke endf endfb70
nuke uninstall

Recommended Packages

The installer script provides a list of recommended Python packages in the packages.txt file. These packages complement the functionality of the installed software. To install them, use:

nuke activate
pip3 install -r packages.txt --default-timeout=0

Please ensure that you have appropriate permissions to install software on your system. The script may require you to enter your administrator password (sudo) during the installation process.

Important Notes

  • The script is primarily designed for systems that use apt-get package manager. If your system doesn't support apt-get, the installation process may not work as expected.
  • The script is intended for use with Linux-based systems, and its compatibility with other operating systems (e.g., macOS, Windows) may vary.
  • Use the script at your own risk. Always review and understand the code before executing any script on your system.
  • Before running the script, make sure to read and understand the installation process, as it may involve modifying your system's settings.

License

This project is licensed under the MIT License.

Disclaimer

The NukeBox program is provided for informational purposes only. The authors and contributors are not responsible for any damages or issues caused by using this script. Use it at your own risk.

Contributing

Contributions to this project are welcome. If you find any issues or have improvements to suggest, feel free to open a GitHub issue or create a pull request. For more information, check out the CONTRIBUTING page.

Contact

For any questions or inquiries, please contact through:

nukebox's People

Contributors

ahnaf-tahmid-chowdhury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nukebox's Issues

Problem in installing Nuclear Boy

I have tried to install Nuclear Boy on my PC and it shows error message:

Error compiling Cython file:
------------------------------------------------------------
...
cdef moab.ErrorCode err
cdef Range entities = Range()
cdef moab.EntityType typ = entity_type
cdef vector[eh.EntityHandle] hvec
if as_list:
err = self.inst.get_entities_by_type( meshset,
^
------------------------------------------------------------

                  pymoab/core.pyx:1548:48: no suitable method found
                                                                       
                                                                           Error compiling Cython file:
                           ------------------------------------------------------------
           ...
                          """
                                         cdef moab.ErrorCode err
                                                                            cdef Range ents = Range()
                                 cdef vector[eh.EntityHandle] hvec
                                                                              if as_list:
                         err = self.inst.get_entities_by_handle(<unsigned long> meshset, hvec, recur)
                                                                           ^
                                                                               ------------------------------------------------------------
                                                               
                                                                   pymoab/core.pyx:1711:50: no suitable method found
                                        
                                            Error compiling Cython file:
                                                                            ------------------------------------------------------------
                                                            ...
                                                                           """
          cdef moab.ErrorCode err
                                             cdef Range ents = Range()
                                                                                  cdef vector[eh.EntityHandle] hvec
                                               if as_list:
                                                                          err = self.inst.get_entities_by_dimension(<unsigned long> meshset, dimension, hvec, recur)
                                                             ^
                                                                  ------------------------------------------------------------
                                                  
                                                      pymoab/core.pyx:1751:53: no suitable method found
                           Traceback (most recent call last):
                                                                   File "<string>", line 2, in <module>
                             File "<pip-setuptools-caller>", line 34, in <module>
       File "/home/dresden/NuclearBoy/nuclear-boy/moab-repo/build/pymoab/setup.py", line 53, in <module>
                                setup(
                                            File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
       return distutils.core.setup(**attrs)
                                                 File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
                                         dist.run_commands()
                                                                  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
                                                                 self.run_command(cmd)
            File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
                             File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/setuptools/command/develop.py", line 34, in run
                                                                            self.install_for_development()
                                File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/setuptools/command/develop.py", line 114, in install_for_development
                    self.run_command('build_ext')
                                                       File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
                                                    self.distribution.run_command(command)
                File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
              cmd_obj.run()
                                 File "/usr/lib/python3.10/distutils/command/build_ext.py", line 340, in run
                                    self.build_extensions()
                                                                 File "/usr/lib/python3.10/distutils/command/build_ext.py", line 449, in build_extensions
                                                                                 self._build_extensions_serial()
                                      File "/usr/lib/python3.10/distutils/command/build_ext.py", line 474, in _build_extensions_serial
                                                              self.build_extension(ext)
             File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/Cython/Distutils/build_ext.py", line 122, in build_extension
                                                                         new_ext = cythonize(
                   File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1134, in cythonize
                                                                         cythonize_one(*args)
                   File "/home/dresden/NuclearBoy/nuclear-boy/lib/python3.10/site-packages/Cython/Build/Dependencies.py", line 1301, in cythonize_one
                                                                             raise CompileError(None, pyx_file)
                                   Cython.Compiler.Errors.CompileError: pymoab/core.pyx
           Compiling pymoab/core.pyx because it changed.
                                                            [1/1] Cythonizing pymoab/core.pyx
                 [end of output]

                                note: This error originates from a subprocess, and is likely not a problem with pip.
                                    make[2]: *** [pymoab/CMakeFiles/pymoab-local-install.dir/build.make:71: pymoab/CMakeFiles/pymoab-local-install] Error 1
                                                                           make[1]: *** [CMakeFiles/Makefile2:1266: pymoab/CMakeFiles/pymoab-local-install.dir/all] Error 2
           make: *** [Makefile:146: all] Error 2

For additional information I am using Ubuntu 22.04 and I am not using Anaconda. Thank you sir if you can help, that would be very helpful to me. Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.