Help compiling new version of dcraw

paolone · 2517

paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
on: December 20, 2018, 04:34:14 AM
Hello. I've got in contact with the author of SilkRAW, a GUI for dcraw written in Hollywood. I asked him if he could build SilkRAW for AROS as well, since we had both RapaGUI and dcraw, however, we stumbled into two main issues.
The first one is related to his Hollywood program, and he will check.

The second one is related to our port of dcraw, which is quite outdated. We have dcraw 8.88, while AmigaOS 4.1 has the 9.28 version, at least according to this:

http://os4depot.net/index.php?function=showfile&file=graphics/convert/dcraw.lha

The archive above includes sources used for the OS4 version and a Makefile (which I guess it should be adapted).


I tried, with my zero knowledge of coding, to compile it with gcc, but I miserably failed. I get some missing symbols and the resulting executable is not built. I also tried with the original dcraw.c source from Dave Coffin, same result.

So the question is: can someone please try to compile the same version used for OS4 (linked above) for i386 ABIv0 and send it to me? This will at least give us a up-to-date version of the tool, and the chance to get SilkRAW as well (please notice I will not be authorized to include SilkRAW into Icaros Desktop, since the author does not want, but AROS users with digital cameras deserve this more comfortable tool).

Quote
/Work/MyWorkspace/DCRaw/Source> gcc -mcrt=newlib -O2 -g -Wall   -c -o dcraw.o dcraw.c
cc1: error: unrecognized command line option '-mcrt=newlib'
/Work/MyWorkspace/DCRaw/Source> gcc -O2 -g -Wall   -c -o dcraw.o dcraw.c             
dcraw.c: In function 'getreal':
dcraw.c:356:2: warning: implicit declaration of function 'getc_unlocked' [-Wimplicit-function-declaration]
dcraw.c: In function 'parse_phase_one':
dcraw.c:6655:26: warning: variable 'type' set but not used [-Wunused-but-set-variable]
dcraw.c: In function 'xtrans_interpolate':
dcraw.c:4649:12: warning: 'sgcol' may be used uninitialized in this function [-Wuninitialized]
dcraw.c:4649:12: warning: 'sgrow' may be used uninitialized in this function [-Wuninitialized]
/Work/MyWorkspace/DCRaw/Source> dcraw.o
dcraw.o[1]: syntax error: `^_^\U$Iå]Ã$MvU$Iå]Ã$MvU$IåWVS$Cìl^O·^E^O·^U^O¯Â$M^D$@Áø^C$IE$P1ÛÇE$L$MuÞ$P$?5j' unexpected
/Work/MyWorkspace/DCRaw/Source> gcc -O2 -g -Wall   -c -o swab.o swab.c 
swab.c:3:6: error: conflicting types for 'swab'
/Development/include/aros/posixc/unistd.h:427:6: note: previous declaration of 'swab' was here
/Work/MyWorkspace/DCRaw/Source> gcc -o dcraw -O4 dcraw.c -lm -ljasper -ljpeg -llcms2
There are undefined symbols in 'dcraw':
getc_unlocked
strnlen
/Work/MyWorkspace/DCRaw/Source> gcc -o dcraw -O4 dcraw.c swab.c -lm -ljasper -ljpeg -llcms2
swab.c:3:6: error: conflicting types for 'swab'
/Development/include/aros/posixc/unistd.h:427:6: note: previous declaration of 'swab' was here
/Work/MyWorkspace/DCRaw/Source> gcc -o dcraw -O4 swab.c dcraw.c  -lm -ljasper -ljpeg -llcms2
swab.c:3:6: error: conflicting types for 'swab'
/Development/include/aros/posixc/unistd.h:427:6: note: previous declaration of 'swab' was here
/Work/MyWorkspace/DCRaw/Source> gcc -o dcraw -O4 swab.c dcraw.c -use-static -lm -ljasper -ljpeg -llcms2
swab.c:3:6: error: conflicting types for 'swab'
/Development/include/aros/posixc/unistd.h:427:6: note: previous declaration of 'swab' was here
gcc -o dcraw -O4 dcraw.c -use-static -lm -ljasper -ljpeg -llcms2       
/Work/MyWorkspace/DCRaw/Source> ls
There are undefined symbols in 'dcraw':
getc_unlocked
strnlen
se-static
/Work/MyWorkspace/DCRaw/Source> Makefile  dcraw.c  dcraw.o  swab.c
/Work/MyWorkspace/DCRaw/Source> ls
Makefile  dcraw.c  dcraw.o  swab.c
/Work/MyWorkspace/DCRaw/Source> gcc -o dcraw -O4 dcraw.c -use-static -lm -ljasper -ljpeg -llcms2-llcms2
There are undefined symbols in 'dcraw':
getc_unlocked
strnlen
se-static
/Work/MyWorkspace/DCRaw/Source>
Thanks and kind regards
« Last Edit: December 20, 2018, 04:56:42 AM by paolone »



aha

  • Junior Member
  • **
    • Posts: 66
    • Karma: +41/-0
Reply #1 on: December 20, 2018, 04:57:44 AM
Will the author of SilkRaw it publish on aros-archives? I am just curious.



paolone

  • Legendary Member
  • *****
    • Posts: 568
    • Karma: +90/-0
Reply #2 on: December 20, 2018, 05:07:56 AM
Will the author of SilkRaw it publish on aros-archives? I am just curious.
I hope so. He published SilkRAW for OS4 on Aminet, so I guess he will do the same for the AROS version once ported.

I've sent also a mail to Olivier Tigreat, who ported dcraw on AROS 10 years ago. I hope he will help. :-)


cavemann

  • Junior Member
  • **
    • Posts: 78
    • Karma: +86/-0
Reply #3 on: December 20, 2018, 08:32:00 PM
@ paolone

I got a binary after a few line edits to the makefile.

CC := i386-aros-gcc
STRIP := strip $@ --strip-unneeded --remove-section .comment
CFLAGS := -O2 -Wall -DNO_JASPER -DNO_LCMS
LINK := #-use-static
LIBS := -ljpeg -lm -lstdc
OBJS := dcraw.o

And commented line 49 in dcraw.c
//#define fgetc getc_unlocked

Hope it helps :)



cavemann

  • Junior Member
  • **
    • Posts: 78
    • Karma: +86/-0
Reply #4 on: December 21, 2018, 01:46:41 AM
@ paolone

Oops... we have lib lcms (little color management system).
Make the changes above but these 2 makefile lines should read,

CFLAGS := -O2 -Wall -DNO_JASPER
LIBS := -ljpeg -lm -llcms2 -lstdc

Should be better!



salvatore

  • Guest
Reply #5 on: March 31, 2019, 04:13:12 PM
Paolone I learned from fabio falcucci that he is working on some of my errands, that all you need is the executable of the version where you work with hollywood, currently he uses windows and precisely for example for the gui of xpdftools he is using the native commands for this system, later it can be compiled for any supported architecture, I would say fantastic :)

hi



salvatore

  • Guest
Reply #6 on: April 19, 2019, 05:07:50 PM
no it is not so unfortunately, anyway I can plan later with the current version of being able to do a long time permitting

hi