Installing pycuda on windows - visual-studio

So I try python -m pip install pycuda and it fails (Here's some of the output from the failed install):
Building wheel for pycuda (pyproject.toml) ... error
error: subprocess-exited-with-error
WARNING: nvcc not in path.
ERROR: Failed building wheel for pycuda
Failed to build pycuda
ERROR: Could not build wheels for pycuda, which is required to install pyproject.toml-based projects
I have installed the Visual Studio 2022 build tools but I have not added anything to my path, which is all I figure I have todo but I don't know what I have to add. The pycuda wiki's installation page specifies
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;
but I don't have those directories. Here's the tree of my visual studio install D:\VisualStudioThings\install\VC. (I cannot include the tree for the whole install because it's too much)
Common7
CoreCon
DIA SDK
ImportProjects
Licenses
Microsoft Azure Tools
MSBuild
SDK
Team Tools
VB
VC
VC#
VSSDK
Xml
VC
├───Auxiliary
│ ├───Build
│ └───VS
│ ├───include
│ │ └───CppCoreCheck
│ ├───lib
│ │ ├───arm
│ │ ├───onecore
│ │ │ ├───arm
│ │ │ ├───x64
│ │ │ └───x86
│ │ ├───x64
│ │ └───x86
│ └───UnitTest
│ ├───include
│ │ ├───UWP
│ │ └───v150
│ └───lib
│ ├───ARM
│ ├───ARM64
│ ├───UWP
│ │ ├───arm
│ │ ├───arm64
│ │ └───x64
│ ├───x64
│ └───x86
├───Redist
│ └───MSVC
│ ├───14.34.31931
│ │ ├───Auxiliary
│ │ ├───debug_nonredist
│ │ │ ├───x64
│ │ │ │ ├───Microsoft.VC143.DebugCRT
│ │ │ │ ├───Microsoft.VC143.DebugCXXAMP
│ │ │ │ ├───Microsoft.VC143.DebugOpenMP
│ │ │ │ └───Microsoft.VC143.OpenMP.LLVM
│ │ │ └───x86
│ │ │ ├───Microsoft.VC143.DebugCRT
│ │ │ ├───Microsoft.VC143.DebugCXXAMP
│ │ │ ├───Microsoft.VC143.DebugOPENMP
│ │ │ └───Microsoft.VC143.OpenMP.LLVM
│ │ ├───onecore
│ │ │ ├───debug_nonredist
│ │ │ │ ├───x64
│ │ │ │ │ ├───Microsoft.VC143.DebugCRT
│ │ │ │ │ └───Microsoft.VC143.DebugOpenMP
│ │ │ │ └───x86
│ │ │ │ ├───Microsoft.VC143.DebugCRT
│ │ │ │ └───Microsoft.VC143.DebugOPENMP
│ │ │ ├───x64
│ │ │ │ ├───Microsoft.VC143.CRT
│ │ │ │ └───Microsoft.VC143.OpenMP
│ │ │ └───x86
│ │ │ ├───Microsoft.VC143.CRT
│ │ │ └───Microsoft.VC143.OPENMP
│ │ ├───x64
│ │ │ ├───Microsoft.VC143.CRT
│ │ │ ├───Microsoft.VC143.CXXAMP
│ │ │ └───Microsoft.VC143.OpenMP
│ │ └───x86
│ │ ├───Microsoft.VC143.CRT
│ │ ├───Microsoft.VC143.CXXAMP
│ │ └───Microsoft.VC143.OPENMP
│ └───v143
└───Tools
├───Llvm
│ ├───bin
│ └───x64
│ └───bin
└───MSVC
└───14.34.31933
├───Auxiliary
├───bin
│ ├───Hostx64
│ │ ├───x64
│ │ │ ├───1033
│ │ │ └───onecore
│ │ └───x86
│ │ └───1033
│ └───Hostx86
│ ├───x64
│ │ └───1033
│ └───x86
│ └───1033
├───crt
│ └───src
│ ├───concrt
│ ├───i386
│ ├───linkopts
│ ├───stl
│ ├───vccorlib
│ ├───vcruntime
│ └───x64
├───include
│ ├───cliext
│ ├───CodeAnalysis
│ ├───cvt
│ ├───experimental
│ ├───fuzzer
│ ├───Manifest
│ ├───msclr
│ │ └───com
│ └───sanitizer
└───lib
├───onecore
│ ├───arm
│ ├───x64
│ └───x86
├───x64
│ ├───onecore
│ ├───store
│ └───uwp
└───x86
├───onecore
├───store
│ └───references
└───uwp
So my question is what do I add to my path?

I can reproduce your issue:
Since you are based on windows, you can try the below steps:
pip install --upgrade pip
pip install --upgrade setuptools wheel
If the above steps still don't make it work on your side, I think the issue should comes from the source doesn't have whl file. Because pip will search package from https://pypi.org/, but in this place, I don't see the package pycuda has whl there.
Based on this, I found whl file of pycuda from other place, download it and install the package via this:
python -m pip install packagefilename.whl
It works well on my side, I can install it at the end:

Related

Makefile .tar: Flatten the source files' directory structure

I want to collect some source files and tar them by using Makefile. The source files are scattering as follows:
project
│
├── Makefile
│
├── folder(name is arbitrary)
│ │
│ ├── test1.txt
│ ├── test2.txt
│ .
│ .
│ .
│
├── source.cpp
│
├── source2.cpp
│
├── source.h
.
.
Now, I want to have a flattened tarball file that includes every source files just under the root directory of this tarball file when I call make in the root directory(project), like this:
myTarball.tar.gz
│
├── Makefile
│
├── source.cpp
│
├── source2.cpp
│
├── source.h
│
├── test1.txt
│
├── test2.txt
│
.
.
.
The current make file looks something like this:
FILES=$($(wildcard Makefile *.h *.hpp *.cpp test*.txt */test*.txt))
$(NAME): $(FILES)
COPYFILE_DISABLE=true tar -vczf $(NAME) $(FILES)
I'm not familiar with makefile and bash, but I try my best to play around and do some searching but found nothing. The current one can only generate something like
NAME.tar.gz
│
├── Makefile
│
├── folder
│ │
│ ├── test1.txt
│ ├── test2.txt
│ .
│ .
│ .
│
├── source.cpp
│
├── source2.cpp
│
├── source.h
.
.
with the folder structure. I think I might first copy all source files in the folder to the root directory, and delete them after tar them up. Is there a better way to do this elegantly?
Well, you can do it that way but if you're using GNU tar then it's probably simpler to just let tar do the work for you rather than copying files around to a temporary location first.
Something like this should work:
$(NAME): $(FILES)
COPYFILE_DISABLE=true tar -vczf $(NAME) --transform='s,.*/,,' $(FILES)
which will remove all directories from files inside the generated tar file. See the manual for the --transform option.

MacOS: Could not find Headers in Gstreamer 1.14.2 Framework

I just installed the 1.14.2 on my mac using the pkg. There's no Headers folder!
/Library/Frameworks/GStreamer.framework/Headers links to Versions/Current/Headers. But there nothing there!
To be clear, Current is a symlink to 1.0/ in the same directory
This is what the directory structure of the framework looks like
/Library/Frameworks/GStreamer.framework/
├── Commands -> Versions/Current/Commands
├── Libraries -> Versions/Current/Libraries
├── Resources -> Versions/Current/Resources
└── Versions
├── 1.0
│   ├── Commands -> bin
│   ├── Libraries -> lib
│   ├── Resources
│   ├── bin
│   ├── etc
│   │   └── fonts
│   │   └── conf.d
│   ├── lib
│   │   ├── gio
│   │   │   └── modules
│   │   ├── girepository-1.0
│   │   ├── gst-validate-launcher
│   │   │   └── python
│   │   │   └── launcher
│   │   │   ├── apps
│   │   │   └── testsuites
│   │   └── gstreamer-1.0
│   │   └── validate
│   ├── libexec
│   │   └── gstreamer-1.0
│   └── share
│   ├── fontconfig
│   │   └── conf.avail
│   ├── glib-2.0
│   │   └── schemas
│   ├── gstreamer
│   ├── gstreamer-1.0
│   │   └── validate
│   │   └── scenarios
│   └── locale
│   ├── af
│   │   └── LC_MESSAGES
│   ├── am
│   │   └── LC_MESSAGES
There are two packages - one with the runtime (which you probably have installed) and the developer package which installs on top of the runtime. Make sure you have both.

Exuberant Ctags 5.8 generating incomplete tags file for specific project

Using Arch Linux and I have Ctag 5.8 installed.
My Go project has this structure:
.
├── apply
│   └── apply.go
├── calculate
│   └── calculate.go
├── coupon.sqlite3
├── Godeps
│   ├── Godeps.json
│   └── Readme
├── main.go
├── Makefile
├── models
│   ├── cupom.go
│   ├── errorMessage.go
│   └── product.go
├── ping
│   └── ping.go
├── README.md
├── routes
│   └── routes.go
├── tags
├── tests
│   ├── apply_test.go
│   ├── calculate_test.go
│   ├── config.go
│   ├── coupon.sqlite3
│   └── fixtures
│   └── calculate.go
Running the command ctags -R or ctags -R . I have a tags file generated but with this content only.
!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert#users.sourceforge.net/
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
Running the same command on other project generate the tags file correctly.
You have Exuberant Ctags installed, which does not support Go out of the box (http://ctags.sourceforge.net/languages.html).
There are a bunch of different alternative programs or ways to add it to your existing ctags:
https://go-wise.blogspot.ca/2011/09/using-ctags-with-go.html
https://github.com/eapache/starscope
https://github.com/jstemmer/gotags
http://ctags.sourceforge.net/EXTENDING.html

Qt project include file not found

I have QtCreator project named UePOSCommClient, which is some GUI applications, which is dependent on another QtCreator project, named UePOSCommProtocol, which is implementation of communications protocol betwwen UePOSCommClient and some Server app. Here is UePOSCommClient projects directory hirerachy:
uePOSCommClient/
├── build
│   └── x64
│   ├── debug
│   │   ├── main.o
│   │   ├── Makefile
│   │   ├── moc_uemainwindow.cpp
│   │   ├── moc_uemainwindow.o
│   │   ├── uemainwindow.o
│   │   └── uePOSCommClient
│   └── release
├── main.cpp
├── uemainwindow.cpp
├── uemainwindow.h
├── uePOSCommClient.pro
└── uePOSCommClient.pro.user
and here is UePOSCommProtocol's project's directoty hirerachy:
uePOSCommProtocol/
├── build
│   └── x64
│   ├── debug
│   │   ├── libuePOSCommProtocol.so -> libuePOSCommProtocol.so.1.0.0
│   │   ├── libuePOSCommProtocol.so.1 -> libuePOSCommProtocol.so.1.0.0
│   │   ├── libuePOSCommProtocol.so.1.0 -> libuePOSCommProtocol.so.1.0.0
│   │   ├── libuePOSCommProtocol.so.1.0.0
│   │   ├── Makefile
│   │   ├── moc_uemessageheader.cpp
│   │   ├── moc_uemessageheader.o
│   │   ├── moc_uemessagerequest.cpp
│   │   ├── moc_uemessagerequest.o
│   │   ├── moc_ueposcommprotocol.cpp
│   │   ├── moc_ueposcommprotocol.o
│   │   ├── uemessageheader.o
│   │   ├── uemessagerequest.o
│   │   └── ueposcommprotocol.o
│   └── release
│   ├── libuePOSCommProtocol.so -> libuePOSCommProtocol.so.1.0.0
│   ├── libuePOSCommProtocol.so.1 -> libuePOSCommProtocol.so.1.0.0
│   ├── libuePOSCommProtocol.so.1.0 -> libuePOSCommProtocol.so.1.0.0
│   ├── libuePOSCommProtocol.so.1.0.0
│   ├── Makefile
│   ├── moc_uemessageheader.cpp
│   ├── moc_uemessageheader.o
│   ├── moc_uemessagerequest.cpp
│   ├── moc_uemessagerequest.o
│   ├── moc_ueposcommprotocol.cpp
│   ├── moc_ueposcommprotocol.o
│   ├── uemessageheader.o
│   ├── uemessagerequest.o
│   └── ueposcommprotocol.o
├── net
│   └── comm_protocol
│   ├── uemessageheader.cpp
│   ├── uemessageheader.h
│   ├── uemessagerequest.cpp
│   ├── uemessagerequest.h
│   └── ueprotocolcommands.h
├── settings
│   └── uedefaults.h
├── ueposcommprotocol.cpp
├── ueposcommprotocol_global.h
├── ueposcommprotocol.h
├── uePOSCommProtocol.pro
└── uePOSCommProtocol.pro.user
Now, all works fine, the project UePOSCommClient compiles without errors, and runs without problems. However, in UePOSCommProtocol project, I have following #include statement:
#include "../../../../../../../../../home/users/Projects/uePOSCommProtocol/settings/uedefaults.h"
which is absolute path to uedefaults.h file. I am aware this is a bad practice and therefore I've replaced upper #include with:
#include "settings/uedefaults.h"
After doing so now I get No such file or directory error:
In file included from ../../../../uePOSCommProtocol/ueposcommprotocol.h:7:0,
from ../../../uemainwindow.h:11,
from ../../../main.cpp:3:
../../../../uePOSCommProtocol/net/comm_protocol/uemessagerequest.h:9:33: fatal error: settings/uedefaults.h: No such file or directory
#include "settings/uedefaults.h"
^
compilation terminated.
make: *** [main.o] Error 1
14:43:03: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project uePOSCommClient (kit: Desktop Qt 5.6.0 GCC 64bit)
When executing step "Make"
Both projects reside in /home/user/Projects directory and why am I getting this error?
P.S.: I am using Qt 5.6.0 for Linux (64bit) with QtCreator 3.6.1 on Ubuntu Linux 14.04 LTS (64bit).

Can't install Revel (Unrecognized import path)

I'm a beginner in Go and I would like to use the Revel web framework.
I installed: Git; Mercurial and even: Bazaar and CVS.
I checked my environment variables. I set environment variable GOPATH to D:\Go and added D:\Go\bin to PATH.But I still get these errors when I go get The Revel Framework (go get github.com/revel/revel)
**
package golang.org/x/net/websocket: unrecognized import path "golang.org/x/net/websocket"
package gopkg.in/fsnotify.v1: unrecognized import path "gopkg.in/fsnotify.v1"**
For instalation of GO into your home folder you need this environment variables:
.
├── bin
├── go (GO)
└── src
├── revel.project
│   ├── app
│   │   ├── controllers
│   │   ├── models
│   │   ├── routes
│   │   ├── tmp
│   │   └── views
│   │   ├── admin
│   │   ├── App
│   │   ├── errors
│   │   └── users
│   ├── conf
│   ├── messages
│   ├── public
│   │   ├── css
│   │   │   └── administrator
│   │   ├── img
│   │   ├── js
│   │   └── uploads
│   │   └── 1
│   ├── resources
│   ├── scripts
│   ├── test-results
│   └── tests
├── code.google.com
├── github.com
│   ├── revel
│   │   ├── cmd
│   │   ├── modules
│   │   └── revel
run this in your prompt path or modify if your folders are differents.
export GOARCH=amd64
export GOPATH=~/go
export GOBIN=~/go/go/bin
export GOROOT=~/go/go
export PATH=$PATH:$GOPATH/go/bin
export GOTOOLDIR=~/go/go/pkg/tool/linux_amd64
export CC="gcc"
export GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
export CXX=g++
export CGO_ENABLED=1
Where ~ is the name of you personal folder in the system (Bash Gnu Linux)

Resources