help > Matlab toolbox build problem (missing tiff.h)
Showing 1-9 of 9 posts
Display:
Results per page:
Aug 29, 2011  08:08 PM | Hanchuan Peng
Matlab toolbox build problem (missing tiff.h)
mark,



need to include the v3d_main/common_lib/include in the path.



-Hanchuan



On 8/29/11 3:06 PM, Mark wrote:


Hi Hanchuan,
  I tried to run your script makeosmex_rawfile_io.m to
compile the mex files for the matlab io toolbox and got errors
(error.orig.txt).  The errors of missing .h files go away if I
include -I/Users/schroederm/Documents/MATLAB/matlabIO/libtiff/tiff-3.9.5/libtiff/,

but there is a new error that it can't find the library for
–lv3dtiff.  I tried searching on nitrc, but I couldn't find any
help on this issue.

  It seemed that getting rid of the original –L flag didn't
cause problems, but I couldn't get rid of –lv3dtiff without
getting a lot of errors under Undefined symbols for architecture
x86_64 (error5.txt).  If you could offer some suggestions it
would be greatly appreciated.

Thanks,
mark

  
Aug 29, 2011  09:08 PM | Mark Schroeder
RE: Matlab toolbox build problem (missing tiff.h)
I had just downloaded the matlab IO toolbox from the v3d website.  I downloaded the v3d trunk and that directory is in this distribution, but I imagine I need to install QT and compile everything to have that main directory.

Is there a way to compile/use the toolbox without doing this?  It seems like there might be since they can be downloaded separately and it's unclear that I need to compile v3d for this purpose.  The QT installation is running, but taking quite a while.

thanks for your help,
mark
Aug 29, 2011  11:08 PM | Hanchuan Peng
RE: Matlab toolbox build problem (missing tiff.h)
you don't need qt.
Aug 31, 2011  03:08 PM | Mark Schroeder
RE: Matlab toolbox build problem (missing tiff.h)
I'm not sure what to download/install/compile to make the mex compilation work.  Having the directories under v3d_main requires downloading the trunk, which I checked out with subversion.

v3d_main/common_lib/include is empty when I do this and the directory v3d_main/common_lib/lib (which is given in the mex calls with the switch -L../v3d_main/common_lib/lib) doesn't exist.  So something is clearly missing for compiling the IO toolbox.

I tried compiling v3d using the command "sh ./build.macx -m -B -j4", but there were a lot of errors about -arch or -Xarch_x86_64 not recognized from cc1plus and g++ respectively (compilation output attached).

I tried compiling the mex files with the default makeosmex_rawfile_io.m, but it failed with the same errors as if the rest of the v3d code wasn't there.  No library was generated called v3dtiff or libv3dtiff, though in the main README it says there should be and that seems to be something the mex compiler is looking for.

It would be great if you could list the minimal steps to install the matlab IO toolbox on a machine without any v3d code compiled on it.  If I need to compile v3d, it would be great if you could take a quick look at the error output.

I'm not sure if it's helpful, but here is some info about my g++ and computer.

g++ -v
Using built-in specs.
Target: x86_64-apple-darwin10
Configured with: ../gcc-4.4.6/configure --prefix=/opt/local --build=x86_64-apple-darwin10 --enable-languages=c,c++,objc,obj-c++,java,fortran --libdir=/opt/local/lib/gcc44 --includedir=/opt/local/include/gcc44 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.4 --with-gxx-include-dir=/opt/local/include/gcc44/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --enable-stage1-checking --enable-fully-dynamic-string
Thread model: posix
gcc version 4.4.6 (GCC)

uname -a
Darwin MN 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64

Thanks for helping me to compile the mex files.  I hope I'm not missing something obvious.
Attachment: v3dBuildOutput.txt
Aug 31, 2011  03:08 PM | Hanchuan Peng
How to build V3D and Matlab toolbox
There are two separate issues: (1) build V3D or not, (2) build the V3D IO Matlab toolbox or not.

For the first issue, you will need qt (of course). You can download the src code (NOT the pre-compiled one) from qt website at nokia.com. Then simply run an untar command like this (on Mac or Unix like system)

    tar zxvf qt_what_ever.tar.gz

Then you can compile qt using the commands like (need to first enter the untarred qt folder)

    ./configure -nomake examples
    make
    sudo make install

Once you have qt, then build V3D is just one command (need to enter v3d src code folder)

    ./build.macx -B -m

The options -m will tell to build 64bit version. -B tells you to rebuild everything.

But this command, when runs for the first time, also automatically untar the bundled boost, fftw, tiff, libraries in V3D. These include files, libraries, etc will be put (automatically!) into v3d_main/common_lib folder. After that, this command will build V3D and the plugins automatically.

Thus it is clear that if you only need libtiff, you can simple run this command. When it stops and indicates that no qt exists, etc, just ignore the message. Of course, if you want to build V3D at the first place, you will not see these erroreneous msgs.

Once you have the libtiff, you are ready to build the Matlab toolbox.

There is one special note: Matlab software itself uses an old version of libtiff, which should be replaced by the libtiff library file you would produce in the above way. That old Matlab library file can be found in /Path_to_matlab/bin/maci64 (assuming you will need 64bit matlab).

-Hanchuan
Sep 1, 2011  05:09 PM | Mark Schroeder
RE: How to build V3D and Matlab toolbox
This thread was continued under a different title: http://www.nitrc.org/forum/forum.php?thr...

Some of the errors I mentioned were due to using a ported version of gcc instead of the xtools version of gcc available from apple.
Feb 22, 2016  07:02 AM | mario negrello
RE: Matlab toolbox build problem (missing tiff.h)
Greetings and kudos for the great work with VAA3D,

I hope this is the appropriate thread ;]. I'm trying to compile the tilff export from matlab, so i run makeosmex_rawfile_io, but i fail.

Error in makeosmex_rawfile_io (line 12)
mex loadRaw2Stack_c.cpp mg_image_lib.cpp mg_utilities.cpp
-L/Users/M/Projects/Code/MatlabExtra/v3d_external/v3d_main/common_lib/lib_mac64
-lv3dtiff


I conclude that from v3d_main/common_lib/lib_maci64 I'm missing 

-lv3dtiff

without which i can't compile the matlab_io. I don't quite understand what that library is. Is there any other tiff library that i can use, potentially? Is it a matter of adding it to matlab's path?

Maybe another question, is it possible these days to export the multipage tiff directly from matlab, maybe using the Tiff class?

Mario
Feb 22, 2016  07:02 AM | mario negrello
RE: Matlab toolbox build problem (missing tiff.h)
I notice now that the thread mentioned in the post above suggests i have to compile the whole of vaa3d before the mex compilation will work. Is that right?

Feb 22, 2016  07:02 PM | Zhi Zhou
RE: Matlab toolbox build problem (missing tiff.h)
Mario,

It seems you are missing tiff library. Yes, you can build Vaa3D first following the instruction (https://github.com/Vaa3D/Vaa3D_Wiki/wiki...). In this way, the tiff library will be built automatically. Or you can just build tiff library under  v3d_external/v3d_main/common_lib/src_packages/ folder. Following the instruction below, you should be able to build the tiff library appropriately (assume you are using Mac 64bit) .

cd v3d_external/v3d_main/common_lib/src_packages
tar zxvf tiff-4.0.2.tar.gz
cd ../
TIFFPATH='pwd'
cd build
../src_packages/tiff-4.0.2/configure -prefix=$TIFFPATH CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" --disable-jpeg --disable-zlib --disable-pixarlog
make clean
make
make install

mv ../lib/libtiff.a ../lib/libv3dtiff.a
mv ../lib/libtiff.dylib ../lib/libv3dtiff.dylib
if [ ! -d ../lib_mac64 ]; then
mkdir ../lib_mac64
fi

cp ../lib/libv3dtiff.a ../lib_mac64/.
cp ../lib/libv3dtiff.dylib ../lib_mac64/.