Skip to content

installationWindowsNew

Joshua J. Cogliati edited this page Jul 17, 2024 · 26 revisions

Installing RAVEN on Windows

Installing RAVEN on Windows is a simple process:

  • Install prerequisites, such as git, conda, and c compilers (note that c compiler is not needed for a pip install)
  • Clone RAVEN from GitHub
  • Compile and build RAVEN
  • Run tests

Installing Prerequisites

For Windows systems perform the following:

  • obtain the latest Git SCM for Windows installer from https://gitforwindows.org/ and install it. Install Git Bash and have the installer add Git Bash to your Windows PATH environment variables. The PATH can be updated in two different ways:

    • Automatic: Allow the Git SCM installer to update it for you: Image: Git SCM Path
    • Manually: Add the Git Bash in your PATH manually: Image: Add Git SCM Path
  • obtain the Microsoft's Build Tools for Visual Studio 2022 (in Tools for Visual Studio) from here. Note that if using a pip install, this is not required. After downloading and running the Visual Studio installer, it will ask what features to install. For building RAVEN, "Desktop development with C++" is needed at a minimum. Installation of other Visual Studio features should be fine.

    • build_tools_visual_studio
    • desktop_development_visual_studio
  • install Miniconda (you can install Miniconda from https://conda.io/miniconda.html). CONDA must be added in the Windows PATH. The PATH can be updated in two different ways:

    • Automatic: Allow the Conda installer to update it for you: Image: Conda Path
    • Manually: Add the Git Bash in your PATH manually: Image: Add Conda Path

Resolve SSL errors caused by INL Zscaler before install RAVEN (Only for INL machines)

  • Download https://certstore.inl.gov/pki/CAINLROOT_B64.crt
  • Method 1: Configure conda and git to trust INL's certificate authority. Open the GitBash (or Windows PowerShell) and cd into the folder where you want to install RAVEN (e.g., projects)
C:\projects> export REQUESTS_CA_BUNDLE=C:\\path\\to\\CAINLROOT_B64.crt 
C:\projects> export SSL_CERT_FILE=C:\\path\\to\\CAINLROOT_B64.crt 
C:\projects> export CURL_CA_BUNDLE=C:\\path\\to\\CAINLROOT_B64.crt 
C:\projects> git config --global http.sslcainfo C:\\path\\to\\CAINLROOT_B64.crt  
  • Method 2: Configure conda to trust INL's certificate authority. Manually place the certificates in the environmental folder. Windows search bar -> edit environment variables for your account -> New -> Variable name is name of certificate, value is location of certificate, etc.. You can following these steps to set up environment variables for REQUESTS_CA_BUNDLE, SSL_CERT_FILE, and CURL_CA_BUNDLE.

1

2

3

4

5

Clone RAVEN

Open the GitBash (or Windows PowerShell) and cd into the folder where you want to install RAVEN (e.g., projects)

C:\projects> cd projects
C:\projects> git clone https://github.com/idaholab/raven.git
C:\projects> cd raven

(Optional) Install RAVEN Plugins (ONLY IF YOU NEED ACCESS TO PLUGINS)

This step is optional, and you need to contact the raven developers to obtain the access first if you need any non-open source plugins. Contact us The installation instruction can be found: RAVEN Plugins


Method 1: Install RAVEN package (release version) through pip

This is the simplest way to install RAVEN.

C:\projects> conda create -n raven_libraries python=3.10
C:\projects> conda activate raven_libraries
C:\projects> pip install raven-framework

Once installed, raven_framework will be available in your system path, and you can run any raven tests under folder raven/tests/framework/, for example:

C:\projects> raven_framework  raven/tests/framework/test_LHS_Sampler.xml

Method 2: Install RAVEN from source through conda

If you would like to make contributions to RAVEN or you would like to get the latest RAVEN updates, you can using the following steps to compile and build RAVEN from source:

Compile and Build RAVEN

Installing Python libraries

  • First, find where your conda was installed. Open a Windows command line terminal and get the following result:
C:\> which conda
/c/Users/TALBPW/AppData/Local/Continuum/miniconda3/Scripts/conda

Your exact path will be slightly different depending on how conda was installed, and possibly using your user name. The result above is simply an example.

Whatever your result is, copy it and modify it as follows:

  • Remove the last two entries (the part after miniconda)

    • Example: /c/Users/TALBPW/AppData/Local/Continuum/miniconda3/
  • Add /etc/profile.d/conda.sh

    • Example: /c/Users/TALBPW/AppData/Local/Continuum/miniconda3/etc/profile.d/conda.sh This is the location of your conda definitions, used during the next step.
  • Then, open GitBash (or Windows PowerShell) and install raven libraries (release branch)

In GitBash:

C:\> cd projects
C:\> cd raven
C:\projects\raven> ./scripts/establish_conda_env.sh --install --conda-defs <yourCondaDefsLocation>

In PowerShell:

C:\> cd projects
C:\> cd raven
C:\projects\raven> bash.exe ./scripts/establish_conda_env.sh --install --conda-defs <yourCondaDefsLocation>

Make sure to replace <yourCondaDefsLocation> with your conda defs location found during the last step above.

The establish_conda_env.sh process is maintained to provide the best libraries for each commit of RAVEN. In the event libraries cannot be installed through conda, see Installing RAVEN Libraries.

Compiling RAVEN

Open GitBash (or Windows PowerShell) and compile RAVEN.

In GitBash:

C:\projects\raven> ./build_raven 

In PowerShell:

C:\projects\raven> bash.exe ./build_raven 

In case the RAVEN libraries have been installed without the conda installation package, (see Installing RAVEN Libraries ), RAVEN needs to be built with the following option:

In GitBash:

# USE ONLY if not using conda (non-standard install)
C:\projects\raven> ./build_raven --skip-conda

In PowerShell:

# USE ONLY if not using conda (non-standard install)
C:\projects\raven> bash.exe ./build_raven --skip-conda 

Test RAVEN installation

In GitBash:

C:\projects\raven> ./run_tests -j2

In PowerShell:

C:\projects\raven> bash.exe ./run_tests -j2

A large number of tests are run in order to check that the installation step has been successful. At the end, a screen output is generated similar to the one below (though the number of tests will not be the same):

383 passed, 19 skipped, 0 pending, 0 failed

Installation Issues and Solutions

Issue 1 when compiling and building raven:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\COSTKR\AppData\Local\miniconda3\envs\raven_libraries\python.exe' -u -c '
  exec(compile('"'"''"'"''"'"'
  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
  #
  # - It imports setuptools before invoking setup.py, to enable projects that directly
  #   import from `distutils.core` to work with newer packaging standards.
  # - It provides a clear error message when setuptools is not installed.
  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
  #     manifest_maker: standard file '"'"'-c'"'"' not found".
  # - It generates a shim setup.py, for handling setup.cfg-only projects.
  import os, sys, tokenize

  try:
      import setuptools
  except ImportError as error:
      print(
          "ERROR: Can not execute `setup.py` since setuptools is not available in "
          "the build environment.",
          file=sys.stderr,
      )
      sys.exit(1)

  __file__ = %r
  sys.argv[0] = __file__

  if os.path.exists(__file__):
      filename = __file__
      with tokenize.open(__file__) as f:
          setup_py_code = f.read()
  else:
      filename = "<auto-generated setuptools caller>"
      setup_py_code = "from setuptools import setup; setup()"

  exec(compile(setup_py_code, filename, "exec"))
  '"'"''"'"''"'"' % ('"'"'C:\\Users\\COSTKR\\projects\\raven\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' bdist_wheel -d 'C:\Users\COSTKR\AppData\Local\Temp\1\pip-wheel-4sm0qm15'
  cwd: C:\Users\COSTKR\projects\raven\
  Building wheel for raven-framework (setup.py) ... error
  ERROR: Failed building wheel for raven-framework
  Running setup.py clean for raven-framework
  Running command python setup.py clean
  running clean
  'build\lib.win-amd64-3.8' does not exist -- can't clean it
  'build\bdist.win-amd64' does not exist -- can't clean it
  'build\scripts-3.8' does not exist -- can't clean it
Failed to build raven-framework
ERROR: Could not build wheels for raven-framework, which is required to install pyproject.toml-based projects

Solution:

To build RAVEN in Windows, Visual C++ 14.0 or greater is needed. Please check Installing Prerequisites at the beginning of this page, and try to obtain the Microsoft's Build Tools for Visual Studio 2022 (in Tools for Visual Studio) following the steps provided in Installing Prerequisites.

In addition, if you continue see the error, you can also check what version is installed in the registry key below: HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio or by using the macros: _MSC_FULL_VER or _MSC_VER To get an updated version of Microsoft Visual C++ go to: http://visualstudio.microsoft.com/visual-cpp-build-tools/ Download the Build Tools, and install the latest Visual Studio Build Tools.

Other Activities

Once RAVEN has been installed, there are several activities that can be done with it:

  • Running RAVEN
  • Receiving new updates
  • Accessing documentation

Running RAVEN

To run in Windows see the running instructions here

Updating RAVEN

# navigate to the RAVEN repository
C:\projects> cd raven
# pull down any new changes
C:\projects\raven> git pull
# update libraries
###### in GitBash:
C:\projects\raven> ./scripts/establish_conda_env.sh --install
###### or in PowerShell:
C:\projects\raven> bash.exe ./scripts/establish_conda_env.sh --install
# compile and build
###### in GitBash:
C:\projects\raven> ./build_raven
# run tests
C:\projects\raven> ./run_tests -j2
###### or in PowerShell:
C:\projects\raven> bash.exe ./build_raven
# run tests
C:\projects\raven> bash.exe ./run_tests -j2

Accessing RAVEN Documentation

The RAVEN distribution includes several documents including user and theory manuals. These have been created using the LaTeX document preparation system and therefore need to be built using LaTeX typesetting software. There are several implementations of such software for all platforms, on Windows we have successfully used MiKTeX. To successfully build the documentation, the LaTeX distribution must provide the pdflatex and biblatex commands, and these commands must be in current system PATH.

Checking to See if Needed LaTeX Commands are in Your PATH

The which command can be used in CMD shells to see if a command is in the current system PATH. If a command can be found in the system PATH, the output looks like this:

C:\projects\raven\doc> which pdflatex
/c/Users/_you_user_name_/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64/pdflatex

If a command is not found, the output instead looks like this:

C:\projects\raven\doc> which pdflateks
which: no pdflateks in (Listing of directories in PATH)

Additional LaTeX packages needed to build RAVEN Documentation

There are several freely available add-on packages for the LaTeX typesetting system that are needed to build the RAVEN documentation:

  • appendix, mathtools, bigints, soul, placeins, xcolor, preprint, titlesec, mptopdf, cite, url, stmaryrd, booktabs, txfonts, listings, symbol, subfigure, fancyhdr

These may be installed using the package manager of the installed LaTeX distribution or allowing MiKTeX to automatically download them in case of need (automatic download on the-fly)

How to Build the RAVEN Manual

A script make_docs.sh is provided in the doc directory of the RAVEN distribution that will build all available documentation in one step. The script is needed to properly mark the version of the code in the documents:

In GitBash:

C:\projects> cd raven\doc
C:\projects\raven\doc> ./make_docs.sh

In PowerShell:

C:\projects> cd raven\doc
C:\projects\raven\doc> bash.exe ./make_docs.sh

If only a specific document needs to be built, navigate to the containing folder and type:

In GitBash:

  ./make_win.sh

In PowerShell:

  bash.exe ./make_win.sh

For example:

C:\projects> cd raven\doc\user_manual
C:\projects\raven\user_manual> ./make_win.sh (In GitBash) or bash.exe make_win.sh (In PowerShell)
Clone this wiki locally