简体   繁体   中英

How do I tell acgmake to use -pthread?

I am building this application, that compiles on other linux machines, on windows with VMware virtual machine (linux guest). It has a makefile and make completes. Then I run acgmake, that should make all the needed files for running. I get this error:

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'

I found that I need to specify -pthread flag for gcc (or something). How is this done? The ACGMakefile contains: (edit: 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 or -pthread is what the linker needs.

You may also want to tell the linker where to find the libraries if they are not set in the LD_LIBRARY_PATH , with the -L/path/to/lib option.

Try adding -pthread to

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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