diff --git a/.github/workflows/ci_with_benchmarks.yml b/.github/workflows/ci_with_benchmarks.yml index 0970370..b82c303 100644 --- a/.github/workflows/ci_with_benchmarks.yml +++ b/.github/workflows/ci_with_benchmarks.yml @@ -40,8 +40,6 @@ jobs: mamba install -y -c conda-forge "openmc=0.14.0=dagmc*nompi*" moab>=5.3.0 gmsh python-gmsh python -m pip install --upgrade pip python -m pip install . - python -m pip install cadquery-ocp==7.7.2 - python -m pip install cadquery==2.4.0 python -m pip install openmc_data_downloader openmc_data_downloader -l ENDFB-7.1-NNDC -i Fe56 Be9 git clone --single-branch -b main --depth 1 https://github.com/fusion-energy/model_benchmark_zoo.git diff --git a/.github/workflows/ci_with_install.yml b/.github/workflows/ci_with_install.yml index 71579ab..6fb283b 100644 --- a/.github/workflows/ci_with_install.yml +++ b/.github/workflows/ci_with_install.yml @@ -37,7 +37,7 @@ jobs: mamba activate mamba create -y --name cad_to_dagmc python=3.10 mamba activate cad_to_dagmc - mamba install -y -c conda-forge moab>=5.3.0 gmsh python-gmsh ocp=7.7.2.0 cadquery=2.4.0 + mamba install -y -c conda-forge moab>=5.3.0 gmsh python-gmsh python -m pip install --upgrade pip python -m pip install . python -c "import cad_to_dagmc" diff --git a/.github/workflows/ci_with_pip_install.yml b/.github/workflows/ci_with_pip_install.yml index 932617a..f0d3093 100644 --- a/.github/workflows/ci_with_pip_install.yml +++ b/.github/workflows/ci_with_pip_install.yml @@ -32,16 +32,27 @@ jobs: apt-get update -y apt-get upgrade -y apt-get install -y libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libosmesa6 libosmesa6-dev libgles2-mesa-dev libarchive-dev libpangocairo-1.0-0 libxcursor-dev libxft2 libxinerama-dev + apt-get install -y make cmake apt install python3 apt install python3-pip - python -m pip install --upgrade pip - python -m pip install gmsh - python -m pip install cadquery-ocp==7.7.2 - python -m pip install cadquery==2.4.0 + python -m pip install --upgrade pip + mkdir MOAB + cd MOAB + git clone --single-branch -b 5.5.1 --depth 1 https://bitbucket.org/fathomteam/moab/ + mkdir build + cd build + apt-get install -y libeigen3-dev + cmake ../moab -DENABLE_PYMOAB=ON -DENABLE_HDF5=ON -DENABLE_BLASLAPACK=OFF -DENABLE_FORTRAN=OFF + make -j2 + make install + cd .. python -m pip install . python -c "import cad_to_dagmc" python -m pip install .[tests] - pytest tests -v + pytest -v tests/test_file_creation.py + pytest -v tests/test_loading_from_file_vs_shape_object.py + pytest -v tests/test_python_api.py + pytest -v tests/test_version.py cd examples python create_stp_files_for_examples.py python cadquery_assembly.py diff --git a/README.md b/README.md index 3d0ef5d..a49a33a 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,9 @@ Also checkout these other software projects that also create DAGMC geometry [CAD # Installation options -- Install using Mamba and minimal pip -- Install using Conda and minimal pip +- Install using Mamba and pip +- Install using Conda and pip - Install using pip and source compilations -- Install using Conda and maximum pip TODO -- Install using Mamba and maximum pip TODO ## Install using Mamba and pip @@ -59,7 +57,7 @@ mamba activate new_env Install the dependencies ```bash -mamba install -y -c conda-forge gmsh python-gmsh moab>=5.3.0 ocp>=7.7.2.0 cadquery>=2.4.0 +mamba install -y -c conda-forge moab>=5.3.0 gmsh python-gmsh ``` Then you can install the cad_to_dagmc package with ```pip``` @@ -67,17 +65,6 @@ Then you can install the cad_to_dagmc package with ```pip``` pip install cad_to_dagmc ``` -You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others [link to DAGMC documentation](https://svalinn.github.io/DAGMC/). - -To install OpenMC You can run ```mamba install -c conda-forge openmc``` however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba -```bash -mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*" -``` - -It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there. - -Another option would be to [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which would also need compiling with MOAB and DAGMC options. - ## Install using Conda and pip @@ -100,7 +87,7 @@ conda activate new_env Install the dependencies ```bash -conda install -y -c conda-forge gmsh python-gmsh moab>=5.3.0 ocp>=7.7.2.0 cadquery>=2.4.0 +conda install -y -c conda-forge moab>=5.3.0 gmsh python-gmsh ``` Then you can install the cad_to_dagmc package with ```pip``` @@ -110,23 +97,38 @@ pip install cad_to_dagmc ## Install using pip and source compilations -It is possible to avoid the use of conda and installing using pip and compiling from source. +It should possible to avoid the use of conda and installing using pip and compiling from source. First compile MOAB (and install Pymoab) from source -Then install cadquery and ocp using pip +Then install gmsh from source (installing from pip appears to cause conflicts with the open cascade used in ocp and cadquery) + +Then you can install the cad_to_dagmc package with ```pip``` ```bash -pip install cadquery-ocp==7.7.2 -pip install cadquery==2.4.0 +pip install cad_to_dagmc ``` -Then you can install the cad_to_dagmc package with ```pip``` +## Install transport code (e.g OpenMC) + +You may also want to install OpenMC with DAGMC to make use of the h5m geometry files produced in simulations. However you could also use other supported particle transport codes such as MCNP, FLUKA and others [link to DAGMC documentation](https://svalinn.github.io/DAGMC/). +To install OpenMC you can run ```mamba install -c conda-forge openmc``` however this more specific command makes sure the latest version of OpenMC which contains DAGMC is chosen by conda / mamba ```bash -pip install cad_to_dagmc +mamba install -c conda-forge -y "openmc=0.14.0=dagmc*nompi*" ``` +It might not be possible to install OpenMC and cad-to-dagmc in the same conda/mamba python environment so you may have to create a new conda/mamba environment and install OpenMC there. + +Another option would be to [install OpenMC from source](https://docs.openmc.org/en/stable/quickinstall.html) which would also need compiling with MOAB and DAGMC options. + +# Known incompatibilities + +The package requires newer versions of Linux. For example the package does not work on Ubuntu 18.04 or older. + +The package requires newer versions of pip. It is recommended to ensure that your version of pip is up to date. This can be done with ```python -m pip install --upgrade pip``` + +Installing one of the package dependancies (gmsh) with pip appears to result in occational errors when passing cad objects between cadquery / ocp and gmsh. The conda install gmsh appears to work fine. # Usage - with OpenMC diff --git a/pyproject.toml b/pyproject.toml index b91b060..4542820 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,8 @@ classifiers = [ dependencies = [ "trimesh", "networkx", + "cadquery-ocp>=7.7.2", + "cadquery>=2.4.0", ] dynamic = ["version"]