Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isn't there a way for out-of-source building manually? #635

Closed
jiapei100 opened this issue Apr 10, 2016 · 10 comments
Closed

Isn't there a way for out-of-source building manually? #635

jiapei100 opened this issue Apr 10, 2016 · 10 comments

Comments

@jiapei100
Copy link

Hi, all:

I followed the installation doc at http://torch.ch/docs/getting-started.html# and almost have torch installed, which is still NOT there.

I prefer the traditional way to git torch7, and then
mkdir build cd build ccmake ../

But, it looks the ONLY way to install torch is just to follow these 3 lines:
git clone https://github.com/torch/distro.git ~/torch --recursive cd ~/torch; bash install-deps; ./install.sh

  1. Since I'm using GCC 5.3.1, I met the error message when I "./install.sh":

CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCStorage.cu

/usr/include/string.h: In function ‘void* mempcpy_inline(void, const void, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at THC_generated_THCBlas.cu.o.cmake:266 (message):
Error generating file
/home/jiapei/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:354: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/usr/include/string.h: In function ‘void* mempcpy_inline(void, const void, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:266 (message):
Error generating file
/home/jiapei/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:216: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
/usr/include/string.h: In function ‘void* mempcpy_inline(void, const void, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at THC_generated_THCHalf.cu.o.cmake:266 (message):
Error generating file
/home/jiapei/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:2119: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
/usr/include/string.h: In function ‘void* mempcpy_inline(void, const void, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at THC_generated_THCStorage.cu.o.cmake:266 (message):
Error generating file
/home/jiapei/torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o

lib/THC/CMakeFiles/THC.dir/build.make:1164: recipe for target 'lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o' failed
make[2]: *** [lib/THC/CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1
CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed
make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Error: Build error: Failed building.

The solution should be here:
http://www.visionopen.com/forums/topic/for-gcc-5-3-1/
add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") at the very front of CMakeLists.txt .

However, it looks like this solution doesn't solve my problem and I still get the above error messages. Any other suggestions?

cheers
Pei

@jiapei100
Copy link
Author

Ok... yes, problem seems to be solved

Add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") to every single CMakeLists.txt .

However, I still leave this issue open, for I still have the following warning:

CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65 (message):
Removing non-existent dependency file: generic/THCTensor.h

Cheers
Pei

@joshxjin
Copy link

Can you explain how/where to changed the line? (ie. where are the CMakeList.txt?)

@swearos
Copy link

swearos commented Apr 23, 2016

add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") at the very front of CMakeLists.txt ,in the root folder where you install

@petamem
Copy link

petamem commented May 13, 2016

@swearos Well, no. What jiapei100 said: " to every single CMakeLists.txt"
Only so it worked.

@noa
Copy link

noa commented May 13, 2016

You can fix the warnings by installing the following package:

https://github.com/hughperkins/FindCUDA

luarocks install findcuda

On Sun, Apr 10, 2016 at 8:30 PM, JIA Pei notifications@github.com wrote:

Ok... yes, problem seems to be solved

Add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") to every
single CMakeLists.txt .

However, I still leave this issue open, for I still have the following
warning:

CMake Warning at /usr/share/cmake-3.5/Modules/FindCUDA/make2cmake.cmake:65
(message):
Removing non-existent dependency file: generic/THCTensor.h

Cheers
Pei


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#635 (comment)

@petamem
Copy link

petamem commented May 14, 2016

luarocks install findcuda

Error: No results matching query were found.

?

@serginator
Copy link

Following what @jiapei100 said, it worked for me in Ubuntu 16.04. I executed this little script in the root of ~/torch folder:

#!/bin/bash
for file in $(find . -name "*CMakeLists.txt" | sed "s|\./||")
do
  echo "trying to fix $file"
  echo 'set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")' | cat - "$file" > temp && mv temp "$file"
done

@soumith
Copy link
Member

soumith commented Jun 4, 2016

this should be fixed now

@soumith soumith closed this as completed Jun 4, 2016
@floringogianu
Copy link

I am still experiencing this issue on Ubuntu 16.04, cuda 7.5 and findcuda installed. I didn't yet move to cuda 8.0 RC as recommended for Ubuntu 16.04 since support in other libraries is missing.

@ShivangiM
Copy link

ShivangiM commented Aug 21, 2016

I am having similar error and still the error persist. I tried to add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES") but in vain.

I am on Mac OS X 10.9.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants