Bugzilla – Bug 176
torque-4.0.0: HWLOC_CFLAGS and HWLOC_LIBS ignored
Last modified: 2012-05-30 17:09:37 MDT
You need to log in before you can comment on or make changes to this bug.
Created an attachment (id=103) [details] patch to include HWLOC env. variables in Libifl Makefile When configuring torque-4.0.0 with HWLOC_CFLAGS and HWLOC_LIBS set the subsequent make fails in Libifl because those environment variables are not used in the Makefile: gcc -DHAVE_CONFIG_H -I. -I../../../src/include -I../../../src/include -DPBS_DEFAULT_FILE=\"/var/spool/torque/server_name\" -DPBS_SERVER_HOME=\"/var/spool/torque\" -g -DGEOMETRY_REQUESTS -DALWAYS_USE_CPUSETS -DNUMA_SUPPORT -MT tcp_dis.o -MD -MP -MF .deps/tcp_dis.Tpo -c -o tcp_dis.o tcp_dis.c In file included from ../Libutils/u_lock_ctl.h:5, from tcp_dis.c:101: ../../../src/include/pbs_nodes.h:98:21: error: hwloc.h: No such file or directory In file included from ../Libutils/u_lock_ctl.h:5, from tcp_dis.c:101: ../../../src/include/pbs_nodes.h:225: error: expected specifier-qualifier-list before ‘hwloc_bitmap_t’ make[4]: *** [tcp_dis.o] Error 1 make[4]: Leaving directory `/usr/local/src/torque-4.0.0/src/lib/Libifl' The attached patch works for me. - Martin
Martin, This patch patches Makefile.in files, which are not version controlled. How did you define these variables?
(In reply to comment #1) > Martin, > > This patch patches Makefile.in files, which are not version controlled. How did > you define these variables? I wonder if the real bug is that this: src/lib/Libifl/Makefile.am: CPPFLAGS = -DPBS_DEFAULT_FILE=\"$(PBS_DEFAULT_FILE)\" -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" should be this: AM_CPPFLAGS += -DPBS_DEFAULT_FILE=\"$(PBS_DEFAULT_FILE)\" -DPBS_SERVER_HOME=\"$(PBS_SERVER_HOME)\" which matches the other Makefile templates. Just setting the CPPFLAGS equal would surely drop any existing settings?
When configure does not find the hwloc.pc file it prints: No package 'hwloc' found Perhaps you should add the directory containing 'hwloc.pc' to the PKG_CONFIG_PATH environment variable. Alternatively, you may set the environment variables HWLOC_CFLAGS and HWLOC_LIBS before running configure. Example: export HWLOC_CFLAGS='-I/usr/local/hwloc-1.1/include' export HWLOC_LIBS='-L/usr/local/hwloc-1.1/lib -lhwloc' Alas, setting HWLOC_CFLAGS and HWLOC_LIBS has absolutely no effect since these variables are not referenced in the Makefile. - Martin
(In reply to comment #3) > When configure does not find the hwloc.pc file it prints: > > No package 'hwloc' found > > Perhaps you should add the directory containing 'hwloc.pc' > to the PKG_CONFIG_PATH environment variable. > > Alternatively, you may set the environment variables > HWLOC_CFLAGS and HWLOC_LIBS before running configure. > > Example: > export HWLOC_CFLAGS='-I/usr/local/hwloc-1.1/include' > export HWLOC_LIBS='-L/usr/local/hwloc-1.1/lib -lhwloc' > > Alas, setting HWLOC_CFLAGS and HWLOC_LIBS has absolutely no effect > since these variables are not referenced in the Makefile. > > - Martin Hi Martin, I found the same and have bug180 on this which includes a temporary solution, and there's a proper solution in bug 179. If you put: PKG_PROG_PKG_CONFIG right after LT_INIT in configure.ac, and rerun autogen.sh, the problem should go away. Cheers, Rhys
This still is not quite right with torque-4.0.2. Let's say that hwloc is installed in /usr/local, i.e., include files in /usr/local/include and libraries in /usr/local/lib64. Both /usr/local/lib64 and /usr/local/include are searched by the compiler by default, i.e., -I and -L flags are unnecessary. I set HWLOC_LIBS="-lhwloc" and run configure: ... checking for HWLOC... no configure: error: cpuset support requires the hwloc package No package 'hwloc' found Perhaps you should add the directory containing 'hwloc.pc' to the PKG_CONFIG_PATH environment variable. Alternatively, you may set the environment variables HWLOC_CFLAGS and HWLOC_LIBS before running configure. Example: export HWLOC_CFLAGS='-I/usr/local/hwloc-1.1/include' export HWLOC_LIBS='-L/usr/local/hwloc-1.1/lib -lhwloc' The problem is that HWLOC_CFLAGS is empty and in that case configure checks for pkg-config which fails in my case; configure does not consider the case that the code would compile without pkg-config and without any additional CFLAGS.
Is there some reason we can't have a --with-hwloc option instead of passing environment variables? That is already done for tcl/tk. Using a similar method to tcl/tk it could be --with-hwloc=/usr/local/hwloc (if that is where you put it). With options to override --with-hwloclib and --with-hwlocinclude if necessary. I'm not sure why the environment variables are being used at the moment. Is there a reason for that? What does it enable that configure options don't. Building RPMs would also be simpler with configure options. - Craig.
These configure options will be added before 4.0.3. We may also support environment variables if this isn't sufficient, but there is already a ticket earmarked for 4.0.3 with the environment options. (In reply to comment #6) > Is there some reason we can't have a --with-hwloc option instead of passing > environment variables? That is already done for tcl/tk. > > Using a similar method to tcl/tk it could be --with-hwloc=/usr/local/hwloc (if > that is where you put it). With options to override --with-hwloclib and > --with-hwlocinclude if necessary. > > I'm not sure why the environment variables are being used at the moment. Is > there a reason for that? What does it enable that configure options don't. > Building RPMs would also be simpler with configure options. > > - Craig.
Fixed in 4.0.3