Author Topic: Help Needed Compiling Gphoto2  (Read 15895 times)

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« on: January 15, 2006, 02:01:47 pm »
I've compiled gphoto2 (and its associated dependencies - libexif, libgphoto2, libusb), but it doesn't quite work. What happened is that when I compiled them, to prevent make install from putting files directly into my system, I used something like:
Code: [Select]
./configure --prefix=/mnt/hd/ipkg-tmp/usr/local
Unfortunately this had the effect of hardcoding that path into some of the libraries with the result that after installation the libraries are looking in the wrong place for the list of supported cameras and hence finding none:
Code: [Select]
# grep ipkg ./*
Binary file ./libexif.a matches
./libexif.la:libdir='/mnt/hd/ipkg-libexif/usr/lib'
Binary file ./libexif.so matches
Binary file ./libexif.so.12 matches
Binary file ./libexif.so.12.0.1 matches
Binary file ./libgphoto2.a matches
./libgphoto2.la:dependency_libs=' /mnt/hd/ipkg-tmp/usr/local/lib/libgphoto2_port.la -ldl -lm'
./libgphoto2.la:libdir='/mnt/hd/ipkg-tmp/usr/local/lib'
Binary file ./libgphoto2.so matches
Binary file ./libgphoto2.so.2 matches
Binary file ./libgphoto2.so.2.0.3 matches
Binary file ./libgphoto2_port.a matches
./libgphoto2_port.la:libdir='/mnt/hd/ipkg-tmp/usr/local/lib'
Binary file ./libgphoto2_port.so matches
Binary file ./libgphoto2_port.so.0 matches
Binary file ./libgphoto2_port.so.0.5.2 matches

The making an ipk howto suggests one workaround, ie use "--prefix=/usr/local" then "mount a partition over /usr/local". I was wondering whether there are any other ways to overcome this problem?


-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #1 on: January 15, 2006, 04:06:53 pm »
did you try
Quote
make DESTDIR=/my/path/ipkg install

?
« Last Edit: January 15, 2006, 04:07:07 pm by pgas »
SLC-860 cacko / senao wifi

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #2 on: January 16, 2006, 07:21:53 am »
Quote
did you try
Quote
make DESTDIR=/my/path/ipkg install

?

Well kind of. But as you point out it the howto not all "Makefile"s support it. I was looking for a generic solution that can be used in all cases.

