0

I've installed pythran as per instruction:

sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev python-ply python-networkx python-numpy
pip install pythran

I have pythran==0.9.7, gast==0.4.0, g++==5.5.0, ubuntu 16.04

Trying to run pythran dprod.py (same file as in their tutorial) throws an error which ends like this:

/home/viktoriya/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /usr/lib/libblas.so: undefined reference to `ATL_caxpby'
collect2: error: ld returned 1 exit status
WARNING: Compilation error, trying hard to find its origin...
WARNING: Nop, I'm going to flood you with C++ errors!
CRITICAL: Cover me Jack. Jack? Jaaaaack!!!!
E: error: Command "/home/viktoriya/anaconda3/bin/x86_64-conda_cos6-linux-gnu-c++ -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/viktoriya/anaconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/viktoriya/anaconda3/include -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_BLAS -I/home/viktoriya/anaconda3/lib/python3.8/site-packages/pythran -I/home/viktoriya/anaconda3/lib/python3.8/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I/home/viktoriya/anaconda3/include -I/home/viktoriya/anaconda3/include/python3.8 -c /tmp/tmpvkyb90vr.cpp -o /tmp/tmpidzc_k4l/tmp/tmpvkyb90vr.o -std=c++11 -fno-math-errno -w -fvisibility=hidden -fno-wrapv" failed with exit status 1

UPD: I've also installed libblas-dev.

How do I fix this?

Viktoriya Malyasova
  • 1,343
  • 1
  • 11
  • 25
  • `/usr/lib/libblas.so: undefined reference to 'ATL_caxpby'` might be the first thing to investigate here. Which could mean you might need to install additional libraries, which are supposed to be linked against. – nada Nov 27 '20 at 22:11
  • Either way, consider the possibility you're wasting time with pythran. It will not magically make your python code run faster, (which is what you're looking for i guess ?), it will probably not even be able to run your project (out of the box). – nada Nov 27 '20 at 22:14
  • @nada I've installed libatlas-base-dev, and also libblas-dev just to be sure – Viktoriya Malyasova Nov 27 '20 at 22:16
  • @виктория [this SO answer](https://stackoverflow.com/questions/50445008/g-compilation-undefined-reference-to-atl-on-ubuntu-18-04#53485265) suggests that you need to add some linker flags in the makefile to make it work in Ubuntu. – nada Nov 27 '20 at 22:19
  • @nada `CFLAGS="-lblas" pythran dprod.py` worked like a charm! You can post your suggestion as an answer if you want, I'll accept. – Viktoriya Malyasova Nov 28 '20 at 00:40

1 Answers1

0

CFLAGS="-lblas" pythran dprod.py worked.

Viktoriya Malyasova
  • 1,343
  • 1
  • 11
  • 25