Skip to content

Commit

Permalink
Update manual (installation section)
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed May 7, 2022
1 parent d74868b commit 23ca735
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 33 deletions.
Binary file added docs/images/logo-dipc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 59 additions & 32 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,56 @@
Installation
============

Requirements
____________
:program:`cosymlib` is available in both GitHub and PyPI repositories (https://pypi.org/project/cosymlib/).
Installation via PyPI is simpler and it is recommended for most users.

from PyPI (recommended)
-----------------------

This installation requires :program:`pip` ( https://pip.pypa.io/en/stable/installing/) to be installed
in your system. We strongly recommend the use of python environments (https://docs.python.org/3/library/venv.html).
For most users the basic installation instructions are:

1. Create a virtual environment at path <venv>::

python3 -m venv <venv>

2. Activate environment ::

# on MAC / Linux (bash shell)
source <venv>/bin/activate

# on windows (powershell)
C:\> <venv>\Scripts\Activate.ps1

3. Install cosymlib ::

pip install numpy
pip install cosymlib

4. Deactivate environmen ::

deactivate

.. note::
To use :program:`cosymlib` it is necessary to activate the environment every time a new shell is open.
All the scripts contained in :program:`cosymlib` will be accessible in this environment. On windows
it is necessary to type *python* before the script name ::

python <script_name> <script_options>

.. note::
On windows it may be necessary to add user execution permissions to activate the environment.
To do this open a poweshell as administrator and type ::

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser


from source code
----------------

Alternatively you can download the latest version of :program:`cosymlib` from github using :program:`git` (https://git-scm.com)
and install it manually through :file:`setup.py` file using :program:`setuptools` (https://setuptools.readthedocs.io/).

:program:`cosymlib` contains libraries written in Fortran that require a compiler to build them.
Before installing cosymlib make sure you have a working Fortran compiler installed in your system.
Expand All @@ -31,32 +79,14 @@ typing the following commands:

brew install gcc

Install
_______

:program:`cosymlib` is available in both GitHub and PyPI repositories (https://pypi.org/project/cosymlib/).
Installation via PyPI is simpler and it is recommended for most users.

from PyPI
---------

This installation requires :program:`pip` ( https://pip.pypa.io/en/stable/installing/) to be installed
in your system. Once pip is properly installed you can install :program:`cosymlib` by typing: ::

pip install cosymlib --user
- **Windows**

if your system contains both :program:`python2` and :program:`python3` installed and you intend to install :program:`cosymlib`
for :program:`python3` use: ::
1. Install windows development environment :program:`Visual Studio` (https://developer.microsoft.com/en-us/windows/downloads/)

pip3 install cosymlib --user
2. Install C/Fortran compiler for windows. We have tested and recommend :program:`mingw` (https://www.mingw-w64.org)

from GitHub
-----------

Alternatively you can download the latest version of :program:`cosymlib` from github using :program:`git` (https://git-scm.com)
and install it manually through :file:`setup.py` file using :program:`setuptools` (https://setuptools.readthedocs.io/).

First, download the code using :program:`git` in your computer by typing: ::
To install :program:`cosymlib` download the source code using :program:`git` in your computer by typing: ::

git clone https://github.com/GrupEstructuraElectronicaSimetria/cosymlib.git

Expand All @@ -82,13 +112,8 @@ installed you can run the :program:`python` interpreter and execute: ::

if the execution do not show any errors :program:`cosymlib` has been installed successfully.

Possible errors
---------------
- **Mac**

Possible errors for M1 users:

1. For users with Apple M1, scipy library might not properly install when following the next instructions,
.. note::
For users with Apple M1, scipy library might not properly install when following the next instructions,
to solve this, install manually: ::

brew install openblas
Expand All @@ -97,8 +122,10 @@ Possible errors for M1 users:
pip install cython pybind11 pythran numpy
OPENBLAS=$(brew --prefix openblas) CFLAGS="-falign-functions=8 ${CFLAGS}" pip install --no-use-pep517 scipy==1.7.0

2. When using an IDE remember to select the python interpreter in the hombrew path, to find it: ::
.. note::
When using an IDE remember to select the python interpreter in the hombrew path, to find it: ::

which python3
>> /opt/homebrew/bin/python3


2 changes: 1 addition & 1 deletion docs/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Useful links
:height: 100px
:target: https://www.iqtc.ub.edu

.. figure:: https://www.nanogune.eu/sites/default/files/styles/large/public/DonostiaInternationalPhysicsCenter.jpg?itok=uodkqUAl
.. figure:: images/logo-dipc.png
:height: 100px
:target: http://dipc.ehu.es

Expand Down

0 comments on commit 23ca735

Please sign in to comment.