I notice that "./configure" sometimes allows "--disable-rpath" which means "do not hardcode runtime library paths". Does this do what I want -- ie to be able to use an arbitary --prefix (so that make install doesn't put anything into my system).

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

anunakin

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
    • http://vivaphp.net
Help Needed Compiling Gphoto2
« Reply #3 on: January 16, 2006, 10:35:12 am »
Can u try

$ make install > install.log

And move all fite to ipkg_temp .... not good but works  
[img]http://www.vivaphp.net/imagens/rev2.jpg\" border=\"0\" class=\"linked-sig-image\" /]
Anunakin (Marcus Fazzi)

Nokia N900 32GB + microSD 2GB
Nokia N810 w/ microSD 8GB
Nokia 5310 XpressMusic w/ microSD 1GB
HP48GX->Psion Sienna->Palm m130->Tungsten T->Zaurus SL-5500->C3000->C3100 ALL SOLD

My FEED(On Line AGAIN!!!)

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #4 on: January 16, 2006, 03:16:22 pm »
Quote
Can u try

$ make install > install.log

I use
Code: [Select]
make install 2>&1 > installation.log as suggested by the howto. But the problem is, is there an automated way to parse that logfile to extract the directories/files that were created/copied?

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #5 on: January 16, 2006, 03:26:58 pm »
I've recompiled everything to use "--prefix=/usr/local" and things are working slightly better. Eg. "gphoto2 --list-cameras" works. Unfortunately when I use any of these:
Code: [Select]
gphoto2 --auto-detect
gphoto2 -L
etc
I get a segfault  

Searching this forum I find a few mentions of strace but I can't find it in the official feeds. Any idea where I can get it? Or how I might go about finding out what is going wrong with gphoto2?

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #6 on: January 17, 2006, 03:52:36 am »
In case anyone wants to play with it to see whether they get any better results here are all the required packages (you need to install all the non *-devel packages).

NB the libgphoto2 needs to overwrite the file /etc/hotplug/usb.usermap. It will make a backup before doing so (although on a fresh install of pdaXrom there is nothing of note in that file), and will restore it when you uninstall.

Also I've had too much trouble trying to not use "/usr/local", so these all install into "/usr/local" where applicable.

Examples of usage:
Code: [Select]
gphoto2 --help
gphoto2 --list-cameras
gphoto2 --auto-detect
gphoto2 -L

add the "--debug" option for a running commentary on what gphoto2 is doing. On my setup, as soon as gphoto2 has identified my camera it segfaults.

-- cheers
« Last Edit: January 17, 2006, 03:53:34 am by desertrat »
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #7 on: January 17, 2006, 05:40:06 am »
Quote
I get a segfault 

I managed to compile strace and used in on gphoto2. Here are the interesting parts just before the segfault:
Code: [Select]
open("/proc/bus/usb/001/001", O_RDWR)   = -1 EACCES (Permission denied)
open("/proc/bus/usb/001/001", O_RDONLY) = 4
ioctl(4, USBDEVFS_CONNECTINFO, 0xbfffb408) = -1 EPERM (Operation not permitted)
read(4, "\22\1\20\1\t\0\0\10\0\0\0\0\0\0\0\2\1\1\t\2", 20) = 20
read(4, "\31\0\1\1\0@\0\t", 8)          = 8
read(4, "\4\0\0\1\t\0\0\0\7\5\201\3\2\0\377", 249) = 15
close(4)                                = 0
open("/proc/bus/usb/001/003", O_RDWR)   = 4
ioctl(4, USBDEVFS_CONNECTINFO, 0xbfffb408) = 0
read(4, "\22\1\20\1\377\377\377 \251\4X0\1\0\1\2\0\1\t\2", 20) = 20
read(4, "\'\0\1\1\0\3002\t", 8)         = 8
read(4, "\4\0\0\3\377\377\377\0\7\5\201\2@\0\0\7\5\2\2@\0\0\7\5"..., 249) = 29
close(4)                                = 0
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
open("/proc/bus/usb/001/001", O_RDWR)   = -1 EACCES (Permission denied)
open("/proc/bus/usb/001/001", O_RDONLY) = 3
ioctl(3, USBDEVFS_IOCTL, 0xbfffd014)    = -1 EPERM (Operation not permitted)
close(3)                                = 0
open("/proc/bus/usb/001/003", O_RDWR)   = 3
ioctl(3, USBDEVFS_IOCTL, 0xbfffd014)    = -1 ENOSYS (Function not implemented)
close(3)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

Can any experts tell me what is going wrong?

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Help Needed Compiling Gphoto2
« Reply #8 on: March 21, 2006, 02:08:28 am »
Hi,

Any news on gphoto ?

I'm compiling "gthumb" http://gthumb.sourceforge.net/screenshots.html and I've got it working with jpeg-support, tiff-support, exif-support.
Gphoto2-support can also be included. I don't really need it myself, but it could be nice if we get it working to complete the app.

Have fun,
Chero.
« Last Edit: March 21, 2006, 02:08:49 am by Chero »
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

merli

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #9 on: March 21, 2006, 04:40:48 am »
Hello

I compiled gphoto2 and it seems to work for me with Canon S2 IS.

# ./gphoto2 --auto-detect
Model                          Port                                            
----------------------------------------------------------
Canon PowerShot S2 IS (PTP mode) usb:            

# ./gphoto2 -L          
There are no files in folder '/'.                                              
There are no files in folder '/store_00010001'.
There are no files in folder '/store_00010001/DCIM'.
There are 11 files in folder '/store_00010001/DCIM/100CANON':
#1     IMG_0046.JPG                 1268 KB 2592x1944 image/jpeg
#2     IMG_0047.JPG                 1323 KB 2592x1944 image/jpeg
#3     IMG_0048.JPG                 1359 KB 2592x1944 image/jpeg
#4     IMG_0049.JPG                 1243 KB 2592x1944 image/jpeg
#5     IMG_0050.JPG                  564 KB 2592x1944 image/jpeg
#6     IMG_0051.JPG                 1128 KB 2592x1944 image/jpeg
#7     IMG_0052.JPG                 1068 KB 2592x1944 image/jpeg
#8     IMG_0053.JPG                 1291 KB 2592x1944 image/jpeg
#9     IMG_0054.JPG                 1340 KB 2592x1944 image/jpeg
#10    IMG_0055.JPG                 1086 KB 2592x1944 image/jpeg
#11    IMG_0056.JPG                 1117 KB 2592x1944 image/jpeg
There are no files in folder '/store_00010001/MISC'.
There are no files in folder '/store_80000001'.

Enjoy them and give me feedback.

UPDATE:

I recompiled libgphoto2 libraries ... I had error with hardcoded paths to libs. When I tried camera I had libraries installed in /usr and also where --prefix were used /home/root/libgphoto2. When I deleted /home/root/libgphoto2 directory, gphoto2 stopped working. I recompiled libgphoto2 with --prefix=/usr.
Now it is working from scratch with my camera.
I just plugged my Canon S2 IS and run: "gphoto2 -L" and I got actual list of files from camera. This camera working without active usb hub.no hotplug files installed
I also added new libreadline

Please try now

I read post that some gui is now compiled :-)
« Last Edit: March 23, 2006, 04:25:56 am by merli »
merli
------
SL-C1000 - pdaxii13 5.3.3 but considering go back to beta1
Wifi D-link DCF-650W CF card - not using
bluetooth Billionton BT CF card and Samsung SGH-i310 GPRS
Pretec Cheetah 133x 4GB SD, Pretec Cheetah 80x 1GB CF

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Help Needed Compiling Gphoto2
« Reply #10 on: March 21, 2006, 09:50:55 am »
I'll try to add gphoto support to gthumb, then it should be possible to browse the pictures on the camera using gthumb.

