Trying to compile on OS X 10.5

12 views
Skip to first unread message

J. Brisbin

unread,
Sep 2, 2009, 6:03:58 PM9/2/09
to pfstools
I downloaded the latest and greatest pfstools and pfstmo and am stuck
compiling pfstmo. This is a persistent error. I'm configured as
follows:

PFStmo is now configured

Source directory: .
Installation prefix: /usr/local/pfstmo
C++ compiler: g++ -O3 -I/opt/local/include -ffast-math -
ftree-vectorize -mfpmath=sse,387 -DBRANCH_PREDICTION
LIBS:

fftw3f: yes
LIBS: -L/opt/local/lib

GSL: yes
LIBS: -L/opt/local/lib -lgsl -lgslcblas -lm
CFLAGS: -I/opt/local/include

Debug mode: no

which gives me an error:

make all-recursive
Making all in src
Making all in drago03
g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/pfstools/include/pfs-1.2 -
I../../src/pfstmo/ -I/usr/local/pfstools/pfs-1.2 -O3 -I/opt/local/
include -ffast-math -ftree-vectorize -mfpmath=sse,387 -
DBRANCH_PREDICTION -MT pfstmo_drago03.o -MD -MP -MF .deps/
pfstmo_drago03.Tpo -c -o pfstmo_drago03.o pfstmo_drago03.cpp
mv -f .deps/pfstmo_drago03.Tpo .deps/pfstmo_drago03.Po
g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/pfstools/include/pfs-1.2 -
I../../src/pfstmo/ -I/usr/local/pfstools/pfs-1.2 -O3 -I/opt/local/
include -ffast-math -ftree-vectorize -mfpmath=sse,387 -
DBRANCH_PREDICTION -MT tmo_drago03.o -MD -MP -MF .deps/tmo_drago03.Tpo
-c -o tmo_drago03.o tmo_drago03.cpp
mv -f .deps/tmo_drago03.Tpo .deps/tmo_drago03.Po
/bin/sh ../../libtool --tag=CXX --mode=link g++ -O3 -I/opt/local/
include -ffast-math -ftree-vectorize -mfpmath=sse,387 -
DBRANCH_PREDICTION -L/opt/local/lib -o pfstmo_drago03
pfstmo_drago03.o tmo_drago03.o -L/usr/local/pfstools/lib
mkdir .libs
g++ -O3 -I/opt/local/include -ffast-math -ftree-vectorize -mfpmath=sse,
387 -DBRANCH_PREDICTION -o pfstmo_drago03 pfstmo_drago03.o
tmo_drago03.o -Wl,-bind_at_load -L/opt/local/lib -L/usr/local/
pfstools/lib
Undefined symbols:
"pfs::DOMIO::readFrame(__sFILE*)", referenced from:
tmo_drago03(int, char**)in pfstmo_drago03.o
"pfs::DOMIO::DOMIO()", referenced from:
tmo_drago03(int, char**)in pfstmo_drago03.o
"pfs::DOMIO::writeFrame(pfs::Frame*, __sFILE*)", referenced from:
tmo_drago03(int, char**)in pfstmo_drago03.o
"pfs::DOMIO::~DOMIO()", referenced from:
tmo_drago03(int, char**)in pfstmo_drago03.o
tmo_drago03(int, char**)in pfstmo_drago03.o
"pfs::DOMIO::freeFrame(pfs::Frame*)", referenced from:
tmo_drago03(int, char**)in pfstmo_drago03.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [pfstmo_drago03] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Help, please! :)

Thanks!

J. Brisbin

rafm

unread,
Sep 3, 2009, 3:20:52 AM9/3/09
to pfstools
Hi,

On Sep 2, 3:03 pm, "J. Brisbin" <jon.bris...@gmail.com> wrote:

> g++ -DHAVE_CONFIG_H -I. -I../.. -I/usr/local/pfstools/include/pfs-1.2 -
> I../../src/pfstmo/  -I/usr/local/pfstools/pfs-1.2  -O3 -I/opt/local/
> include -ffast-math -ftree-vectorize -mfpmath=sse,387 -
> DBRANCH_PREDICTION -MT pfstmo_drago03.o -MD -MP -MF .deps/
> pfstmo_drago03.Tpo -c -o pfstmo_drago03.o pfstmo_drago03.cpp
> mv -f .deps/pfstmo_drago03.Tpo .deps/pfstmo_drago03.Po
...
> g++ -O3 -I/opt/local/include -ffast-math -ftree-vectorize -mfpmath=sse,
> 387 -DBRANCH_PREDICTION -o pfstmo_drago03 pfstmo_drago03.o
> tmo_drago03.o -Wl,-bind_at_load  -L/opt/local/lib -L/usr/local/
> pfstools/lib
> Undefined symbols:
>   "pfs::DOMIO::readFrame(__sFILE*)", referenced from:
>       tmo_drago03(int, char**)in pfstmo_drago03.o
>   "pfs::DOMIO::DOMIO()", referenced from:
>       tmo_drago03(int, char**)in pfstmo_drago03.o
>   "pfs::DOMIO::writeFrame(pfs::Frame*, __sFILE*)", referenced from:
>       tmo_drago03(int, char**)in pfstmo_drago03.o
>   "pfs::DOMIO::~DOMIO()", referenced from:
>       tmo_drago03(int, char**)in pfstmo_drago03.o
>       tmo_drago03(int, char**)in pfstmo_drago03.o
>   "pfs::DOMIO::freeFrame(pfs::Frame*)", referenced from:
>       tmo_drago03(int, char**)in pfstmo_drago03.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make[3]: *** [pfstmo_drago03] Error 1
> make[2]: *** [all-recursive] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2

