Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./configure needs to be told to link 'pthread' under arch linux #83

Open
nilsnolde opened this issue Jan 11, 2020 · 10 comments
Open

./configure needs to be told to link 'pthread' under arch linux #83

nilsnolde opened this issue Jan 11, 2020 · 10 comments
Labels

Comments

@nilsnolde
Copy link
Contributor

I recently installed Arch Linux and wanted to rebuild Valhalla and all its dependencies.

For prime-server, I got stuck following the documentation. When running make test:

  CXX      src/libprime_server_la-prime_server.lo
  CXX      src/libprime_server_la-netstring_protocol.lo
  CXX      src/libprime_server_la-http_util.lo
  CXX      src/libprime_server_la-http_protocol.lo
  CXX      src/prime_httpd-prime_httpd.o
  CXX      src/prime_proxyd-prime_proxyd.o
  CXX      src/prime_workerd-prime_workerd.o
  CXX      src/prime_echod-prime_echod.o
  CXX      src/prime_filed-prime_filed.o
  CXXLD    libprime_server.la
  CXXLD    prime_serverd
/usr/bin/ld: src/prime_serverd-prime_serverd.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:890: prime_serverd] Error 1
make: *** Waiting for unfinished jobs....

However, re-running ./configure LDFLAGS='-pthread' seemed to solve it. I guess this could be somewhere in the CMakeLists.txt. If not, happy to PR an updated documentation.

@nilsnolde
Copy link
Contributor Author

Oh, not yet used to Arch apparently.. Just found it in the AUR: https://aur.archlinux.org/packages/prime_server/.

Also, announced in Valhalla repo: valhalla/valhalla#1159.

At least Valhalla, maintained by the same account, doesn't seem to be at its latest.

@kevinkreiser
Copy link
Owner

we've seen this so many times on so many different compilers. at this point im wondering what is the right thing to do? it seems to me that some versions of GCC must be automatically linking pthread without it needing to be specified meanwhile other versions did not. or perhaps the project is freeloading off of other dependencies flags...

anyway because we ran into this a bunch of times already, we added it to configure.ac https://github.com/kevinkreiser/prime_server/blob/master/configure.ac#L37-L38

which should put the flag into your generated Makefile... We'd need to look at configures log and the generated Makefile to see what exactly is going on on your system.

@noerw
Copy link

noerw commented May 19, 2020

I had the same issue on Fedora 31.
I still needed to add -lpthread to LIBS in Makefile to make it work

@kevinkreiser
Copy link
Owner

@noerw can you drop the output of config.log here?

@noerw
Copy link

noerw commented May 19, 2020

sure

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by prime_server configure 0.6.5, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = x280n
uname -m = x86_64
uname -r = 5.6.11-200.fc31.x86_64
uname -s = Linux
uname -v = #1 SMP Wed May 6 19:10:55 UTC 2020

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/norwin/.yarn/bin
PATH: /home/norwin/.config/yarn/global/node_modules/.bin
PATH: /home/norwin/.nvm/versions/node/v10.14.1/bin
PATH: /home/norwin/.yarn/bin
PATH: /home/norwin/.npm-packages/bin
PATH: /usr/share/Modules/bin
PATH: /home/norwin/.cargo/bin
PATH: /home/norwin/.local/bin
PATH: /home/norwin/bin
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/bin
PATH: /usr/sbin
PATH: /home/norwin/bin
PATH: /home/norwin/bin
PATH: /bin
PATH: /home/norwin/bin
PATH: /home/norwin/Android/Sdk/emulator
PATH: /home/norwin/Android/Sdk/tools
PATH: /home/norwin/Android/Sdk/tools/bin
PATH: /home/norwin/Android/Sdk/platform-tools
PATH: /home/norwin/Android/Sdk/build-tools/28.0.3


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2336: checking for a BSD-compatible install
configure:2404: result: /usr/bin/install -c
configure:2415: checking whether build environment is sane
configure:2470: result: yes
configure:2619: checking for a thread-safe mkdir -p
configure:2658: result: /usr/bin/mkdir -p
configure:2665: checking for gawk
configure:2681: found /usr/bin/gawk
configure:2692: result: gawk
configure:2703: checking whether make sets $(MAKE)
configure:2725: result: yes
configure:2754: checking whether make supports nested variables
configure:2771: result: yes
configure:2926: checking build system type
configure:2940: result: x86_64-pc-linux-gnu
configure:2960: checking host system type
configure:2973: result: x86_64-pc-linux-gnu
configure:3014: checking how to print strings
configure:3041: result: printf
configure:3066: checking whether make supports the include directive
configure:3081: make -f confmf.GNU && cat confinc.out
this is the am__doit target
configure:3084: $? = 0
configure:3103: result: yes (GNU style)
configure:3173: checking for gcc
configure:3189: found /usr/bin/gcc
configure:3200: result: gcc
configure:3429: checking for C compiler version
configure:3438: gcc --version >&5
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3449: $? = 0
configure:3438: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) 
configure:3449: $? = 0
configure:3438: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3449: $? = 1
configure:3438: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3449: $? = 1
configure:3469: checking whether the C compiler works
configure:3491: gcc    conftest.c  >&5
configure:3495: $? = 0
configure:3543: result: yes
configure:3546: checking for C compiler default output file name
configure:3548: result: a.out
configure:3554: checking for suffix of executables
configure:3561: gcc -o conftest    conftest.c  >&5
configure:3565: $? = 0
configure:3587: result: 
configure:3609: checking whether we are cross compiling
configure:3617: gcc -o conftest    conftest.c  >&5
configure:3621: $? = 0
configure:3628: ./conftest
configure:3632: $? = 0
configure:3620: result: no
configure:3625: checking for suffix of object files
configure:3647: gcc -c   conftest.c >&5
configure:3651: $? = 0
configure:3672: result: o
configure:3676: checking whether we are using the GNU C compiler
configure:3695: gcc -c   conftest.c >&5
configure:3695: $? = 0
configure:3704: result: yes
configure:3713: checking whether gcc accepts -g
configure:3733: gcc -c -g  conftest.c >&5
configure:3733: $? = 0
configure:3774: result: yes
configure:3791: checking for gcc option to accept ISO C89
configure:3854: gcc  -c -g -O2  conftest.c >&5
configure:3854: $? = 0
configure:3867: result: none needed
configure:3892: checking whether gcc understands -c and -o together
configure:3914: gcc -c conftest.c -o conftest2.o
configure:3917: $? = 0
configure:3914: gcc -c conftest.c -o conftest2.o
configure:3917: $? = 0
configure:3929: result: yes
configure:3948: checking dependency style of gcc
configure:4059: result: gcc3
configure:4074: checking for a sed that does not truncate output
configure:4138: result: /usr/bin/sed
configure:4156: checking for grep that handles long lines and -e
configure:4214: result: /usr/bin/grep
configure:4219: checking for egrep
configure:4281: result: /usr/bin/grep -E
configure:4286: checking for fgrep
configure:4348: result: /usr/bin/grep -F
configure:4383: checking for ld used by gcc
configure:4450: result: /usr/bin/ld
configure:4457: checking if the linker (/usr/bin/ld) is GNU ld
configure:4472: result: yes
configure:4484: checking for BSD- or MS-compatible name lister (nm)
configure:4538: result: /usr/bin/nm -B
configure:4668: checking the name lister (/usr/bin/nm -B) interface
configure:4675: gcc -c -g -O2  conftest.c >&5
configure:4678: /usr/bin/nm -B "conftest.o"
configure:4681: output
0000000000000000 B some_variable
configure:4682: result: BSD nm
configure:4685: checking whether ln -s works
configure:4689: result: yes
configure:4697: checking the maximum length of command line arguments
configure:4828: result: 1572864
configure:4876: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format
configure:4916: result: func_convert_file_noop
configure:4923: checking how to convert x86_64-pc-linux-gnu file names to toolchain format
configure:4943: result: func_convert_file_noop
configure:4950: checking for /usr/bin/ld option to reload object files
configure:4957: result: -r
configure:5031: checking for objdump
configure:5047: found /usr/bin/objdump
configure:5058: result: objdump
configure:5090: checking how to recognize dependent libraries
configure:5290: result: pass_all
configure:5375: checking for dlltool
configure:5405: result: no
configure:5435: checking how to associate runtime and link libraries
configure:5462: result: printf %s\n
configure:5523: checking for ar
configure:5539: found /usr/bin/ar
configure:5550: result: ar
configure:5587: checking for archiver @FILE support
configure:5604: gcc -c -g -O2  conftest.c >&5
configure:5604: $? = 0
configure:5607: ar cru libconftest.a @conftest.lst >&5
configure:5610: $? = 0
configure:5615: ar cru libconftest.a @conftest.lst >&5
ar: conftest.o: No such file or directory
configure:5618: $? = 1
configure:5617: result: @
configure:5675: checking for strip
configure:5691: found /usr/bin/strip
configure:5702: result: strip
configure:5774: checking for ranlib
configure:5790: found /usr/bin/ranlib
configure:5801: result: ranlib
configure:5903: checking command to parse /usr/bin/nm -B output from gcc object
configure:6056: gcc -c -g -O2  conftest.c >&5
configure:6059: $? = 0
configure:6063: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm
configure:6066: $? = 0
configure:6132: gcc -o conftest -g -O2   conftest.c conftstm.o >&5
configure:6135: $? = 0
configure:6173: result: ok
configure:6220: checking for sysroot
configure:6250: result: no
configure:6257: checking for a working dd
configure:6295: result: /usr/bin/dd
configure:6299: checking how to truncate binary pipes
configure:6314: result: /usr/bin/dd bs=4096 count=1
configure:6450: gcc -c -g -O2  conftest.c >&5
configure:6453: $? = 0
configure:6643: checking for mt
configure:6673: result: no
configure:6693: checking if : is a manifest tool
configure:6699: : '-?'
configure:6707: result: no
configure:7384: checking how to run the C preprocessor
configure:7415: gcc -E  conftest.c
configure:7415: $? = 0
configure:7429: gcc -E  conftest.c
conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory
   11 | #include <ac_nonexistent.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:7429: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "prime_server"
| #define PACKAGE_TARNAME "prime_server-0.6.5"
| #define PACKAGE_VERSION "0.6.5"
| #define PACKAGE_STRING "prime_server 0.6.5"
| #define PACKAGE_BUGREPORT "https://github.com/kevinkreiser/prime_server/issues"
| #define PACKAGE_URL "https://github.com/kevinkreiser/prime_server"
| #define PACKAGE "prime_server-0.6.5"
| #define VERSION "0.6.5"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:7454: result: gcc -E
configure:7474: gcc -E  conftest.c
configure:7474: $? = 0
configure:7488: gcc -E  conftest.c
conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory
   11 | #include <ac_nonexistent.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:7488: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "prime_server"
| #define PACKAGE_TARNAME "prime_server-0.6.5"
| #define PACKAGE_VERSION "0.6.5"
| #define PACKAGE_STRING "prime_server 0.6.5"
| #define PACKAGE_BUGREPORT "https://github.com/kevinkreiser/prime_server/issues"
| #define PACKAGE_URL "https://github.com/kevinkreiser/prime_server"
| #define PACKAGE "prime_server-0.6.5"
| #define VERSION "0.6.5"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:7517: checking for ANSI C header files
configure:7537: gcc -c -g -O2  conftest.c >&5
configure:7537: $? = 0
configure:7610: gcc -o conftest -g -O2   conftest.c  >&5
configure:7610: $? = 0
configure:7610: ./conftest
configure:7610: $? = 0
configure:7621: result: yes
configure:7634: checking for sys/types.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for sys/stat.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for stdlib.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for string.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for memory.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for strings.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for inttypes.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for stdint.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7634: checking for unistd.h
configure:7634: gcc -c -g -O2  conftest.c >&5
configure:7634: $? = 0
configure:7634: result: yes
configure:7648: checking for dlfcn.h
configure:7648: gcc -c -g -O2  conftest.c >&5
configure:7648: $? = 0
configure:7648: result: yes
configure:7904: checking for objdir
configure:7919: result: .libs
configure:8183: checking if gcc supports -fno-rtti -fno-exceptions
configure:8201: gcc -c -g -O2  -fno-rtti -fno-exceptions conftest.c >&5
cc1: warning: command line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
configure:8205: $? = 0
configure:8218: result: no
configure:8576: checking for gcc option to produce PIC
configure:8583: result: -fPIC -DPIC
configure:8591: checking if gcc PIC flag -fPIC -DPIC works
configure:8609: gcc -c -g -O2  -fPIC -DPIC -DPIC conftest.c >&5
configure:8613: $? = 0
configure:8626: result: yes
configure:8655: checking if gcc static flag -static works
configure:8683: result: no
configure:8698: checking if gcc supports -c -o file.o
configure:8719: gcc -c -g -O2  -o out/conftest2.o conftest.c >&5
configure:8723: $? = 0
configure:8745: result: yes
configure:8753: checking if gcc supports -c -o file.o
configure:8800: result: yes
configure:8833: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:10092: result: yes
configure:10129: checking whether -lc should be explicitly linked in
configure:10137: gcc -c -g -O2  conftest.c >&5
configure:10140: $? = 0
configure:10155: gcc -shared  -fPIC -DPIC conftest.o  -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep  -lc  \>/dev/null 2\>\&1
configure:10158: $? = 0
configure:10172: result: no
configure:10332: checking dynamic linker characteristics
configure:10913: gcc -o conftest -g -O2   -Wl,-rpath -Wl,/foo conftest.c  >&5
configure:10913: $? = 0
configure:11153: result: GNU/Linux ld.so
configure:11275: checking how to hardcode library paths into programs
configure:11300: result: immediate
configure:11848: checking whether stripping libraries is possible
configure:11853: result: yes
configure:11888: checking if libtool supports shared libraries
configure:11890: result: yes
configure:11893: checking whether to build shared libraries
configure:11918: result: yes
configure:11921: checking whether to build static libraries
configure:11925: result: yes
configure:8764: checking whether make supports nested variables
configure:8781: result: yes
configure:8865: checking for g++
configure:8881: found /usr/bin/g++
configure:8892: result: g++
configure:8919: checking for C++ compiler version
configure:8928: g++ --version >&5
g++ (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:8939: $? = 0
configure:8928: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) 
configure:8939: $? = 0
configure:8928: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:8939: $? = 1
configure:8928: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:8939: $? = 1
configure:8943: checking whether we are using the GNU C++ compiler
configure:8962: g++ -c   conftest.cpp >&5
configure:8962: $? = 0
configure:8971: result: yes
configure:8980: checking whether g++ accepts -g
configure:9000: g++ -c -g  conftest.cpp >&5
configure:9000: $? = 0
configure:9041: result: yes
configure:9066: checking dependency style of g++
configure:9177: result: gcc3
configure:9210: checking how to run the C++ preprocessor
configure:9237: g++ -E  conftest.cpp
configure:9237: $? = 0
configure:9251: g++ -E  conftest.cpp
conftest.cpp:23:10: fatal error: ac_nonexistent.h: No such file or directory
   23 | #include <ac_nonexistent.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:9251: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "prime_server"
| #define PACKAGE_TARNAME "prime_server-0.6.5"
| #define PACKAGE_VERSION "0.6.5"
| #define PACKAGE_STRING "prime_server 0.6.5"
| #define PACKAGE_BUGREPORT "https://github.com/kevinkreiser/prime_server/issues"
| #define PACKAGE_URL "https://github.com/kevinkreiser/prime_server"
| #define PACKAGE "prime_server-0.6.5"
| #define VERSION "0.6.5"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:9276: result: g++ -E
configure:9296: g++ -E  conftest.cpp
configure:9296: $? = 0
configure:9310: g++ -E  conftest.cpp
conftest.cpp:23:10: fatal error: ac_nonexistent.h: No such file or directory
   23 | #include <ac_nonexistent.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:9310: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "prime_server"
| #define PACKAGE_TARNAME "prime_server-0.6.5"
| #define PACKAGE_VERSION "0.6.5"
| #define PACKAGE_STRING "prime_server 0.6.5"
| #define PACKAGE_BUGREPORT "https://github.com/kevinkreiser/prime_server/issues"
| #define PACKAGE_URL "https://github.com/kevinkreiser/prime_server"
| #define PACKAGE "prime_server-0.6.5"
| #define VERSION "0.6.5"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:9472: checking for ld used by g++
configure:9539: result: /usr/bin/ld -m elf_x86_64
configure:9546: checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld
configure:9561: result: yes
configure:9616: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:10689: result: yes
configure:10725: g++ -c -g -O2  conftest.cpp >&5
configure:10728: $? = 0
configure:11209: checking for g++ option to produce PIC
configure:11216: result: -fPIC -DPIC
configure:11224: checking if g++ PIC flag -fPIC -DPIC works
configure:11242: g++ -c -g -O2  -fPIC -DPIC -DPIC conftest.cpp >&5
configure:11246: $? = 0
configure:11259: result: yes
configure:11282: checking if g++ static flag -static works
configure:11310: result: no
configure:11322: checking if g++ supports -c -o file.o
configure:11343: g++ -c -g -O2  -o out/conftest2.o conftest.cpp >&5
configure:11347: $? = 0
configure:11369: result: yes
configure:11374: checking if g++ supports -c -o file.o
configure:11421: result: yes
configure:11451: checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:11491: result: yes
configure:11632: checking dynamic linker characteristics
configure:12380: result: GNU/Linux ld.so
configure:12445: checking how to hardcode library paths into programs
configure:12470: result: immediate
configure:11354: checking whether make sets $(MAKE)
configure:11376: result: yes
configure:11386: checking for ANSI C header files
configure:11490: result: yes
configure:11513: checking whether g++ supports C++11 features by default
configure:11547: g++ -c -g -O2  conftest.cpp >&5
configure:11547: $? = 0
configure:11554: result: yes
configure:11700: checking for pkg-config
configure:11718: found /usr/bin/pkg-config
configure:11730: result: /usr/bin/pkg-config
configure:11755: checking pkg-config is at least version 0.9.0
configure:11758: result: yes
configure:11768: checking for DEPS
configure:11775: $PKG_CONFIG --exists --print-errors "libzmq >= 4.1.4 libczmq >= 3.0 libcurl >= 7.22.0"
configure:11778: $? = 0
configure:11792: $PKG_CONFIG --exists --print-errors "libzmq >= 4.1.4 libczmq >= 3.0 libcurl >= 7.22.0"
configure:11795: $? = 0
configure:11853: result: yes
configure:12042: checking whether gcc is Clang
configure:12067: result: no
configure:12190: checking whether pthreads work with -pthread
configure:12284: gcc -o conftest -g -O2 -pthread   conftest.c   >&5
configure:12284: $? = 0
configure:12293: result: yes
configure:12312: checking for joinable pthread attribute
configure:12330: gcc -o conftest -g -O2 -pthread   conftest.c   >&5
configure:12330: $? = 0
configure:12338: result: PTHREAD_CREATE_JOINABLE
configure:12352: checking whether more special flags are required for pthreads
configure:12365: result: no
configure:12373: checking for PTHREAD_PRIO_INHERIT
configure:12389: gcc -o conftest -g -O2 -pthread   conftest.c   >&5
configure:12389: $? = 0
configure:12398: result: yes
configure:12738: checking that generated files are newer than configure
configure:12744: result: done
configure:12775: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by prime_server config.status 0.6.5, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on x280n

config.status:1166: creating Makefile
config.status:1166: creating libprime_server.pc
config.status:1166: creating prime_server/config.h
config.status:1347: prime_server/config.h is unchanged
config.status:1395: executing depfiles commands
config.status:1472: cd .       && sed -e '/# am--include-marker/d' Makefile         | make -f - am--depfiles
make: Nothing to be done for 'am--depfiles'.
config.status:1477: $? = 0
config.status:1395: executing libtool commands

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DEPS_CFLAGS_set=
ac_cv_env_DEPS_CFLAGS_value=
ac_cv_env_DEPS_LIBS_set=
ac_cv_env_DEPS_LIBS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_header_dlfcn_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_FGREP='/usr/bin/grep -F'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_lt_DD=/usr/bin/dd
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_CXXCPP='g++ -E'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_ac_ct_OBJDUMP=objdump
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
am_cv_CXX_dependencies_compiler_type=gcc3
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes
ax_cv_PTHREAD_CLANG=no
ax_cv_PTHREAD_JOINABLE_ATTR=PTHREAD_CREATE_JOINABLE
ax_cv_PTHREAD_PRIO_INHERIT=yes
ax_cv_PTHREAD_SPECIAL_FLAGS=no
ax_cv_cxx_compile_cxx11=yes
lt_cv_ar_at_file=@
lt_cv_archive_cmds_need_lc=no
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_ld_reload_flag=-r
lt_cv_nm_interface='BSD nm'
lt_cv_objdir=.libs
lt_cv_path_LD=/usr/bin/ld
lt_cv_path_LDCXX='/usr/bin/ld -m elf_x86_64'
lt_cv_path_NM='/usr/bin/nm -B'
lt_cv_path_mainfest_tool=no
lt_cv_prog_compiler_c_o=yes
lt_cv_prog_compiler_c_o_CXX=yes
lt_cv_prog_compiler_pic='-fPIC -DPIC'
lt_cv_prog_compiler_pic_CXX='-fPIC -DPIC'
lt_cv_prog_compiler_pic_works=yes
lt_cv_prog_compiler_pic_works_CXX=yes
lt_cv_prog_compiler_rtti_exceptions=no
lt_cv_prog_compiler_static_works=no
lt_cv_prog_compiler_static_works_CXX=no
lt_cv_prog_gnu_ld=yes
lt_cv_prog_gnu_ldcxx=yes
lt_cv_sharedlib_from_linklib_cmd='printf %s\n'
lt_cv_shlibpath_overrides_runpath=no
lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[	 ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[	 ][	 ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\'''
lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/  {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/  {"\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/  {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/  {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/  {"lib\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\'''
lt_cv_sys_global_symbol_to_import=
lt_cv_sys_max_cmd_len=1572864
lt_cv_to_host_file_cmd=func_convert_file_noop
lt_cv_to_tool_file_cmd=func_convert_file_noop
lt_cv_truncate_bin='/usr/bin/dd bs=4096 count=1'
pkg_cv_DEPS_CFLAGS='-I/usr/include/pgm-5.2 '
pkg_cv_DEPS_LIBS='-lczmq -lzmq -lcurl '

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/norwin/src/prime_server/missing aclocal-1.16'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='0'
AM_V='$(V)'
AR='ar'
AUTOCONF='${SHELL} /home/norwin/src/prime_server/missing autoconf'
AUTOHEADER='${SHELL} /home/norwin/src/prime_server/missing autoheader'
AUTOMAKE='${SHELL} /home/norwin/src/prime_server/missing automake-1.16'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
COVERAGE_CFLAGS=''
COVERAGE_CXXFLAGS=''
COVERAGE_LDFLAGS=''
CPP='gcc -E'
CPPFLAGS=''
CXX='g++'
CXXCPP='g++ -E'
CXXDEPMODE='depmode=gcc3'
CXXFLAGS='-g -O2'
CYGPATH_W='echo'
DEFS='-DHAVE_CONFIG_H'
DEPDIR='.deps'
DEPS_CFLAGS='-I/usr/include/pgm-5.2  -pthread'
DEPS_LIBS='-lczmq -lzmq -lcurl  '
DLLTOOL='false'
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
ENABLE_COVERAGE_FALSE=''
ENABLE_COVERAGE_TRUE='#'
EXEEXT=''
FGREP='/usr/bin/grep -F'
GENHTML=''
GREP='/usr/bin/grep'
HAVE_CXX11=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LCOV=''
LD='/usr/bin/ld -m elf_x86_64'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LIBTOOL_DEPS='./ltmain.sh'
LIPO=''
LN_S='ln -s'
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAKEINFO='${SHELL} /home/norwin/src/prime_server/missing makeinfo'
MANIFEST_TOOL=':'
MKDIR_P='/usr/bin/mkdir -p'
NM='/usr/bin/nm -B'
NMEDIT=''
OBJDUMP='objdump'
OBJEXT='o'
OTOOL64=''
OTOOL=''
PACKAGE='prime_server-0.6.5'
PACKAGE_BUGREPORT='https://github.com/kevinkreiser/prime_server/issues'
PACKAGE_NAME='prime_server'
PACKAGE_STRING='prime_server 0.6.5'
PACKAGE_TARNAME='prime_server-0.6.5'
PACKAGE_URL='https://github.com/kevinkreiser/prime_server'
PACKAGE_VERSION='0.6.5'
PATH_SEPARATOR=':'
PKG_CONFIG='/usr/bin/pkg-config'
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
PTHREAD_CC='gcc'
PTHREAD_CFLAGS='-pthread'
PTHREAD_LIBS=''
RANLIB='ranlib'
SED='/usr/bin/sed'
SET_MAKE=''
SHELL='/bin/sh'
STRIP='strip'
VERSION='0.6.5'
ac_ct_AR='ar'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE='#'
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE='#'
am__fastdepCXX_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
ax_pthread_config=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host='x86_64-pc-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/norwin/src/prime_server/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
pkgconfigdir='${libdir}/pkgconfig'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "prime_server"
#define PACKAGE_TARNAME "prime_server-0.6.5"
#define PACKAGE_VERSION "0.6.5"
#define PACKAGE_STRING "prime_server 0.6.5"
#define PACKAGE_BUGREPORT "https://github.com/kevinkreiser/prime_server/issues"
#define PACKAGE_URL "https://github.com/kevinkreiser/prime_server"
#define PACKAGE "prime_server-0.6.5"
#define VERSION "0.6.5"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define STDC_HEADERS 1
#define HAVE_PTHREAD_PRIO_INHERIT 1
#define HAVE_PTHREAD 1

configure: exit 0

@kevinkreiser
Copy link
Owner

@noerw thanks! the output looks the same as mine with respect to DEPS_LIBS... so can you then do:

VERBOSE=1 make prime_serverd

and share that output?

@noerw
Copy link

noerw commented May 19, 2020

$ make clean prime_serverd -j8 VERBOSE=1                                                                                                                                                   ⬡ 10.14.1 [±master ✓]
test -z "libprime_server.la" || rm -f libprime_server.la
rm -rf .libs _libs
rm -f *.o
test -z "test/zmq.log test/netstring.log test/http.log test/shaping.log test/interrupt.log" || rm -f test/zmq.log test/netstring.log test/http.log test/shaping.log test/interrupt.log
 rm -f prime_serverd prime_httpd prime_proxyd prime_workerd prime_echod prime_filed
 rm -f test/zmq test/netstring test/http test/shaping test/interrupt
rm -rf src/.libs src/_libs
rm -f *.lo
rm -f src/*.o
test -z "test/zmq.trs test/netstring.trs test/http.trs test/shaping.trs test/interrupt.trs" || rm -f test/zmq.trs test/netstring.trs test/http.trs test/shaping.trs test/interrupt.trs
rm -rf test/.libs test/_libs
rm -f src/*.lo
test -z "test-suite.log" || rm -f test-suite.log
  CXX      src/prime_serverd-prime_serverd.o
  CXX      src/libprime_server_la-prime_server.lo
rm -f ./so_locations
rm -f test/*.o
  CXX      src/libprime_server_la-zmq_helpers.lo
  CXX      src/libprime_server_la-netstring_protocol.lo
  CXX      src/libprime_server_la-http_util.lo
  CXX      src/libprime_server_la-http_protocol.lo
  CXXLD    libprime_server.la
  CXXLD    prime_serverd
/usr/bin/ld: src/prime_serverd-prime_serverd.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:890: prime_serverd] Error 1

but this succeeds:

$ make prime_serverd -j8 VERBOSE=1 LIBS=-lpthread
  CXXLD    prime_serverd

@kevinkreiser
Copy link
Owner

hmm... i was expecting that this part:

  CXX      src/libprime_server_la-zmq_helpers.lo
  CXX      src/libprime_server_la-netstring_protocol.lo
  CXX      src/libprime_server_la-http_util.lo
  CXX      src/libprime_server_la-http_protocol.lo
  CXXLD    libprime_server.la
  CXXLD    prime_serverd

would actually show the compiler/linker command line and args... why isnt VERBOSE=1 working?

@noerw
Copy link

noerw commented May 20, 2020

Ah, somehow only V=1 worked for me (GNU Make 4.2.1):

$ make prime_serverd -j8 V=1
g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/prime_serverd-prime_serverd.o -MD -MP -MF src/.deps/prime_serverd-prime_serverd.Tpo -c -o src/prime_serverd-prime_serverd.o `test -f 'src/prime_serverd.cpp' || echo './'`src/prime_serverd.cpp
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-prime_server.lo -MD -MP -MF src/.deps/libprime_server_la-prime_server.Tpo -c -o src/libprime_server_la-prime_server.lo `test -f 'src/prime_server.cpp' || echo './'`src/prime_server.cpp
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-zmq_helpers.lo -MD -MP -MF src/.deps/libprime_server_la-zmq_helpers.Tpo -c -o src/libprime_server_la-zmq_helpers.lo `test -f 'src/zmq_helpers.cpp' || echo './'`src/zmq_helpers.cpp
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-netstring_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-netstring_protocol.Tpo -c -o src/libprime_server_la-netstring_protocol.lo `test -f 'src/netstring_protocol.cpp' || echo './'`src/netstring_protocol.cpp
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_util.lo -MD -MP -MF src/.deps/libprime_server_la-http_util.Tpo -c -o src/libprime_server_la-http_util.lo `test -f 'src/http_util.cpp' || echo './'`src/http_util.cpp
/bin/sh ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./prime_server  -I/usr/include/pgm-5.2  -pthread  -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-http_protocol.Tpo -c -o src/libprime_server_la-http_protocol.lo `test -f 'src/http_protocol.cpp' || echo './'`src/http_protocol.cpp
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-prime_server.lo -MD -MP -MF src/.deps/libprime_server_la-prime_server.Tpo -c src/prime_server.cpp  -fPIC -DPIC -o src/.libs/libprime_server_la-prime_server.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_util.lo -MD -MP -MF src/.deps/libprime_server_la-http_util.Tpo -c src/http_util.cpp  -fPIC -DPIC -o src/.libs/libprime_server_la-http_util.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-http_protocol.Tpo -c src/http_protocol.cpp  -fPIC -DPIC -o src/.libs/libprime_server_la-http_protocol.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-netstring_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-netstring_protocol.Tpo -c src/netstring_protocol.cpp  -fPIC -DPIC -o src/.libs/libprime_server_la-netstring_protocol.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-zmq_helpers.lo -MD -MP -MF src/.deps/libprime_server_la-zmq_helpers.Tpo -c src/zmq_helpers.cpp  -fPIC -DPIC -o src/.libs/libprime_server_la-zmq_helpers.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_util.lo -MD -MP -MF src/.deps/libprime_server_la-http_util.Tpo -c src/http_util.cpp -o src/libprime_server_la-http_util.o >/dev/null 2>&1
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-zmq_helpers.lo -MD -MP -MF src/.deps/libprime_server_la-zmq_helpers.Tpo -c src/zmq_helpers.cpp -o src/libprime_server_la-zmq_helpers.o >/dev/null 2>&1
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-netstring_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-netstring_protocol.Tpo -c src/netstring_protocol.cpp -o src/libprime_server_la-netstring_protocol.o >/dev/null 2>&1
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-http_protocol.lo -MD -MP -MF src/.deps/libprime_server_la-http_protocol.Tpo -c src/http_protocol.cpp -o src/libprime_server_la-http_protocol.o >/dev/null 2>&1
mv -f src/.deps/libprime_server_la-zmq_helpers.Tpo src/.deps/libprime_server_la-zmq_helpers.Plo
mv -f src/.deps/libprime_server_la-http_util.Tpo src/.deps/libprime_server_la-http_util.Plo
mv -f src/.deps/libprime_server_la-netstring_protocol.Tpo src/.deps/libprime_server_la-netstring_protocol.Plo
mv -f src/.deps/prime_serverd-prime_serverd.Tpo src/.deps/prime_serverd-prime_serverd.Po
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./prime_server -I/usr/include/pgm-5.2 -pthread -I/home/norwin/src/prime_server/prime_server -g -O2 -MT src/libprime_server_la-prime_server.lo -MD -MP -MF src/.deps/libprime_server_la-prime_server.Tpo -c src/prime_server.cpp -o src/libprime_server_la-prime_server.o >/dev/null 2>&1
mv -f src/.deps/libprime_server_la-http_protocol.Tpo src/.deps/libprime_server_la-http_protocol.Plo
mv -f src/.deps/libprime_server_la-prime_server.Tpo src/.deps/libprime_server_la-prime_server.Plo
/bin/sh ./libtool  --tag=CXX   --mode=link g++ -I/home/norwin/src/prime_server/prime_server -g -O2   -o libprime_server.la -rpath /usr/lib64 src/libprime_server_la-prime_server.lo src/libprime_server_la-zmq_helpers.lo src/libprime_server_la-netstring_protocol.lo src/libprime_server_la-http_util.lo src/libprime_server_la-http_protocol.lo -lczmq -lzmq -lcurl   
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/9/crtbeginS.o  src/.libs/libprime_server_la-prime_server.o src/.libs/libprime_server_la-zmq_helpers.o src/.libs/libprime_server_la-netstring_protocol.o src/.libs/libprime_server_la-http_util.o src/.libs/libprime_server_la-http_protocol.o   -lczmq -lzmq -lcurl -L/usr/lib/gcc/x86_64-redhat-linux/9 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/9/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o  -g -O2   -Wl,-soname -Wl,libprime_server.so.0 -o .libs/libprime_server.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libprime_server.so.0" && ln -s "libprime_server.so.0.0.0" "libprime_server.so.0")
libtool: link: (cd ".libs" && rm -f "libprime_server.so" && ln -s "libprime_server.so.0.0.0" "libprime_server.so")
libtool: link: ar cru .libs/libprime_server.a  src/libprime_server_la-prime_server.o src/libprime_server_la-zmq_helpers.o src/libprime_server_la-netstring_protocol.o src/libprime_server_la-http_util.o src/libprime_server_la-http_protocol.o
libtool: link: ranlib .libs/libprime_server.a
libtool: link: ( cd ".libs" && rm -f "libprime_server.la" && ln -s "../libprime_server.la" "libprime_server.la" )
/bin/sh ./libtool  --tag=CXX   --mode=link g++ -I/home/norwin/src/prime_server/prime_server -g -O2   -o prime_serverd src/prime_serverd-prime_serverd.o -lczmq -lzmq -lcurl   libprime_server.la 
libtool: link: g++ -I/home/norwin/src/prime_server/prime_server -g -O2 -o .libs/prime_serverd src/prime_serverd-prime_serverd.o  ./.libs/libprime_server.so -lczmq -lzmq -lcurl
/usr/bin/ld: src/prime_serverd-prime_serverd.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:890: prime_serverd] Error 1

@kevinkreiser
Copy link
Owner

so this is your link line:

libtool: link: g++ -I/home/norwin/src/prime_server/prime_server -g -O2 -o .libs/prime_serverd src/prime_serverd-prime_serverd.o ./.libs/libprime_server.so -lczmq -lzmq -lcurl

and this is mine:

libtool: link: g++ -I/sandbox/prime_server/prime_server -g -O2 -o .libs/prime_serverd src/prime_serverd-prime_serverd.o ./.libs/libprime_server.so -lzmq -lczmq /usr/lib/x86_64-linux-gnu/libcurl.so -pthread

So it seems to me that this is a combination of this: https://lists.gnu.org/archive/html/libtool/2010-11/msg00032.html

And my misunderstanding about this: https://stackoverflow.com/questions/17055279/autotools-for-pthreads-not-setting-correct-linker-flags

Which means that my libtool must automatically inject pthreads for me and I incorrectly rely on that. So it seems to me I need to actually use PTHREAD_CFLAGS instead of hoping someone elses platform will add it for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants