torch / torch7

http://torch.ch
Other
8.98k stars 2.38k forks source link

Compiling torch fails on Jetson TX1 with JetPack 2.3 filesystem #891

Open ZahlGraf opened 7 years ago

ZahlGraf commented 7 years ago

Hi and happy new Year!

I tried today to install torch after flashing my Jetson TX1 with a fresh filesystem provided by JetPack 2.3. I run into an issue, that in the file ~/torch/pkg/torch/lib/TH/generic/simd/simd.h the define __NEON__ exists, but not __arm__.

The __arm__ define is also not set automatically by the compiler.

This leads to an issue, where it tries to compile the functions for x86. I simply added #define __arm__ to this file and that worked for me. Does CMake defines __arm__ normally?

Maybe there is any relation to this issue: #766

ZahlGraf commented 7 years ago

This was the original error (for google):

Install the project...
-- Install configuration: "Release"
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/paths/scm-1/lua/paths/init.lua
-- Installing: /home/ubuntu/torch/install/lib/luarocks/rocks/paths/scm-1/lib/libpaths.so
Updating manifest for /home/ubuntu/torch/install/lib/luarocks/rocks
paths scm-1 is now built and installed in /home/ubuntu/torch/install/ (license: BSD)
Warning: unmatched variable LUALIB
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=/home/ubuntu/torch/install/bin/luajit -DLUALIB= -DLUA_BINDIR="/home/ubuntu/torch/install/bin" -DLUA_INCDIR="/home/ubuntu/torch/install/include" -DLUA_LIBDIR="/home/ubuntu/torch/install/lib" -DLUADIR="/home/ubuntu/torch/install/lib/luarocks/rocks/torch/scm-1/lua" -DLIBDIR="/home/ubuntu/torch/install/lib/luarocks/rocks/torch/scm-1/lib" -DCMAKE_INSTALL_PREFIX="/home/ubuntu/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 on this machine.
-- No OMAP4 processor on this on this machine.
-- asimd/Neon found with compiler flag : -D__NEON__
-- TH_SO_VERSION: 0
-- Atomics: using GCC intrinsics
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - pthread - m]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - pthread - m]
--   Library mkl_gf_lp64: 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_lp64 - mkl_gnu_thread - mkl_core - pthread - m]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m]
--   Library mkl_intel_lp64: 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_lp64 - mkl_sequential - mkl_core - m]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - pthread - m]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - pthread - m]
--   Library mkl_gf_lp64: 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_lp64 - mkl_gnu_thread - mkl_core - pthread - m]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m]
--   Library mkl_intel_lp64: 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/ubuntu/torch/pkg/torch/build
[  6%] Built target luaT
[  9%] Building C object lib/TH/CMakeFiles/TH.dir/THVector.c.o
In file included from /home/ubuntu/torch/pkg/torch/lib/TH/THVector.c:3:0:
/home/ubuntu/torch/pkg/torch/lib/TH/generic/simd/simd.h: In function ‘detectHostSIMDExtensions’:
/home/ubuntu/torch/pkg/torch/lib/TH/generic/simd/simd.h:125:21: error: ‘SIMDExtension_AVX2’ undeclared (first use in this function)
     hostSimdExts |= SIMDExtension_AVX2;
                     ^
/home/ubuntu/torch/pkg/torch/lib/TH/generic/simd/simd.h:125:21: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/torch/pkg/torch/lib/TH/generic/simd/simd.h:130:21: error: ‘SIMDExtension_AVX’ undeclared (first use in this function)
     hostSimdExts |= SIMDExtension_AVX;
                     ^
/home/ubuntu/torch/pkg/torch/lib/TH/generic/simd/simd.h:132:21: error: ‘SIMDExtension_SSE’ undeclared (first use in this function)
     hostSimdExts |= SIMDExtension_SSE;
                     ^
lib/TH/CMakeFiles/TH.dir/build.make:374: recipe for target 'lib/TH/CMakeFiles/TH.dir/THVector.c.o' failed
make[2]: *** [lib/TH/CMakeFiles/TH.dir/THVector.c.o] Error 1
CMakeFiles/Makefile2:144: recipe for target 'lib/TH/CMakeFiles/TH.dir/all' failed
make[1]: *** [lib/TH/CMakeFiles/TH.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.