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

Installation Windows #15

Closed
rudi59 opened this issue Feb 9, 2017 · 16 comments
Closed

Installation Windows #15

rudi59 opened this issue Feb 9, 2017 · 16 comments
Assignees

Comments

@rudi59
Copy link

rudi59 commented Feb 9, 2017

Is it possible to install/compile python-gammu in windows? i have some errors with install in windows.

@nijel
Copy link
Member

nijel commented Feb 9, 2017

Yes it's possible, but there is slight problem in getting Gammu built by same MSVC version as Python. So you most likely will have to build Gammu as well.

@ktngoykalolo
Copy link

hello struggling as well to install the Python-gammu package on Visual Studio. trying out the VS tools for Python. when importing the package it fails. any help ?

@nijel
Copy link
Member

nijel commented Feb 20, 2017

What error do you get? Maybe you just need to copy Gammu.dll somewhere it can find it?

@ktngoykalolo
Copy link

I have PTVS on VS 2015. (community edition) . I have installed Python via the Anaconda tooling.
I have tried adding it via pip, easy_install or conda, only pip says that it doesn't find the gammu files.
it fails to install.

@rudi59
Copy link
Author

rudi59 commented Feb 20, 2017

At the Moment i can only compile Gammu self with VS 2015.
python-gammu has Errors in smsd.c - if i compile without gammu-smsd VS can not Link the Build correctly.
Maybe there are some dependencies not corretly installed on my System, i dont know it exactly at the Moment. I also modified my gammu.pc (pkgconfig) VS don´t need a libm.

@ktngoykalolo
Copy link

@rudi59 could you give me more details on how you compile Gammu on VS 2015 ?
I am considering porting this project on .NET via native bindings.

@nijel
Copy link
Member

nijel commented Feb 20, 2017 via email

@rudi59
Copy link
Author

rudi59 commented Feb 20, 2017

@ktngoykalolo For Gammu you need minimum cmake and doxygen, python2.7 and pkg-config installed. with cmake -G "Visual Studio 14 2015" you can create a Visual Studio 2015 Gammu.sln. All other dependencies are listed her https://wammu.eu/docs/manual/project/install.html#compiling-on-microsoft-windows To compile you need Windows SDK and C++ Headers in Community Edtion.

@nijel Yes i would share any changes, at the Moment i don´t have any solution for the Errors in smsd.c and the Linker Problem.
In gammu.pc (and gammu-smsd.pc) for Windows

gammu-smsd.pc:
"Libs: -L${libdir} -lgsmsd -lm" changed to
"Libs: -L${libdir} -lgsmsd"

gammu.pc:
"Libs: -L${libdir} -lgsmsd -lm" changed to
"Libs: -L${libdir} -lgsmsd"

If you Need, i can provide a diff file.

@ktngoykalolo
Copy link

ktngoykalolo commented Feb 21, 2017

@nijel here are the results I get when trying to add python-gammu on the project :

Collecting python-gammu
  Using cached python-gammu-2.7.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 69, in _spawn_nt
        rc = os.spawnv(os.P_WAIT, executable, cmd)
    FileNotFoundError: [Errno 2] No such file or directory
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Kevin\AppData\Local\Temp\pip-build-751bgc3t\python-gammu\setup.py", line 110, in <module>
        check_minimum_gammu_version()
      File "C:\Users\Kevin\AppData\Local\Temp\pip-build-751bgc3t\python-gammu\setup.py", line 45, in check_minimum_gammu_version
        "gammu"
      File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 38, in spawn
        _spawn_nt(cmd, search_path, dry_run=dry_run)
      File "C:\ProgramData\Anaconda3\lib\distutils\spawn.py", line 75, in _spawn_nt
        "command %r failed: %s" % (cmd, exc.args[-1]))
    distutils.errors.DistutilsExecError: command 'pkg-config' failed: No such file or directory
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Kevin\AppData\Local\Temp\pip-build-751bgc3t\python-gammu\
'python-gammu' failed to install. Exit code: 1

@ktngoykalolo
Copy link

here is the result with easy_install :
Installing 'python-gammu' Searching for python-gammu Reading https://pypi.python.org/simple/python-gammu/ Downloading https://pypi.python.org/packages/ee/ec/1ed4c72ae1399edcf7f450798d52dd6b2d54bd85056a8b9fd698fabdfbac/python-gammu-2.7.tar.gz#md5=16c668d9a2334f5301182f0a7e8feb59 Best match: python-gammu 2.7 Processing python-gammu-2.7.tar.gz Writing C:\Users\Kevin\AppData\Local\Temp\easy_install-1u6skrx8\python-gammu-2.7\setup.cfg Running python-gammu-2.7\setup.py -q bdist_egg --dist-dir C:\Users\Kevin\AppData\Local\Temp\easy_install-1u6skrx8\python-gammu-2.7\egg-dist-tmp-56hgz2yz error: command 'pkg-config' failed: No such file or directory 'python-gammu' failed to install. Exit code: 1

nijel added a commit to gammu/gammu that referenced this issue Feb 21, 2017
It's not needed there, see
gammu/python-gammu#15 (comment)

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member

nijel commented Feb 21, 2017

@rudi59 Feel free to report errors in building. The -lm issue should be fixed as of gammu/gammu@c845917fd

@nijel nijel added the question label Feb 21, 2017
@nijel
Copy link
Member

nijel commented Feb 21, 2017

@ktngoykalolo Install pkg-config.

@nijel
Copy link
Member

nijel commented Feb 21, 2017

Looking at https://wiki.python.org/moin/WindowsCompilers, the official binaries should be compatible with Python 3.5 and 3.6. In that case you don't need to build it, just install (and ensure pkg-config finds it).

@rudi59
Copy link
Author

rudi59 commented Feb 23, 2017

There are several issue on Windows. I attached some patch files for misc.c, smsd.c and convertors\base.c
patch.zip
please review this changes.

i can minimsize the errors, but some of them are still existing on linking. i work on it.

base.obj : error LNK2019: unresolved external symbol _strcasecmp referenced in f
unction _BoolFromPython
diverts.obj : error LNK2001: unresolved external symbol _strcasecmp
gammu.obj : error LNK2001: unresolved external symbol _strcasecmp
gsmsd.lib(core.obj) : error LNK2019: unresolved external symbol _GSM_StringArray
_New referenced in function _SMSD_NewConfig
gsmsd.lib(core.obj) : error LNK2019: unresolved external symbol _GSM_StringArray
_Free referenced in function _SMSD_FreeConfig
gsmsd.lib(core.obj) : error LNK2019: unresolved external symbol _GSM_StringArray
_Add referenced in function _SMSD_LoadIniNumbersList
gsmsd.lib(core.obj) : error LNK2019: unresolved external symbol _GSM_StringArray
_Find referenced in function _SMSD_CheckRemoteNumber
gsmsd.lib(core.obj) : error LNK2019: unresolved external symbol _round reference
d in function _SMSD_MainLoop
gsmsd.lib(sql.obj) : error LNK2019: unresolved external symbol _strptime referen
ced in function _SMSDSQL_ParseDate
Gammu.lib(s60phone.obj) : error LNK2001: unresolved external symbol _strcasestr
Gammu.lib(gsmlogo.obj) : error LNK2019: unresolved external symbol _strcasestr r
eferenced in function _GSM_SaveBitmapFile
Gammu.lib(gsmback.obj) : error LNK2001: unresolved external symbol _strcasestr
Gammu.lib(gsmstate.obj) : error LNK2001: unresolved external symbol _strcasestr
Gammu.lib(atgen.obj) : error LNK2001: unresolved external symbol _strcasestr
Gammu.lib(gsmstate.obj) : error LNK2019: unresolved external symbol __imp__SHGet
FolderPathA@20 referenced in function _GSM_FindGammuRC
Gammu.lib(dummy.obj) : error LNK2019: unresolved external symbol _closedir refer
enced in function _DUMMY_Terminate
Gammu.lib(dummy.obj) : error LNK2019: unresolved external symbol _readdir refere
nced in function _DUMMY_GetFolderListing
Gammu.lib(dummy.obj) : error LNK2019: unresolved external symbol _opendir refere
nced in function _DUMMY_GetFolderListing
Gammu.lib(at-sms.obj) : error LNK2019: unresolved external symbol _strchrnul ref
erenced in function _ATGEN_ReplyGetSMSMemories```


nijel added a commit that referenced this issue Mar 1, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Mar 1, 2017
This code is wrong, but GCC seems to be more tollerant here.

Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member

nijel commented Mar 1, 2017

Thanks, I've merged these changes.

nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
This is needed to have full install as default.

Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit to gammu/gammu that referenced this issue Jun 14, 2017
It is used there and having that separately just makes proper linking on
Windows hard.

See gammu/python-gammu#15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Jun 14, 2017
It sems that the system has troubles with such thing.

Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel
Copy link
Member

nijel commented Jun 14, 2017

I've managed to fix compilation and automate it on AppVeyor, so the binaries are now produced for every commit and will be included in upcoming releases.

@nijel nijel closed this as completed Jun 14, 2017
@nijel nijel self-assigned this Jun 14, 2017
nijel added a commit that referenced this issue Jun 14, 2017
Issue #15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit to gammu/gammu that referenced this issue Jun 17, 2017
See gammu/python-gammu#15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit to gammu/gammu that referenced this issue Nov 23, 2017
This should allow to build Python 2.7 python-gammu module.

Also build only one debug build. It is pretty much needed only to get
coverage reports and that should not differ between 32bit and 64bit
build, while this saves 50 minutes of build time.

See gammu/python-gammu#15

Signed-off-by: Michal Čihař <michal@cihar.com>
nijel added a commit that referenced this issue Nov 23, 2017
- build 32-bit and 64-bit versions
- build for Python 2.7
- this currently uses latest build of Gammu

See #15 and gammu/wammu#51

Signed-off-by: Michal Čihař <michal@cihar.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants