Discussion:
[Gwyddion-users] pygwy installation from macports
YTC
2014-04-23 09:41:55 UTC
Permalink
Recently switched to Mac and tried to install gwyddion from macports. But
pygwy is not available. Possible to enable it?

Also tried to build from source but at the end, "make install" got the
following error:

*pygwy.c:32:10: **fatal error: **'pygtk-2.0/pygobject.h' file not found*

#include <pygtk-2.0/pygobject.h>


though pygtk-2.0 is installed and pygobject.h does exist.


Any help would be appreciated. Thanks.
David Nečas (Yeti)
2014-04-23 11:02:41 UTC
Permalink
Post by YTC
Also tried to build from source but at the end, "make install" got the
*pygwy.c:32:10: **fatal error: **'pygtk-2.0/pygobject.h' file not found*
#include <pygtk-2.0/pygobject.h>
though pygtk-2.0 is installed and pygobject.h does exist.
I don't know much about the Mac specifics but this is certainly odd.
I suppose you get the same error when you just run ‘make’ because
getting it only on ‘make install’ makes no sense.

Could you please post (or send me) config.log? Do you have pygtk and
everything else from macports installed to the standard /opt/local?

Yeti
Rolf Wuerdemann
2014-04-23 19:53:28 UTC
Permalink
Post by David Nečas (Yeti)
Post by YTC
Also tried to build from source but at the end, "make install" got the
*pygwy.c:32:10: **fatal error: **'pygtk-2.0/pygobject.h' file not found*
#include <pygtk-2.0/pygobject.h>
though pygtk-2.0 is installed and pygobject.h does exist.
I don't know much about the Mac specifics but this is certainly odd.
I suppose you get the same error when you just run ‘make’ because
getting it only on ‘make install’ makes no sense.
Enabling pygwy with macports is not such trivial. You have at least
to activate some python version (native/macports) for this ...
Post by David Nečas (Yeti)
Could you please post (or send me) config.log? Do you have pygtk and
everything else from macports installed to the standard /opt/local?
Yeti
rowue
Post by David Nečas (Yeti)
[...]
--
Security is an illusion - Datasecurity twice
Rolf WÃŒrdemann - ***@digitalis.org
GnuPG fingerprint: EEDC BEA9 EFEA 54A9 E1A9 2D54 69CC 9F31 6C64 206A
xmpp: ***@digitalis.org E1189573 6B4A150C A0C2BF5A 5553F865 0B9CBF7A
***@jabber.ccc.de 64CBBB68 0A3514A4 026FC1E7 5328CE87 AEE2185F
YTC
2014-04-23 20:16:05 UTC
Permalink
Yeah, I got the same error when just running "make".

I believe everything is installed to /opt/local

pygtk is at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/pygtk-2.0
where pygobject.h actually is

This seems a bit strange because there are a bunch of other .h files in
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7

Also when I first run ./configure, it was not able to find pygtk at all as
the summary says pygwy will not be installed (pygtk2 is needed)

Then I did the following:

export
PKG_CONFIG_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig/

After this, ./configure was able to find pygtk2 and pygwy is listed as
'yes'.
Post by David Nečas (Yeti)
Post by YTC
Also tried to build from source but at the end, "make install" got the
*pygwy.c:32:10: **fatal error: **'pygtk-2.0/pygobject.h' file not found*
#include <pygtk-2.0/pygobject.h>
though pygtk-2.0 is installed and pygobject.h does exist.
I don't know much about the Mac specifics but this is certainly odd.
I suppose you get the same error when you just run ‘make’ because
getting it only on ‘make install’ makes no sense.
Could you please post (or send me) config.log? Do you have pygtk and
everything else from macports installed to the standard /opt/local?
Yeti
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gwyddion-users mailing list
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
YTC
2014-04-24 10:12:28 UTC
Permalink
Update: after some search, I did the following which made it go through

./configure CPPFLAGS="-I/opt/local/include
-I/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/"
LDFLAGS="-L/opt/local/lib"

pygwy console is now available.

However, I am having another problem importing gwy in python shell outside
gwyddion. (As I often need to batch process many files, I prefer to do it
outside gwyddion, and it has been working well in Windows.)
Post by YTC
Post by David Nečas (Yeti)
import gwy
Traceback (most recent call last):

File "<stdin>", line 1, in <module>

ImportError: Cannot dlopen() libgwyddion2.so.

I had followed the instructions here (
https://www.mail-archive.com/gwyddion-***@lists.sourceforge.net/msg01251.html
)

set LD_LIBRARY_PATH (to include the lib directory), PYTHONPATH (to include
the site-packages directory containing gwy.so)

PATH is not set as I am not sure what to set

I couldn't find libgwyddion2.so in the gwyddion installation path. Should I
include more paths in any of the environmental variables?

Thanks
Post by YTC
Yeah, I got the same error when just running "make".
I believe everything is installed to /opt/local
pygtk is at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/pygtk-2.0
where pygobject.h actually is
This seems a bit strange because there are a bunch of other .h files in
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
Also when I first run ./configure, it was not able to find pygtk at all as
the summary says pygwy will not be installed (pygtk2 is needed)
export
PKG_CONFIG_PATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig/
After this, ./configure was able to find pygtk2 and pygwy is listed as
'yes'.
Post by David Nečas (Yeti)
Also tried to build from source but at the end, "make install" got the
*pygwy.c:32:10: **fatal error: **'pygtk-2.0/pygobject.h' file not found*
#include <pygtk-2.0/pygobject.h>
though pygtk-2.0 is installed and pygobject.h does exist.
I don't know much about the Mac specifics but this is certainly odd.
I suppose you get the same error when you just run ‘make’ because
getting it only on ‘make install’ makes no sense.
Could you please post (or send me) config.log? Do you have pygtk and
everything else from macports installed to the standard /opt/local?
Yeti
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gwyddion-users mailing list
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
David Nečas (Yeti)
2014-04-24 12:02:54 UTC
Permalink
Post by YTC
import gwy
File "<stdin>", line 1, in <module>
ImportError: Cannot dlopen() libgwyddion2.so.
Well, this is a message I am responsible for...

What libgwyddion2* files you have in the Gwyddion's lib directory? I am
not sure if the shared libraries get extension .so or .dylib or .bundle
or what when you compile Gwyddion on OS X (Rowue, can you enlighten me?).
At this moment it looks for libgwyddion2.G_MODULE_SUFFIX, where the
G_MODULE_SUFFIX macro is apparently defines as "so". But if OS X has
different suffixes for modules and shared libraries (which should be
the from the dlopen() point of view) we may need to change this...

Regards,

Yeti
YTC
2014-04-24 16:58:59 UTC
Permalink
in the lib directory, the modules have .dylib extension. There are
both libgwyddion2.dylib and libgwyddion2.0.dylib. Not sure if this is
redundant.
Post by David Nečas (Yeti)
Post by YTC
import gwy
File "<stdin>", line 1, in <module>
ImportError: Cannot dlopen() libgwyddion2.so.
Well, this is a message I am responsible for...
What libgwyddion2* files you have in the Gwyddion's lib directory? I am
not sure if the shared libraries get extension .so or .dylib or .bundle
or what when you compile Gwyddion on OS X (Rowue, can you enlighten me?).
At this moment it looks for libgwyddion2.G_MODULE_SUFFIX, where the
G_MODULE_SUFFIX macro is apparently defines as "so". But if OS X has
different suffixes for modules and shared libraries (which should be
the from the dlopen() point of view) we may need to change this...
Regards,
Yeti
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gwyddion-users mailing list
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
David Nečas (Yeti)
2014-04-25 07:53:31 UTC
Permalink
Post by YTC
in the lib directory, the modules have .dylib extension. There are
both libgwyddion2.dylib and libgwyddion2.0.dylib. Not sure if this is
redundant.
Please try the attached patch. If it makes the standalone gwy module
work for you, I will try to fix it properly based on that. You may
still need to set DYLD_FALLBACK_LIBRARY_PATH or DYLD_LIBRARY_PATH, I am
not sure about the library search paths.

