Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

moving packages into the pip installer #67

Merged
merged 12 commits into from
Mar 18, 2024
2 changes: 0 additions & 2 deletions .github/workflows/ci_with_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_with_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/ci_with_pip_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 25 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,25 +57,14 @@ 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```
```bash
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

Expand All @@ -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```
Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ classifiers = [
dependencies = [
"trimesh",
"networkx",
"cadquery-ocp>=7.7.2",
"cadquery>=2.4.0",
]
dynamic = ["version"]

Expand Down
Loading