aasensio / hazel2

Hazel v2.0: synthesis and inversion of Stokes profiles caused by the joint action of atomic level polarization and the Hanle and Zeeman effects
https://aasensio.github.io/hazel2/index.html
MIT License
21 stars 6 forks source link

'gcc' problems in hazel2 installation #19

Closed captainsoy closed 5 years ago

captainsoy commented 5 years ago

Hi Dr Ramos,

I tried to install the HAZEL2 on Ubuntu 16.04 with Anaconda3-5.0.0/Python3.6, but I cannot finish the installation via instructions. The [setup.py] file cannot be found from the copies of GitHub, so I tried to install from folders in the harddisk. The installation record is attached as follow, but some errors occured as the last few lines. Could you help check what happens? Thanks a lot!

[Operation System & Softwares] Ubuntu 16.04, Anaconda3-5.0.0, Python 3.6 [Dependencies] gcc cython numpy scipy h5py tqdm astropy configobj matplotlib mpi4py pyqt

installProblemRecord.txt

aasensio commented 5 years ago

Could you remove the environment and create it again? conda remove --name myenv --all conda create -n hazel_env python=3.6

This seems to be an issue related with Anaconda. If after that it still does not work, try to install the Anaconda gcc compilers conda install gcc

captainsoy commented 5 years ago

I've tried your advice, remove and create the environment again with python=3.7, but failed again. [Version] Ubuntu 18.04.4, Anacond3-5.3.1-Linux-x86_64, python=3.7

I've also found that, when using the Anaconda gcc complier installation code, conda install gcc , the gcc is limited to gcc --version=4.8.5, which caused problems in the last few lines in the previous issue report. [Added] gcc-linux_64 --version=7.3.0, installed by conda install -c conda-forge gcc_linux-64

This time there's no gcc problem, only existing gfortran problems. The installation record is as .txt shows. hazelInstallationFailure_gcc720.txt

aasensio commented 5 years ago

It looks like you have no gfortran compiler installed on your system. Anaconda 5 added the possibility to install compilers on the environment. I've done a quick test with a new environment and things seem to work if you follow the process:

conda create -n hazel_env python=3.6
conda activate hazel_env
conda install -c conda-forge cython numpy h5py tqdm scipy astropy mpi4py configobj gfortran_linux-64 gcc_linux-64
conda deactivate
conda activate hazel_env
python setup.py install

The deactivate and then activate is for the environment variables pointing to the newly installed compilers to be properly defined. Could you test whether this works? If it does, I will update the documentation. I think the current docs are only working if you have a working gfortran compiler installed on the system but perhaps it's safer if I use those of Anaconda.

captainsoy commented 5 years ago

Hi Dr Ramos, I've tried your advice, but some of the dependencies changed and added. 1) The dependency gfortran_linux-64 cannot be found in conda-forge, but in anaconda. 2) The dependency, fortran-compiler, is added to solve the bug, 'gfortran' losing.

conda create -n hazel_env python=3.6 conda activate hazel_env conda install -c conda-forge cython numpy h5py tqdm scipy astropy mpi4py configobj gcc_linux-64 fortran-complier conda install -c anaconda gfortran_linux-64 conda deactivate conda activate hazel_env python setup.py install

Thus I had these Fortran-related dependencies in Anaconda3-5.3.0: gcc-linux_64 v7.3.0; gfortran_linux-64 v8.2.0; fortran-compiler v1.0.1.

The setup command shows as the .txt file, with some unknown warnings (seems like it is related with NumPy?).

Thanks again for your patience!

hazel2_setupRecord_pkgAdded.txt

aasensio commented 5 years ago

Great. It seems like you've successfully compiled hazel. These warnings are related with cython but they are not important. I'll update the docs. Thanks.