Regards,

Yeti
YTC
2014-04-26 02:58:15 UTC
Permalink
The patch worked. "import gwy" now works.

I also just tried to create symlinks of .dylib with .so extension and it
also worked.

To rowue,

I modified the portfile, and it can now go through. If you can incorporate
Yeti's patch, the macports version should work perfectly, without the need
to compile from source.

Thanks a lot for the help.

YTC
Post by David Nečas (Yeti)
Post by YTC
in the lib directory, the modules have .dylib extension. There are
both libgwyddion2.dylib and libgwyddion2.0.dylib. Not sure if this is
redundant.
Please try the attached patch. If it makes the standalone gwy module
work for you, I will try to fix it properly based on that. You may
still need to set DYLD_FALLBACK_LIBRARY_PATH or DYLD_LIBRARY_PATH, I am
not sure about the library search paths.
Regards,
Yeti
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gwyddion-users mailing list
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
Rolf Wuerdemann
2014-04-26 20:23:00 UTC
Permalink
Post by YTC
The patch worked. "import gwy" now works.
I also just tried to create symlinks of .dylib with .so extension and it
also worked.
To rowue,
I modified the portfile, and it can now go through. If you can
incorporate Yeti's patch, the macports version should work perfectly,
without the need to compile from source.
Usually: if you incooperate a patch for a c-file, you have to recompile
and link the spectific file. If you are a port-maintainer, you should
rebuild from scratch ....
Post by YTC
Thanks a lot for the help.
YTC
regs,

rowue
Post by YTC
[...]
--
Security is an illusion - Datasecurity twice
Rolf WÃŒrdemann - ***@digitalis.org
GnuPG fingerprint: EEDC BEA9 EFEA 54A9 E1A9 2D54 69CC 9F31 6C64 206A
xmpp: ***@digitalis.org E1189573 6B4A150C A0C2BF5A 5553F865 0B9CBF7A
***@jabber.ccc.de 64CBBB68 0A3514A4 026FC1E7 5328CE87 AEE2185F
Rolf Wuerdemann
2014-04-26 19:39:11 UTC
Permalink
Post by David Nečas (Yeti)
Post by YTC
in the lib directory, the modules have .dylib extension. There are
both libgwyddion2.dylib and libgwyddion2.0.dylib. Not sure if this is
redundant.
Please try the attached patch. If it makes the standalone gwy module
work for you, I will try to fix it properly based on that. You may
still need to set DYLD_FALLBACK_LIBRARY_PATH or DYLD_LIBRARY_PATH, I am
not sure about the library search paths.
The patch works nice, except the fact that I have to use
"DYLD_FALLBACK_LIBRARY_PATH". Do you think, you can set up the
loader to work on ${prefix}/lib instead of /usr/local/lib?
Post by David Nečas (Yeti)
Regards,
Yeti
Best,

rowue

PS: Might the debian maintainer take also a look? dlopen
fails for debian wheezy also

[...]
--
Security is an illusion - Datasecurity twice
Rolf WÃŒrdemann - ***@digitalis.org
GnuPG fingerprint: EEDC BEA9 EFEA 54A9 E1A9 2D54 69CC 9F31 6C64 206A
xmpp: ***@digitalis.org E1189573 6B4A150C A0C2BF5A 5553F865 0B9CBF7A
***@jabber.ccc.de 64CBBB68 0A3514A4 026FC1E7 5328CE87 AEE2185F
David Nečas (Yeti)
2014-04-27 11:10:02 UTC
Permalink
Post by Rolf Wuerdemann
The patch works nice,
Great, I commited a patch to use the libtool-detected shared library
extensions instead of module extension (revs 16158, 16159).
Post by Rolf Wuerdemann
except the fact that I have to use
"DYLD_FALLBACK_LIBRARY_PATH". Do you think, you can set up the
loader to work on ${prefix}/lib instead of /usr/local/lib?
I am somewhat confused abouth the library paths. If you can run
Gwyddion it means the libraries it requires are found by the dynamic
linker. And they are exactly the same libraries and the loading uses
the same search paths as we need for gwy.so – with one exception, a
library search path can be also encoded into the executable. However,
gwy.so is already built with

