Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
hello devs!
just saw that LightCrafts LightZone was upgraded to 2.0 recently, but the price is now $249, which is rather steep. I also found that they give away a Linux binary away for free. Just for fun I downloaded that and tried to run it in X11. Of course, it didn't work. Anyway, considering that OS X is UNIX- based, I'd expect that there's some way to get this to work. What can I do?
Thanks,
wmmk
 

Super Macho Man

macrumors 6502a
Jul 24, 2006
505
0
Hollywood, CA
I know that FreeBSD for x86 includes an optional Linux binary compatibility package. Mac OS X is based on FreeBSD but uses a different kernel. So maybe there is a similar solution for OS X (probably not). Of course you would need to have an Intel processor even if it were possible.

Otherwise you would probably have to use something like Virtual PC (PowerPC Macs) or Parallels/Boot Camp (Intel Macs) and install Linux in a VM.
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
You could install Linux into Parallels...

Probably the most expedient solution... I think with systems like Fink, it's not that complex to re-engineer source code to run in Fink on OS X, but this is closed-source app.

BTW, does anyone use this app? I've never heard of it on photography websites before.
 

risc

macrumors 68030
Jul 23, 2004
2,756
0
Melbourne, Australia
couldnt installin x11 help? i think this is out of my league so ill shut up now lol

No; the only way having X11 installed would help is if the app was open source and the OP had the time to compile it (and all it's deps) for OS X. Since this app is closed source though there is no way it will work.
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
No; the only way having X11 installed would help is if the app was open source and the OP had the time to compile it (and all it's deps) for OS X. Since this app is closed source though there is no way it will work.

Yes, absolutely. X11 is only a small subset of the APIs that the Linux binary needs access to, in order to run.

I was curious about the linux compatibility layer in BSD so I did some reading about it... can anyone help me understand what I read? :eek:

1) From what I understand, the linux compatibility layer is a relatively late addition to the FreeBSD kernel, and acts primarily at the kernel level.

2) OS X uses Mach, which is a somewhat older branching of FreeBSD, at least in the sense that NeXT was working with Mach before Linux really became so prominent as it is now.

3) So this means that Mach didn't inherit the compatibility layer, and as the kernel is owned by Apple, the fact that the compatibility layer has been developed by the FreeBSD people is pretty much useless towards the goal of an OS X / Linux compatibility layer, because only Apple can implement it by implementing it in their kernel.

Is that basically correct?

Don't get me wrong... in this proximal issue, this is nonsense to me. This application is readily available for OS X. If you want it, pay for it. But I'm curious about the general issue.
 

Compile 'em all

macrumors 601
Apr 6, 2005
4,130
323
Yes, absolutely. X11 is only a small subset of the APIs that the Linux binary needs access to, in order to run.

I was curious about the linux compatibility layer in BSD so I did some reading about it... can anyone help me understand what I read? :eek:

1) From what I understand, the linux compatibility layer is a relatively late addition to the FreeBSD kernel, and acts primarily at the kernel level.

2) OS X uses Mach, which is a somewhat older branching of FreeBSD, at least in the sense that NeXT was working with Mach before Linux really became so prominent as it is now.

3) So this means that Mach didn't inherit the compatibility layer, and as the kernel is owned by Apple, the fact that the compatibility layer has been developed by the FreeBSD people is pretty much useless towards the goal of an OS X / Linux compatibility layer, because only Apple can implement it by implementing it in their kernel.

Is that basically correct?

Just a minor correction.

Apple doesn't own the Mach kernel. OS X is based on the XNU kernel which is a hybrid kernel (as opposed to being monolithic or micro kernel). XNU is made up of the Mach kernel and FreeBSD components.

EDIT: risc beat me to it.
 

risc

macrumors 68030
Jul 23, 2004
2,756
0
Melbourne, Australia
Second the Fink advice. If you ever used Debian and apt-get, you will feel at home with fink. You can check as well Darwin ports.

Closed source apps are not going to be part of Fink or MacPorts. The FreeBSD Linux compatibility is kernel based so you will not find that at either location either.
 

mkrishnan

Moderator emeritus
Jan 9, 2004
29,776
15
Grand Rapids, MI, USA
Sorry, I meant own in a project management sense, not in an intellectual property sense. :eek: What I meant is that only Apple can implement a change on the kernel. Which means that the fact that the compatibility layer exists for a relatively close sibling of the OS X kernel doesn't mean that a third-party could just go and implement Linux compatibility in OS X easily.

But also thank you for clarifying about the hybridity. I keep saying Mach, but I do recognize that what Apple uses is not the current official Mach branch.
 

GeeYouEye

macrumors 68000
Dec 9, 2001
1,669
10
State of Denial
Well, there's TECHNICALLY nothing stopping you from writing an ELF loader... but one does not exist at present.

Alternately, you could try downloading it (and binaries of all its dependencies), and running it in OpenFirmware, which DOES have an ELF loader.

Unfortunately, neither are very practical solutions.
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
no big deal. there is another app which I do have the source for, but I'm a n00b who has no idea about porting stuff. how would I go about this? thanks!:)
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
Try to compile the source. Look at the errors. Fix them.

if it was obj-c, I could at least give this a shot, but it's Qt4. I tried configuring QT mac, but some directories were messed up or something. anyway, how would I go about correcting these errors. would this be obvious?
 

MisterMe

macrumors G4
Jul 17, 2002
10,709
69
USA
if it was obj-c, I could at least give this a shot, but it's Qt4. I tried configuring QT mac, but some directories were messed up or something. anyway, how would I go about correcting these errors. would this be obvious?
Qt is a C++ cross-platform framework. Objective-C is an object-oriented version of the C programming language.

If you need help, it might be useful to explain which OS, which version of Qt, and which development environment you are using.
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
Qt is a C++ cross-platform framework. Objective-C is an object-oriented version of the C programming language.

If you need help, it might be useful to explain which OS, which version of Qt, and which development environment you are using.

what i meant by the obj-c thing was that maybe then I could get this working in xcode, which I've used a bit. I'm not a programmer, just a photographer who wants to use a linux HDR creation app, and all of this is a bit over my head.:eek: To answer your question I'm using OS X 10.4.8, trying to use Qt4, and I don't even know what development environment I'm trying to use.

If it helps, the developer of the app sent me this a while ago
Giuseppe Rota said:
Hi,
I wanted to give it a try with the compiling process on mac:
first you need to download Qt4 from
http://www.trolltech.com/developer/downloads/qt/mac
then I found out that there's a darwin port of exiv2 as well, at:
exiv2.darwinports.com
the website right now doesn't seem to work, I found the google cache:
209.85.135.104/search?q=cache:yxwKEdb9SWAJ:exiv2.darwinports.com/+darwinports+exiv2&hl=en&ct=clnk&cd=1&client=firefox-a
As an alternative you can download the sources of exiv2 from:
http://www.exiv2.org/exiv2-0.12.tar.gz
untar it with:
tar xzf evix2-0.12.tar.gz
cd exiv2-0.12
./configure
make
make install
(last step as root)
Once you have Qt4 and exiv2 installed you can download the sources of qtpfsgui, type:
qmake
then with:
make
you compile the sources; at the end of the process you can run it with
./qtpfsgui
that should be it. I'd like to stress the "should" part because OS X could have its quirks that I don't know about. :)
Let me know,
Giuseppe
I know it seems cut and dry, but I just couldn't get Qt to configure properly...
 

MisterMe

macrumors G4
Jul 17, 2002
10,709
69
USA
.... I'm not a programmer, just a photographer who wants to use a linux HDR creation app, and all of this is a bit over my head.:eek: To answer your question I'm using OS X 10.4.8, trying to use Qt4, and I don't even know what development environment I'm trying to use.

....
Instead of worrying about trying to compile an app, you should concern yourself with finding a MacOS X app which does what you need done. If you install the Qt4 frameworks on your Mac, any Qt4-dependent app which you install should just work. Again, which Linux HDR creation app and is there a Mac version of it already?
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
Instead of worrying about trying to compile an app, you should concern yourself with finding a MacOS X app which does what you need done. If you install the Qt4 frameworks on your Mac, any Qt4-dependent app which you install should just work. Again, which Linux HDR creation app and is there a Mac version of it already?

the app is qtpfsgui (I linked to it earlier in this thread), no, there is not a mac version of it, and there is no open source Mac app that does the same thing. I know that there are free HDR mac apps, but they use tone mapping engines that I don't really like the output of, whereas qtpfsgui uses many operators, including the fattal contrast enhancing engine, which I really like. Anyway, this app is only available as platform independent source and Windows exe, so I'll have to compile.
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
does anyone have any tips for this? sorry to bump, but this is really important for me:eek:
thanks/sorry...
 

Grover

macrumors member
May 14, 2004
48
0
If it helps, I tried this and QT4 installed fine for me following the instructions in their README file. Basically I did this:

1. Unzip and untar to desktop
2. CD into resulting directory
3. ./configure -universal
4. make
5. sudo make install
6. Add:

PATH=/usr/local/Trolltech/Qt-4.2.2/bin:$PATH
export PATH

to ~/.profile

I then compiled and installed exiv2 according to the instructions in their README - unzip, untar, cd to resulting directory and:

1. ./configure --without-zlib (because there was some other dependency I didn't want to fool with just to see if I could get this compiled.)
2. make
3. sudo make install

All of that appeared to go well.

Now when I went to compile qtpfsgui I got past the qmake stage OK (after changing the location of exiv2 to match the OSX path in the project.pro file as the instructions required).

At that point I went to make qtpfsgui and I get this:

src/hdrcreate/createhdr.cpp:15: error: 'open_memstream' was not declared in this scope
make: *** [generated_obj/createhdr.o] Error 1

At that point the code looks like:

Code:
#ifdef _WIN32
void       createHDR(QList<QImage*> &list, const float * arrayofexptime, config_triple* chosen_config, bool antighosting, int iterations, const char * outfname) {
    FILE *fpout=fopen(outfname,"wb");
#else
QByteArray createHDR(QList<QImage*> &list, const float * arrayofexptime, config_triple* chosen_config, bool antighosting, int iterations){
    //prepare "fake" FILE* where pfs library will write the output hdr to, in pfs stream format.
    char *pfshdr;
    size_t size;
    FILE * fpout=open_memstream(&pfshdr, &size);
#endif

So we're getting into the unix-specific code correctly and it's failing there. I'm not sure why - maybe open_memstream has some trick to it on OSX. Hopefully this is enough of a clue for someone else to spot what's going on.

Anyway, I didn't get the whole thing working but I can say that QT4 appears to install fine for me on an Intel Mac (for anyone else who wants to try this, be forewarned that building it takes a good long time) so with any luck you'll be able to get over that hurdle. It was necessary to read the documentation to catch that I had to specify the flag for a universal build and that I needed to add QT to my path so if you didn't do that, that may have been your QT problem.
 

wmmk

macrumors 68020
Original poster
Mar 28, 2006
2,414
0
The Library.
If it helps, I tried this and QT4 installed fine for me following the instructions in their README file. Basically I did this:

1. Unzip and untar to desktop
2. CD into resulting directory
3. ./configure -universal
4. make
5. sudo make install
6. Add:

PATH=/usr/local/Trolltech/Qt-4.2.2/bin:$PATH
export PATH

to ~/.profile

I then compiled and installed exiv2 according to the instructions in their README - unzip, untar, cd to resulting directory and:

1. ./configure --without-zlib (because there was some other dependency I didn't want to fool with just to see if I could get this compiled.)
2. make
3. sudo make install

All of that appeared to go well.

Now when I went to compile qtpfsgui I got past the qmake stage OK (after changing the location of exiv2 to match the OSX path in the project.pro file as the instructions required).

At that point I went to make qtpfsgui and I get this:

src/hdrcreate/createhdr.cpp:15: error: 'open_memstream' was not declared in this scope
make: *** [generated_obj/createhdr.o] Error 1

At that point the code looks like:

Code:
#ifdef _WIN32
void       createHDR(QList<QImage*> &list, const float * arrayofexptime, config_triple* chosen_config, bool antighosting, int iterations, const char * outfname) {
    FILE *fpout=fopen(outfname,"wb");
#else
QByteArray createHDR(QList<QImage*> &list, const float * arrayofexptime, config_triple* chosen_config, bool antighosting, int iterations){
    //prepare "fake" FILE* where pfs library will write the output hdr to, in pfs stream format.
    char *pfshdr;
    size_t size;
    FILE * fpout=open_memstream(&pfshdr, &size);
#endif

So we're getting into the unix-specific code correctly and it's failing there. I'm not sure why - maybe open_memstream has some trick to it on OSX. Hopefully this is enough of a clue for someone else to spot what's going on.

Anyway, I didn't get the whole thing working but I can say that QT4 appears to install fine for me on an Intel Mac (for anyone else who wants to try this, be forewarned that building it takes a good long time) so with any luck you'll be able to get over that hurdle. It was necessary to read the documentation to catch that I had to specify the flag for a universal build and that I needed to add QT to my path so if you didn't do that, that may have been your QT problem.
wow! thank you so(!) much!
this will be immensely helpful!
I'll get as far as I can with this, then MSN with the dev (he's in Italy) on saturday afternoon. hopefully, there will be a universal OS X build of qtpfsgui by Sunday morning. maybe I'll even photoshop some new buttons to make it mire mac-like!:D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.