I'll be on the train for an hour or two this evening, so plenty of time to compile. Testing will be for tomorrow evening.

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #11 on: March 21, 2006, 02:59:16 pm »
Quote
I compiled gphoto2 and it seems to work for me with Canon S2 IS.
That's good, at least I know gphoto2 does work on the Z.

Quote
Enjoy them and give me feedback.
I notice that you've compiled it against a newer readline - it wants libreadline.so.5 and I've only got libreadline.so.4. As a quick and dirty fix I created a symlink. I also note that there is no usb.usermap so I ran /usr/lib/libgphoto2/print-usb-usermap, but that gave no output at all.

I'll play with it a bit more tomorrow.

Update
On further examination, I see that there is no provision for hotplug to recognise when a supported camera is plugged in. In my libgphoto2 package I have:

/etc/hotplug/usb.usermap which allows hotplug to recognise camera

and

/etc/hotplug/usb/usbcam which sets up correct permissions for camera

Both these files seems to be missing from your packages    I would appreciate it if you could post some info on how to your packages to work  


Update
I copied the above 2 missing files from my own package, now hotplug detects camera and does the right thing. However now gphoto2 is looking for the libgphoto2 stuff in /home/root   ! I created some suitable symlinks and now gphoto2 works - thanks Merli.

Is it possible for you to repackage your stuff (it probably only involves libgphoto2) so that:

1) it includes the hotplug stuff
2) looks for the libgphoto2 stuff in the right place

If you don't have the time or inclination could you please tell me:

1) what ./configure options you used on all the packages
2) and any other particular tweaks/patches/fixes etc you had to use

Also any reason why you used readline 5.X? Even 1.10beta2 still use readline 4.3 (same as 1.10beta1).

