Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

make failed on ubuntu 16.04 #193

Open
Harsha5524 opened this issue Jan 27, 2019 · 8 comments
Open

make failed on ubuntu 16.04 #193

Harsha5524 opened this issue Jan 27, 2019 · 8 comments

Comments

@Harsha5524
Copy link

~/ELL/build$ make
[ 0%] Built target documentation
[ 0%] Building CXX object libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o
In file included from /home/kharsha/ELL/libraries/utilities/include/TypeName.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:13,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:106:17: error: ‘is_pointer_v’ in namespace ‘std’ does not name a type
std::is_pointer_v>T<<
^~~~~~~~~~~~
In file included from /usr/include/c++/8/bits/move.h:55,
from /usr/include/c++/8/bits/nested_exception.h:40,
from /usr/include/c++/8/exception:144,
from /home/kharsha/ELL/libraries/utilities/include/Exception.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Debug.h:10,
from /home/kharsha/ELL/libraries/utilities/include/TypeFactory.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:12,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/usr/include/c++/8/type_traits:2742:25: note: ‘template constexpr const bool std::is_pointer_v<_Tp>’ declared here
inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
^~~~~~~~~~~~
In file included from /home/kharsha/ELL/libraries/utilities/include/TypeName.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:13,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:115:34: error: expected identifier before ‘<’ token
struct RemoveAllPointers < T;
^
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:115:34: error: expected unqualified-id before ‘<’ token
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:116:9: error: expected unqualified-id before ‘false’
false >
^~~~~
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:125:66: error: expected identifier before ‘<’ token
using RemoveAllPointersT = typename detail::RemoveAllPointers::Type;
^
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:129:72: error: expected unqualified-id before ‘<’ token
inline constexpr size_t CountOfPointers = detail::RemoveAllPointers::NumPointers;
^

/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:129:74: error: expected primary-expression before ‘>’ token
nline constexpr size_t CountOfPointers = detail::RemoveAllPointers::NumPointers;
^

/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:129:77: error: ‘::NumPointers’ has not been declared
ne constexpr size_t CountOfPointers = detail::RemoveAllPointers::NumPointers;
^~~~~~~~~~~

/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:129:77: note: suggested alternative: ‘CountOfPointers’
ne constexpr size_t CountOfPointers = detail::RemoveAllPointers::NumPointers;
^~~~~~~~~~~
CountOfPointers
libraries/utilities/CMakeFiles/utilities.dir/build.make:62: recipe for target 'libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o' failed
make[2]: *** [libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o] Error 1
CMakeFiles/Makefile2:2201: recipe for target 'libraries/utilities/CMakeFiles/utilities.dir/all' failed
make[1]: *** [libraries/utilities/CMakeFiles/utilities.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

@lovettchris
Copy link
Member

Can you include the output of your "cmake .." command line ?

@Harsha5524
Copy link
Author

~/ELL/build$ cmake ..
-- Configuring tests to use TEST_MODELS_REPO at: https://github.com/Microsoft/ell-test-models
-- PYTHONINTERP_FOUND=TRUE
-- PYTHON_EXECUTABLE=/home/kharsha/miniconda3/bin/python3.7
-- PYTHON_VERSION_STRING=3.7.1
-- PYTHON_VERSION_MAJOR=3
-- PYTHONLIBS_FOUND=TRUE
-- PYTHON_LIBRARIES=/home/kharsha/miniconda3/lib/libpython3.7m.so
-- PYTHON_INCLUDE_PATH=/home/kharsha/miniconda3/include/python3.7m
-- PYTHON_INCLUDE_DIRS=/home/kharsha/miniconda3/include/python3.7m
-- PYTHON_DEBUG_LIBRARIES=
-- PYTHONLIBS_VERSION_STRING=3.7.1
-- Blas libraries: /usr/lib/libopenblas.so
-- Blas linker flags:
-- Blas include directories: /usr/include
-- Blas Vendor: OpenBLAS
-- Using BLAS include path: /usr/include
-- Using BLAS library: /usr/lib/libopenblas.so
-- Using BLAS DLLs:
-- Found LLVM 6.0.0
-- Using LLVMConfig.cmake in: /usr/lib/llvm-6.0/cmake
-- Found SWIG_EXECUTABLE=/usr/local/bin/swig
-- Creating wrappers for python
CMake Deprecation Warning at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:524 (message):
SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)

