That’s what I see in my cmake, so you should be ok for pthreads, something else is causing
cmake to fail.
Frank
From: Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC] [mailto:jeffrey.c.becker@nasa.gov]
Sent: Friday, January 8, 2021 12:34 PM
To: Frank Filz <ffilzlnx(a)mindspring.com>
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org>
Subject: Re: [NFS-Ganesha-Devel] Re: [EXTERNAL] RE: Pthread CMake error
Yes:
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
From: Frank Filz <ffilzlnx(a)mindspring.com <mailto:ffilzlnx@mindspring.com> >
Date: Friday, January 8, 2021 at 12:03 PM
To: "Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC]" <jeffrey.c.becker(a)nasa.gov
<mailto:jeffrey.c.becker@nasa.gov> >
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org
<mailto:devel@lists.nfs-ganesha.org> >
Subject: RE: [NFS-Ganesha-Devel] Re: [EXTERNAL] RE: Pthread CMake error
Did it eventually say “Found Threads: TRUE” though? If so, look for what other errors
there are. I get the Failed message with my cmake, but also get the Found Threads: TRUE,
and everything works.
Frank
From: Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC] via Devel
[mailto:devel@lists.nfs-ganesha.org]
Sent: Friday, January 8, 2021 11:27 AM
To: Frank Filz <ffilzlnx(a)mindspring.com <mailto:ffilzlnx@mindspring.com> >
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org
<mailto:devel@lists.nfs-ganesha.org> >
Subject: [NFS-Ganesha-Devel] Re: [EXTERNAL] RE: Pthread CMake error
I’ve added several packages that the CMake output indicated were missing, and the CMake
still fails with the same CMakeError output. The only thing I can see is:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
Is that the issue? If so, how to fix? Thanks.
-Jeff
From: Frank Filz <ffilzlnx(a)mindspring.com <mailto:ffilzlnx@mindspring.com> >
Date: Thursday, January 7, 2021 at 4:47 PM
To: "Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC]" <jeffrey.c.becker(a)nasa.gov
<mailto:jeffrey.c.becker@nasa.gov> >
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org
<mailto:devel@lists.nfs-ganesha.org> >
Subject: RE: [EXTERNAL] RE: [NFS-Ganesha-Devel] Pthread CMake error
No, there must have been another error. Keep looking through the output and error logs.
Frank
From: Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC] [mailto:jeffrey.c.becker@nasa.gov]
Sent: Thursday, January 7, 2021 3:57 PM
To: Frank Filz <ffilzlnx(a)mindspring.com <mailto:ffilzlnx@mindspring.com> >
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org
<mailto:devel@lists.nfs-ganesha.org> >
Subject: Re: [EXTERNAL] RE: [NFS-Ganesha-Devel] Pthread CMake error
I think it fails. The end of the output along with the cmake error code is:
-- Configuring incomplete, errors occurred!
See also "/u/jcbecker/ganesha.build/CMakeFiles/CMakeOutput.log".
See also "/u/jcbecker/ganesha.build/CMakeFiles/CMakeError.log".
-bash-4.4# echo $?
1
Did it actually work? Thanks.
-Jeff
From: Frank Filz <ffilzlnx(a)mindspring.com <mailto:ffilzlnx@mindspring.com> >
Date: Thursday, January 7, 2021 at 3:50 PM
To: "Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC]" <jeffrey.c.becker(a)nasa.gov
<mailto:jeffrey.c.becker@nasa.gov> >
Cc: 'Ganesha-devel' <devel(a)lists.nfs-ganesha.org
<mailto:devel@lists.nfs-ganesha.org> >
Subject: [EXTERNAL] RE: [NFS-Ganesha-Devel] Pthread CMake error
Does it actually fail? I see similar errors and everything works find.
Apparently the cmake magic checking for pthread functions looks for both libpthread and
libpthreads. Our respective systems have libpthread which if you look below IS were it
finds pthread_create, so all should be good.
Frank
From: Becker, Jeffrey C. (ARC-TN)[InuTeq, LLC] via Devel
[mailto:devel@lists.nfs-ganesha.org]
Sent: Thursday, January 7, 2021 2:02 PM
To: devel(a)lists.nfs-ganesha.org <mailto:devel@lists.nfs-ganesha.org>
Subject: [NFS-Ganesha-Devel] Pthread CMake error
Hi. I’m trying to build Ganesha 3.4 (latest stable), and CMake output shows the
following:
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
However CMake fails with the following in CMakeError.log. Not sure how to proceed. Please
advise. Thanks.
-Jeff
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_52ec6/fast && /usr/bin/gmake -f
CMakeFiles/cmTC_52ec6.dir/build.make CMakeFiles/cmTC_52ec6.dir/build
gmake[1]: Entering directory '/u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_52ec6.dir/src.c.o
/usr/bin/cc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing
-DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_52ec6.dir/src.c.o -c
/u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_52ec6
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_52ec6.dir/link.txt --verbose=1
/usr/bin/cc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing
-DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_52ec6.dir/src.c.o -o cmTC_52ec6
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
CMakeFiles/cmTC_52ec6.dir/src.c.o: in function `main':
src.c:(.text+0x2d): undefined reference to `pthread_create'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
src.c:(.text+0x39): undefined reference to `pthread_detach'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
src.c:(.text+0x45): undefined reference to `pthread_cancel'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
src.c:(.text+0x56): undefined reference to `pthread_join'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
src.c:(.text+0x6a): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_52ec6.dir/build.make:104: cmTC_52ec6] Error 1
gmake[1]: Leaving directory '/u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:138: cmTC_52ec6/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the
following output:
Change Dir: /u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_3a45d/fast && /usr/bin/gmake -f
CMakeFiles/cmTC_3a45d.dir/build.make CMakeFiles/cmTC_3a45d.dir/build
gmake[1]: Entering directory '/u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3a45d.dir/CheckFunctionExists.c.o
/usr/bin/cc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing
-DCHECK_FUNCTION_EXISTS=pthread_create -o
CMakeFiles/cmTC_3a45d.dir/CheckFunctionExists.c.o -c
/usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_3a45d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3a45d.dir/link.txt --verbose=1
/usr/bin/cc -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing
-DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic
CMakeFiles/cmTC_3a45d.dir/CheckFunctionExists.c.o -o cmTC_3a45d -lpthreads
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: cannot find
-lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_3a45d.dir/build.make:104: cmTC_3a45d] Error 1
gmake[1]: Leaving directory '/u/jcbecker/ganesha.build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:138: cmTC_3a45d/fast] Error 2