OpenNMT / CTranslate

Lightweight C++ translator for OpenNMT Torch models (deprecated)
https://opennmt.net/
MIT License
79 stars 50 forks source link

cmake -DEIGEN3_ROOT hint doesn't work if eigen3 exists in /usr/include #25

Closed NickRuiz closed 7 years ago

NickRuiz commented 7 years ago

I tried to install CTranslate with a different path to eigen3. Setting EIGEN3_ROOT as a hint doesn't work if /usr/include/eigen3 exists.

I already had eigen3 2.5.7 installed in /usr/include/eigen3.

/n/w10-nruiz/nmt/CTranslate/build$ cmake3 -DEIGEN3_ROOT=/usr/local/include/eigen3 ..
-- Build type: Release
-- Boost version: 1.59.0
-- Found the following Boost libraries:
-- program_options
-- Eigen3 version 3.2.5 found in /usr/include/eigen3, but at least version 3.3 is required
-- Could NOT find MKL (missing: MKL_INCLUDE_DIR MKL_INTEL_LP64_LIBRARY MKL_GF_LP64_LIBRARY MKL_GNU_THREAD_LIBRARY MKL_CORE_LIBRARY)
-- Boost version: 1.59.0
-- Found the following Boost libraries:
-- program_options
-- Configuring done
-- Generating done
-- Build files have been written to: /n/w10-nruiz/nmt/CTranslate/build

Explicitly setting EIGEN3_INCLUDE_DIR worked, instead.

$ cmake3 -DEIGEN3_INCLUDE_DIR=/usr/local/include/eigen3 ..

It seems like the other hints were overwritten because a version of eigen3 was found in /usr/include.

Please fix and update readme.md to correct this information.

guillaumekln commented 7 years ago

I agree it is not a good behavior. The commit above disables the system-wide search when EIGEN3_ROOT (or EIGEN_ROOT) is set.