繁体   English   中英

如何告诉acgmake使用-pthread?

[英]How do I tell acgmake to use -pthread?

我在使用VMware虚拟机(Linux来宾)的Windows上构建此应用程序,该应用程序可在其他Linux机器上编译。 它具有一个makefile并完成。 然后,我运行acgmake,这应该使所有需要的文件都可以运行。 我收到此错误:

Build executable  Debian64_gcc4.6_dbg/libsrc_CadModel.so  ->  Debian64_gcc4.6_dbg/cadmodel
/home///intel/mkl/10.2.2.025/lib/em64t/libiomp5.so: undefined reference     to `pthread_atfork'

我发现我需要为gcc(或其他内容)指定-pthread标志。 怎么做? ACGMakefile包含:(编辑:CadModel / ACGmakefile)

#==  SYSTEM PART -- DON'T TOUCH  ==============================================
include $(ACGMAKE)/Config
#==============================================================================
CXX_CFLAGS += -DQT_THREAD_SUPPORT

ifeq ($(findstring g++,$(CXX_COMP)),g++)
CXX_CFLAGS +=  -Wno-write-strings -Wno-ignored-qualifiers
CXX_LDFLAGS += -Xlinker --no-warn-search-mismatch
endif

SUBDIRS     = $(call find-subdirs)
PACKAGES   := ftgl opencascade qt4 glut opengl x11 math mkl
PROJ_LIBS   =  OpenMesh/Core
MODULES    := moc4 rcc cxxlib cxx

 all: build

info:
@echo "Using compiler $(filter g++, $(CXX_COMP))"
#   @echo "CFLAGS = $(CXX_LDFLAGS)"

#==  SYSTEM PART -- DON'T TOUCH  ==============================================
include $(ACGMAKE)/Rules
#==============================================================================

 run: $(cxx-exes)
./$(cxx-exes)

链接器需要-lpthread-pthread

如果未在LD_LIBRARY_PATH中使用-L/path/to/lib选项设置它们,您可能还想告诉链接器在哪里可以找到这些库。

尝试将-pthread添加到

ifeq ($(findstring g++,$(CXX_COMP)),g++)
CXX_CFLAGS +=  -Wno-write-strings -Wno-ignored-qualifiers -pthread
CXX_LDFLAGS += -Xlinker --no-warn-search-mismatch -pthread
endif

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM