LINKER ERROR libtool: link: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -fopenmp -fstack-protector-strong -o .libs/netgen demoview.o ngappinit.o onetcl.o parallelfunc.o ngpkg.o -Wl,--export-dynamic ../libsrc/visualization/.libs/libvisual.a -L/usr/local/lib ../libsrc/csg/.libs/libcsgvis.so ../libsrc/csg/.libs/libcsg.so ../libsrc/interface/.libs/libinterface.so ../libsrc/meshing/.libs/libmesh.so -ltogl -lGLU -ltk86 -ltcl86 -ljpeg -lGL -lXmu -lX11 -fopenmp -Wl,-rpath -Wl,/usr/local/lib ld: error: ../libsrc/interface/.libs/libinterface.so: undefined reference to pthread_create c++: error: linker command failed with exit code 1 (use -v to see invocation) gmake[3]: *** [Makefile:415: netgen] Error 1 gmake[3]: Leaving directory '/wrkdirs/usr/ports/cad/netgen/work/netgen-5.3.1/ng' gmake[2]: *** [Makefile:354: all-recursive] Error 1 gmake[2]: Leaving directory '/wrkdirs/usr/ports/cad/netgen/work/netgen-5.3.1' gmake[1]: *** [Makefile:285: all] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/cad/netgen/work/netgen-5.3.1' *** Error code 1 Stop. make: stopped in /usr/ports/cad/netgen =>> Cleaning up wrkdir ===> Cleaning for netgen-5.3.1_10 build of cad/netgen | netgen-5.3.1_10 ended at Fri Nov 22 08:07:47 CST 2019 build time: 00:07:19 !!! build failure encountered !!! PATCH: --- work/netgen-5.3.1/configure.ac.orig 2019-11-22 19:12:55.362850000 +0800 +++ work/netgen-5.3.1/configure.ac 2019-11-22 19:13:44.566282000 +0800 @@ -180,7 +180,7 @@ ;; x11) AC_SUBST(TOGL_WINDOWINGSYSTEM,TOGL_X11) - TEA_ADD_LIBS([-lGL -lXmu -lX11]) + TEA_ADD_LIBS([-lGL -lXmu -lX11 -lpthread]) LIBGLU=-lGLU ;; win32)
@Reporter, Could you please: 1) Provide additional information, including: - Exact FreeBSD versions (uname -a output) - /var/run/dmesg.boot output (as an attachment) - /etc/make.conf contents (if not empty, as an attachment) - pkg version -v output (as an attachment) - Full build log (as an attachment 2) Attach your proposed patch as an attachment Note: It may be worth attempting to modify the configure build at configure time, rather than patching configure.ac, which would additionally require running autoreconf to rebuild the configure file. ./configure --help output may provide the specific details on how to add libraries to that component/variable. Thanks!
Created attachment 209342 [details] make.conf
Created attachment 209343 [details] dmesg.boot
Created attachment 209344 [details] pkg version -v output
Created attachment 209345 [details] cd /usr/ports/cad/netgen && make | tee log
FreeBSD *** 12.1-RELEASE-p1 FreeBSD 12.1-RELEASE-p1 r354703 GENERIC amd64 For the patch, sorry... I am not quite sure how to do with the 'configure built': I am using cmake for my projects. To make it work, I modified the Makefile and added the thread library link. (I use poudriere on another computer to build my packages; the files in attachment are reproducing the problem on my desktop)
A commit references this bug: Author: stephen Date: Sun Nov 24 02:36:45 UTC 2019 New revision: 518291 URL: https://svnweb.freebsd.org/changeset/ports/518291 Log: - Add patch so that -pthreads is included in libraries. - Mild corrections to pkg-plist. - Bump portrevision. PR: 242154 Submitted by: smars@yuntech.edu.tw Changes: head/cad/netgen/Makefile head/cad/netgen/files/patch-configure.ac head/cad/netgen/pkg-plist
I was able to reproduce the problem. I committed the patch. Thank you. Let's hope it doesn't mess up netgen for other versions of FreeBSD.
(In reply to Stephen Montgomery-Smith from comment #8) Thanks!