CMake Warning (dev) at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:564 (message):
Policy CMP0078 is not set. Run "cmake --help-policy CMP0078" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Call Stack (most recent call first):
/usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:525 (swig_add_library)
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Creating wrappers for javascript
-- Creating wrappers for xml
-- Writing: /home/kharsha/ELL/build/config.json
-- Configuring done
CMake Warning at tools/utilities/debugCompiler/CMakeLists.txt:29 (add_executable):
Cannot generate a safe runtime search path for target debugCompiler because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.

CMake Warning at tools/utilities/profile/CMakeLists.txt:27 (add_executable):
Cannot generate a safe runtime search path for target profile because files
in some directories may conflict with libraries in implicit directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.

CMake Warning at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:665 (add_library):
Cannot generate a safe runtime search path for target _ELL_python because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
/usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:525 (swig_add_library)
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)

-- Generating done
-- Build files have been written to: /home/kharsha/ELL/build

@lovettchris
Copy link
Member

Sorry can you delete your build folder and do it again, I'm curious what C and C++ compiler versions it is finding (which is not reported the second time you run cmake). I'm looking for output like this:

-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 7.3.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

which shows my C and C++ compiler versions are mismatched. One is 7 and the other is 8. And I will get compiler errors as a result. But if I run this:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-8

then everything compiles without errors.

@Harsha5524
Copy link
Author

Sorry can you delete your build folder and do it again, I'm curious what C and C++ compiler versions it is finding (which is not reported the second time you run cmake). I'm looking for output like this:

-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 7.3.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

which shows my C and C++ compiler versions are mismatched. One is 7 and the other is 8. And I will get compiler errors as a result. But if I run this:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-8

then everything compiles without errors.

After re build my folder cmake output like this
~/ELL/build$ cmake ..
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.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
-- Configuring tests to use TEST_MODELS_REPO at: https://github.com/Microsoft/ell-test-models
-- PYTHONINTERP_FOUND=TRUE
-- PYTHON_EXECUTABLE=/home/kharsha/miniconda3/bin/python3.7
-- PYTHON_VERSION_STRING=3.7.1
-- PYTHON_VERSION_MAJOR=3
-- PYTHONLIBS_FOUND=TRUE
-- PYTHON_LIBRARIES=/home/kharsha/miniconda3/lib/libpython3.7m.so
-- PYTHON_INCLUDE_PATH=/home/kharsha/miniconda3/include/python3.7m
-- PYTHON_INCLUDE_DIRS=/home/kharsha/miniconda3/include/python3.7m
-- PYTHON_DEBUG_LIBRARIES=
-- PYTHONLIBS_VERSION_STRING=3.7.1
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Blas libraries: /usr/lib/libopenblas.so
-- Blas linker flags:
-- Blas include directories:
-- Blas Vendor: OpenBLAS
-- Using BLAS include path: /usr/include
-- Using BLAS library: /usr/lib/libopenblas.so
-- Using BLAS DLLs:
-- Found LLVM 6.0.0
-- Using LLVMConfig.cmake in: /usr/lib/llvm-6.0/cmake
-- Found SWIG: /usr/local/bin/swig (found suitable version "3.0.12", minimum required is "3.0.12")
-- Found SWIG_EXECUTABLE=/usr/local/bin/swig
-- Creating wrappers for python
CMake Deprecation Warning at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:524 (message):
SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)

CMake Warning (dev) at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:564 (message):
Policy CMP0078 is not set. Run "cmake --help-policy CMP0078" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Call Stack (most recent call first):
/usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:525 (swig_add_library)
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Creating wrappers for javascript
-- Creating wrappers for xml
-- Writing: /home/kharsha/ELL/build/config.json
-- Configuring done
CMake Warning at tools/utilities/debugCompiler/CMakeLists.txt:29 (add_executable):
Cannot generate a safe runtime search path for target debugCompiler because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.