-Wl,-rpath -Wl,$(libdir)

at least for me, so the path is encoded to gwy.so. If you install the
libraries where you told configure you would do so, no search paths
should need to be set. But maybe I am missing something.
Post by Rolf Wuerdemann
PS: Might the debian maintainer take also a look? dlopen
fails for debian wheezy also
This cannot be caused by the extension because shared libraries and
modules are both called ".so" on Linux. It should not be caused by the
library search path either because libraries from a package are
installed into the system lib directory so they must be in the search
path.

Regards,

Yeti

Rolf Wuerdemann
2014-04-24 21:52:43 UTC
Permalink
import gwy
[...]
What libgwyddion2* files you have in the Gwyddion's lib directory?[...]
As YTC states - extension is .dylib

For anybody who is interested in using pygwy. I've added the
variant pygwy to macports which includes pygwy (tested with 10.8.5).
It's a little bit harsh by now (depends on python 2.7), but works
(at least for me)

For anybody who like to check:

sudo port sync
sudo port uninstall gwyddion
sudo port clean gwyddion
sudo port install gwyddion +pygwy
Regards,
Yeti
Kind regards,

rowue
[...]
--
Security is an illusion - Datasecurity twice
Rolf WÃŒrdemann - ***@digitalis.org
GnuPG fingerprint: EEDC BEA9 EFEA 54A9 E1A9 2D54 69CC 9F31 6C64 206A
xmpp: ***@digitalis.org E1189573 6B4A150C A0C2BF5A 5553F865 0B9CBF7A
***@jabber.ccc.de 64CBBB68 0A3514A4 026FC1E7 5328CE87 AEE2185F
YTC
2014-04-25 01:12:04 UTC
Permalink
That's great. Thanks a lot!

When I tried this, it says:

Dependency 'python-27' not found.


Should it be python27 instead? That's what is listed when I do "port select
--list python"
Post by Rolf Wuerdemann
import gwy
[...]
What libgwyddion2* files you have in the Gwyddion's lib directory?[...]
As YTC states - extension is .dylib
For anybody who is interested in using pygwy. I've added the
variant pygwy to macports which includes pygwy (tested with 10.8.5).
It's a little bit harsh by now (depends on python 2.7), but works
(at least for me)
sudo port sync
sudo port uninstall gwyddion
sudo port clean gwyddion
sudo port install gwyddion +pygwy
Regards,
Yeti
Kind regards,
rowue
[...]
--
Security is an illusion - Datasecurity twice
GnuPG fingerprint: EEDC BEA9 EFEA 54A9 E1A9 2D54 69CC 9F31 6C64 206A
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gwyddion-users mailing list
https://lists.sourceforge.net/lists/listinfo/gwyddion-users
Rolf Wuerdemann
2014-04-25 10:06:33 UTC
Permalink
Thats great. Thanks a lot!
Dependency python-27 not found.
Should it be python27 instead? Thats what is listed when I do "port
select --list python"
*5* - "you should never add dependencies after the test"x100 ....
I will change it this evening (and try and probably add Yetis
patch)
O[...]
kr,

rowue
--
Security is an illusion - Datasecurity twice
Rolf Würdemann - ***@digitalis.org
GnuPG fingerprint: 7383 348F 67D1 CD27 C90F DDD0 86A3 31B6 67F0 D02F
jabber: ***@digitalis.org ECF127C7 EAB85F87 BC75ACB5 2EC646D4 9211A31
Loading...