Hi
Scanning dependencies of target luaT
Scanning dependencies of target TH
[ 3%] Building C object lib/luaT/CMakeFiles/luaT.dir/luaT.c.o
[ 6%] Building C object lib/TH/CMakeFiles/TH.dir/THGeneral.c.o
[ 9%] Building C object lib/TH/CMakeFiles/TH.dir/THAllocator.c.o
[ 12%] Linking C shared library libluaT.so
Building C object lib/TH/CMakeFiles/TH.dir/THStorage.c.o
[ 12%] Built target luaT
[ 15%] Building C object lib/TH/CMakeFiles/TH.dir/THTensor.c.o
[ 18%] Building C object lib/TH/CMakeFiles/TH.dir/THBlas.c.o
[ 21%] Building C object lib/TH/CMakeFiles/TH.dir/THLapack.c.o
[ 25%] Building C object lib/TH/CMakeFiles/TH.dir/THLogAdd.c.o
[ 28%] Building C object lib/TH/CMakeFiles/TH.dir/THRandom.c.o
[ 31%] Building C object lib/TH/CMakeFiles/TH.dir/THFile.c.o
[ 34%] Building C object lib/TH/CMakeFiles/TH.dir/THDiskFile.c.o
[ 37%] Building C object lib/TH/CMakeFiles/TH.dir/THMemoryFile.c.o
[ 40%] Building C object lib/TH/CMakeFiles/TH.dir/THAtomic.c.o
[ 43%] Building C object lib/TH/CMakeFiles/TH.dir/THVector.c.o
In file included from /home/sarhad1/torch/pkg/torch/lib/TH/THVector.c:2:0:
/home/sarhad1/torch/pkg/torch/lib/TH/generic/THVectorDispatch.c: In function ‘THByteVector_vectorDispatchInit’:
/home/sarhad1/torch/pkg/torch/lib/TH/generic/simd/simd.h:72:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
/home/sarhad1/torch/pkg/torch/lib/TH/generic/simd/simd.h:72:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
lib/TH/CMakeFiles/TH.dir/build.make:330: recipe for target 'lib/TH/CMakeFiles/TH.dir/THVector.c.o' failed
make[2]: * [lib/TH/CMakeFiles/TH.dir/THVector.c.o] Error 1
make[2]: Waiting for unfinished jobs....
^Clib/TH/CMakeFiles/TH.dir/build.make:123: recipe for target 'lib/TH/CMakeFiles/TH.dir/THTensor.c.o' failed
make[2]: [lib/TH/CMakeFiles/TH.dir/THTensor.c.o] Interrupt
CMakeFiles/Makefile2:129: recipe for target 'lib/TH/CMakeFiles/TH.dir/all' failed
make[1]: [lib/TH/CMakeFiles/TH.dir/all] Interrupt
Makefile:117: recipe for target 'all' failed
make: ** [all] Interrupt
any idea?
@alirezaniki is this on ARM or Intel CPU?
Hi Dear Soumith
the CPU is intel
@alirezaniki Are you trying to build this in some kind of a virtual machine ?
Hi Dear Pavanky
yes im running it on a virtual machine with 1700 mb RAm and 2 cpu`s
@alirezaniki I have experienced issues with cpuid when running inside virtual machines earlier. There may be a way around it, but I am not familiar with it.
@soumith Is there a way to disable just the cpuid functionality in torch? My experience was with arrayfire and I ended up adding an option to disable it for these kinds of situations.
this seems like a compiler / assembler issue, rather than a runtime issue:
/home/sarhad1/torch/pkg/torch/lib/TH/generic/simd/simd.h:72:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
gcc 4.4 and up do pick these up just fine, except on ARM platforms.
The only way to avoid the codepath right now is to declare: __arm__
https://github.com/torch/torch7/blob/8b5d132ee408df55d3ee4f9f3dba2e9844be4ba4/lib/TH/generic/simd/simd.h#L60
This might be the result of -fPIC claiming the ebx register on GCC < 5.
Torch should include cpuid.h and call __get_cpuid() instead, that way older GCC environments will preserve ebx when calling CPUID.
Hi,
I try to install Torch in Ubuntu 32-bit in a VM ware workstation, and i get the same Error,
-- C inline is supported (inline)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/issamef/torch/pkg/torch/build
[ 3%] [ 6%] Built target luaT
Building C object lib/TH/CMakeFiles/TH.dir/THVector.c.o
In file included from /home/issamef/torch/pkg/torch/lib/TH/THVector.c:3:0:
/home/issamef/torch/pkg/torch/lib/TH/generic/THVectorDispatch.c: In function ‘THFloatVector_vectorDispatchInit’:
/home/issamef/torch/pkg/torch/lib/TH/generic/simd/simd.h:108:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
/home/issamef/torch/pkg/torch/lib/TH/generic/simd/simd.h:108:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
make[2]: * [lib/TH/CMakeFiles/TH.dir/THVector.c.o] Error 1
make[1]: [lib/TH/CMakeFiles/TH.dir/all] Error 2
make: ** [all] Error 2
Error: Build error: Failed building.
@soumith Could you please. guide me how to fix this Error !!
@AndressDriss can you please paste the full installation log? I am looking for some lines I added to the log to debug further.
Hi Dear @soumith ,
there is full installation log :
~/torch$ ./install.sh
Prefix set to /home/issamef/torch/install
Installing Lua version: LUAJIT21
Installing common Lua packages
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c src/lfs.c -o src/lfs.o
gcc -shared -o lfs.so -L/home/issamef/torch/install/lib src/lfs.o
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
luafilesystem 1.6.3-1 is now built and installed in /home/issamef/torch/install/ (license: MIT/X11)
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
penlight scm-1 is now built and installed in /home/issamef/torch/install/ (license: MIT/X11)
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c lua_cjson.c -o lua_cjson.o
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c strbuf.c -o strbuf.o
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c fpconv.c -o fpconv.o
gcc -shared -o cjson.so -L/home/issamef/torch/install/lib lua_cjson.o strbuf.o fpconv.o
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
lua-cjson 2.1devel-1 is now built and installed in /home/issamef/torch/install/ (license: MIT)
Installing core Torch packages
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c test.c -o test.o
gcc -shared -o ffi/libtest.so -L/home/issamef/torch/install/lib test.o
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c call.c -o call.o -Idynasm
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c ctype.c -o ctype.o -Idynasm
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c ffi.c -o ffi.o -Idynasm
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c parser.c -o parser.o -Idynasm
gcc -shared -o ffi.so -L/home/issamef/torch/install/lib call.o ctype.o ffi.o parser.o
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
luaffi scm-1 is now built and installed in /home/issamef/torch/install/ (license: BSD)
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c src/autolink.c -o src/autolink.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c src/buffer.c -o src/buffer.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c src/markdown.c -o src/markdown.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c src/stack.c -o src/stack.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c html/houdini_href_e.c -o html/houdini_href_e.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c html/houdini_html_e.c -o html/houdini_html_e.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c html/html.c -o html/html.o -Isrc/ -Ihtml/
gcc -O2 -fPIC -I/home/issamef/torch/install/include -c html/html_smartypants.c -o html/html_smartypants.o -Isrc/ -Ihtml/
gcc -shared -o libsundown.so -L/home/issamef/torch/install/lib src/autolink.o src/buffer.o src/markdown.o src/stack.o html/houdini_href_e.o html/houdini_html_e.o html/html.o html/html_smartypants.o
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
sundown scm-1 is now built and installed in /home/issamef/torch/install/ (license: BSD)
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
cwrap scm-1 is now built and installed in /home/issamef/torch/install/ (license: BSD)
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUALIB= -DLUA_INCDIR="/home/issamef/torch/install/include" -DLUA_LIBDIR="/home/issamef/torch/install/lib" -DLUADIR="/home/issamef/torch/install/lib/luarocks/rocks/paths/scm-1/lua" -DLIBDIR="/home/issamef/torch/install/lib/luarocks/rocks/paths/scm-1/lib" -DCMAKE_INSTALL_PREFIX="/home/issamef/torch/install/lib/luarocks/rocks/paths/scm-1" && make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/issamef/torch/pkg/paths/build
[100%] Built target paths
cd build && make install
[100%] Built target paths
Install the project...
-- Install configuration: "Release"
-- Installing: /home/issamef/torch/install/lib/luarocks/rocks/paths/scm-1/lua/paths/init.lua
-- Installing: /home/issamef/torch/install/lib/luarocks/rocks/paths/scm-1/lib/libpaths.so
Updating manifest for /home/issamef/torch/install/lib/luarocks/rocks
paths scm-1 is now built and installed in /home/issamef/torch/install/ (license: BSD)
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=/home/issamef/torch/install/bin/luajit -DLUALIB= -DLUA_BINDIR="/home/issamef/torch/install/bin" -DLUA_INCDIR="/home/issamef/torch/install/include" -DLUA_LIBDIR="/home/issamef/torch/install/lib" -DLUADIR="/home/issamef/torch/install/lib/luarocks/rocks/torch/scm-1/lua" -DLIBDIR="/home/issamef/torch/install/lib/luarocks/rocks/torch/scm-1/lib" -DCMAKE_INSTALL_PREFIX="/home/issamef/torch/install/lib/luarocks/rocks/torch/scm-1" && make -j$(getconf _NPROCESSORS_ONLN)
-- Compiling with OpenMP support
-- Compiling with OpenMP support
-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- TH_SO_VERSION: 0
-- Atomics: using GCC intrinsics
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m]
-- Library mkl_intel: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m]
-- Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_gf: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m]
-- Library mkl_intel: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [openblas]
-- Library openblas: /opt/OpenBLAS/lib/libopenblas.so
-- Found a library with BLAS API (open).
-- Found a library with LAPACK API. (open)
-- C inline is supported (inline)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/issamef/torch/pkg/torch/build
[ 3%] Built target luaT
[ 6%] Building C object lib/TH/CMakeFiles/TH.dir/THVector.c.o
In file included from /home/issamef/torch/pkg/torch/lib/TH/THVector.c:3:0:
/home/issamef/torch/pkg/torch/lib/TH/generic/THVectorDispatch.c: In function ‘THFloatVector_vectorDispatchInit’:
/home/issamef/torch/pkg/torch/lib/TH/generic/simd/simd.h:108:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
/home/issamef/torch/pkg/torch/lib/TH/generic/simd/simd.h:108:3: error: inconsistent operand constraints in an ‘asm’
asm volatile ( "cpuid\n\t"
^
make[2]: * [lib/TH/CMakeFiles/TH.dir/THVector.c.o] Error 1
make[1]: [lib/TH/CMakeFiles/TH.dir/all] Error 2
make: ** [all] Error 2
Error: Build error: Failed building.
Note that I am in Ubuntu 32-bits Virtual Machine.
Thanks ,
this doesn't look like it's either the latest torch or it is the full logfile.
I am looking for a line like this:
Performing Test HAVE_GCC_GET_CPUID
The problem in my case seemed to be related to my version of gcc, I had to update it to 5.0
This is the source link http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04 and these are the commands they suggested (which I used):
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
Thanks @martincammiteracode , also for me, the problem it was in the gcc version, i fixed it by using the same versions of gcc, g++ and gfortran.
Most helpful comment
The problem in my case seemed to be related to my version of gcc, I had to update it to 5.0
This is the source link http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04 and these are the commands they suggested (which I used):
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5