Getting MEAFS
Prerequisites
Python3 and GCC needs to be previously installed in the system (step-by-step to install for Windows users bellow;
- A software for creating a synthetic spectrum also needs to be previously installed. This version of MEAFS is compatible with the following softwares:
Turbospectrum2019: https://github.com/bertrandplez/Turbospectrum2019
Optionally: to execute the unify_plots.py, a LaTeX installation must be present on the system.
Optionally: Anaconda (recommended).
Creating Anaconda Environment (recommended)
First, download anaconda here and execute the script.
For Linux users, if needed, export anaconda to your path by adding the line
export PATH="/home/USERNAME/anaconda3/bin:$PATH"(changing theUSERNAMEto your user) to the~/.bashrcfile. Close and open a new terminal to update the path.If desirable, disable auto activation of anaconda with
conda config --set auto_activate_base false.
Create MEAFS environment with
conda create python -n meafs;Then, to activate the environment, type
conda activate meafs.
Step-by-Step for Windows (Python + GCC)
Python
Go to Python Windows Releases and download a stable release by clicking on it and downloading the Windows installer (64-bit) Recommended. After downloading, execute the files and follow the installation process.
- Add the Python folder to the path.
- Open the menu and search for path, click Edit the system environment variables, at the bottom right click Environment Variables…, in the tab System variables (attention: not the User variables for Username), look for the variable Path and click Edit. Add two new lines:
C:\Users\USERNAME\AppData\Local\Programs\Python\Python311C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\ScriptsChange
USERNAMEwith your username andPython311to the actual version that you installed.
Go to the python folder (ex:
C:\Users\USERNAME\AppData\Local\Programs\Python\Python311) and create a copy of thepython.exefile in the same location with the namepython3.11.exe.
GCC
Download the x64 version of Winlibs.
Choose the x64 MCF with all the libraries;
After downloading, decompress the file and move the
mingw64folder toC:\Program Files\;- Now add the folder
binof themingw64folder to the path: Use the sames steps as before but now add the line:
C:\Program Files\mingw64\bin.
- Now add the folder
Installation
Getting the pip version (recommended)
The pip version can easily be acquired by typing in the terminal:
pip install meafs
Updates
Updates when using the pip version are handle by pip itself. To force an update, type in the terminal:
pip install meafs --upgrade
Cloning from GitHub
Or you can directly clone from the GitHub page with:
git clone https://github.com/MatheusJCastro/meafs.git
After cloning, you can install it with pip or run without any installation at all (see the Basic Usage - Without Installation section).
To build the package and install it with pip from the source, first install the build package:
pip install build
Then go to the MEAFS source code directory and type:
python3 -m build
pip install .
Updates need to be handle by the user by cloning new versions and building it again.
Post Installation
Adding the PATH (for non Anaconda installations)
Linux
For Linux users, you can add the following line in the end of the file ~/.bashrc, changing USER to your own user.
export PATH="${PATH}:/home/USER/.local/bin/"
For some Linux distributions and Python installations, the location of the executables can slightly change. If this does not work out, you can try different paths such as /usr/local/bin and others.
Windows
For Windows users, use the sames steps as in Step-by-Step for Windows for the path only, but now check if those lines are already there, if not, add them:
C:\Users\Windows\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts
Or:
C:\Users\USERNAME\AppData\Local\Programs\Python\Python311\Scripts
Be aware of different Python versions, the path will change also. Always verify if the current path exists.
Compilation
There is one file written in C Language (meafs/meafs_code/scripts/bisec_interpol.c), in the first run, MEAFS will compile the C library using GCC. Otherwise, the compilation directives can be found in meafs/meafs_code/scripts/comp.sh. The C file needs to be compiled as a shared library, when using GCC Compiler, this can be achieved by adding the -shared flag.
If the auto compilation fails, for Linux users, just add execution privileges at the comp.sh file and execute it in a terminal to create the binary. For that, open a terminal in the meafs/meafs_code/scripts/ folder and type:
chmod +x comp.sh
./comp.sh
If you are on Windows, check this comp.sh file for the full gcc command.
Uninstall
If you did not install with pip (both directly or by cloning), you can just erase the meafs folder.
Otherwise, first remove the menu entries (if you have added it, see Basic Usage - With Installation) and then uninstall:
meafs-desktop-remove
pip uninstall meafs
Anaconda
If you have created an Anaconda environment, you can delete it with:
conda env remove --name meafs