Theano Compilation Error in Linux

I’m getting a compilation error in RHEL with the following configuration:

# lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	RedHatEnterpriseServer
Description:	Red Hat Enterprise Linux Server release 7.8 (Maipo)
Release:	7.8
Codename:	Maipo

I tried running the example in GLM: Linear regression — PyMC3 3.11.5 documentation, but got the following error:

/home/username/.theano/compiledir_Linux-3.10-el7.x86_64-x86_64-with-glibc2.10-x86_64-3.8.10-64/tmpnzbk43jn/mod.cpp:459:60: error: expected primary-expression before '{' token
  459 |                             #pragma omp parallel for if(n>={int(config.openmp_elemwise_minsize)})
      |                                                            ^

I did install PyMC3 as recommended in Installation Guide (Linux) · pymc-devs/pymc Wiki · GitHub. What am I missing?

Quick update. I had to disable openmp in ~/.theanorc to finally get no compilation errors:


It seems that if openmp=True, then that #pragma stament is inserted, but g++ doesn’t recognize the syntax. Even if I remove the curly braces around int(config.openmp_elemwise_minsize), it gives me an error because config isn’t defined.

I’d like to keep openmp=True. What should I do to avoid the compilation error?