https://github.com/uibcdf/testconda_withf90libs
Sample case showing how to distribute a python package with fortran f90 libraries in conda.
https://github.com/uibcdf/testconda_withf90libs
conda conda-recipe example-project f2py
Last synced: 6 months ago
JSON representation
Sample case showing how to distribute a python package with fortran f90 libraries in conda.
- Host: GitHub
- URL: https://github.com/uibcdf/testconda_withf90libs
- Owner: uibcdf
- License: mit
- Created: 2018-06-08T15:26:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-09T01:24:40.000Z (about 8 years ago)
- Last Synced: 2025-01-23T03:14:02.854Z (over 1 year ago)
- Topics: conda, conda-recipe, example-project, f2py
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# Setting up and uploading a python package with f90 library to Anaconda.
The purpose of this repo is to show how a python package with a f90 fortran library is setup and distributed via anaconda.
A simple setup file `setup.py` includes the necessary declarations to compile the fortran code through numpy (f2py).
Any comment is appreciated.
## Instructions
### Manually testing the package
The fortran code can be compiled manually with f2py and the package locally invoked to run a first test:
```bash
cd extra
python f2py_compiling.py
cd ..
python
```
Once the python interpreter is opened you can already check that the fortran
library is usable with the piece of python code in the 'Finnal test' subsection.
### Building and uploading the package to your anaconda channel
Find the conda recipe and steps description in [devtools/conda-recipe](https://github.com/uibcdf/TestConda_withF90Libs/tree/master/devtools/conda-recipe).
### Finnal test:
conda install -c YOUR_ANACONDA_CHANNEL vector_normalization
```python
import numpy as np
from vector_normalization import normalize_vector()
vect=np.array([1.0,1.0,1.0])
normalize_vector(vect)
print(vect)
```