[ptx] hugin on mac OS X

Axel Wernicke axel.wernicke at gmx.de
Fri Feb 27 21:25:46 GMT 2004


Hi Bruno,

first let me thank you for all the efforts to make hugin available for  
the Mac community. I grabbed all the infos and tried to do it on my  
iBook G4 @ OS X 10.3.3. I got almost through the process, but failed at  
the end in building hugin. All the excpieriences are attached - so may  
be you get it done at last.

Sincerely, Axel!

Am 26.02.2004 um 16:02 schrieb Bruno Postle:

> This is how I built hugin on mac OS X 10.1, probably things will
> differ for later versions of OS X.
>
> Note: although everything builds, hugin doesn't actually work yet.
>
> Read this document before starting:
>
>     http://fink.sourceforge.net/doc/porting/porting.html
>
> Setting up the build environment
> ================================
>
> First you need to install the OS X Developer Tools, you either get
> this on CD or download from http://developer.apple.com/

did that already

>
> You also need various bits of unix software, the Fink project has
> lots of unix stuff as well as apt-get (a network-based package
> installer) - So install fink:
>
>     http://fink.sourceforge.net/
>

already installed

> The default shell on 10.1 is tcsh, start-up a terminal, then switch
> to the bash shell and load some sane defaults like so:
>
>     bash
>     source /etc/bashrc
>     source /sw/bin/init.sh
>
> You can now use apt to install some useful tools:
>
>     sudo apt-get update
>     sudo apt-get install  screen vim mutt wget lynx

did that, but screen didn't exist ...

Get:1 http://us.dl.sourceforge.net 10.3/release/main lynx 2.8.4-12  
[1329kB]
Get:2 http://us.dl.sourceforge.net 10.3/release/main mutt 1.4i-11  
[1717kB]
Get:3 http://us.dl.sourceforge.net 10.3/release/main vim 6.1-15 [2501kB]
Get:4 http://us.dl.sourceforge.net 10.3/release/main wget 1.8.2-1  
[346kB]

>
> On 10.1 the default compiler is gcc2, hugin needs gcc3, so you
> should change this permanently before you compile anything.
>
>     sudo /usr/sbin/gcc_select 3

I'm on 10.3 - so probably nothing to do here
gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)

>
> Installing required libraries
> =============================
>
> Building hugin requires a load of libraries:
>
>     zlib
>     libtiff
>     libjpeg
>     libpng
>     fftw
>     xfree86-base   (building hugin requires the makedepend tool)
>     wxwindows   (with xrc extension)
>     panorama-tools
>     vigra
>     boost
>
> You can install the first few easily using apt:
>
>     sudo apt-get install  libjpeg libpng libtiff zlib xfree86-base fftw

O.K.
libjpeg, *-bin, *.shlibs 6b-6
libpng3, *-shlibs 1.2.5-14
libtiff 3.5.7-7
zlib ?? there are only some perl modules in fink
xfree ?? there is already the placeholder for the apple package  
installed
fftw, fftw-shlibs 2.1.3-13

>
> Note that the version of libpng available via fink for 10.1 is
> ancient, I had to compile fresh versions of libpng and zlib.
>
> wxWindows
> ---------
>
> Download wxmac from http://www.wxwidgets.org/
>
> Compile and install like so:
>
>     tar -zxvf wxMac-2.4.2.tar.gz
>     cd wxMac-2.4.2
>     ./configure

