CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
137 stars 74 forks source link

[Linux Mint] Issue with Installation of YDK Core (Python) CMake Dependencies #601

Closed skg-net closed 7 years ago

skg-net commented 7 years ago

Issue tracker is ONLY used for reporting bugs. Please use the YDK Community for any support issues.

Expected Behavior

The generated ydk core should be installed successfully.

Current Behavior

Fails with the cmake dependency.

Steps to Reproduce

Your Script

Logs

kg-dev ~/dev/ydk/ydk-gen $ pip install gen-api/python/ydk/dist/ydk*.tar.gz Processing ./gen-api/python/ydk/dist/ydk-0.6.1.tar.gz Requirement already satisfied: pybind11>=2.1.1 in /home/skg/.virtualenvs/ydk-gen/lib/python2.7/site-packages (from ydk==0.6.1) Building wheels for collected packages: ydk Running setup.py bdist_wheel for ydk ... error Complete output from command /home/skg/.virtualenvs/ydk-gen/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-hWgITG-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmp7LU4Bxpip-wheel- --python-tag cp27: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/ydk copying ydk/exthook.py -> build/lib.linux-x86_64-2.7/ydk copying ydk/init.py -> build/lib.linux-x86_64-2.7/ydk creating build/lib.linux-x86_64-2.7/ydk/entity_utils copying ydk/entity_utils/init.py -> build/lib.linux-x86_64-2.7/ydk/entity_utils creating build/lib.linux-x86_64-2.7/ydk/providers copying ydk/providers/init.py -> build/lib.linux-x86_64-2.7/ydk/providers copying ydk/providers/codec_provider.py -> build/lib.linux-x86_64-2.7/ydk/providers creating build/lib.linux-x86_64-2.7/ydk/filters copying ydk/filters/init.py -> build/lib.linux-x86_64-2.7/ydk/filters creating build/lib.linux-x86_64-2.7/ydk/logging copying ydk/logging/init.py -> build/lib.linux-x86_64-2.7/ydk/logging creating build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/executor_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/codec_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/init.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/netconf_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/crud_service.py -> build/lib.linux-x86_64-2.7/ydk/services creating build/lib.linux-x86_64-2.7/ydk/ext copying ydk/ext/init.py -> build/lib.linux-x86_64-2.7/ydk/ext creating build/lib.linux-x86_64-2.7/ydk/path copying ydk/path/init.py -> build/lib.linux-x86_64-2.7/ydk/path creating build/lib.linux-x86_64-2.7/ydk/errors copying ydk/errors/init.py -> build/lib.linux-x86_64-2.7/ydk/errors copying ydk/errors/error_handler.py -> build/lib.linux-x86_64-2.7/ydk/errors creating build/lib.linux-x86_64-2.7/ydk/models copying ydk/models/init.py -> build/lib.linux-x86_64-2.7/ydk/models creating build/lib.linux-x86_64-2.7/ydk/types copying ydk/types/init.py -> build/lib.linux-x86_64-2.7/ydk/types copying ydk/types/py_types.py -> build/lib.linux-x86_64-2.7/ydk/types creating build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/netconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/init.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/restconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions running build_ext -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is unknown -- 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/local/bin/cmake -- Check for working CXX compiler: /usr/local/bin/cmake -- broken CMake Error at /usr/local/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "/usr/local/bin/cmake" is not able to compile a simple test program.

It fails with the following output:

 Change Dir: /tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e3504/fast"

/usr/bin/make -f CMakeFiles/cmTC_e3504.dir/build.make
CMakeFiles/cmTC_e3504.dir/build

make[1]: Entering directory
'/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp'

Building CXX object CMakeFiles/cmTC_e3504.dir/testCXXCompiler.cxx.o

/usr/local/bin/cmake -o CMakeFiles/cmTC_e3504.dir/testCXXCompiler.cxx.o -c
/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

CMake Error: The source directory
"/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp/testCXXCompiler.cxx"
is a file, not a directory.

Specify --help for usage, or press the help button on the CMake GUI.

CMakeFiles/cmTC_e3504.dir/build.make:65: recipe for target
'CMakeFiles/cmTC_e3504.dir/testCXXCompiler.cxx.o' failed

make[1]: *** [CMakeFiles/cmTC_e3504.dir/testCXXCompiler.cxx.o] Error 1

make[1]: Leaving directory
'/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp'

Makefile:126: recipe for target 'cmTC_e3504/fast' failed

