当使用OpenBLAS而不是常规BLAS发行版编译SuperLU 4.3库时,此错误不断出现:
>gcc cdrive.o sp_cconvert.o cgst01.o cgst02.o cgst04.o cgst07.o sp_ienv.o
> libtmglib.a /a/location/lib/libsuperlu_4.3.a ->L/a/location/lib/libopenblas.a -lopenblas -lm -o ctest
>/a/location/lib/libopenblas.a(memory.o): In function >'openblas_fork_handler':
>memory.c:(.text+0x3e0): undefined reference to 'pthread_atfork'
>/a/location/lib/libopenblas.a(blas_server.o): In function >'blas_thread_shutdown_':
>blas_server.c:(.text+0x25e): undefined reference to 'pthread_join'
>/a/location/lib/libopenblas.a(blas_server.o): In function >'goto_set_num_threads':
>blas_server.c:(.text+0x403): undefined reference to 'pthread_create'
>/a/location/lib/libopenblas.a(blas_server.o): In function >'blas_thread_init':
>blas_server.c:(.text+0x721): undefined reference to 'pthread_create'
您需要链接pthread/libpthread。根据链接器的不同,这可能会自动完成,但在您的情况下不是这样。