Do you use MacPorts or Fink? (I recommend the latter one, as I
actually did not manage to compile with MacPorts)

The error message says that it cannot find libpfs. Could you check if
you have libpfs-1.2.a in /usr/local/pfstools/lib. If not, you can add
the directory where libpfs-1.2.a is located to the environmental
variable LIBS:

export LIBS=/directory

if you are using bash. The problem that you are reporting should not
happen because pfstmo should get the right paths from lib/pkgconfig/
pfs.pc.

I hope this helps,

Rafal

Jon Brisbin

unread,
Sep 3, 2009, 9:27:34 AM9/3/09
to pfst...@googlegroups.com
Rafal,

Thanks for the tips. I finally got it working after a couple hours of playing around with build flags. I eventually got it built by setting:

CFLAGS=-I/opt/local/include
LDFLAGS=-L/opt/local/lib
CXXFLAGS=-I/opt/local/include
PFS_CLFAGS=-I/usr/local/pfstools/include/pfs-1.2
PFS_LIBS="-L/usr/local/pfstools/lib -lpfs-1.2"

Note that the "-lpfs-1.2" was the only way to get it built such that ld could find the pfs stuff. I've never had to specify a version before, so this one took me a while to figure out. I would have expected only "-lpfs".

I never could get it to compile using FFTW3_CFLAGS/LIBS, even though that library is compiled using MacPorts, so lives in /opt/local. Every time I tried to include it, I got linker errors.

IMHO the build process should take configure flags to figure all this stuff out (e.g. --with-pfstools=/usr/local/pfstools --with-fftw3=/opt/local). The process of using environment vars to specify the actual build flags is error-prone to say the least.

Of course, it would be better if I could just download a DMG of these, pre-compiled for OS X. :) I really hate having to twiddle with build scripts just to get an end product.

Thanks!

Jon Brisbin

rafm

unread,
Sep 3, 2009, 2:37:47 PM9/3/09
to pfstools
I am glad that you managed to compile and I am puzzled why it was
causing so much problems. configure script from pfstmo should detect
the pkg-config file lib/pkgconfig/
pfs.pc and take all the paths from there. If this file is missing,
configure should fail. The other possibility is that the paths in that
file are wrong, which should not happen either, unless you made some
custom changes when compiling pfstools.

It is still surprising that you managed to compile pfstools with
MacPorts. If you have any tricks or instruction that may help the
others and should be included in README.OSX, please post them to the
group.

Regarding pre-compiled packages, I always look for contributors who
could maintain them.

Cheers,

Rafal


On Sep 3, 6:27 am, Jon Brisbin <jon.bris...@gmail.com> wrote:
> Rafal,
>
> Thanks for the tips. I finally got it working after a couple hours of  
> playing around with build flags. I eventually got it built by setting:
>
> CFLAGS=-I/opt/local/include
> LDFLAGS=-L/opt/local/lib
> CXXFLAGS=-I/opt/local/include
> PFS_CLFAGS=-I/usr/local/pfstools/include/pfs-1.2
> PFS_LIBS="-L/usr/local/pfstools/lib -lpfs-1.2"
>
> Note that the "-lpfs-1.2" was the only way to get it built such that  
> ld could find the pfs stuff. I've never had to specify a version  
> before, so this one took me a while to figure out. I would have  
> expected only "-lpfs".
>
> I never could get it to compile using FFTW3_CFLAGS/LIBS, even though  
> that library is compiled using MacPorts, so lives in /opt/local. Every  
> time I tried to include it, I got linker errors.
>
> IMHO the build process should take configure flags to figure all this  
> stuff out (e.g. --with-pfstools=/usr/local/pfstools --with-fftw3=/opt/
> local). The process of using environment vars to specify the actual  
> build flags is error-prone to say the least.
>
> Of course, it would be better if I could just download a DMG of these,  
> pre-compiled for OS X. :) I really hate having to twiddle with build  
> scripts just to get an end product.
>
> Thanks!
>
> Jon Brisbinhttp://jbrisbin.com/

Jon Brisbin

unread,
Sep 3, 2009, 5:38:41 PM9/3/09
to pfst...@googlegroups.com
I just compiled it several times again, testing different scenarios, but the gist of this seems to be:

to compile on OS X 10.5 using MacPorts OpenEXR, ImageMagick, and tiff libraries (the QT stuff seems broken on OS X with MacPorts), set:

CFLAGS=-I/opt/local/include
CXXFLAGS=-I/opt/local/include
LDFLAGS=-L/opt/local/lib

normal make && make install seems to do the trick.

to install pfstmo, however, you have to ADD (leave the above in your env):

PFS_CFLAGS=-I/usr/local/include/pfs-1.2
PFS_LIBS=/usr/local/lib/libpfs-1.2.la

...so I can have pfs compiled into pfstmo statically. I have also compiled it for linking dynamically, but I'm trying to create a portable group of files that I can drop on any system because I'd like to create a bundle or Cocoa framework that ties into pfs.

I've got a copy of OS X 10.6 coming and I'm very interested to see how difficult it would be to make an OS X app that parallelizes the tonemapping using the new concurrent processing tools in 10.6. I think this is possible right away by introducing pfscut into the processing chain. Theoretically, it could also be networked, so that a farm of servers could process images.


jb

Reply all
Reply to author
Forward
0 new messages