luckiezhou / DynamicTriad

Dynamic Network Embedding by Modeling Triadic Closure Process
Apache License 2.0
137 stars 50 forks source link

CMakeLists.txt has not been tested/written for your compiler #16

Open corwinliu opened 5 years ago

corwinliu commented 5 years ago

After I ran bash build.sh and setup the environment variables, I got the following error:

building mygraph module ...
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- 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
CMake Error at CMakeLists.txt:17 (MESSAGE):
  CMakeLists.txt has not been tested/written for your compiler.

-- Configuring incomplete, errors occurred!
See also "/Users/corwin/Desktop/project/DynamicTriad/core/mygraph-build/CMakeFiles/CMakeOutput.log".

My platform is macOS Mojave 10.14.3 and python2.7 with virtualenv. PYTHON_LIBRARY and PYTHON_INCLUDE_DIR were set to default. EIGEN3_INCLUDE_DIR and BOOST_ROOT were set to be the path of downloaded and extracted directories. Name for boost_python library was set to the name of BOOST's directory(boost_1_68_0).

Can you give me some advise to solve this problem? Thanks a lot.

luckiezhou commented 5 years ago

The problem is that I've manually disabled the compilers other than gnu gcc in the make script.

  1. I'd recommend using a gcc compiler, rather than the Apple clang (install gcc on macOS, or compile on a *nix platform).
  2. If it is not possible to use a gcc compiler, try removing the compiler check at core/graph/CMakeLists.txt:13. You may have to eliminate several compilation errors before it compiles.
corwinliu commented 5 years ago

Thanks for your help. The problem solved after I removed the compiler check at core/graph/CMakeLists.txt and core/algorithm/CMakeLists.txt. Now I get two errors:

In file included from /Users/corwin/Desktop/project/DynamicTriad/core/graph/graph_pywrapper.cpp:5:
In file included from /Users/corwin/Desktop/project/DynamicTriad/core/graph/graph_pywrapper.h:8:
In file included from /Users/corwin/Desktop/project/DynamicTriad/core/graph/graph.h:12:
In file included from /Users/corwin/Desktop/project/DynamicTriad/core/graph/nodemap.h:14:
In file included from /Users/corwin/Desktop/project/DynamicTriad/core/graph/nodeset.h:14:
/Users/corwin/Desktop/project/DynamicTriad/core/graph/exception.h:27:57: error:
      non-const lvalue reference to type
      'basic_ostringstream<...>' cannot bind to a temporary of
      type 'basic_ostringstream<...>'
  ...static_cast<std::ostringstream&>(std::ostringstream() << key...
     ^                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/corwin/Desktop/project/DynamicTriad/core/graph/graph.h:257:19: note:
      in instantiation of member function
      'InvalidKeyException<long long>::InvalidKeyException'
      requested here
            throw InvalidKeyException<node_type>(__FUNCTIO...
                  ^
/Users/corwin/Desktop/project/DynamicTriad/core/graph/graph_pywrapper.h:112:12: note:
      in instantiation of member function 'Graph<long long, float,
      NodeMap>::newedge' requested here
        g->newedge(from, to, std::move(val));
           ^
/Users/corwin/Desktop/project/DynamicTriad/core/graph/graph_pywrapper.cpp:149:5: note:
      in instantiation of member function 'GraphPyWrapper<long
      long, float>::add_edge' requested here
    DECL_GRAPH_METHODS(Graph_Int64_Float);
    ^
/Users/corwin/Desktop/project/DynamicTriad/core/graph/graph_pywrapper.cpp:57:28: note:
      expanded from macro 'DECL_GRAPH_METHODS'
    .def("add_edge", &cls::add_edge) \
                           ^
10 warnings and 6 errors generated.
make[2]: *** [CMakeFiles/mygraph.dir/graph_pywrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/mygraph.dir/all] Error 2
make: *** [all] Error 2
building c extensions for dynamic triad ...
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- 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
Using custom python path /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/Python.framework/Versions/2.7/Python and /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/include/python2.7
-- Found PythonLibs: /usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/Python.framework/Versions/2.7/Python (found suitable version "2.7.16", minimum required is "2.7")
-- Found PythonInterp: /Users/corwin/envdyntriad/bin/python2.7 (found suitable version "2.7.16", minimum required is "2.7")
-- Numpy headers found
Using eigen path /Users/corwin/Downloads/eigen-eigen-323c052e1731
-- Boost version: 1.68.0
-- Could NOT find Boost
boost_python not detected by cmake, trying custom lib name
          boost_python
CMake Error at /usr/local/Cellar/cmake/3.14.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.14.5/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.14.5/share/cmake/Modules/FindOpenMP.cmake:474 (find_package_handle_standard_args)
  CMakeLists.txt:113 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!
See also "/Users/corwin/Desktop/project/DynamicTriad/core/algorithm/build/CMakeFiles/CMakeOutput.log".
See also "/Users/corwin/Desktop/project/DynamicTriad/core/algorithm/build/CMakeFiles/CMakeError.log".

One error seems that boost_python cannot be detected. I set the path of BOOST_ROOT to be the path of downloaded and extracted directory from https://www.boost.org/doc/libs/1_70_0/more/getting_started/unix-variants.html#get-boost. Did I do it correctly?

luckiezhou commented 5 years ago
  1. The first problem is expected to be fixed now, though I'm not perfectly sure without testing on your compiler.
  2. According to the log, the boost library is found without boost_python library in it. You may check the built/installed boost libraries to see if boost_python libraries exist. If they do not exist, you'll have to check your boost building commands; If they do exist, but with a non-default name (libboost_python.so), setting the "name for boost_python library" option helps.
  3. It seems that the vital error during your compilation is "Could NOT find OpenMP_C", which means your compiler does not support OpenMP (by default). You should do some research on your compiler to see if you can have the OpenMP support enabled.