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

build hwloc 2.11.1 on old suse 9: undefined reference to `hwloc_accessat' #676

Closed
zhchgbj opened this issue Jul 18, 2024 · 1 comment · Fixed by #677
Closed

build hwloc 2.11.1 on old suse 9: undefined reference to `hwloc_accessat' #676

zhchgbj opened this issue Jul 18, 2024 · 1 comment · Fixed by #677

Comments

@zhchgbj
Copy link
Contributor

zhchgbj commented Jul 18, 2024

What version of hwloc are you using?

2.11.1

Which operating system and hardware are you running on?

I'm using my old box of suse 9 to build hwloc 2.11.1.

ff75ff964fbd:/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64 # uname -a
Linux ff75ff964fbd 5.14.0-427.22.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 10 09:23:36 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
ff75ff964fbd:/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64 # cat /etc/*release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64"
SUSE LINUX Enterprise Server 9 (x86_64)
VERSION = 9
PATCHLEVEL = 4

Details of the problem

When run make, it report hwloc_accessat not defined.

  CC       topology-linux.lo                                                                                                                                
  CC       topology-hardwired.lo                                                                                                                            
  CC       topology-x86.lo                                                                                                                                  
topology-linux.c: In function `hwloc_find_linux_cgroup_mntpnt':                                                                                             
topology-linux.c:2290: warning: implicit declaration of function `hwloc_accessat'                                                                           
  CCLD     libhwloc.la                                                                                                                                      
make[1]: Leaving directory `/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/hwloc'                                                         
Making all in utils                                                                                                                                         
make[1]: Entering directory `/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/utils'                                                        
Making all in hwloc                                                                                                                                         
make[2]: Entering directory `/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/utils/hwloc'                                                  
Making all in .                                                                                                                                             
make[3]: Entering directory `/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/utils/hwloc'                                                  
  CC       hwloc-annotate.o       
...

  CCLD     hwloc-info                                                                                                                                       
  CCLD     hwloc-patch                                                                                                                                      
   File `hwloc-gather-cpuid' does not exist.                                                                                                                
  Must remake target `hwloc-gather-cpuid'.                                                                                                                  
  CCLD     hwloc-ps                                                                                                                                         
/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/hwloc/.libs/libhwloc.so: undefined reference to `hwloc_accessat'                           
collect2: ld returned 1 exit status                                                                                                                         
/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/hwloc/.libs/libhwloc.so: undefined reference to `hwloc_accessat'                           
collect2: ld returned 1 exit status                                                                                                                         
/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/hwloc/.libs/libhwloc.so: undefined reference to `hwloc_accessat'                           
collect2: ld returned 1 exit status
/data/code/3rd/hwloc/build/hwloc-2.11.1/linux2.6-glibc2.3-x86_64/hwloc/.libs/libhwloc.so: undefined reference to `hwloc_accessat'
collect2: ld returned 1 exit status
make[3]: *** [hwloc-distrib] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [hwloc-bind] Error 1

Additional information

@zhchgbj
Copy link
Contributor Author

zhchgbj commented Jul 18, 2024

HAVE_OPENAT should not defined on my old suse 9, so

Paste my code diff:

# diff hwloc/topology-linux.c.orig hwloc/topology-linux.c
--- hwloc/topology-linux.c.orig 2024-07-18 04:01:23.966193672 -0400
+++ hwloc/topology-linux.c      2024-07-18 04:02:20.630314763 -0400
@@ -2288,15 +2288,15 @@
 
   /* try standard mount points */
-  if (!hwloc_accessat("/sys/fs/cgroup/cpuset.cpus.effective", R_OK, fsroot_fd)) {
+  if (!hwloc_access("/sys/fs/cgroup/cpuset.cpus.effective", R_OK, fsroot_fd)) {
     hwloc_debug("Found standard cgroup2/cpuset mount point at /sys/fs/cgroup/\n");
     *cgtype = HWLOC_LINUX_CGROUP2;
     *mntpnt = strdup("/sys/fs/cgroup");
     return;
-  } else if (!hwloc_accessat("/sys/fs/cgroup/cpuset/cpuset.cpus", R_OK, fsroot_fd)) {
+  } else if (!hwloc_access("/sys/fs/cgroup/cpuset/cpuset.cpus", R_OK, fsroot_fd)) {
     hwloc_debug("Found standard cgroup1/cpuset mount point at /sys/fs/cgroup/cpuset/\n");
     *cgtype = HWLOC_LINUX_CGROUP1;
     *mntpnt = strdup("/sys/fs/cgroup/cpuset");
     return;
-  } else if (!hwloc_accessat("/dev/cpuset/cpus", R_OK, fsroot_fd)) {
+  } else if (!hwloc_access("/dev/cpuset/cpus", R_OK, fsroot_fd)) {
     hwloc_debug("Found standard cpuset mount point at /dev/cpuset/\n");
     *cgtype = HWLOC_LINUX_CPUSET;

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

Successfully merging a pull request may close this issue.

1 participant