make: *** [cmTC_e3504/fast] Error 2

CMake will not be able to correctly generate this project.

Call Stack (most recent call first): CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred! See also "/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log". See also "/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeError.log". Traceback (most recent call last): File "", line 1, in File "/tmp/pip-hWgITG-build/setup.py", line 157, in zip_safe=False, File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/home/skg/.virtualenvs/ydk-gen/local/lib/python2.7/site-packages/wheel/bdist_wheel.py", line 204, in run self.run_command('build') File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run self.run_command(cmd_name) File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/tmp/pip-hWgITG-build/setup.py", line 69, in run self.build_extension(ext) File "/tmp/pip-hWgITG-build/setup.py", line 93, in build_extension subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp) File "/usr/lib/python2.7/subprocess.py", line 541, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-hWgITG-build', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-hWgITG-build/build/lib.linux-x86_64-2.7', '-DPYBIND11_INCLUDE=/home/skg/.virtualenvs/ydk-gen/include/site/python2.7;/home/skg/.virtualenvs/ydk-gen/include/site/python2.7', '-DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so', '-DPYTHON_INCLUDE=/usr/include/python2.7', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1


Failed building wheel for ydk Running setup.py clean for ydk Failed to build ydk Installing collected packages: ydk Running setup.py install for ydk ... error Complete output from command /home/skg/.virtualenvs/ydk-gen/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-hWgITG-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 /tmp/pip-9w98El-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/skg/.virtualenvs/ydk-gen/include/site/python2.7/ydk: running install running build running build_py creating build creating build/lib.linux-x86_64-2.7 creating build/lib.linux-x86_64-2.7/ydk copying ydk/exthook.py -> build/lib.linux-x86_64-2.7/ydk copying ydk/init.py -> build/lib.linux-x86_64-2.7/ydk creating build/lib.linux-x86_64-2.7/ydk/entity_utils copying ydk/entity_utils/init.py -> build/lib.linux-x86_64-2.7/ydk/entity_utils creating build/lib.linux-x86_64-2.7/ydk/providers copying ydk/providers/init.py -> build/lib.linux-x86_64-2.7/ydk/providers copying ydk/providers/codec_provider.py -> build/lib.linux-x86_64-2.7/ydk/providers creating build/lib.linux-x86_64-2.7/ydk/filters copying ydk/filters/init.py -> build/lib.linux-x86_64-2.7/ydk/filters creating build/lib.linux-x86_64-2.7/ydk/logging copying ydk/logging/init.py -> build/lib.linux-x86_64-2.7/ydk/logging creating build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/executor_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/codec_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/init.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/netconf_service.py -> build/lib.linux-x86_64-2.7/ydk/services copying ydk/services/crud_service.py -> build/lib.linux-x86_64-2.7/ydk/services creating build/lib.linux-x86_64-2.7/ydk/ext copying ydk/ext/init.py -> build/lib.linux-x86_64-2.7/ydk/ext creating build/lib.linux-x86_64-2.7/ydk/path copying ydk/path/init.py -> build/lib.linux-x86_64-2.7/ydk/path creating build/lib.linux-x86_64-2.7/ydk/errors copying ydk/errors/init.py -> build/lib.linux-x86_64-2.7/ydk/errors copying ydk/errors/error_handler.py -> build/lib.linux-x86_64-2.7/ydk/errors creating build/lib.linux-x86_64-2.7/ydk/models copying ydk/models/init.py -> build/lib.linux-x86_64-2.7/ydk/models creating build/lib.linux-x86_64-2.7/ydk/types copying ydk/types/init.py -> build/lib.linux-x86_64-2.7/ydk/types copying ydk/types/py_types.py -> build/lib.linux-x86_64-2.7/ydk/types creating build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/netconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/init.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions copying ydk/path/sessions/restconf_session.py -> build/lib.linux-x86_64-2.7/ydk/path/sessions running build_ext -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is unknown -- 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/local/bin/cmake -- Check for working CXX compiler: /usr/local/bin/cmake -- broken CMake Error at /usr/local/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "/usr/local/bin/cmake" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp

  Run Build Command:"/usr/bin/make" "cmTC_f646e/fast"

  /usr/bin/make -f CMakeFiles/cmTC_f646e.dir/build.make
  CMakeFiles/cmTC_f646e.dir/build

  make[1]: Entering directory
  '/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp'

  Building CXX object CMakeFiles/cmTC_f646e.dir/testCXXCompiler.cxx.o

  /usr/local/bin/cmake -o CMakeFiles/cmTC_f646e.dir/testCXXCompiler.cxx.o -c
  /tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp/testCXXCompiler.cxx

  CMake Error: The source directory
  "/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp/testCXXCompiler.cxx"
  is a file, not a directory.

  Specify --help for usage, or press the help button on the CMake GUI.

  CMakeFiles/cmTC_f646e.dir/build.make:65: recipe for target
  'CMakeFiles/cmTC_f646e.dir/testCXXCompiler.cxx.o' failed

  make[1]: *** [CMakeFiles/cmTC_f646e.dir/testCXXCompiler.cxx.o] Error 1

  make[1]: Leaving directory
  '/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeTmp'

  Makefile:126: recipe for target 'cmTC_f646e/fast' failed

  make: *** [cmTC_f646e/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)

