opencog / cogutil

Very low-level C++ programming utilities used by several components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Building Cogutils on OS X 10.10.5

dbl001 opened this issue · comments

commented

David-Laxers-MacBook-Pro:cogutils davidlaxer$ mkdir build
David-Laxers-MacBook-Pro:cogutils davidlaxer$ cd build
David-Laxers-MacBook-Pro:build davidlaxer$ cmake ..
-- The C compiler identification is AppleClang 6.1.0.6020053
-- The CXX compiler identification is AppleClang 6.1.0.6020053
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type: Release
-- Looking for include file bfd.h
-- Looking for include file bfd.h - not found
-- BFD not found
-- Binutils-dev missing: No pretty stack-trace printing.
-- Boost version: 1.59.0
-- Found the following Boost libraries:
-- date_time
-- filesystem
-- program_options
-- regex
-- serialization
-- system
-- thread
-- Boost version 105900 found.
-- Found PythonInterp: /users/davidlaxer/anaconda/bin/python (found version "2.7.10")
-- Looking for include file libiberty.h
-- Looking for include file libiberty.h - not found
-- IBERTY not found
-- Libiberty-dev missing: No pretty stack-trace printing.
CMake Warning (dev) at CMakeLists.txt:271 (ADD_CUSTOM_TARGET):
Policy CMP0037 is not set: Target names should not be reserved and should
match a validity pattern. Run "cmake --help-policy CMP0037" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.

The target name "test" is reserved or not valid for certain CMake features,
such as generator expressions, and may result in undefined behavior.
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found Doxygen: /opt/local/bin/doxygen (found version "1.8.9.1")

The following components will be built:

Doxygen - Code documentation.
Unit tests - Unit tests.
Util - General utility library.

The following components WILL NOT be built:

StackPrint - Pretty printing of stack traces.

-- Configuring done
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

MACOSX_RPATH is not specified for the following targets:

cogutil

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /Users/davidlaxer/cogutils/build
David-Laxers-MacBook-Pro:build davidlaxer$ make
Scanning dependencies of target cogutil
[ 4%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/ansi.cc.o
[ 8%] Building C object opencog/util/CMakeFiles/cogutil.dir/backtrace-symbols.c.o
[ 13%] Building C object opencog/util/CMakeFiles/cogutil.dir/cluster.c.o
[ 17%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/Config.cc.o
[ 21%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/exceptions.cc.o
In file included from /Users/davidlaxer/cogutils/opencog/util/exceptions.cc:35:
In file included from /Users/davidlaxer/cogutils/opencog/util/Logger.h:36:
/Users/davidlaxer/cogutils/opencog/util/concurrent_queue.h:53:49: warning:
deleted function definitions are a C++11 extension [-Wc++11-extensions]
concurrent_queue(const concurrent_queue&) = delete; // disable copying
^
/Users/davidlaxer/cogutils/opencog/util/concurrent_queue.h:54:60: warning:
deleted function definitions are a C++11 extension [-Wc++11-extensions]
concurrent_queue& operator=(const concurrent_queue&) = delete; // no assign
^
/Users/davidlaxer/cogutils/opencog/util/concurrent_queue.h:72:22: warning:
rvalue references are a C++11 extension [-Wc++11-extensions]
void push(Element&& item)
^
3 warnings generated.
[ 26%] Building CXX object opencog/util/CMakeFiles/cogutil.dir/files.cc.o
/Users/davidlaxer/cogutils/opencog/util/files.cc:55:39: error: non-aggregate
type 'const std::vectorstd::string' cannot be initialized with an
initializer list
static const std::vectorstd::string paths =
^
1 error generated.
make[2]: *** [opencog/util/CMakeFiles/cogutil.dir/files.cc.o] Error 1
make[1]: *** [opencog/util/CMakeFiles/cogutil.dir/all] Error 2
make: *** [all] Error 2
David-Laxers-MacBook-Pro:build davidlaxer$

Based on the warnings and error, I'm guessing you need to get a more modern compiler. Significant parts of opencog assume the c++11 standard from 2011, and parts of it might even be using the 2014 standard, not sure.

Since the compiler is clang, and clang is fairly up-to-date, I'm guessing that maybe you need to either specify some extra compiler flag to clang, or you simply have an old version of clang (llvm)

There some apple stuff here:
https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L64
but that assumes GCC:
https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L57

so I guess a IF(COMPILER is CLANG) stanzas are needed.

commented

So, perhaps ‘clang -3.7’?

David-Laxers-MacBook-Pro:~ davidlaxer$ clang --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

David-Laxers-MacBook-Pro:~ davidlaxer$ port search clang
Bear @2.0.3 (devel)
Bear is a tool to generate compilation database for clang tooling.

clang-2.9 @2.9_15 (lang)
this port is only a stub and has been made obsolete by clang-3.4

clang-3.0 @3.0_14 (lang)
this port is only a stub and has been made obsolete by clang-3.4

clang-3.1 @3.1_9 (lang)
this port is only a stub and has been made obsolete by clang-3.4

clang-3.2 @3.2_4 (lang)
this port is only a stub and has been made obsolete by clang-3.4

clang-3.3 @3.3_8 (lang)
C, C++, Objective C and Objective C++ compiler

clang-3.4 @3.4.2_9 (lang)
C, C++, Objective C and Objective C++ compiler

clang-3.5 @3.5.2_6 (lang)
C, C++, Objective C and Objective C++ compiler

clang-3.6 @3.6.1_2 (lang)
C, C++, Objective C and Objective C++ compiler

clang-3.7 @3.7-r245076_1 (lang)
C, C++, Objective C and Objective C++ compiler

clang-3.8 @3.8-r245076_1 (lang)
C, C++, Objective C and Objective C++ compiler

clang_select @1.0 (sysutils)
common files for selecting default clang version

mpich-clang @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-clang33 @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-clang34 @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-clang35 @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-clang36 @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-clang37 @3.1.4_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang33 @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang34 @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang35 @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang36 @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

mpich-devel-clang37 @3.2b3_1 (science, parallel, net)
Message Passing Interface (MPI) Library

openmpi-clang @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-clang33 @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-clang34 @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-clang35 @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-clang36 @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-clang37 @1.7.5_5 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang33 @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang34 @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang35 @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang36 @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

openmpi-devel-clang37 @1.9a1_34660 (science, parallel, net)
A High Performance Message Passing Library

Found 36 ports.
David-Laxers-MacBook-Pro:~ davidlaxer$

On Aug 31, 2015, at 12:09 PM, Linas Vepštas notifications@github.com wrote:

Based on the warnings and error, I'm guessing you need to get a more modern compiler. Significant parts of opencog assume the c++11 standard from 2011, and parts of it might even be used the 2014 standard, not sure.

Since the compiler is clang, and clang is fairly up-to-date, I'm guessing that maybe you need to either specify some extra compiler flag to clang, or you simply have an old version of clang (llvm)

There some apple stuff here:
https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L64 https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L64
but that assumes GCC:
https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L57 https://github.com/opencog/cogutils/blob/master/CMakeLists.txt#L57
so I guess a IF(COMPILER is CLANG) stanzas are needed.


Reply to this email directly or view it on GitHub #18 (comment).

Is this now resolved?

If it is resolved, can you please supply an update to the docs/README.osx file that explains all the magic incantations that are needed?

This may be relevant: I am adding clang to the cmake file as I noticed that there is no such condition in cogutils. It will be part of the fix for #32

For now it appears that only gcc has been specified for cogutils.

Additionally the compiler flags were set to c++0x and not c++11, which will be included in the pull request

Closing, I assume that this is fixed.