Commit a89c33b4 authored by Scott Cyphers's avatar Scott Cyphers Committed by GitHub

Merge pull request #75 from NervanaSystems/bob/relax_requirements

Bob/relax requirements
parents 6a4225c0 ed84369d
...@@ -11,41 +11,14 @@ ...@@ -11,41 +11,14 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# We require version 3.5.1 only because that's the lowest version of CMake on which cmake_minimum_required (VERSION 2.8)
# we've validate this repository.
cmake_minimum_required (VERSION 3.5.1)
# Suppress an OS X-specific warning. # Suppress an OS X-specific warning.
if (POLICY CMP0042) if (POLICY CMP0042)
cmake_policy(SET CMP0042 OLD) cmake_policy(SET CMP0042 OLD)
endif() endif()
if ("${CMAKE_CXX_COMPILER}" STREQUAL "") project (ngraph)
# The user didn't indicate a compiler preference, to pick the compiler based on
# the personal preferences and convenience of the project's developers...
find_program(
CXX_COMPILER
NAMES
clang++-4.0
clang++-3.9
clang++
c++
NAMES_PER_DIR
DOC "Which C++ compiler to use when building `libngraph` and the tests."
)
if ("${CXX_COMPILER}" STREQUAL "CXX_COMPILER-NOTFOUND")
message(FATAL_ERROR "Unable to find a suitable c++ compiler.")
else()
message(STATUS "Using C++ compiler: '${CXX_COMPILER}'")
set(CMAKE_CXX_COMPILER "${CXX_COMPILER}")
endif()
endif()
project (ngraph
LANGUAGES CXX
VERSION 0.1
)
# These variables are undocumented but useful. # These variables are undocumented but useful.
set(CMAKE_DISABLE_SOURCE_CHANGES ON) set(CMAKE_DISABLE_SOURCE_CHANGES ON)
...@@ -63,10 +36,8 @@ set(NGRAPH_CXX_WARNING_FLAGS "") ...@@ -63,10 +36,8 @@ set(NGRAPH_CXX_WARNING_FLAGS "")
# Compiler-specific logic... # Compiler-specific logic...
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(Apple)?Clang$") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(Apple)?Clang$")
message("using project warning flags") message("setting clang flags...")
include( cmake/clang_4_0_flags.cmake ) include( cmake/clang_4_0_flags.cmake )
else()
message(WARNING "CMAKE_CXX_COMPILER_ID='${CMAKE_CXX_COMPILER_ID}'. CMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}'. The only supported compiler is 'clang', but the selected compiler is '${CMAKE_CXX_COMPILER}'.")
endif() endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
......
...@@ -18,7 +18,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override") ...@@ -18,7 +18,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=inconsistent-missing-override")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++98-compat-pedantic")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-weak-vtables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-global-constructors")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch-enum")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
......
...@@ -39,21 +39,24 @@ bool ngraph::Node::is_parameter() const ...@@ -39,21 +39,24 @@ bool ngraph::Node::is_parameter() const
return dynamic_cast<const ngraph::Parameter*>(this) != nullptr; return dynamic_cast<const ngraph::Parameter*>(this) != nullptr;
} }
std::ostream& ngraph::operator<<(std::ostream& out, const ngraph::Node& node) namespace ngraph
{ {
auto op_tmp = dynamic_cast<const ngraph::Op*>(&node); std::ostream& operator<<(std::ostream& out, const ngraph::Node& node)
auto parameter_tmp = dynamic_cast<const ngraph::Op*>(&node);
if (op_tmp)
{ {
out << "Op(" << op_tmp->node_id() << ")"; auto op_tmp = dynamic_cast<const ngraph::Op*>(&node);
auto parameter_tmp = dynamic_cast<const ngraph::Op*>(&node);
if (op_tmp)
{
out << "Op(" << op_tmp->node_id() << ")";
}
else if (parameter_tmp)
{
out << "Parameter(" << parameter_tmp->node_id() << ")";
}
else
{
out << "Node(" << node.node_id() << ")";
}
return out;
} }
else if (parameter_tmp)
{
out << "Parameter(" << parameter_tmp->node_id() << ")";
}
else
{
out << "Node(" << node.node_id() << ")";
}
return out;
} }
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <vector> #include <vector>
#include <memory>
namespace ngraph namespace ngraph
{ {
......
...@@ -36,7 +36,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR} ...@@ -36,7 +36,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCURDIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}
add_executable(unit-test ${SRC}) add_executable(unit-test ${SRC})
target_link_libraries(unit-test ngraph pthread libgtest) target_link_libraries(unit-test ngraph libgtest pthread)
target_link_libraries(unit-test ${CMAKE_DL_LIBS}) target_link_libraries(unit-test ${CMAKE_DL_LIBS})
add_dependencies(unit-test ngraph libgtest) add_dependencies(unit-test ngraph libgtest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment