Help compiling cr2hdr

Started by Audionut, September 09, 2013, 04:54:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Audionut

Using the ML VM, I've downloaded mingw development environment and pretty sure I have the paths setup right.

Do I need to change anything in the makefile?

edit:  Got it.  Needed .exe added to CR2HDR_BIN=cr2hdr.exe

RenatoPhoto

Quote from: Audionut on September 09, 2013, 04:54:56 PM
Using the ML VM, I've downloaded mingw development environment and pretty sure I have the paths setup right.

Do I need to change anything in the makefile?

edit:  Got it.  Needed .exe added to CR2HDR_BIN=cr2hdr.exe
I had the same problem and never solved it.  Where did you add the CR2HDR_BIN=cr2hdr.exe ?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Makefile.cr2hdr

# Makefile for the cr2hdr software

CR2HDR_BIN=cr2hdr.exe
HOSTCC=gcc


When you have installed the mingw development environment, you need to copy the "i686-w64-mingw32" folder from "file system/usr/" to the magic-lantern directory (same place as gcc-arm-none-eabi) and either restructure the directory structure to match that in the makefile, or edit the makefile pointing to the directory location.


Quoteifdef CROSS
   HOSTCC=~/mingw-w32/bin/i686-w64-mingw32-gcc
   CR2HDR_BIN=cr2hdr.exe

Then just run make for the modules as per normal and the exe is generated :)

a1ex

Quote from: Audionut on September 09, 2013, 04:54:56 PM
edit:  Got it.  Needed .exe added to CR2HDR_BIN=cr2hdr.exe

make cr2hdr.exe should be enough.

Audionut

That generated permission errors in the VM.

Quote/bin/sh: 1: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: Permission denied

RenatoPhoto

Quote from: a1ex on September 10, 2013, 07:23:04 AM
make cr2hdr.exe should be enough.
First I make and make clean in dual_iso module
Second I make cr2hdr.exe

I get the following error.

Quotemagiclantern@magiclantern-VirtualBox:~/magic-lantern/modules/dual_iso$ make cr2hdr.exe
[ RM ]  cr2hdr cr2hdr.exe  ../../src/chdk-dng-host.o  cr2hdr-host.o  dcraw-bridge-host.o  exiftool-bridge-host.o
CROSS=1 make cr2hdr.exe
make[1]: Entering directory `/home/magiclantern/magic-lantern/modules/dual_iso'
[ RM ]  cr2hdr.exe cr2hdr.exe.exe  ../../src/chdk-dng-host.o  cr2hdr-host.o  dcraw-bridge-host.o  exiftool-bridge-host.o
[ HOSTCC   ]   ../../src/chdk-dng-host.o
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 1: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ELF: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 2: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: H���%�1h��%: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 3: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: �1h��%�1h��%��1h��%��1h��%��1h��%��1h��%��1h�1�I��^H��H���PTI����CH����CH��P�@�����H�H�9�1H��t��H�������������UH��SH��=: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 4: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ���P���: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 5: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ���1H�[��U�p�JH��H��t���q���P胦: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 6: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: Syntax error: ")" unexpected
make[1]: *** [../../src/chdk-dng-host.o] Error 2
make[1]: Leaving directory `/home/magiclantern/magic-lantern/modules/dual_iso'
make: *** [cr2hdr.exe] Error 2

I guess the VM machine does not include ELF?
Is there a (get apt) command to get the elf installed?
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

You still need to install the mingw development environment and fix the path.

Use the Ubuntu software center in the VM.  Search for mingw.  Top option.


RenatoPhoto

Quote from: Audionut on September 10, 2013, 03:06:12 PM
Use the Ubuntu software center in the VM.  Search for mingw.  Top option.

thanks for your help. 
I had already downloaded mgwin and put it in the the directory structure required...  but just in case I installed it again from the software center.  The installation completed but there is no compilers in the bin directory... i686-w64-mingw32-gcc is not there.  Although I do have it in the installation which I did previously.

