I have a conda virtual environment based on the following yaml:
channels:
- conda-forge
dependencies:
- gcc_linux-64
- gxx_linux-64
- gfortran_linux-64
- theano
This is a simplified example, in reality the YAML has much more packages.
In details, the software is installed in base environment inside a docker container, however I do not believe that my problem is related to containers at all. The important part of the Dockerfile is below:
# BASE IMAGE
FROM ubuntu:18.04
# PATH EXPORT
ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"
# UPDATE THE PACKAGE LIST
RUN apt-get update
# INSTALL WGET
RUN apt-get install -y wget && rm -rf /var/lib/apt/lists/*
# INSTALL MINICONDA WITH PYTHON 3.7
RUN wget --no-verbose \
https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& mkdir /root/.conda \
&& bash Miniconda3-latest-Linux-x86_64.sh -b \
&& rm -f Miniconda3-latest-Linux-x86_64.sh
# UPDATE CONDA
RUN conda update --name base --channel defaults conda
# COPY THE YAML & INSTALL SOFTWARE WITH CONDA
COPY conda_packages.yaml .
RUN conda env update --name base --file conda_packages.yaml
The container is built properly and afterwards I can run the Anaconda New Compilers within using commands: x86_64-conda_cos6-linux-gnu-gcc or x86_64-conda_cos6-linux-gnu-c++. However, when I run a test python script that does import theano I get an error:
/root/miniconda3/lib/python3.7/site-packages/theano/configdefaults.py:560: UserWarning:
DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
When I later check the build logs theano version that is installed is: 1.0.4
Compilers versions are: 7.3.0