CMA-ES / libcmaes

libcmaes is a multithreaded C++11 library with Python bindings for high performance blackbox stochastic optimization using the CMA-ES algorithm for Covariance Matrix Adaptation Evolution Strategy
Other
315 stars 79 forks source link

cmake error on ubuntu16.04 #212

Closed mudiandian closed 3 years ago

mudiandian commented 3 years ago

When I used cmake to compile in ubuntu16.04, the following error occurred:

~/libcmaes/build$ cmake .. -DCMAKE_INSTALL_PREFIX=~/.local/

-- 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 dlfcn.h -- Looking for dlfcn.h - found -- Looking for unistd.h -- Looking for unistd.h - found -- Looking for string.h -- Looking for string.h - found -- Looking for strings.h -- Looking for strings.h - found -- Looking for inttypes.h -- Looking for inttypes.h - found -- Looking for memory.h -- Looking for memory.h - found -- Looking for stdlib.h -- Looking for stdlib.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Found Eigen3: /usr/include/eigen3 (Required is at least version "3.0.0") -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Found OpenMP: -fopenmp
-- 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 PythonInterp: /usr/bin/python (found version "2.7.12") -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found version "2.7.12") CMake Error at CMakeLists.txt:82 (target_include_directories): target_include_directories called with non-compilable target type

-- Found NumPy: /usr/lib/python2.7/dist-packages/numpy/core/include (found version "1.11.0") CMake Error at cmake/FindNumPy.cmake:70 (target_include_directories): Cannot specify include directories for imported target "Python::NumPy". Call Stack (most recent call first): CMakeLists.txt:87 (find_package)

-- Looking for component python-py27 CMake Error at CMakeLists.txt:138 (target_include_directories): target_include_directories called with non-compilable target type

-- Found boost-python: /usr/lib/x86_64-linux-gnu/libboost_python-py27.so -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Configuring incomplete, errors occurred! See also "/home/ycj/libcmaes/build/CMakeFiles/CMakeOutput.log". See also "/home/ycj/libcmaes/build/CMakeFiles/CMakeError.log".

beniz commented 3 years ago

Hi, I believe this error is due to https://gitlab.kitware.com/cmake/cmake/-/issues/19434, and it seems to require cmake 3.16. Since we don't want a dependency to a specific version of cmake, see this PR #213 that should fix the issue.

Alternatively if it is simpler at this stage until the PR gets merged, you can use via the autogen.sh path.