-- cheers
« Last Edit: March 22, 2006, 04:41:33 am by desertrat »
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM

merli

  • Full Member
  • ***
  • Posts: 227
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #12 on: March 23, 2006, 04:33:07 am »
Quote
Quote
I compiled gphoto2 and it seems to work for me with Canon S2 IS.
That's good, at least I know gphoto2 does work on the Z.

Quote
Enjoy them and give me feedback.
I notice that you've compiled it against a newer readline - it wants libreadline.so.5 and I've only got libreadline.so.4. As a quick and dirty fix I created a symlink. I also note that there is no usb.usermap so I ran /usr/lib/libgphoto2/print-usb-usermap, but that gave no output at all.

I'll play with it a bit more tomorrow.

Update
On further examination, I see that there is no provision for hotplug to recognise when a supported camera is plugged in. In my libgphoto2 package I have:

/etc/hotplug/usb.usermap which allows hotplug to recognise camera

and

/etc/hotplug/usb/usbcam which sets up correct permissions for camera

Both these files seems to be missing from your packages    I would appreciate it if you could post some info on how to your packages to work  


Update
I copied the above 2 missing files from my own package, now hotplug detects camera and does the right thing. However now gphoto2 is looking for the libgphoto2 stuff in /home/root   ! I created some suitable symlinks and now gphoto2 works - thanks Merli.

Is it possible for you to repackage your stuff (it probably only involves libgphoto2) so that:

1) it includes the hotplug stuff
2) looks for the libgphoto2 stuff in the right place

If you don't have the time or inclination could you please tell me:

1) what ./configure options you used on all the packages
2) and any other particular tweaks/patches/fixes etc you had to use

Also any reason why you used readline 5.X? Even 1.10beta2 still use readline 4.3 (same as 1.10beta1).

-- cheers
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119666\"][{POST_SNAPBACK}][/a][/div]

Updated post ... please read.
I compiled libreadline in some other project, and from that time I have it on Z :-) and compile with it. Anyway my cam seems working without hotplug files. If you post them I will repackage libreadline2 ipk.
merli
------
SL-C1000 - pdaxii13 5.3.3 but considering go back to beta1
Wifi D-link DCF-650W CF card - not using
bluetooth Billionton BT CF card and Samsung SGH-i310 GPRS
Pretec Cheetah 133x 4GB SD, Pretec Cheetah 80x 1GB CF

Chero

  • Hero Member
  • *****
  • Posts: 1140
    • View Profile
    • http://users.telenet.be/zaurususer/Chero
Help Needed Compiling Gphoto2
« Reply #13 on: March 23, 2006, 05:12:18 am »
Quote
I read post that some gui is now compiled :-)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=119539\"][{POST_SNAPBACK}][/a][/div]

Not exactly, but i think this newly compiled lib can help to bring gphoto2 support to gthumb. Thanks. I'll try to add it this evening.

Chero.
HP-95LX -> HP Jornada 680 -> SL-C860 -> SL-C3100 -> Fuji u810 -> SL-C1000 -> HTC uni -> SL-C860 -> SL-C760.
March 12 2009 : Back because the Zaurus is one of a kind.
SL-C760 : pdaXrom
Pandora pre-ordered -> received and tested : great device but not my cup of tea -> sold.

desertrat

  • Hero Member
  • *****
  • Posts: 743
    • View Profile
    • http://
Help Needed Compiling Gphoto2
« Reply #14 on: March 23, 2006, 06:34:49 am »
Quote
Updated post ... please read.
I compiled libreadline in some other project, and from that time I have it on Z :-) and compile with it. Anyway my cam seems working without hotplug files. If you post them I will repackage libreadline2 ipk.
OK, I removed my hotplug stuff and installed your updated libgphoto2 and gphoto2 still works nicely.

It begs the question WTF are the hotplug files for?

-- cheers
SL-C3100 / Ambicon WL1100C-CF / pdaXrom 1.1.0beta3 / IceWM