1

I'd like to use python copperhead for CUDA C++ prototyping, which requires MSVC++14, and I want to make copperhead work first without CUDA. I've installed Microsoft Build Tools 2015 and tried to generate the hello world example from https://pypi.org/project/copperhead/, but I got an error message shown below. I don't want to install Visual Studio, if possible.

I installed MS Build Tools 2015 (build 14.0.23107.10), I am not sure if this is what I am supposed to install... I installed copperhead via pip on python 3.7.2.

import copperhead as cpp

hello_world_cpp = '''
#include <iostream>
void hello_world()
{
   std::cout << "Hello World!" << std::endl;
}'''

hello_world = cpp.generate('hello_world', 'void()', hello_world_cpp)

hello_world()
running install
running bdist_egg
running egg_info
writing hello_world.egg-info\PKG-INFO
writing dependency_links to hello_world.egg-info\dependency_links.txt
writing top-level names to hello_world.egg-info\top_level.txt
reading manifest file 'hello_world.egg-info\SOURCES.txt'
writing manifest file 'hello_world.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_ext
building 'hello_world' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
  • Just install "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ . Maybe there is a version mismatch, or some missing libs with Microsoft build tools 2015? – Piotr Kamoda Jun 13 '19 at 09:14
  • 1
    Don't bother. Copperhead was an Nvidia research project which hasn't been touched for 6 or 7 years. You are very unlikely to get it to work – talonmies Jun 13 '19 at 09:33
  • Hi, thanks for the answers, I gave in and installed VS2019 :) I re-run the script, now with, MS's python3.7.3 and got ```C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\include\pyconfig.h(203): fatal error C1083: Cannot open include file: 'basetsd.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2``` – Gugyin Adrián Jun 13 '19 at 09:58

0 Answers0