ogmacorp / EOgmaNeo

Ogma - EOgmaNeo https://ogma.ai/
Other
111 stars 20 forks source link

error on install #6

Closed andrewcz closed 7 years ago

andrewcz commented 7 years ago

hi all, Trying to use this awesome software :).

getting the below error.

andrewcz@andrewcz-PORTEGE-Z30t-B ~/EOgmaNeo/build $ make install [ 10%] Building CXX object CMakeFiles/EOgmaNeo.dir/source/optional/OpenCVInterop.cpp.o In file included from /home/andrewcz/EOgmaNeo/source/optional/OpenCVInterop.cpp:12:0: /home/andrewcz/EOgmaNeo/source/optional/OpenCVInterop.h:12:34: fatal error: opencv2/features2d.hpp: No such file or directory

include "opencv2/features2d.hpp"

                              ^

compilation terminated. make[2]: [CMakeFiles/EOgmaNeo.dir/source/optional/OpenCVInterop.cpp.o] Error 1 make[1]: [CMakeFiles/EOgmaNeo.dir/all] Error 2 make: *** [all] Error 2

rcrowder commented 7 years ago

Hi @andrewcz If you re-run the CMake step of the build process, the output log will show whether it has found an install of OpenCV (and which version). It looks like it hasn't found it and hence produced this error. Can you let me know how you installed OpenCV?

andrewcz commented 7 years ago

to be honest, i having trouble installing opencv. its coming up with errors. If you have some ideas that could help i would sincerly appreciate it :). Many thanks, Andrew

andrewcz commented 7 years ago

so it look like it build now trying to build the python library

andrewcz@andrewcz-PORTEGE-Z30t-B ~/Downloads/EOgmaNeo-master/Python $ python2 setup.py install running install running build_ext creating /home/andrewcz/Downloads/EOgmaNeo-master/Python/build/temp.linux-x86_64-2.7 -- The C compiler identification is GNU 4.8.5 -- The CXX compiler identification is GNU 4.8.5 -- 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 -- Bitness: 64 CMAKE_BUILD_TYPE not set, setting it to Release -- Build type: Release Python target version: 2 -- Build pre-encoders: ON -- Found SFML 2.4 in /usr/local/include CMake Warning at CMakeLists.txt:52 (find_package): Could not find a package configuration file provided by "OpenCV" with any of the following names:

OpenCVConfig.cmake
opencv-config.cmake

Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set "OpenCV_DIR" to a directory containing one of the above files. If "OpenCV" provides a separate development package or SDK, be sure it has been installed.