Anyway as I said before, it seems that ELF is still missing...
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Quote from: RenatoPhoto on September 11, 2013, 03:46:06 AM
The installation completed but there is no compilers in the bin directory... i686-w64-mingw32-gcc is not there.

It's in "file system/usr/"  You have to copy the folders from there to the required directory structure that matches what's in the makefile.



Your elf errors will go away when you get the correct folders into the correct directory structure ;)

RenatoPhoto

Thanks, the images are helpful in illustrating the file structure.  I copied the whole  i686-w64-mingw32 directory from usr/  This directory contained the three folders: include, lib, and libsrc.

So now I have the following directory structure:

magiclantern
  mingw-32
    bin
      i686-w64-mingw32
        include
        lib
        libsrc

The error continues as follows:  (The same as before)

make[1]: Entering directory `/home/magiclantern/magic-lantern/modules/dual_iso'
[ RM ]  cr2hdr.exe cr2hdr.exe.exe  ../../src/chdk-dng-host.o  cr2hdr-host.o  dcraw-bridge-host.o  exiftool-bridge-host.o
[ HOSTCC   ]   ../../src/chdk-dng-host.o
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 1: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ELF: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 2: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: H���%�1h��%: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 3: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: �1h��%�1h��%��1h��%��1h��%��1h��%��1h��%��1h�1�I��^H��H���PTI����CH����CH��P�@�����H�H�9�1H��t��H�������������UH��SH��=: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 4: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ���P���: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 5: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ���1H�[��U�p�JH��H��t���q���P胦: not found
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 6: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: Syntax error: ")" unexpected
make[1]: *** [../../src/chdk-dng-host.o] Error 2
make[1]: Leaving directory `/home/magiclantern/magic-lantern/modules/dual_iso'
make: *** [cr2hdr.exe] Error 2


I dont see why I created that new directory because the makefile does not point to it!

New directory created is:

magiclantern
  mingw-32
    bin
      i686-w64-mingw32

The make file points to:

magiclantern
  mingw-32
    bin

The i686-w64-mingw32-gcc is the compiler in the bin directory,  which it is there, and the makefile can find it but cannot proccess it due to some elf stuff.

So the command:

HOSTCC=~/mingw-w32/bin/i686-w64-mingw32-gcc

Reffers to the directories mingw-w32 and bin and the other is the compiler : i686-w64-mingw32-gcc
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Look at your directory structure.

Quote from: RenatoPhoto on September 11, 2013, 05:12:15 AM
magiclantern
  mingw-32
    bin
      i686-w64-mingw32
        include
        lib
        libsrc

And now at where ML is looking for the files.

Quote from: RenatoPhoto on September 11, 2013, 05:12:15 AM
[ HOSTCC   ]   ../../src/chdk-dng-host.o
/home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: 1: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: ELF: not found

Either add -gcc to the directory name

Quotemagiclantern
  mingw-32
    bin
      i686-w64-mingw32-gcc
        include
        lib
        libsrc

Or remove it from the makefile

QuoteHOSTCC=~/mingw-w32/bin/i686-w64-mingw32-gcc

RenatoPhoto

That is news to me, I thought that is the compiler i686-w64-mingw32-gcc and not a directory...  But i can try it ..
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

RenatoPhoto

If I do that then I get your permission denied error as you did on previous post.... 

/bin/sh: 1: /home/magiclantern/mingw-w32/bin/i686-w64-mingw32-gcc: Permission denied

Are you able to make cr2hdr.exe???
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Edit the makefile

Quote# Makefile for the cr2hdr software

CR2HDR_BIN=cr2hdr.exe
HOSTCC=gcc

Then just run make.

make cr2hdr.exe generates the error.

RenatoPhoto

So now it does not make the linux version of cr2hdr.

It generated a cr2hdr.exe file but it does not work.  I gives some windows compatibility issue.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Nope.  You can make either one or the other.

Remove the .exe from the makefile and it will generate the linux version.

If you need both versions, run make as normal, copy cr2hdr to safe place, run make clean, edit makefile adding .exe, run make.

Quote from: RenatoPhoto on September 11, 2013, 05:38:14 AM
It generated a cr2hdr.exe file but it does not work.  I gives some windows compatibility issue.

You've buggered the mingw install.  Remove it from ubuntu software manger, check all the other mingw packages in the software manager to ensure they are all removed.  Remove whatever other version you downloaded.

Ensure the i686-w64-mingw32 folder in "file system/usr" got removed when you unistalled mingw through the software manager.

Reinstall the mingw development environment as per


Make sure you delete all the stuff you put into the ML directory also.  And then copy the freshly installed folders back to the ML directory.

RenatoPhoto

I will do that-  but I still think that:

i686-w64-mingw32-gcc is the compiler and and not a directory.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

gerk.raisen

I also have compile problem for cr2hdr on the virtual machine.
Followed Audionut suggestion:

-Installed only "Development environment targetting 32- and 64-bit Windows"

copied the folders:
include
lib
libsrc

from /usr/i686-w64-mingw32 to match HOSTCC:
~/mingw-w32/bin/i686-w64-mingw32-gcc

- I have run "make cr2hdr.exe" an I received this error:

root@magiclantern-VirtualBox:~/mylantern/modules/dual_iso# make cr2hdr.exe
make: *** No rule to make target `hgstamp', needed by `module_strings.h'.  Stop.

Help :)

gerk.raisen

No one can help me :(? please  :)

mk11174

Quote from: gerk.raisen on October 22, 2013, 11:35:55 AM
No one can help me :(? please  :)
What I did, looks like we use same Enviroment, I changed lines in Makefile.cr2hdr

From:
ifdef CROSS
   HOSTCC=~/mingw-w32/bin/i686-w64-mingw32-gcc
   CR2HDR_BIN=cr2hdr.exe

To:
ifdef CROSS
   MINGW=/usr/bin/i686-w64-mingw32-gcc
   CR2HDR_BIN=cr2hdr.exe

And and Have to make sure you run make first to generate the strings, then it seems cr2hdr.exe will work fine.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

gerk.raisen

Thank you mk11174.

I've tried but I continue receiving this error:

root@magiclantern-VirtualBox:~/mylantern/modules/dual_iso# make cr2hdr.exe
make: *** No rule to make target `hgstamp', needed by `module_strings.h'.  Stop.

mk11174

Quote from: gerk.raisen on October 22, 2013, 12:28:23 PM
Thank you mk11174.

I've tried but I continue receiving this error:

root@magiclantern-VirtualBox:~/mylantern/modules/dual_iso# make cr2hdr.exe
make: *** No rule to make target `hgstamp', needed by `module_strings.h'.  Stop.
Sorry forgot a step check my update on last post
I was stumped for a minute to cause I got the error myself.
Just did a make then make cr2hdr.exe and all was fine.
500D/T1i  550D/T2i  600D/T3i  700D/T5i

RenatoPhoto

Excellent!  I can now compile cr2hdr.exe
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

gerk.raisen

Thank you mk11174.

A huge step ahead.
Now I can compile it without error.
The only remaining problem is that when try to run the .exe file on Win7 64bit I receive the error:

The version of this file is not compatible with the version of Windows you're running
....

mk11174

Quote from: gerk.raisen on October 23, 2013, 11:04:13 AM
Thank you mk11174.

A huge step ahead.
Now I can compile it without error.
The only remaining problem is that when try to run the .exe file on Win7 64bit I receive the error:

The version of this file is not compatible with the version of Windows you're running
....
you are so right, this is new for sure in the last week, it has always been compatible? I will see if I can figure it out.

Update: It seems the new way it is set up, it has to be set like this in the Makefile.cr2hdr
ifdef CROSS
   HOSTCC=/usr/bin/i686-w64-mingw32-gcc
   CR2HDR_BIN=cr2hdr.exe
endif
500D/T1i  550D/T2i  600D/T3i  700D/T5i