Menu

#197 Build failed with flag _CL_DISABLE_MULTITHREADING

open
nobody
core (32)
5
2011-03-23
2011-03-23
No

I download latest version (clucene-core-2.3.3.4.tar.gz). Create solution for VisualStudio 2005 with parameter _CL_DISABLE_MULTITHREADING. Solution build failed.

Discussion

  • Elias Probst

    Elias Probst - 2011-05-07

    I can confirm this problem.
    As it looks like it is not possible to attach a file to an existing bug report in the Sourceforge tracker, I'm posting the full output here:

    cmake --no-warn-unused-cli -C /var/tmp/portage/dev-cpp/clucene-2.3.3.4/temp/gentoo_common_config.cmake -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_ASCII_MODE=OFF -DENABLE_PACKAGING=OFF -DENABLE_CLDOCS=OFF -DBUILD_STATIC_LIBRARIES=OFF -DDISABLE_MULTITHREADING=ON -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_INSTALL_DO_STRIP=OFF -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/dev-cpp/clucene-2.3.3.4/temp/gentoo_rules.cmake /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4
    Not searching for unused variables given on the command line.
    loading initial cache file /var/tmp/portage/dev-cpp/clucene-2.3.3.4/temp/gentoo_common_config.cmake
    -- The C compiler identification is GNU
    -- The CXX compiler identification is GNU
    -- Check for working C compiler: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc
    -- Check for working C compiler: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-gcc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++
    -- Check for working CXX compiler: /usr/lib/ccache/bin/x86_64-pc-linux-gnu-g++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Looking for include files CMAKE_HAVE_PTHREAD_H
    -- Looking for include files CMAKE_HAVE_PTHREAD_H - found
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE
    Compiling as Gentoo
    -- Checking to see if CXX compiler accepts flag -pg
    -- Checking to see if CXX compiler accepts flag -pg - yes
    -- Boost version: 1.42.0
    Boost found
    -- Boost_INCLUDE_DIR : /usr/include/boost-1_42
    -- Found ZLIB: /usr/include (found version "1.2.5")
    -- Looking for include files _CL_TIME_WITH_SYS_TIME
    -- Looking for include files _CL_TIME_WITH_SYS_TIME - found
    -- Looking for C++ include stdlib.h
    -- Looking for C++ include stdlib.h - found
    -- Looking for C++ include stdarg.h
    -- Looking for C++ include stdarg.h - found
    -- Looking for C++ include stdio.h
    -- Looking for C++ include stdio.h - found
    -- Looking for C++ include stddef.h
    -- Looking for C++ include stddef.h - found
    -- Looking for C++ include ctype.h
    -- Looking for C++ include ctype.h - found
    -- Looking for C++ include algorithm
    -- Looking for C++ include algorithm - found
    -- Looking for C++ include functional
    -- Looking for C++ include functional - found
    -- Looking for C++ include map
    -- Looking for C++ include map - found
    -- Looking for C++ include vector
    -- Looking for C++ include vector - found
    -- Looking for C++ include list
    -- Looking for C++ include list - found
    -- Looking for C++ include set
    -- Looking for C++ include set - found
    -- Looking for C++ include math.h
    -- Looking for C++ include math.h - found
    -- Looking for C++ include fcntl.h
    -- Looking for C++ include fcntl.h - found
    -- Looking for C++ include limits.h
    -- Looking for C++ include limits.h - found
    -- Looking for C++ include string.h
    -- Looking for C++ include string.h - found
    -- Looking for C++ include sys/time.h
    -- Looking for C++ include sys/time.h - found
    -- Looking for C++ include memory.h
    -- Looking for C++ include memory.h - found
    -- Looking for C++ include sys/types.h
    -- Looking for C++ include sys/types.h - found
    -- Looking for C++ include stdint.h
    -- Looking for C++ include stdint.h - found
    -- Looking for C++ include unistd.h
    -- Looking for C++ include unistd.h - found
    -- Looking for C++ include io.h
    -- Looking for C++ include io.h - not found
    -- Looking for C++ include direct.h
    -- Looking for C++ include direct.h - not found
    -- Looking for C++ include sys/dir.h
    -- Looking for C++ include sys/dir.h - found
    -- Looking for C++ include sys/ndir.h
    -- Looking for C++ include sys/ndir.h - not found
    -- Looking for C++ include dirent.h
    -- Looking for C++ include dirent.h - found
    -- Looking for C++ include wctype.h
    -- Looking for C++ include wctype.h - found
    -- Looking for C++ include stat.h
    -- Looking for C++ include stat.h - not found
    -- Looking for C++ include sys/stat.h
    -- Looking for C++ include sys/stat.h - found
    -- Looking for C++ include stdexcept
    -- Looking for C++ include stdexcept - found
    -- Looking for C++ include errno.h
    -- Looking for C++ include errno.h - found
    -- Looking for C++ include windef.h
    -- Looking for C++ include windef.h - not found
    -- Looking for C++ include windows.h
    -- Looking for C++ include windows.h - not found
    -- Looking for C++ include wchar.h
    -- Looking for C++ include wchar.h - found
    -- Looking for C++ include hash_map
    -- Looking for C++ include hash_map - found
    -- Looking for C++ include hash_set
    -- Looking for C++ include hash_set - found
    -- Looking for C++ include ext/hash_map
    -- Looking for C++ include ext/hash_map - found
    -- Looking for C++ include tr1/unordered_set
    -- Looking for C++ include tr1/unordered_set - found
    -- Looking for C++ include tr1/unordered_map
    -- Looking for C++ include tr1/unordered_map - found
    -- Looking for C++ include sys/timeb.h
    -- Looking for C++ include sys/timeb.h - found
    -- Looking for C++ include tchar.h
    -- Looking for C++ include tchar.h - not found
    -- Looking for C++ include strings.h
    -- Looking for C++ include strings.h - found
    -- Looking for C++ include sys/mman.h
    -- Looking for C++ include sys/mman.h - found
    -- Looking for C++ include winerror.h
    -- Looking for C++ include winerror.h - not found
    -- Choosing type for int8_t
    -- Check size of int8_t
    -- Check size of int8_t - done
    -- Choosing type for int8_t - signed int8_t
    -- Choosing type for uint8_t
    -- Check size of uint8_t
    -- Check size of uint8_t - done
    -- Choosing type for uint8_t - unsigned uint8_t
    -- Choosing type for int16_t
    -- Check size of int16_t
    -- Check size of int16_t - done
    -- Choosing type for int16_t - signed int16_t
    -- Choosing type for uint16_t
    -- Check size of uint16_t
    -- Check size of uint16_t - done
    -- Choosing type for uint16_t - unsigned uint16_t
    -- Choosing type for int32_t
    -- Check size of int32_t
    -- Check size of int32_t - done
    -- Choosing type for int32_t - signed int32_t
    -- Choosing type for uint32_t
    -- Check size of uint32_t
    -- Check size of uint32_t - done
    -- Choosing type for uint32_t - unsigned uint32_t
    -- Choosing type for int64_t
    -- Check size of int64_t
    -- Check size of int64_t - done
    -- Choosing type for int64_t - signed int64_t
    -- Choosing type for uint64_t
    -- Check size of uint64_t
    -- Check size of uint64_t - done
    -- Choosing type for uint64_t - unsigned uint64_t
    -- Choosing type for size_t
    -- Check size of size_t
    -- Check size of size_t - done
    -- Choosing type for size_t - unsigned size_t
    -- Choosing option for HAVE_TYPE__TIMEB
    -- Performing Test _CL_HAVE_OPTION__TIMEB
    -- Performing Test _CL_HAVE_OPTION__TIMEB - Failed
    -- Performing Test _CL_HAVE_OPTION_TIMEB
    -- Performing Test _CL_HAVE_OPTION_TIMEB - Success
    -- Choosing option for HAVE_TYPE__TIMEB - timeb
    -- Performing Test HAVE_SYMBOL_FLOAT_T
    -- Performing Test HAVE_SYMBOL_FLOAT_T - Success
    -- Check size of DWORD
    -- Check size of DWORD - failed
    -- Looking for printf
    -- Looking for printf - found
    -- Looking for strftime
    -- Looking for strftime - found
    -- Looking for wcscpy
    -- Looking for wcscpy - found
    -- Looking for wcsncpy
    -- Looking for wcsncpy - found
    -- Looking for wcscat
    -- Looking for wcscat - found
    -- Looking for wcschr
    -- Looking for wcschr - found
    -- Looking for wcsstr
    -- Looking for wcsstr - found
    -- Looking for wcslen
    -- Looking for wcslen - found
    -- Looking for wcscmp
    -- Looking for wcscmp - found
    -- Looking for wcsncmp
    -- Looking for wcsncmp - found
    -- Looking for wcscspn
    -- Looking for wcscspn - found
    -- Looking for wcsupr
    -- Looking for wcsupr - not found
    -- Looking for wcscasecmp
    -- Looking for wcscasecmp - found
    -- Looking for wcsicmp
    -- Looking for wcsicmp - not found
    -- Looking for wcstoll
    -- Looking for wcstoll - found
    -- Looking for wprintf
    -- Looking for wprintf - found
    -- Looking for lltow
    -- Looking for lltow - not found
    -- Looking for wcstod
    -- Looking for wcstod - found
    -- Looking for wcsdup
    -- Looking for wcsdup - found
    -- Looking for strupr
    -- Looking for strupr - not found
    -- Looking for strlwr
    -- Looking for strlwr - not found
    -- Looking for lltoa
    -- Looking for lltoa - not found
    -- Looking for strtoll
    -- Looking for strtoll - found
    -- Looking for gettimeofday
    -- Looking for gettimeofday - found
    -- Looking for _vsnwprintf
    -- Looking for _vsnwprintf - not found
    -- Looking for mmap
    -- Looking for mmap - found
    -- Looking for MapViewOfFile
    -- Looking for MapViewOfFile(0,0,0,0,0) - not found
    -- Choosing function for fileHandleStat
    -- Looking for fstati64
    -- Looking for fstati64 - not found
    -- Looking for _fstati64
    -- Looking for _fstati64 - not found
    -- Looking for fstat64
    -- Looking for fstat64 - found
    -- Choosing function for fileHandleStat - fstat64
    -- Choosing function for fileStat
    -- Looking for stati64
    -- Looking for stati64 - not found
    -- Looking for _stati64
    -- Looking for _stati64 - not found
    -- Looking for stat64
    -- Looking for stat64 - found
    -- Choosing function for fileStat - stat64
    -- Choosing function for fileSize
    -- Looking for filelengthi64
    -- Looking for filelengthi64 - not found
    -- Looking for _filelengthi64
    -- Looking for _filelengthi64 - not found
    -- Looking for filelength
    -- Looking for filelength - not found
    -- Looking for _filelength
    -- Looking for _filelength - not found
    -- Choosing function for fileSize - using default
    -- Choosing function for fileSeek
    -- Looking for lseeki64
    -- Looking for lseeki64 - not found
    -- Looking for _lseeki64
    -- Looking for _lseeki64 - not found
    -- Looking for lseek64
    -- Looking for lseek64 - found
    -- Choosing function for fileSeek - lseek64
    -- Choosing option for HAVE_TYPE_CL_STAT_T
    -- Performing Test _CL_HAVE_OPTION_STATI64
    -- Performing Test _CL_HAVE_OPTION_STATI64 - Failed
    -- Performing Test _CL_HAVE_OPTION__STATI64
    -- Performing Test _CL_HAVE_OPTION__STATI64 - Failed
    -- Performing Test _CL_HAVE_OPTION_STAT64
    -- Performing Test _CL_HAVE_OPTION_STAT64 - Success
    -- Choosing option for HAVE_TYPE_CL_STAT_T - stat64
    -- Choosing function for fileTell
    -- Looking for telli64
    -- Looking for telli64 - not found
    -- Looking for _telli64
    -- Looking for _telli64 - not found
    -- Looking for tell64
    -- Looking for tell64 - not found
    -- Looking for tell
    -- Looking for tell - not found
    -- Looking for _tell
    -- Looking for _tell - not found
    -- Choosing function for fileTell - using default
    -- Choosing function for _realpath
    -- Looking for realpath
    -- Looking for realpath - found
    -- Choosing function for _realpath - realpath
    -- Choosing function for _rename
    -- Looking for rename
    -- Looking for rename - found
    -- Choosing function for _rename - rename
    -- Choosing function for _close
    -- Looking for _close
    -- Looking for _close((int)0) - not found
    -- Looking for close
    -- Looking for close - found
    -- Choosing function for _close - close
    -- Choosing function for _read
    -- Looking for _read
    -- Looking for _read((int)0, (void*)0, (unsigned int)0) - not found
    -- Looking for read
    -- Looking for read - found
    -- Choosing function for _read - read
    -- Choosing function for _cl_open
    -- Looking for _open
    -- Looking for _open(0,0,0) - not found
    -- Looking for open
    -- Looking for open - found
    -- Choosing function for _cl_open - open
    -- Choosing function for _write
    -- Looking for _write
    -- Looking for _write((int)0, (const void*)0, (unsigned int)0) - not found
    -- Looking for write
    -- Looking for write - found
    -- Choosing function for _write - write
    -- Choosing function for _unlink
    -- Looking for _unlink
    -- Looking for _unlink((const char*)0) - not found
    -- Looking for unlink
    -- Looking for unlink - found
    -- Choosing function for _unlink - unlink
    -- Choosing function for _ftime
    -- Looking for _ftime
    -- Looking for _ftime(0) - not found
    -- Looking for ftime
    -- Looking for ftime - found
    -- Choosing function for _ftime - ftime
    -- Choosing function for _mkdir
    -- Looking for _mkdir
    -- Looking for _mkdir((const char*)0) - not found
    -- Choosing function for _mkdir - using default
    -- Choosing function for SLEEPFUNCTION
    -- Looking for usleep
    -- Looking for usleep - found
    -- Choosing function for SLEEPFUNCTION - usleep
    -- Choosing function for _snprintf
    -- Looking for snprintf
    -- Looking for snprintf - found
    -- Choosing function for _snprintf - snprintf
    -- Choosing function for _snwprintf
    -- Looking for snwprintf
    -- Looking for snwprintf - not found
    -- Looking for _snwprintf
    -- Looking for _snwprintf - not found
    -- Choosing function for _snwprintf - not found
    -- Choosing symbol for _O_RANDOM
    -- Looking for _O_RANDOM
    -- Looking for _O_RANDOM - not found.
    -- Looking for O_RANDOM
    -- Looking for O_RANDOM - not found.
    -- Choosing symbol for _O_RANDOM - not found
    -- Choosing symbol for _O_BINARY
    -- Looking for _O_BINARY
    -- Looking for _O_BINARY - not found.
    -- Looking for O_BINARY
    -- Looking for O_BINARY - not found.
    -- Choosing symbol for _O_BINARY - not found
    -- Choosing symbol for _S_IREAD
    -- Looking for _S_IREAD
    -- Looking for _S_IREAD - not found.
    -- Looking for S_IREAD
    -- Looking for S_IREAD - found
    -- Choosing symbol for _S_IREAD - S_IREAD
    -- Choosing symbol for _S_IWRITE
    -- Looking for _S_IWRITE
    -- Looking for _S_IWRITE - not found.
    -- Looking for S_IWRITE
    -- Looking for S_IWRITE - found
    -- Choosing symbol for _S_IWRITE - S_IWRITE
    -- Choosing type for TCHAR
    -- Check size of TCHAR
    -- Check size of TCHAR - failed
    -- Check size of wchar_t
    -- Check size of wchar_t - done
    -- Choosing type for TCHAR - wchar_t
    -- Choosing symbol for _T
    -- Looking for _T
    -- Looking for _T - not found.
    -- Choosing symbol for _T - not found
    -- Performing Test _CL_HAVE_PTHREAD_MUTEX_RECURSIVE
    -- Performing Test _CL_HAVE_PTHREAD_MUTEX_RECURSIVE - Success
    -- Performing Test _CL_HAVE_GCC_ATOMIC_FUNCTIONS
    -- Performing Test _CL_HAVE_GCC_ATOMIC_FUNCTIONS - Success
    -- Performing Test _CL_HAVE_GCCVISIBILITYPATCH
    -- Performing Test _CL_HAVE_GCCVISIBILITYPATCH - Success
    -- Performing Test _CL_HAVE_TRY_BLOCKS
    -- Performing Test _CL_HAVE_TRY_BLOCKS - Success
    -- Checking support new float byte<->float conversions
    -- Checking support new float byte<->float conversions - yes
    -- Choosing namespace for hashmaps
    -- Performing Test _CL_HAVE_STD__TR1_HASHMAP
    -- Performing Test _CL_HAVE_STD__TR1_HASHMAP - Success
    -- Choosing namespace for hashmaps - std::tr1::func
    -- Performing Test _CL_HAVE_NAMESPACES
    -- Performing Test _CL_HAVE_NAMESPACES - Success
    -- Performing Test _CL_HAVE_NO_SNPRINTF_BUG
    -- Performing Test _CL_HAVE_NO_SNPRINTF_BUG - Success
    -- Performing Test _CL_ILONGLONG_LL
    -- Performing Test _CL_ILONGLONG_LL - Success
    -- Performing Test LUCENE_STATIC_CONSTANT_SYNTAX
    -- Performing Test LUCENE_STATIC_CONSTANT_SYNTAX - Success
    -- Check for ANSI scope
    -- Check for ANSI scope - found
    -- Checking to see if CXX compiler accepts flag -fprofile-arcs -ftest-coverage
    -- Checking to see if CXX compiler accepts flag -fprofile-arcs -ftest-coverage - yes
    -- <<< Gentoo configuration >>>
    Build type Gentoo
    Install path /usr
    Compiler flags:
    C -march=nocona -O2 -pipe -ggdb
    C++ -march=nocona -O2 -pipe -ggdb -fPIC -ansi
    Linker flags:
    Executable -Wl,--as-needed
    Module -Wl,--as-needed
    Shared -Wl,--as-needed

    -- Configuring done
    -- Generating done
    -- Build files have been written to: /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-2.3.3.4_build
    >>> Source configured.
    >>> Compiling source in /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4 ...
    >>> Working in BUILD_DIR: "/var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-2.3.3.4_build"
    make -j1
    Scanning dependencies of target clucene-shared
    [ 0%] Building CXX object src/shared/CMakeFiles/clucene-shared.dir/CLucene/SharedHeader.o
    In file included from /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/shared/CLucene/SharedHeader.h:202,
    from /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/shared/CLucene/_SharedHeader.h:14,
    from /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/shared/CLucene/SharedHeader.cpp:9:
    /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/core/CLucene/debug/lucenebase.h: In constructor 'lucene::debug::LuceneBase::LuceneBase()':
    /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/core/CLucene/debug/lucenebase.h:20: error: '_LUCENE_ATOMIC_INT_SET' was not declared in this scope
    /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/core/CLucene/debug/lucenebase.h: In member function 'int lucene::debug::LuceneBase::__cl_getref()':
    /var/tmp/portage/dev-cpp/clucene-2.3.3.4/work/clucene-core-2.3.3.4/src/core/CLucene/debug/lucenebase.h:23: error: '_LUCENE_ATOMIC_INT_GET' was not declared in this scope
    make[2]: *** [src/shared/CMakeFiles/clucene-shared.dir/CLucene/SharedHeader.o] Error 1
    make[1]: *** [src/shared/CMakeFiles/clucene-shared.dir/all] Error 2
    make: *** [all] Error 2

     
  • Karelin Pavel

    Karelin Pavel - 2011-05-10

    Excuse me, it is necessary was write little in detail: itself solution for VisualStudio with flag DDISABLE_MULTITHREADING=ON created without problems.
    The Problems begin under the further compiling.

    In file LuceneThreads.h exists the section: #if defined(_CL_DISABLE_MULTITHREADING)
    I rewrited it's as is shown below
    #if defined(_CL_DISABLE_MULTITHREADING)
    #define SCOPED_LOCK_MUTEX(theMutex)
    //#define DEFINE_MUTEX(x)
    #define DEFINE_MUTABLE_MUTEX(x)
    #define DEFINE_CONDITION(x)
    //#define STATIC_DEFINE_MUTEX(x)
    #define CONDITION_WAIT(theMutex, theCondition)
    #define CONDITION_NOTIFYALL(theCondition)
    #define _LUCENE_CURRTHREADID 1
    #define _LUCENE_THREADID_TYPE int
    #define _LUCENE_THREAD_FUNC(name, argName) int name(void* argName)
    #define _LUCENE_THREAD_FUNC_RETURN(val) return (int)val;
    #define _LUCENE_THREAD_CREATE(func, arg) (*func)(arg)
    #define _LUCENE_THREAD_JOIN(value) //nothing to do...
    //#define _LUCENE_THREADMUTEX void*

    #define _LUCENE_ATOMIC_INC(theInteger) (++(*theInteger))
    #define _LUCENE_ATOMIC_DEC(theInteger) (--(*theInteger))
    #define _LUCENE_ATOMIC_INT int

    #define _LUCENE_ATOMIC_INT_SET(x,v) x=v
    #define _LUCENE_ATOMIC_INT_GET(x) x

    struct CLUCENE_SHARED_EXPORT mutex_thread
    {
    void lock() {}
    void unlock() {}
    };
    #define _LUCENE_THREADMUTEX CL_NS(util)::mutex_thread

    #define DEFINE_MUTEX(theMutex) _LUCENE_THREADMUTEX theMutex;
    #define STATIC_DEFINE_MUTEX(theMutex) static _LUCENE_THREADMUTEX theMutex;

    #define CONDITION_WAIT(theMutex, theCondition)
    #define CONDITION_NOTIFYALL(theCondition)
    #else
    .......................

    In the same way, the changes were contributed to files Misc.h/Misc.cpp
    Misc.h:
    #ifndef _CL_DISABLE_MULTITHREADING
    static std::string toString(const _LUCENE_THREADID_TYPE value);
    #endif

    Misc.cpp:
    #ifndef _CL_DISABLE_MULTITHREADING
    std::string Misc::toString(_LUCENE_THREADID_TYPE value){
    static int32_t nextindex = 0;
    static std::map<_LUCENE_THREADID_TYPE, int32_t> ids;
    if (ids.find(value) == ids.end()) {
    ids[value] = nextindex++;
    }
    return toString(ids[value]);
    }
    #endif

    The Project became be compiled. Passed unit-tests.
    However me wanted that these moments have taken into account the developers.

     
  • Itamar Syn-Hershko

    OK thanks we will have a look shortly

     

Log in to post a comment.