Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wmd installation on OS Sierra #25

Open
melodywolk opened this issue Feb 16, 2018 · 5 comments
Open

wmd installation on OS Sierra #25

melodywolk opened this issue Feb 16, 2018 · 5 comments

Comments

@melodywolk
Copy link

Running

pip3 install git+https://github.com/src-d/wmd-relax

I got this issue

Collecting git+https://github.com/src-d/wmd-relax
  Cloning https://github.com/src-d/wmd-relax to /private/var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-gomjzjne-build
Requirement already satisfied: numpy in ./python3env/lib/python3.5/site-packages (from wmd==1.2.9)
Installing collected packages: wmd
  Running setup.py install for wmd ... error
    Complete output from command python3env/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-gomjzjne-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-27ls9nc4-record/install-record.txt --single-version-externally-managed --compile --install-headers python3env/include/site/python3.5/wmd:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.12-x86_64-3.5
    creating build/lib.macosx-10.12-x86_64-3.5/wmd
    copying wmd/__init__.py -> build/lib.macosx-10.12-x86_64-3.5/wmd
    running build_ext
    building 'libwmdrelax' extension
    creating build/temp.macosx-10.12-x86_64-3.5
    creating build/temp.macosx-10.12-x86_64-3.5/or-tools
    creating build/temp.macosx-10.12-x86_64-3.5/or-tools/src
    creating build/temp.macosx-10.12-x86_64-3.5/or-tools/src/graph
    creating build/temp.macosx-10.12-x86_64-3.5/or-tools/src/base
    creating build/temp.macosx-10.12-x86_64-3.5/or-tools/src/util
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ipython3env/lib/python3.5/site-packages/numpy/core/include -Ior-tools/src -I/Users//.pyenv/versions/3.5.0/include/python3.5m -c python.cc -o build/temp.macosx-10.12-x86_64-3.5/python.o -std=c++11 -march=native -ftree-vectorize -DNDEBUG -Wno-sign-compare -flto
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:478:15: error: C++ requires a type specifier for all declarations
        char_type toupper(char_type __c) const
                  ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:706:29: note: expanded from macro 'toupper'
    #define toupper(c) towupper(btowc(c))
                                ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:484:48: error: too many arguments provided to function-like macro invocation
        const char_type* toupper(char_type* __low, const char_type* __high) const
                                                   ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:706:9: note: macro 'toupper' defined here
    #define toupper(c) towupper(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:484:29: error: expected ';' at end of declaration list
        const char_type* toupper(char_type* __low, const char_type* __high) const
                                ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:496:48: error: too many arguments provided to function-like macro invocation
        const char_type* tolower(char_type* __low, const char_type* __high) const
                                                   ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:704:9: note: macro 'tolower' defined here
    #define tolower(c) towlower(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:480:27: error: use of undeclared identifier '__c'
            return do_toupper(__c);
                              ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:587:15: error: C++ requires a type specifier for all declarations
        char_type toupper(char_type __c) const
                  ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:706:29: note: expanded from macro 'toupper'
    #define toupper(c) towupper(btowc(c))
                                ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:593:48: error: too many arguments provided to function-like macro invocation
        const char_type* toupper(char_type* __low, const char_type* __high) const
                                                   ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:706:9: note: macro 'toupper' defined here
    #define toupper(c) towupper(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:593:29: error: expected ';' at end of declaration list
        const char_type* toupper(char_type* __low, const char_type* __high) const
                                ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:605:48: error: too many arguments provided to function-like macro invocation
        const char_type* tolower(char_type* __low, const char_type* __high) const
                                                   ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:704:9: note: macro 'tolower' defined here
    #define tolower(c) towlower(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:589:27: error: use of undeclared identifier '__c'
            return do_toupper(__c);
                              ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:715:21: error: too many arguments provided to function-like macro invocation
    isspace(_CharT __c, const locale& __loc)
                        ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:700:9: note: macro 'isspace' defined here
    #define isspace(c) iswspace(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:715:1: error: declaration conflicts with target of using declaration already in scope
    isspace(_CharT __c, const locale& __loc)
    ^
    /usr/include/ctype.h:267:1: note: target of using declaration
    isspace(int _c)
    ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/cctype:113:9: note: using declaration
    using ::isspace;
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:717:5: error: expected expression
        return use_facet<ctype<_CharT> >(__loc).is(ctype_base::space, __c);
        ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:718:2: error: expected ';' at end of declaration
    }
     ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:739:21: error: too many arguments provided to function-like macro invocation
    isupper(_CharT __c, const locale& __loc)
                        ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:702:9: note: macro 'isupper' defined here
    #define isupper(c) iswupper(btowc(c))
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:739:1: error: declaration conflicts with target of using declaration already in scope
    isupper(_CharT __c, const locale& __loc)
    ^
    /usr/include/ctype.h:273:1: note: target of using declaration
    isupper(int _c)
    ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/cctype:114:9: note: using declaration
    using ::isupper;
            ^
    In file included from python.cc:12:
    In file included from ./emd.h:14:
    In file included from or-tools/src/graph/min_cost_flow.h:177:
    In file included from or-tools/src/base/integral_types.h:17:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:38:
    In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ios:216:
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:741:5: error: expected expression
        return use_facet<ctype<_CharT> >(__loc).is(ctype_base::upper, __c);
        ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:742:2: error: expected ';' at end of declaration
    }
     ^
    /Library/Developer/CommandLineTools/usr/include/c++/v1/__locale:747:21: error: too many arguments provided to function-like macro invocation
    islower(_CharT __c, const locale& __loc)
                        ^
    /Users//.pyenv/versions/3.5.0/include/python3.5m/pyport.h:698:9: note: macro 'islower' defined here
    #define islower(c) iswlower(btowc(c))
            ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command 'clang' failed with exit status 1
    
    ----------------------------------------
Command "python3env/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/private/var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-gomjzjne-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-27ls9nc4-record/install-record.txt --single-version-externally-managed --compile --install-headers python3env/include/site/python3.5/wmd" failed with error code 1 in /private/var/folders/16/9dq69g6927zf323r1bxk96r80000gn/T/pip-gomjzjne-build/
@melodywolk
Copy link
Author

melodywolk commented Feb 16, 2018

Following Farama-Foundation/ViZDoom@1737ff0

That was solved by adding #include <iostream> in emd.h

 #include <cmath>
 #include <algorithm>
 #include <string>
+#include <iostream>

@melodywolk
Copy link
Author

Then I had another issue with openmp
Running cmake -D CMAKE_BUILD_TYPE=Release .
I got this error message

CMake Error at /usr/local/Cellar/cmake/3.9.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) (found
  version "1.0")
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.9.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:377 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.9.0/share/cmake/Modules/FindOpenMP.cmake:402 (find_package_handle_standard_args)
  CMakeLists.txt:4 (find_package)


-- Configuring incomplete, errors occurred!
See also "wmd-relax/CMakeFiles/CMakeOutput.log".

@melodywolk
Copy link
Author

I managed to solve this so I thought it could be useful

  1. brew install llvm

  2. Following this https://stackoverflow.com/questions/46414660/macos-cmake-and-openmp I changed CMakeLists.txt (here is the diff)

diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,40 @@
 cmake_minimum_required(VERSION 3.2)
 project(wmdrelax)
 set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake)
+
+set(OPENMP_LIBRARIES "/usr/local/opt/llvm/lib")
+set(OPENMP_INCLUDES "/usr/local/opt/llvm/include")
+
+# Find OpenMP
+if(APPLE)
+    if(CMAKE_C_COMPILER_ID MATCHES "gcc-7")
+        set(OpenMP_C "${CMAKE_C_COMPILER}")
+        set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+        set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
+        set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+        set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+        set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
+    endif()
+    if(CMAKE_CXX_COMPILER_ID MATCHES "gcc-7")
+      set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
+      set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+      set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
+      set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+      set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+      set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+    endif()
+endif()
+
 find_package(OpenMP REQUIRED)
+
+if (OPENMP_FOUND)
+    include_directories("${OPENMP_INCLUDES}")
+    link_directories("${OPENMP_LIBRARIES}")
+    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+    # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+endif(OPENMP_FOUND)
+
 if (NOT DISABLE_PYTHON)
   if (APPLE)
     # workaround

And compile with CC=gcc-7 CXX=g++-7 cmake -DCMAKE_BUILD_TYPE=Release .

  1. Using make -j I had this error message
wmd-relax/or-tools/src/base/sysinfo.cc:35:10: error: unused variable 'task' [-Werror=unused-variable]
   task_t task = MACH_PORT_NULL;
          ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o] Error 1
make[1]: *** [CMakeFiles/wmdrelax.dir/all] Error 2
make: *** [all] Error 2

That I just solved by commenting this line

  1. Finally everything worked great
make -j
Scanning dependencies of target wmdrelax
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/max_flow.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/logging.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/stringprintf.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/util/stats.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/min_cost_flow.cc.o
[ 75%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o
[ 87%] Building CXX object CMakeFiles/wmdrelax.dir/python.cc.o
[100%] Linking CXX shared library libwmdrelax.dylib
[100%] Built target wmdrelax

But trying to import the library in python (3.6.4) caused an error

>>> import wmd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wmd-relax/wmd/__init__.py", line 11, in <module>
    import libwmdrelax
ModuleNotFoundError: No module named 'libwmdrelax'

That was solved following this https://github.com/src-d/kmcuda
and renaming the file
mv libwmdrelax.{dylib,so}

And it worked :)

@ZhiyuanCao98
Copy link

ZhiyuanCao98 commented Sep 7, 2019

I managed to solve this so I thought it could be useful

  1. brew install llvm
  2. Following this https://stackoverflow.com/questions/46414660/macos-cmake-and-openmp I changed CMakeLists.txt (here is the diff)
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,40 @@
 cmake_minimum_required(VERSION 3.2)
 project(wmdrelax)
 set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake)