CMake Warning at tools/utilities/profile/CMakeLists.txt:27 (add_executable):
Cannot generate a safe runtime search path for target profile because files
in some directories may conflict with libraries in implicit directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.

CMake Warning at /usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:665 (add_library):
Cannot generate a safe runtime search path for target _ELL_python because
files in some directories may conflict with libraries in implicit
directories:

runtime library [libffi.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
  /home/kharsha/miniconda3/lib

Some of these libraries may not be found correctly.
Call Stack (most recent call first):
/usr/local/share/cmake-3.13/Modules/UseSWIG.cmake:525 (swig_add_library)
CMake/CommonInterfaces.cmake:129 (swig_add_module)
CMake/CommonInterfaces.cmake:160 (generate_interface_module)
interfaces/python/CMakeLists.txt:21 (generate_interface)

-- Generating done
-- Build files have been written to: /home/kharsha/ELL/build

@Harsha5524
Copy link
Author

And still I am facing this errors..............
(py36) kharsha@kharsha:~/ELL/build$ make
[ 0%] Built target documentation
[ 0%] Building CXX object libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o
In file included from /home/kharsha/ELL/libraries/utilities/include/TypeName.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:13,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:106:17: error: ‘is_pointer_v’ in namespace ‘std’ does not name a type
std::is_pointer_v>T<<
^~~~~~~~~~~~
In file included from /usr/include/c++/8/bits/move.h:55,
from /usr/include/c++/8/bits/nested_exception.h:40,
from /usr/include/c++/8/exception:144,
from /home/kharsha/ELL/libraries/utilities/include/Exception.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Debug.h:10,
from /home/kharsha/ELL/libraries/utilities/include/TypeFactory.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:12,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/usr/include/c++/8/type_traits:2742:25: note: ‘template constexpr const bool std::is_pointer_v<_Tp>’ declared here
inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
^~~~~~~~~~~~
In file included from /home/kharsha/ELL/libraries/utilities/include/TypeName.h:11,
from /home/kharsha/ELL/libraries/utilities/include/Archiver.h:13,
from /home/kharsha/ELL/libraries/utilities/src/Archiver.cpp:9:
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:115:16: error: ‘RemoveAllPointers’ is not a class template
struct RemoveAllPointers < T;
^~~~~~~~~~~~~~~~~
/home/kharsha/ELL/libraries/utilities/include/TypeTraits.h:116:9: error: expected unqualified-id before ‘false’
false >
^~~~~
libraries/utilities/CMakeFiles/utilities.dir/build.make:62: recipe for target 'libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o' failed
make[2]: *** [libraries/utilities/CMakeFiles/utilities.dir/src/Archiver.cpp.o] Error 1
CMakeFiles/Makefile2:2201: recipe for target 'libraries/utilities/CMakeFiles/utilities.dir/all' failed
make[1]: *** [libraries/utilities/CMakeFiles/utilities.dir/all] Error 2
Makefile:94: recipe for target 'all' failed
make: *** [all] Error 2

@lovettchris
Copy link
Member

I just ran our full setup instructions on fresh Ubuntu 18 machine I got a newer compiler:

-- The C compiler identification is GNU 8.2.0
-- The CXX compiler identification is GNU 8.2.0

is this not available on Ubuntu 16 when you use this:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get -y update
sudo apt-get install -y gcc-8 g++-8 

@Harsha5524
Copy link
Author

Thanks for support.......
Upgraded to 18.04 it is successfully build.........

@mrohera
Copy link

mrohera commented Feb 4, 2019

With multiple GCC version installed on my machine, I used update-alternatives to pin to GCC 8.2. Perhaps these instructions are useful to others running into similar issues:

sudo update-alternatives --config gcc // check if any GCC versions already registered
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 8 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7 --slave /usr/bin/g++ g++ /usr/bin/g++-7
sudo update-alternatives --config gcc  // I ensured that 8.2 was auto

Props to an excellent write up on the topic: http://charette.no-ip.com:81/programming/2011-12-24_GCCv47/

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

No branches or pull requests

3 participants