I installed torch and then I try the code on train-a-digit-classifier demo.
It works well when using the SGD optimization technique; however, I get the following error when I switch to apply the LBFGS optimization technique.
<trainer> online epoch # 1 [batchSize = 100]
/home/nate/torch/install/bin/luajit: gels : Lapack library not found in compile time
at /home/nate/torch/pkg/torch/lib/TH/generic/THLapack.c:79
stack traceback:
[C]: at 0x7fa7b2f73a20
[C]: in function 'gels'
/home/nate/torch/install/share/lua/5.1/optim/polyinterp.lua:172: in function 'polyinterp'
/home/nate/torch/install/share/lua/5.1/optim/lswolfe.lua:89: in function 'lineSearch'
/home/nate/torch/install/share/lua/5.1/optim/lbfgs.lua:202: in function 'lbfgs'
train-on-mnist.lua:255: in function 'train'
train-on-mnist.lua:357: in main chunk
[C]: in function 'dofile'
...nate/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50
gels : Lapack library not found in compile time
Then I tried a lot ways to solve it, such as
install the OpenBLAS
git clone https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make NO_AFFINITY=1 USE_OPENMP=1
sudo make install
and then
CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH luarocks install torch
However, it still does not work.
I also reinstall the torch again, but still doesnot work.
How do I fix it?
I'm on a Ubuntu 16.04.
I need your help,thanks~
I met the same problem when used torch.inverse().
I have installed the openBlas as said in issue 174, but it does not work me either.
There is a link in google group saying it has something to do with google chrome. Though I am doubtful, but my chrome does not function well after I installed the openblas.
And if you see the THLapck.c, the error stems from undefined marco USE_LAPACK. So we may need to find it somewhere, or do something else.
I am also waiting for someone's help.
Hi, it turns out it is my problem. I did not run 'CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH luarocks install torch' properly.
After having done so, my torch is able to find openblas.
I came across the same problem, and finally it worked with both gcc and fortran compiler. On a CentOS7 the installing is successful.
```$sudo yum install gcc-gfortran
$cd OpenBLAS/
$make clean
$make CC=gcc FC=gfortran USE_OPENMP=1 NUM_THREADS=8 NO_AFFINITY=1
$sudo make install
$export CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH
$luarocks build torch-scm-1.rockspec
```
FYI.
Most helpful comment
Hi, it turns out it is my problem. I did not run 'CMAKE_LIBRARY_PATH=/opt/OpenBLAS/include:/opt/OpenBLAS/lib:$CMAKE_LIBRARY_PATH luarocks install torch' properly.
After having done so, my torch is able to find openblas.