+
+set(OPENMP_LIBRARIES "/usr/local/opt/llvm/lib")
+set(OPENMP_INCLUDES "/usr/local/opt/llvm/include")
+
+# Find OpenMP
+if(APPLE)
+    if(CMAKE_C_COMPILER_ID MATCHES "gcc-7")
+        set(OpenMP_C "${CMAKE_C_COMPILER}")
+        set(OpenMP_C_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+        set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
+        set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+        set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
+        set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
+    endif()
+    if(CMAKE_CXX_COMPILER_ID MATCHES "gcc-7")
+      set(OpenMP_CXX "${CMAKE_CXX_COMPILER}")
+      set(OpenMP_CXX_FLAGS "-fopenmp=libomp -Wno-unused-command-line-argument")
+      set(OpenMP_CXX_LIB_NAMES "libomp" "libgomp" "libiomp5")
+      set(OpenMP_libomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+      set(OpenMP_libgomp_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+      set(OpenMP_libiomp5_LIBRARY ${OpenMP_CXX_LIB_NAMES})
+    endif()
+endif()
+
 find_package(OpenMP REQUIRED)
+
+if (OPENMP_FOUND)
+    include_directories("${OPENMP_INCLUDES}")
+    link_directories("${OPENMP_LIBRARIES}")
+    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+    # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
+endif(OPENMP_FOUND)
+
 if (NOT DISABLE_PYTHON)
   if (APPLE)
     # workaround

And compile with CC=gcc-7 CXX=g++-7 cmake -DCMAKE_BUILD_TYPE=Release .

  1. Using make -j I had this error message
wmd-relax/or-tools/src/base/sysinfo.cc:35:10: error: unused variable 'task' [-Werror=unused-variable]
   task_t task = MACH_PORT_NULL;
          ^~~~
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o] Error 1
make[1]: *** [CMakeFiles/wmdrelax.dir/all] Error 2
make: *** [all] Error 2

That I just solved by commenting this line

  1. Finally everything worked great
make -j
Scanning dependencies of target wmdrelax
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/max_flow.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/logging.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/stringprintf.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/util/stats.cc.o
[ 62%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/graph/min_cost_flow.cc.o
[ 75%] Building CXX object CMakeFiles/wmdrelax.dir/or-tools/src/base/sysinfo.cc.o
[ 87%] Building CXX object CMakeFiles/wmdrelax.dir/python.cc.o
[100%] Linking CXX shared library libwmdrelax.dylib
[100%] Built target wmdrelax

But trying to import the library in python (3.6.4) caused an error

>>> import wmd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "wmd-relax/wmd/__init__.py", line 11, in <module>
    import libwmdrelax
ModuleNotFoundError: No module named 'libwmdrelax'

That was solved following this https://github.com/src-d/kmcuda
and renaming the file
mv libwmdrelax.{dylib,so}

And it worked :)

Hi,

Thanks for your sharing.
Right now, I still have some questions.
I have same issue with you that I can not find the OpenMP,
so, I change the CMakeList.txt' just like your wrote, but it still has the error.
Then, I replace "gcc-7" to "Clang" and it works.

After that, I try to run make -j, I have the following problems:

(cvan2) cvans-MacBook-Air:wmd-relax cvanzy$ make -j
[ 12%] Building CXX object CMakeFiles/wmdrelax.dir/python.cc.o
/Users/cvanzy/Desktop/Machine_Learning/EMD/wmd-relax/python.cc:207:18: error: loop not
      vectorized: the optimizer was unable to perform the requested transformation; the
      transformation might be disabled or specified as part of an unsupported transformation
      ordering [-Werror,-Wpass-failed=transform-warning]
static PyObject *py_emd(PyObject *self, PyObject *args, PyObject *kwargs) {
                 ^
/Users/cvanzy/Desktop/Machine_Learning/EMD/wmd-relax/python.cc:207:18: error: loop not
      vectorized: the optimizer was unable to perform the requested transformation; the
      transformation might be disabled or specified as part of an unsupported transformation
      ordering [-Werror,-Wpass-failed=transform-warning]
/Users/cvanzy/Desktop/Machine_Learning/EMD/wmd-relax/python.cc:207:18: error: loop not
      vectorized: the optimizer was unable to perform the requested transformation; the
      transformation might be disabled or specified as part of an unsupported transformation
      ordering [-Werror,-Wpass-failed=transform-warning]
/Users/cvanzy/Desktop/Machine_Learning/EMD/wmd-relax/python.cc:207:18: error: loop not
      vectorized: the optimizer was unable to perform the requested transformation; the
      transformation might be disabled or specified as part of an unsupported transformation
      ordering [-Werror,-Wpass-failed=transform-warning]
4 errors generated.
make[2]: *** [CMakeFiles/wmdrelax.dir/python.cc.o] Error 1
make[1]: *** [CMakeFiles/wmdrelax.dir/all] Error 2

Do you have idea about that?

Sincerely,
Zy

@ZhiyuanCao98
Copy link

I think I have resolved this issue.
I download the gcc version 7 and implement in the code then works.

But when I run the code, it always shows:
Segmentation fault: 11

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

No branches or pull requests

2 participants