Pĺl Frenger - 2002-01-23

IT++ (version 3.6.1) compiles under cygwin with some minor modifications. If you don't already have cygwin, then download that from http://sources.redhat.com/cygwin/. In summary, what I did to compile IT++ under cygwin was the following:

    1. Download it++, unzip, and untar.
    2. Comment out the two log2 functions in {it++}/include/base/scalfunc.h
    3. Comment out the two log2 functions in {it++}/include/base/elmatfunc.h
    4. run "./configure opt debug prof" in the {it++} directory
    5. make
    6. "cd lib" and "ln -s libit++.a libit++_s.a"
    7. "cd test", "mv audiodev.cpp audiodev.backup", "make test"

And this worked! What I did not get to work with the method above are the following things:

    1. the log2 functions in scalfunc.h and elmatfunc.h
    2. The shared library
    3. No audio

If you want to see the detailed error messages I got, and perhaps suggest how to fix them in a more elegant way, then read on:

-----------------------------------------------------------------------------------
Details:
-----------------------------------------------------------------------------------
When compiling it++ under cygwin the following error messages occur:

    g++ -Wall -pipe   -O3 -DNDEBUG -DASSERT_LEVEL=1 -I../include -I../src/base/fftw
    -c base/vec.cpp -o base/vec.o
    In file included from base/vec.cpp:30:
    ../include/base/scalfunc.h:91: parse error before `/'
    make[1]: *** [base/vec.o] Error 1
    make[1]: Leaving directory `/home/Administrator/it++/src'
    make: *** [suball] Error 2

The error is that the log2 function on line 91: (in {it++}/include/base/scalfunc.h)

    /*! \brief Base-2 logarithm
      \ingroup logexpfunc
    */
    inline double log2(double x) { return M_LOG2E*log(x); }

is not accepted by the compiler. Renaming the function to "my_log2" or "log22" works fine.
But we try to comment it out instead, like this:

    /* \brief Base-2 logarithm
      \ingroup logexpfunc
    */
    //inline double log2(double x) { return M_LOG2E*log(x); }

With this modification the compilation continues until it reaches elmatfunc.cpp:

    g++ -Wall -pipe   -O3 -DNDEBUG -DASSERT_LEVEL=1 -I../include -I../src/base/fftw
    -c base/elmatfunc.cpp -o base/elmatfunc.o
    In file included from base/elmatfunc.cpp:24:
    ../include/base/elmatfunc.h:83: parse error before `/'
    ../include/base/elmatfunc.h:85: parse error before `/'
    make[1]: *** [base/elmatfunc.o] Error 1
    make[1]: Leaving directory `/home/Administrator/it++/src'
    make: *** [suball] Error 2

The following lines causes problems (lines 82-85 in {it++}/include/base/elmatfunc.h)

    //! log-2 of the elements
    inline vec log2(const vec &x) {return vec_function((double(*)(double)) log2,x);}
    //! log-2 of the elements
    inline mat log2(const mat &x) {return mat_function((double(*)(double)) log2,x);}

This I can't explain. I give up on this problem. I tried to rename the functions to my_log2 and then the compiler

complains that log2 is undefined. I just comment out these lines (who needs log2 functions anyway?) like this:

    // log-2 of the elements
    //inline vec log2(const vec &x) {return vec_function((double(*)(double)) log2,x);}
    // log-2 of the elements
    //inline mat log2(const mat &x) {return mat_function((double(*)(double)) log2,x);}

Now everything compiles except that the shared library is not created properly. Every file gives a warning like

this:

    cc1plus.exe: warning: -fPIC ignored for target (all code is position independent)

And the the following error message occurs when the shared library is supposed to be created:

    Creating ../lib/libit++.so
    base/itassert_pic.o(.text+0x443):itassert.cpp: undefined reference to `cerr'
    base/itassert_pic.o(.text+0x454):itassert.cpp: undefined reference to `endl(ostream &)'
    base/itassert_pic.o(.text+0x460):itassert.cpp: undefined reference to `flush(ostream &)'
    base/itassert_pic.o(.text+0x9f5):itassert.cpp: undefined reference to `cerr'
    base/itassert_pic.o(.text+0xa06):itassert.cpp: undefined reference to `endl(ostream &)'
    base/itassert_pic.o(.text+0xa12):itassert.cpp: undefined reference to `flush(ostream &)'
    base/itassert_pic.o(.text+0xd3b):itassert.cpp: undefined reference to `ostream::operator<<(char const *)'
    base/itassert_pic.o(.text+0xd4d):itassert.cpp: undefined reference to `ostream::operator<<(char const *)'
    base/itassert_pic.o(.text+0xd56):itassert.cpp: undefined reference to `ostream::operator<<(int)'
    base/itassert_pic.o(.text+0xd5f):itassert.cpp: undefined reference to `ostream::operator<<(char const *)'
    base/itassert_pic.o(.text+0xd6b):itassert.cpp: undefined reference to `endl(ostream &)'
    base/itassert_pic.o(.text+0xd80):itassert.cpp: undefined reference to `endl(ostream &)'
    base/itassert_pic.o(.text+0xd8c):itassert.cpp: undefined reference to `flush(ostream &)'
    base/itassert_pic.o(.data+0x4):itassert.cpp: undefined reference to `cerr'
    base/itassert_pic.o(.__default_alloc_template<false, 0>::text$_S_chunk_alloc(unsigned int,    

int&)+0x112):itassert.cpp: undefined reference to `cerr'
    base/itassert_pic.o(.__default_alloc_template<false, 0>::text$_S_chunk_alloc(unsigned int, int    

&)+0x117):itassert.cpp: undefined reference to `ostream::operator<<(char const *)'
    ..... and so on.....

Now I've got everything in IT++ except the log2 functions and the shared library. I can do without them. Let's

test the installation. "make test" in the tests folder complains about that libit++_s.a is missing. That is

easily fixed with:

    cd lib
    ln -s libit++.a libit++_s.a

The audiodev.cpp file doesn't work. I can live without that too:

    mv audiodev.cpp audiodev.backup

Thats all. If you have any suggestions on how to make the log2 functions, the shared lib, or the audiodev

functionality to work, please send in a response to this list.

//Pl