Configured wxWindows 2.4.2 for `powerpc-apple-darwin7.2.0'

   Which GUI toolkit should wxWindows use?                 MAC
   Should wxWindows be compiled in debug mode?             no
   Should wxWindows be linked as a shared library?         yes
   Should wxWindows be compiled in Unicode mode?           no
   What level of wxWindows compatibility should be enabled?
                                        wxWindows 2.0      no
                                        wxWindows 2.2      yes
   Which libraries should wxWindows use?
                                        jpeg               builtin
                                        png                builtin
                                        regex              sys
                                        tiff               builtin
                                        zlib               sys


>     make

done!
to build it on panther I had to update src/mac/dc.cpp from cvs version   
1.56.2.12 does it

>     sudo make install

done!

>     cd contrib/src/xrc
>     make
>     sudo make install

done!

>
> Panorama Tools
> --------------
>
> Follow the cvs instructions from here to download libpano:
>
>     http://panotools.sourceforge.net/

done!

>
> I haven't been able to build a fully-loadable pano12 library, but
> these instructions more or less work to build something that can be
> statically linked:
>
>     http://www.email-lists.org/pipermail/ptx/2004-February/001374.html

make - fails gcc didn't resolve the link to the include dir

makefile:  
	-I/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Headers    
\

done!

making PTOptimizer failed with:

ld: Undefined symbols:
_FSClose
_FSRead
_FSWrite
_FSpCreate
_FSpDelete
_FSpOpenDF
_FSpRename
_MyCtoPStr
_p2cstr
_setLibToResFile
_unsetLibToResFile
_CFStringCreateWithPascalString
_CFURLCreateWithFileSystemPath
_CFURLGetFileSystemRepresentation
_CopyCStringToPascal
_kCFAllocatorDefault


>
> Vigra
> -----
>
> Get vigra from here:
>
>     http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/
>
> Vigra-1.2.0 has a bug which prevents it from compiling on OS X, I'll
> try and remember to attach the patch that fixes it.
>
> Installation goes something like this:
>
>     patch -p1 < vigra-viff.patch

done!

>
>     ./configure --enable-shared=jpeg,png,tiff,zlib,fftw \
>                 --build=ppc --prefix=/usr/local

done with:
./configure --enable-shared=jpeg,png,tiff,zlib,fftw  --build=ppc  
--prefix=/usr/local --with-fftw=/sw --with-tiff=/sw --with-jpeg=/sw  
--with-png=/sw
there seems to be a problem that causes configure to miss the libfftw.
Did it with sudo ln -s /sw/lib/libdfftw.a /sw/lib/libfftw.a, afterwards  
libfftw was found....


>
>     make

done!

>     sudo make install

done with install: the -d and -C options may not be specified together

>
> Boost
> -----
>
> Download boost from here:
>
>     http://www.boost.org/
>

done! version: boost_1.31.0

> Boost has it's own build system called jam, you have to bootstrap it
> first:
>
>     cd tools/build/jam_src
>     ./build.sh
>     cd ../../..

done!

>
> Then build:
>
>     ./tools/build/jam_src/bin.macosxppc/bjam "-sTOOLS=darwin" stage

done!
didn't get too much errors, but python wasn't found and seems to be  
important...
... can be fixed by setting export PYTHON_VERSION="2.3" for panther


>     sudo ./tools/build/jam_src/bin.macosxppc/bjam "-sTOOLS=darwin"  
> install

done!
...failed updating 6 targets...
...skipped 6 targets...

>
> I get hundreds of errors during this process; hugin only uses the
> boost header template files and they seem to get installed ok, so
> you can ignore all the failure messages.
>
> Building hugin
> ==============
>
> Download hugin following the cvs instructions:
>
>     http://hugin.sourceforge.net/download/

done!

>
> Dependencies
> ------------
>
> The wxWindows xrc module gets installed with the wrong name, create
> a copy with the correct name in the hugin lib directory:
>
>     cp /usr/local/lib/libwx_mac_xrc-2.4.so  
> ./src/lib/libwx_mac_xrc-2.4.dylib

done! but needed to create lib in src by hand...

>
> Put a copy of the pano12 library in the same place:
>
>     cp /path/to/libpano/libpano12.a ./src/lib/
>
> Copy the pano12 headers into the hugin tree:
>
>     mkdir src/include/pano12
>     cp /path/to/libpano/*.h src/include/pano12/

done!

>
> Edit the configure script and make some changes.  Locate this line:
>
>     $EXTRA_CFLAGS="$EXTRA_CFLAGS -O2";
>
> ..and change it to this:
>
>     $EXTRA_CFLAGS="$EXTRA_CFLAGS -O2 -I/sw/include  
> -I/usr/local/include/boost-1_31";
>
> Locate this line:
>
>     $XRC_LFLAGS="-lwx_gtk_xrc-2.4";
>
> ..and change it to this:
>
>     $XRC_LFLAGS="-lwx_mac_xrc-2.4";

done!

>
> Other changes
> -------------
>
> Apply a patch to fix a bug in panoviewer that stops it compiling:
>     patch -p0 < hugin-panoviewer-fix.patch
>
> wxmac doesn't support "toggle buttons", so you can apply this crude
> patch that removes a button from hugin:
>
>     patch -p0 < hugin-remove-togglebutton.patch

done! did both in one ...
patching file src/PanoImage/panorama.h
patching file src/hugin/PreviewFrame.cpp

>
> Compile hugin
> -------------
>
>     ./configure

done!
needs export PATH=$PATH:/usr/local/bin/ to find wx-config

>     make

failed!

error message:

white-shadow:~/Desktop/iNCOMING/hugin axelwernicke$ makemake -C src
Descending directory jhead to do "make depend"
Descending directory klt to do "make depend"
Descending directory common to do "make depend"
Descending directory vigra_ext to do "make depend"
Descending directory Panorama to do "make depend"
Descending directory hugin to do "make depend"
Descending directory xrc to do "make depend"
Descending directory data to do "make depend"
Descending directory po to do "make depend"
Descending directory tools to do "make depend"
Descending directory PanoImage to do "make depend"
make[2]: *** No rule to make target `depend'.  Stop.
Descending directory keypoints to do "make depend"
Descending directory jhead to do "make lib"
Descending directory klt to do "make lib"
Descending directory common to do "make lib"
Descending directory vigra_ext to do "make lib"
Descending directory Panorama to do "make lib"
     ---- Compiling PanoToolsInterface.cpp (C++)
g++ -I. -I../include -Wall -O2 -I/sw/include  
-I/usr/local/include/boost-1_31 -I../ -I/usr/local/include   -c -o  
.obj/PanoToolsInterface.o PanoToolsInterface.cpp
In file included from  
/usr/local/include/boost-1_31/boost/iterator/iterator_categories.hpp: 
21,
                  from  
/usr/local/include/boost-1_31/boost/graph/graph_traits.hpp:33,
                  from ../include/PT/ImageGraph.h:28,
                  from ../include/PT/PTOptimise.h:33,
                  from PanoToolsInterface.cpp:29:
/usr/local/include/boost-1_31/boost/type_traits/is_convertible.hpp:275:  
warning: use
    of `long double' type; its size may change in a future release
/usr/local/include/boost-1_31/boost/type_traits/is_convertible.hpp:275:  
warning: (Long
    double usage is reported only once for each file.
/usr/local/include/boost-1_31/boost/type_traits/is_convertible.hpp:275:  
warning: To
    disable this warning, use -Wno-long-double.)
In file included from  
/usr/local/include/boost-1_31/boost/type_traits.hpp:29,
                  from  
/usr/local/include/boost-1_31/boost/detail/numeric_traits.hpp:71,
                  from  
/usr/local/include/boost-1_31/boost/iterator/counting_iterator.hpp:10,
                  from  
/usr/local/include/boost-1_31/boost/pending/integer_range.hpp:15,
                  from  
/usr/local/include/boost-1_31/boost/graph/detail/adjacency_list.hpp:34,
                  from  
/usr/local/include/boost-1_31/boost/graph/adjacency_list.hpp:294,
                  from ../include/PT/ImageGraph.h:29,
                  from ../include/PT/PTOptimise.h:33,
                  from PanoToolsInterface.cpp:29:
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:112:61: macro "check" passed 2 arguments, but  
takes just 1
In file included from  
/usr/local/include/boost-1_31/boost/type_traits.hpp:29,
                  from  
/usr/local/include/boost-1_31/boost/detail/numeric_traits.hpp:71,
                  from  
/usr/local/include/boost-1_31/boost/iterator/counting_iterator.hpp:10,
                  from  
/usr/local/include/boost-1_31/boost/pending/integer_range.hpp:15,
                  from  
/usr/local/include/boost-1_31/boost/graph/detail/adjacency_list.hpp:34,
                  from  
/usr/local/include/boost-1_31/boost/graph/adjacency_list.hpp:294,
                  from ../include/PT/ImageGraph.h:29,
                  from ../include/PT/PTOptimise.h:33,
                  from PanoToolsInterface.cpp:29:
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:112: error: template
    declaration of `yes_type boost::detail::bd_helper<B, D>::check'
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:113:63: macro "check" passed 2 arguments, but  
takes just 1
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:113: error: declaration
    of `boost::type_traits::no_type boost::detail::bd_helper<B,  
D>::check'
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:112: error: conflicts
    with previous declaration `template<class B, class D> template<class  