-- Configuring incomplete, errors occurred!
See also "/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-hWgITG-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-hWgITG-build/setup.py", line 157, in <module>
    zip_safe=False,
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/skg/.virtualenvs/ydk-gen/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
    self.run_command('build')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/tmp/pip-hWgITG-build/setup.py", line 69, in run
    self.build_extension(ext)
  File "/tmp/pip-hWgITG-build/setup.py", line 93, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-hWgITG-build', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-hWgITG-build/build/lib.linux-x86_64-2.7', '-DPYBIND11_INCLUDE=/home/skg/.virtualenvs/ydk-gen/include/site/python2.7;/home/skg/.virtualenvs/ydk-gen/include/site/python2.7', '-DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so', '-DPYTHON_INCLUDE=/usr/include/python2.7', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1

----------------------------------------

Command "/home/skg/.virtualenvs/ydk-gen/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-hWgITG-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 /tmp/pip-9w98El-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/skg/.virtualenvs/ydk-gen/include/site/python2.7/ydk" failed with error code 1 in /tmp/pip-hWgITG-build/ (ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $

System Information

(ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $ python --version Python 2.7.12 (ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $ cmake --version cmake version 3.9.4

CMake suite maintained and supported by Kitware (kitware.com/cmake). (ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $ pip freeze alabaster==0.7.10 Babel==2.5.1 docutils==0.14 gitdb==0.6.4 GitPython==1.0.1 imagesize==0.7.1 Jinja2==2.9.6 MarkupSafe==1.0 pyang==1.6 pybind11==2.2.1 Pygments==2.2.0 pytz==2017.2 rstr==2.2.6 six==1.11.0 smmap==0.9.0 snowballstemmer==1.2.1 Sphinx==1.4a1 sphinx-rtd-theme==0.1.9 (ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $ uname -a Linux skg-dev 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

ghost commented 7 years ago

Hi Senthil,

Just googling this errorhttps://www.google.com/search?q=cmake%22+is+not+able+to+compile+a+simple+test+program got me some different answers. Let if know if any of these would fix your issue.

In the meanwhile, we will try to debug this further.

Thanks

skg-net commented 7 years ago

Thanks @abhikeshav for the quick reply. I already tried few things including upgrading cmake. It didn't help much. Thats the reason I raised this query.

ghost commented 7 years ago

For me, I was getting a different cmake error, but after I did sudo apt install clang, the installation worked for me.

(p) ydk@ydk-VirtualBox ~/Desktop $ pip install ydk-models-cisco-ios-xr 
Collecting ydk-models-cisco-ios-xr
  Using cached ydk_models_cisco_ios_xr-6.3.1-py2.py3-none-any.whl
Collecting ydk-models-ietf>=0.1.3 (from ydk-models-cisco-ios-xr)
  Using cached ydk_models_ietf-0.1.4-py2.py3-none-any.whl
Collecting ydk>=0.6.1 (from ydk-models-cisco-ios-xr)
  Using cached ydk-0.6.1.tar.gz
Requirement already satisfied: pybind11>=2.1.1 in ./p/lib/python3.5/site-packages (from ydk>=0.6.1->ydk-models-cisco-ios-xr)
Building wheels for collected packages: ydk
  Running setup.py bdist_wheel for ydk ... done
  Stored in directory: /home/ydk/.cache/pip/wheels/d3/d6/9b/2f106181eebe244f1bb59c57c067b045372a14bc55dc8c067a
Successfully built ydk
Installing collected packages: ydk, ydk-models-ietf, ydk-models-cisco-ios-xr
Successfully installed ydk-0.6.1 ydk-models-cisco-ios-xr-6.3.1 ydk-models-ietf-0.1.4

(p) ydk@ydk-VirtualBox ~/Desktop $ pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
pkg-resources (0.0.0)
pybind11 (2.2.1)
setuptools (36.6.0)
wheel (0.30.0)
ydk (0.6.1)
ydk-models-cisco-ios-xr (6.3.1)
ydk-models-ietf (0.1.4)

(p) ydk@ydk-VirtualBox ~/Desktop $ uname -a
Linux ydk-VirtualBox 4.8.0-53-generic #56~16.04.1-Ubuntu SMP Tue May 16 01:18:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Please find attached the full log below: linux-mint-install-ydk.txt

skg-net commented 7 years ago

@abhikeshav installing clang didn't resolve my issue, just to give it a try I changed the CXX compiler to g++ now I am getting different error. Also, the CMake error logs are deleted, is there a way to retain them.

-- Check for working CXX compiler: /usr/bin/g++ -- Check for working CXX compiler: /usr/bin/g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done python library: /usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so python include: /usr/include/python2.7 pybind11 include: /home/skg/.virtualenvs/ydk-gen/include/site/python2.7;/home/skg/.virtualenvs/ydk-gen/include/site/python2.7 CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: ydklocation linked by target "ydk" in directory /tmp/pip-Qg56rX-build

-- Configuring incomplete, errors occurred!
See also "/tmp/pip-Qg56rX-build/build/temp.linux-x86_64-2.7/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-Qg56rX-build/setup.py", line 157, in <module>
    zip_safe=False,
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/home/skg/.virtualenvs/ydk-gen/local/lib/python2.7/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
    self.run_command('build')
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/tmp/pip-Qg56rX-build/setup.py", line 69, in run
    self.build_extension(ext)
  File "/tmp/pip-Qg56rX-build/setup.py", line 93, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp)
  File "/usr/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-Qg56rX-build', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-Qg56rX-build/build/lib.linux-x86_64-2.7', '-DPYBIND11_INCLUDE=/home/skg/.virtualenvs/ydk-gen/include/site/python2.7;/home/skg/.virtualenvs/ydk-gen/include/site/python2.7', '-DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so', '-DPYTHON_INCLUDE=/usr/include/python2.7', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1

----------------------------------------

Command "/home/skg/.virtualenvs/ydk-gen/bin/python2.7 -u -c "import setuptools, tokenize;file='/tmp/pip-Qg56rX-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 /tmp/pip-WdEp5R-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/skg/.virtualenvs/ydk-gen/include/site/python2.7/ydk" failed with error code 1 in /tmp/pip-Qg56rX-build/ (ydk-gen) skg@skg-dev ~/dev/ydk/ydk-gen $

ghost commented 7 years ago

Hi @skg-net, this is a different error now. It indicates that libydk has not been installed.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
    Please set them or make sure they are set and tested correctly in the CMake files:
    ydk_location
        linked by target "ydk_" in directory /tmp/pip-Qg56rX-build

You can install libydk via the below steps (https://github.com/CiscoDevNet/ydk-py#system-requirements):

$ sudo apt-get install gdebi-core python3-dev python-dev libtool-bin
$ wget https://devhub.cisco.com/artifactory/debian-ydk/0.6.1/libydk_0.6.1-1_amd64.deb
$ sudo gdebi libydk_0.6.1-1_amd64.deb

After these steps, pip install ydk should work

skg-net commented 7 years ago

Thanks @abhikeshav, but I thought, the YDK core library is what we generated and trying to do pip install. Is it not true?

After installing ydk, I ran into below issue. Also, the CMake error logs are deleted, is there a way to retain them.

ghost commented 7 years ago

Hi @skg-net,

After the 0.6.0 release, the python ydk core requires libydk to be installed, since the python core now contains a wrapper around C/C++ code.

From looking at the error, it looks like you are trying to do a pip install of the python core from the latest master branch of ydk-gen.

But there have been changes on the master branch since the last 0.6.1 release, hence the error.

On the other hand, if you try pip install ydk, it should grab the latest released python version to install.

To install the latest code, you need to do the below steps first as specified in the ydk-gen README:

$ ./generate.py --cpp --core
$ cd gen-api/cpp/ydk/build && make && sudo make install
ghost commented 7 years ago

Closing. Let me know if there are any further issues

skg-net commented 7 years ago

Thanks @abhikeshav that, resolves my issue.