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

CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE): #36

Closed
ahmedmazari opened this issue Apr 26, 2017 · 6 comments
Closed

CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE): #36

ahmedmazari opened this issue Apr 26, 2017 · 6 comments

Comments

@ahmedmazari
Copy link

ahmedmazari commented Apr 26, 2017

Hello,
My error is related to line 48 from this file code https://github.com/SeanNaren/warp-ctc/blob/pytorch_bindings/CMakeLists.txt

After installing pytorch corrctly. l want to install the Fast parallel CTC https://github.com/SeanNaren/warp-ctc
l started installing as follow :

git clone https://github.com/baidu-research/warp-ctc.git
cd warp-ctc
mkdir build
cd build

then l stacked at the (cmake command)

cmake ../

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "8.0", minimum required is "6.5") 
-- cuda found TRUE
_**CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE):
  By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Torch", but
  CMake did not find one.

  Could not find a package configuration file provided by "Torch" with any of
  the following names:

    TorchConfig.cmake
    torch-config.cmake

  Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
  "Torch_DIR" to a directory containing one of the above files.  If "Torch"
  provides a separate development package or SDK, be sure it has been
  installed.**_


-- Torch found Torch_DIR-NOTFOUND
-- Building shared library with GPU support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ahmed/Downloads/warp-ctc/build

l don't understand the error :

**"_CMake Warning at CMakeLists.txt:48 (FIND_PACKAGE):
By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Torch", but
CMake did not find one.

Could not find a package configuration file provided by "Torch" with any of
the following names:

TorchConfig.cmake
torch-config.cmake

Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
"Torch_DIR" to a directory containing one of the above files. If "Torch"
provides a separate development package or SDK, be sure it has been
installed.
"**

@zhanghang1989
Copy link

Hi @ahmedmazari , have you solved this problem? Thanks!

@ahmedmazari-dhatim
Copy link

@zhanghang1989 , Yes l did. Let me know if you still encounter the same problem to post the steps that allowed me to solve the problem

@zhanghang1989
Copy link

Thanks @ahmedmazari ! I did a hacky way by manually set the path. Let me know if there is a better solution! Thanks again

set(TORCH_BUILD_DIR "/anaconda/lib/python3.6/site-packages/torch/lib")

# Find the include files
set(TORCH_TH_INCLUDE_DIR "${TORCH_BUILD_DIR}/include/TH")
set(TORCH_THC_INCLUDE_DIR "${TORCH_BUILD_DIR}/include/THC")
set(TORCH_THC_UTILS_INCLUDE_DIR "$ENV{HOME}/pytorch/torch/lib/THC")

set(Torch_INSTALL_INCLUDE "${TORCH_BUILD_DIR}/include" ${TORCH_TH_INCLUDE_DIR} ${TORCH_THC_INCLUDE_DIR} ${TORCH_THC_UTILS_INCLUDE_DIR})

# Find the libs. We need to find libraries one by one.
set(TORCH_LIB_HINTS "${TORCH_BUILD_DIR}" "/usr/local/lib" "/root/torch/install/lib")
find_library(THC_LIBRARIES NAMES THC THC.1 PATHS ${TORCH_BUILD_DIR} PATH_SUFFIXES lib)
find_library(TH_LIBRARIES NAMES TH TH.1 PATHS ${TORCH_BUILD_DIR} PATH_SUFFIXES lib)

@ahmedmazari-dhatim
Copy link

Hi @zhanghang1989 , you're welcome
The problem is related to cuda and cudnn . you have to update first torch then install cudnn.
Before :
be sure that you have gcc 4.9 or 4.8 installed
Do the following :

luarocks install torch
luarocks install nn
luarocks install cutorch
luarocks install cunn

If doesn't work downgrade your gcc to 4.9 and try again .

Please et me know if it works

@ZmeiGorynych
Copy link

I ran into the same issue, none of the above suggestions worked, but I could fix it by installing both pytorch AND torch (the latter from from http://torch.ch/docs/getting-started.html) from source, then installing warp-ctc as per the instructions at https://github.com/SeanNaren/warp-ctc

@chrjxj
Copy link

chrjxj commented Jan 28, 2019

Got the same issue.

Solution: export Torch_DIR as env variable before cmake

e.g. i am using python virtual env on linux, and installed pytorch using 'pip'.

export Torch_DIR=/home/my/pyenv/py3.7-torch1.0/lib/python3.7/site-packages/torch/share/cmake/Torch

cmake blablabla
make

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

5 participants