T>
    yes_type boost::detail::bd_helper<B, D>::check'
/usr/local/include/boost-1_31/boost/type_traits/ 
is_base_and_derived.hpp:126:82: macro "check" passed 2 arguments, but  
takes just 1
make[2]: *** [.obj/PanoToolsInterface.o] Error 1
Descending directory hugin to do "make lib"
Descending directory xrc to do "make lib"
Descending directory data to do "make lib"
Descending directory po to do "make lib"
     ---- Compiling ImageProcessing.cpp (C++)
g++ -I. -I../include -Wall -O2 -I/sw/include  
-I/usr/local/include/boost-1_31 -I/usr/local/lib/wx/include/mac-2.4  
-D__WXMAC__ -DWXMAKINGDLL -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I../   
-I/usr/local/include   -c -o .obj/ImageProcessing.o ImageProcessing.cpp
^Cmake[2]: *** [.obj/ImageProcessing.o] Interrupt
make[1]: *** [lib.nested] Interrupt
make: *** [all] Interrupt


>     cd src/hugin
>     ./hugin
>
> That's it, it still doesn't work, but it compiles ok.
>
> -- 
> Bruno
> diff -ur vigra1.2.0/src/impex/viff.cxx  
> vigra1.2.0-new/src/impex/viff.cxx
> --- vigra1.2.0/src/impex/viff.cxx	Thu Aug  7 01:16:44 2003
> +++ vigra1.2.0-new/src/impex/viff.cxx	Wed Feb 25 13:39:05 2004
> @@ -611,7 +611,7 @@
>      void ViffDecoderImpl::color_map()
>      {
>          void_vector_base temp_bands;
> -        unsigned int temp_num_bands;
> +        size_t temp_num_bands;
>
>          if ( header.map_storage_type == VFF_MAPTYP_1_BYTE ) {
>              typedef unsigned char map_storage_type;
> Index: src/PanoImage/panorama.h
> ===================================================================
> RCS file: /cvsroot/hugin/hugin/src/PanoImage/panorama.h,v
> retrieving revision 1.1
> diff -u -r1.1 panorama.h
> --- src/PanoImage/panorama.h	10 Jul 2003 23:39:50 -0000	1.1
> +++ src/PanoImage/panorama.h	26 Feb 2004 14:24:04 -0000
> @@ -42,7 +42,7 @@
>
>  // Create a definition if we're on a Macintosh:
>  #ifndef __Mac__
> -	#if (defined(macintosh) || defined(__MC68K__) ||  
> defined(__POWERPC__) || defined(__powerc))
> +	#if (defined(macintosh) || defined(__MC68K__) )
>  		#define __Mac__			1
>  		#define BIGENDIAN		1
>  	#endif
> Index: src/hugin/PreviewFrame.cpp
> ===================================================================
> RCS file: /cvsroot/hugin/hugin/src/hugin/PreviewFrame.cpp,v
> retrieving revision 1.20
> diff -u -r1.20 PreviewFrame.cpp
> --- src/hugin/PreviewFrame.cpp	15 Feb 2004 14:49:36 -0000	1.20
> +++ src/hugin/PreviewFrame.cpp	26 Feb 2004 14:24:05 -0000
> @@ -49,7 +49,7 @@
>      EVT_TOOL(XRCID("preview_update_tool"),  
> PreviewFrame::OnUpdateButton)
>      EVT_TOOL(XRCID("preview_show_all_tool"), PreviewFrame::OnShowAll)
>      EVT_TOOL(XRCID("preview_show_none_tool"),  
> PreviewFrame::OnShowNone)
> -    EVT_TOGGLEBUTTON(-1, PreviewFrame::OnChangeDisplayedImgs)
> +//    EVT_TOGGLEBUTTON(-1, PreviewFrame::OnChangeDisplayedImgs)
>      EVT_SCROLL_THUMBRELEASE(PreviewFrame::OnChangeFOV)
>      EVT_SCROLL_ENDSCROLL(PreviewFrame::OnChangeFOV)
>      EVT_SCROLL_THUMBTRACK(PreviewFrame::OnChangeFOV)
> @@ -224,9 +224,9 @@
>      // remove items for nonexisting images
>      for (int i=nrButtons-1; i>=(int)nrImages; i--)
>      {
> -        m_ToggleButtonSizer->Remove(m_ToggleButtons[i]);
> -        delete m_ToggleButtons[i];
> -        m_ToggleButtons.pop_back();
> +//        m_ToggleButtonSizer->Remove(m_ToggleButtons[i]);
> +//        delete m_ToggleButtons[i];
> +//        m_ToggleButtons.pop_back();
>          m_displayedImgs.erase(i);
>          dirty = true;
>      }
> @@ -239,27 +239,27 @@
>                  unsigned int imgNr = *it;
>                  // create new item.
>  //                wxImage * bmp = new wxImage(sz.GetWidth(),  
> sz.GetHeight());
> -                wxToggleButton * but = new wxToggleButton(this,
> -                                                           
> ID_TOGGLE_BUT + *it,
> -                                                           
> wxString::Format("%d",*it));
> +//                wxToggleButton * but = new wxToggleButton(this,
> +//                                                           
> ID_TOGGLE_BUT + *it,
> +//                                                           
> wxString::Format("%d",*it));
>                  wxSize sz(9,8);
>                  wxSize res = ConvertDialogToPixels(sz);
> -                sz = but->GetSize();
> -                but->SetSize(res.GetWidth(),sz.GetHeight());
> -                but->SetValue(true);
> -                m_ToggleButtonSizer->Add(but,
> -                                         0,
> -                                         wxLEFT,
> -                                         5);
> +//                sz = but->GetSize();
> +//                but->SetSize(res.GetWidth(),sz.GetHeight());
> +//                but->SetValue(true);
> +//                m_ToggleButtonSizer->Add(but,
> +//                                         0,
> +//                                         wxLEFT,
> +//                                         5);
>
> -                m_ToggleButtons.push_back(but);
> +//                m_ToggleButtons.push_back(but);
>                  m_displayedImgs.insert(imgNr);
>                  dirty = true;
>              }
>          }
>      }
>      if (dirty) {
> -        m_ToggleButtonSizer->Layout();
> +//        m_ToggleButtonSizer->Layout();
>          DEBUG_DEBUG("ndisplayed: " << m_displayedImgs.size());
>          UIntSet copy = m_displayedImgs;
>          m_PreviewPanel->SetDisplayedImages(copy);
> @@ -360,19 +360,19 @@
>
>  void PreviewFrame::OnShowAll(wxCommandEvent & e)
>  {
> -    DEBUG_ASSERT(m_pano.getNrOfImages() == m_ToggleButtons.size());
> +//    DEBUG_ASSERT(m_pano.getNrOfImages() == m_ToggleButtons.size());
>      for (unsigned int i=0; i < m_pano.getNrOfImages(); i++) {
>          m_displayedImgs.insert(i);
> -        m_ToggleButtons[i]->SetValue(true);
> +//        m_ToggleButtons[i]->SetValue(true);
>      }
>      m_PreviewPanel->SetDisplayedImages(m_displayedImgs);
>  }
>
>  void PreviewFrame::OnShowNone(wxCommandEvent & e)
>  {
> -    DEBUG_ASSERT(m_pano.getNrOfImages() == m_ToggleButtons.size());
> +//    DEBUG_ASSERT(m_pano.getNrOfImages() == m_ToggleButtons.size());
>      for (unsigned int i=0; i < m_pano.getNrOfImages(); i++) {
> -        m_ToggleButtons[i]->SetValue(false);
> +//        m_ToggleButtons[i]->SetValue(false);
>      }
>      m_displayedImgs.clear();
>      m_PreviewPanel->SetDisplayedImages(m_displayedImgs);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 19353 bytes
Desc: not available
Url : http://www.email-lists.org/pipermail/ptx/attachments/20040227/739f825f/attachment.bin


More information about the ptX mailing list