没有提升螺纹?

时间:2014-05-01 20:57:03

标签: linux multithreading gcc boost

平台:RHEL6.3(圣地亚哥)

Boost 1.55.0,用gcc-4.4.7-glibc-2.12.2编译(我不控制我们的boost安装和编译,我只是使用它)

我正在尝试使用boost_thread使用gcc 4.8.2(glibc-2.17)编译C ++应用程序。

在makefile中:

BOOST_VERSION :=
BOOST_ROOT := $(DK_ROOT)/boost/1.55.0/gcc-4.4.7/
ifdef ATI_BITS_32
    libdir := lib
else
    libdir := lib64
endif
BOOST_LIB_DIR := "$(BOOST_ROOT)/$(libdir)/"

ifneq ($(BUILD_TYPE)$(BUILD_REL_SYM),rel)
    BOOST_VERSION := -d
endif

LCINCS += $(INCSWITCH) $(BOOST_ROOT)/
LCINCS += $(INCSWITCH) $(BOOST_ROOT)/include/
LCINCS += $(INCSWITCH) $(BOOST_ROOT)/include/boost/

LCINCS += $(INCSWITCH) /contrib/STLport/
LCINCS += $(INCSWITCH) /contrib/STLport/include/

LCINCS += $(INCSWITCH) "/gcc/gcc-4.8.2-glibc-2.17-tls/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/linux/"
LCINCS += $(INCSWITCH) "/gcc/gcc-4.8.2-glibc-2.17-tls/i686-unknown-linux-gnu/i686-unknown-linux-gnu/include/"

GCPPFLAGS += -pthread $(DEFSWITCH)_LINUX -fPIC
GCPPFLAGS += $(DEFSWITCH)_LINUX
GLOPTS += -Wl,--unresolved-symbols=ignore-in-shared-libs
#LLOPTS += $(DEFSWITCH)CT_CC_STATIC_LIBSTDCXX=y
LLOPTS += \
    -L$(OCLCOMPILER_LIB_DIR) \
    -L$(HSASERVICES_LIB_DIR) \
    -L$(HSACORE_LIB_DIR) \
    -L$(BOOST_LIB_DIR) \
     -lrt \
     -ldl \
     -lgtest \
     -lsp3 \
     -lboost_chrono-mt$(BOOST_VERSION) \
     -lboost_date_time-mt$(BOOST_VERSION) \
     -lboost_program_options-mt$(BOOST_VERSION) \
     -lboost_system-mt$(BOOST_VERSION) \
     -lboost_thread-mt$(BOOST_VERSION) 

无论我做什么,当make尝试确定依赖关系时,我总是得到

Generating Test.cpp dependencies ...
In file included from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/detail/platform.hpp:17:0,
                 from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/thread_only.hpp:12,
                 from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread/thread.hpp:12,
                 from /home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/thread.hpp:13,
                 from ../../../../LoggingRegistration/LoggingRegistration.h:33,
                 from ../../../../Common/Common.h:17,
                 from ../../../Test.cpp:18:
/home/p4/bg-lnx-dk/boost/1.55.0/gcc-4.4.7//include/boost/config/requires_threads.hpp:47:5: error: #error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
 #   error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
     ^

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

他们在那里,由我的makefile中的一些包含文件添加。它并没有什么不同。

经过多次游戏,我终于能够编译了。我有几个问题,其中包括:

使用STLport而不是libc ++,混合使用gcc 4.4.6构建的库和使用gcc 4.8.2编译/链接。

一旦我停止使用STLport,并强制使用libc ++,而不是libstdc ++,我就能够编译和链接。