-- Found SWIG: /usr/bin/swig2.0 (found version "2.0.11") -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found suitable version "2.7.6", minimum required is "2") -- Configuring done -- Generating done -- Build files have been written to: /home/andrewcz/Downloads/EOgmaNeo-master/Python/build/temp.linux-x86_64-2.7 cmake --build . --config Release Scanning dependencies of target EOgmaNeo [ 9%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/eogmaneo/ThreadPool.cpp.o [ 18%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/eogmaneo/ComputeSystem.cpp.o [ 27%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/eogmaneo/Layer.cpp.o [ 36%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/eogmaneo/Hierarchy.cpp.o [ 45%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/eogmaneo/Preprocessing.cpp.o [ 54%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/optional/CornerEncoder.cpp.o [ 63%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/optional/RandomEncoder.cpp.o [ 72%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/optional/ImageEncoder.cpp.o [ 81%] Building CXX object CMakeFiles/EOgmaNeo.dir/home/andrewcz/Downloads/EOgmaNeo-master/source/optional/VisAdapter.cpp.o Linking CXX static library libEOgmaNeo.a [ 81%] Built target EOgmaNeo [ 90%] Swig source /home/andrewcz/Downloads/EOgmaNeo-master/Python/../source/eogmaneo/Layer.h:39: Error: Syntax error in input(3). make[2]: [pyeogmaneoPYTHON_wrap.cxx] Error 1 make[1]: [CMakeFiles/_eogmaneo.dir/all] Error 2 make: *** [all] Error 2 error: command 'cmake' failed with exit status 2 andrewcz@andrewcz-PORTEGE-Z30t-B ~/Downloads/EOgmaNeo-master/Python $

andrewcz commented 7 years ago

image

rcrowder commented 7 years ago

Hi @andrewcz Good to hear you have overcome your OpenCV lib install issue. This new issue relates to using the older version 2 of SWIG. We currently use version 3. I double checked in a Mint 18.2 VM and that is the case. Although the default Aptitude (apt) install for swig is actually version 3. If you don't require version 2 of SWIG for other projects you can use the following bash commands to change from v2 to v3 (assuming you are using Mint 18.2):

sudo apt purge swig2.0
sudo apt autoremove
sudo apt install swig

If you do require version 2 of SWIG for other projects, there maybe a local work around that could be made with EOgmaNeo to help you get the Python bindings built.

andrewcz commented 7 years ago

CMake Error at CMakeLists.txt:225 (swig_add_module): Unknown CMake command "swig_add_module".

-- Configuring incomplete, errors occurred! See also "/home/andrewcz/Downloads/EOgmaNeo-master/Python/build/temp.linux-x86_64-3.5/CMakeFiles/CMakeOutput.log". cmake --build . --config Release [ 81%] Built target EOgmaNeo [ 90%] Swig source /bin/sh: 1: /usr/bin/swig2.0: not found make[2]: [pyeogmaneoPYTHON_wrap.cxx] Error 127 make[1]: [CMakeFiles/_eogmaneo.dir/all] Error 2 make: *** [all] Error 2 error: command 'cmake' failed with exit status 2 andrewcz@andrewcz-PORTEGE-Z30t-B ~/Downloads/EOgmaNeo-master/Python $

andrewcz commented 7 years ago

cheers, i am having trouble with the swig install i am using linux 17.3 and trying to install swig from scatch.

rcrowder commented 7 years ago

Make sure that you delete the build/ directory when re-running setup.py

andrewcz commented 7 years ago

CMake Error at /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find SWIG (missing: SWIG_DIR) Call Stack (most recent call first): /usr/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.2/Modules/FindSWIG.cmake:75 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:105 (find_package)

-- Configuring incomplete, errors occurred! See also "/home/andrewcz/Downloads/EOgmaNeo-master/Python/build/temp.linux-x86_64-3.5/CMakeFiles/CMakeOutput.log". cmake --build . --config Release make: *** No targets specified and no makefile found. Stop. error: command 'cmake' failed with exit status 2

andrewcz commented 7 years ago

got the above. the trouble is installing swig. when i go swig -version, nothing comes up.

andrewcz commented 7 years ago

http://www.linuxfromscratch.org/blfs/view/8.1/general/swig.html. i am following the above instructions about how to install it

rcrowder commented 7 years ago

The make install ... step from those instructions should have placed it in a common location (as long as sudo was used to run make install as root).

andrewcz commented 7 years ago

Installing /usr/local/share/swig/3.0.12/std/std_unordered_set.i Installing /usr/local/share/swig/3.0.12/std/std_vectora.i Installing /usr/local/share/swig/3.0.12/std/std_vector.i Installing /usr/local/share/swig/3.0.12/std/std_wios.i Installing /usr/local/share/swig/3.0.12/std/std_wiostream.i Installing /usr/local/share/swig/3.0.12/std/std_wsstream.i Installing /usr/local/share/swig/3.0.12/std/std_wstreambuf.i Installing /usr/local/share/swig/3.0.12/std/std_wstring.i Installing /usr/local/share/swig/3.0.12/std/std_carray.swg make[1]: Entering directory /home/andrewcz/Downloads/swig-3.0.12/CCache' Installing ccache-swig Installing /usr/local/bin/ccache-swig /usr/bin/install -c -d /usr/local/bin /usr/bin/install -c -m 755 ccache-swig /usr/local/bin/echo ccache-swig | sed 's,x,x,' make[1]: Leaving directory/home/andrewcz/Downloads/swig-3.0.12/CCache' Installation complete make: *** No rule to make target `...'. Stop. andrewcz@andrewcz-PORTEGE-Z30t-B ~/Downloads/swig-3.0.12 $

andrewcz commented 7 years ago

using sudo make install ...

andrewcz commented 7 years ago

image

rcrowder commented 7 years ago

Thanks for posting the screen shot. It shows that you've installed Swig into /usr/local/ Which is fine, but on a Mint VM, even with the PATH searching in /usr/local/bin for Swig, it can't find in.. One thing that you can do in your case is to create a soft-link to Swig using:

sudo ln -S /usr/bin/swig /usr/local/bin/swig

andrewcz commented 7 years ago

image

rcrowder commented 7 years ago

Oops, sorry that should have been a lower-case -s, i.e.

sudo ln -s /usr/bin/swig /usr/local/bin/swig

andrewcz commented 7 years ago

image

andrewcz commented 7 years ago

screenshot_2017-09-30_13-50-00

andrewcz commented 7 years ago

cheers for your help Richard :) Best, Andrew

andrewcz commented 7 years ago

image

andrewcz commented 7 years ago

so i was able to install the python module. but for some reason it did not find it on the run. Best, Andrew

rcrowder commented 7 years ago

Hi @andrewcz Glad to hear that you have the library and bindings building. At first I though this issue related to a shared vs statically linked EOgmaNeo C++ library. But after trying to recreate the issue inside Linux Mint (using miniconda3) I haven't so far been able to see the same issue as yourself. An import error like this can also point to the C++ library being linked to one version of Python (v2 for instance), while trying to import it into another version (such as v3). This may happen if after running python setup.py install it is re-run after installing a different version of Python, and the EOgmaNeo/Python/build directory is not deleted between runs of setup.py. Locally the only change I needed to make to the Python build process is to allow it to find a miniconda3 installation. That required one line in the Python/CMakeLists.txt to be duplicated to the following (inserted after line 128 [1], note the first four spaces of indentation):

string(REGEX MATCH "miniconda" ANACONDA_PYTHON_FOUND "${_CONDA_OUTPUT}")

Even with that additional line in the CMakeLists.txt file, the Python bindings built and the sine wave example ran fine for me. Now that you have the appropriate dependencies installed, the only thing I can suggest is to delete and re-clone the repository, pip uninstall eogmaneo, and try the setup.py install again.

1 https://github.com/ogmacorp/EOgmaNeo/blob/master/Python/CMakeLists.txt#L128

andrewcz commented 7 years ago

no worries richard, i think im just going to reinstall everything and see how i go. I am pretty sure its an issue with my computer. Appreciate all the help and support though :) best, Andrew

rcrowder commented 7 years ago

@andrewcz I'll close this issue for now. Create a new issue if you continue to have dependency problems during installation.