1

recently I updated my armadillo to version 5.200.1, but when i tried to compile my code using

g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o code.cpp.o -c code.cpp
g++ -std=c++11 -m64 -O3 -Wall -I. -I/opt/OpenBLAS/include -fopenmp -o main.cpp.o -c main.cpp
g++ -std=c++11 -m64 -O3 -o code.cpp.o main.cpp.o -lgomp -L/opt/OpenBLAS/lib -lopenblas -larmadillo

I got error message in the final linking step

/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib/libarmadillo.so: undefined reference to `pthread_atfork'

collect2: error: ld returned 1 exit status

make: *** [a.out] Error 1

This error appears in my machine with Ubuntu 14.04LTS + gcc 4.9.2. The Armadillo itself is linked with OpenBLAS 0.2.14 (I followed the procedure provided by Armadillo in installation)

such error doesn't occur in my macosx laptop (the same library). It means something problems with my ubuntu machine. I tried to re-install the Armadillo 4.650.2 (this version worked before), but the same error kept appearing (now older doesn't work like before). The only thing that i did before updating those libraries were "apt-self update" and "apt-self upgrade" of my ubuntu machine

is there any suggestion to fix this problem?

xnov
  • 143
  • 9

1 Answers1

1

I also use armadillo on Ubuntu Linux

I had the same problem first when I started to program with armadillo. For g++ I only had to add -larmadillo as command line option. such as this

g++ -O2 -o armadillo_example armadillo_example.cpp -larmadillo