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

how to install lib? #25

Closed
mrgloom opened this issue May 28, 2014 · 6 comments · Fixed by #42
Closed

how to install lib? #25

mrgloom opened this issue May 28, 2014 · 6 comments · Fixed by #42

Comments

@mrgloom
Copy link

mrgloom commented May 28, 2014

how to install lib?

it will be good if I can install it using pip like "pip install cudamat"

on win xp x32 I run make in folder and then run python test_cudamat.py

but it gives me error

Traceback (most recent call last):
File "test_cudamat.py", line 4, in
import cudamat as cm
File "C:\Documents and Settings\User\╨рсюўшщ ёЄюы\cudamat-master\cudamat-mas
ter\cudamat.py", line 8, in
cudamat = ct.cdll.LoadLibrary('libcudamat.dll')
File "C:\Python27\lib\ctypes__init
_.py", line 443, in LoadLibrary
return self.dlltype(name)
File "C:\Python27\lib\ctypes__init
_.py", line 365, in init
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]

it seems that dll is missing?

I have only .so and .lib files.

if I rename .so to .dll in makefile I get error

Traceback (most recent call last):
File "test_cudamat.py", line 4, in
import cudamat as cm
File "C:\Documents and Settings\User\╨рсюўшщ ёЄюы\cudamat-master\cudamat-mas
ter\cudamat.py", line 12, in
cudamat.get_last_cuda_error.restype = ct.c_char_p
File "C:\Python27\lib\ctypes__init
_.py", line 378, in getattr
func = self.getitem(name)
File "C:\Python27\lib\ctypes__init__.py", line 383, in getitem
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'get_last_cuda_error' not found

@mrgloom
Copy link
Author

mrgloom commented May 28, 2014

did like here
https://code.google.com/p/cudamat/issues/detail?id=7

and test_cudamat.py give me

FAILED (errors=1, failures=1)

@f0k
Copy link
Contributor

f0k commented May 28, 2014

You're right, cudamat should get a proper package structure, a setup.py for installation and eventually be registered on PyPI.

Unfortunately, I cannot test cudamat on Windows. Could you please try surban's fork and see if it works? It is based on the original project on google code and does not include any of the new features in the project here, but if it works, we could ask for surban's permission to incorporate his changes.

@mrgloom
Copy link
Author

mrgloom commented Jun 3, 2014

I manage to compile code adding __declspec(dllexport) to all the functions in cudamat.cu like suggested here https://code.google.com/p/cudamat/issues/detail?id=7

but sometimes 1 test fails (not everytime)

FAIL: test_cudamat.test_pow_matrix
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\nose\case.py", line 197, in runTest
self.test(self.arg)
File "C:\Documents and Settings\User\╨рсюўшщ ёЄюы\temp\cudamat-master\tes
udamat.py", line 795, in test_pow_matrix
assert np.max(np.abs(c - m1.numpy_array)) < 10
*-2, "Error in cudamat.pow
ceeded threshold"
AssertionError: Error in cudamat.pow exceeded threshold

I think it's due to some floating point errors.

@f0k
Copy link
Contributor

f0k commented Jan 12, 2015

In the meantime, cudamat is installable via pip (from a local checkout, there's no PyPI release yet); see the installation instructions.

Could you please check what exactly you need to change to compile on Windows? Just replace all occurrences of the useless extern keyword with __declspec(dllexport) (except for the occurrence in extern "C")? If so, then I'll just add the necessary ifdef magic. Unfortunately, I don't have a Windows box to test this myself, so your help would be appreciated!

@mrgloom
Copy link
Author

mrgloom commented Jan 27, 2015

I think you can make it instalable from github like done here:
http://danielnouri.org/notes/2014/12/17/using-convolutional-neural-nets-to-detect-facial-keypoints-tutorial/
something like:
pip install -r https://raw.githubusercontent.com/dnouri/kfkd-tutorial/master/requirements.txt
pip install -r https://raw.githubusercontent.com/dnouri/kfkd-tutorial/master/requirements-2.txt

_>Just replace all occurrences of the useless extern keyword with _declspec(dllexport) (except for the >occurrence in extern "C")
I think so,but it was long ago, for example in cudamat-win DLLEXPORT extern used.

@f0k
Copy link
Contributor

f0k commented Jan 27, 2015

I think you can make it instalable from github

It already is installable from github via pip, there's nothing to be done for that, you can just run pip install git+https://github.com/cudamat/cudamat.git. I find it easier to keep track of updates when I have a local clone, though (i.e., check if there are upstream changes, pull them in and install again; or install in develop mode right away and just recompile if needed).

I think so,but it was long ago

If you still have Windows available, I've created a PR with Windows support two weeks ago and am hoping for somebody to test it: #42
Would be nice if you could help out there!

@f0k f0k mentioned this issue Aug 4, 2015
@f0k f0k closed this as completed in #42 Aug 4, 2015
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

Successfully merging a pull request may close this issue.

2 participants