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

prov/cxi: configure failure - error codes undeclared #9789

Closed
thomasgillis opened this issue Feb 6, 2024 · 4 comments
Closed

prov/cxi: configure failure - error codes undeclared #9789

thomasgillis opened this issue Feb 6, 2024 · 4 comments

Comments

@thomasgillis
Copy link
Contributor

Describe the bug
Hi all,
I am trying to compile cxi from source, and I get a configure error with both gcc-11.2.0 and clang-14.0 (used the cray wrappers cc and CC):

./configure --enable-cxi --with-hip
[...]
configure: *** Configuring cxi provider
checking cxi_prov_hw.h usability... no
checking cxi_prov_hw.h presence... yes
configure: WARNING: cxi_prov_hw.h: present but cannot be compiled
configure: WARNING: cxi_prov_hw.h:     check for missing prerequisite headers?
configure: WARNING: cxi_prov_hw.h: see the Autoconf documentation
configure: WARNING: cxi_prov_hw.h:     section "Present But Cannot Be Compiled"
configure: WARNING: cxi_prov_hw.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------ ##
configure: WARNING:     ## Report this to [email protected] ##
configure: WARNING:     ## ------------------------------------------ ##
checking for cxi_prov_hw.h... no
checking uapi/misc/cxi.h usability... no
checking uapi/misc/cxi.h presence... yes
configure: WARNING: uapi/misc/cxi.h: present but cannot be compiled
configure: WARNING: uapi/misc/cxi.h:     check for missing prerequisite headers?
configure: WARNING: uapi/misc/cxi.h: see the Autoconf documentation
configure: WARNING: uapi/misc/cxi.h:     section "Present But Cannot Be Compiled"
configure: WARNING: uapi/misc/cxi.h: proceeding with the compiler's result
configure: WARNING:     ## ------------------------------------------ ##
configure: WARNING:     ## Report this to [email protected] ##
configure: WARNING:     ## ------------------------------------------ ##
checking for uapi/misc/cxi.h... no
checking libcxi/libcxi.h usability... yes
checking libcxi/libcxi.h presence... yes
checking for libcxi/libcxi.h... yes

When looking at the config.log it seems to be stuck on the undefined ENOSPC error code:

configure:34464: cc -c -O2 -DNDEBUG -fvisibility=hidden -Wall -Wundef -Wpointer-arith    conftest.c >&5
In file included from conftest.c:145:
/usr/include/cxi_prov_hw.h:805:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC;
                        ^
/usr/include/cxi_prov_hw.h:856:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC;
                        ^
/usr/include/cxi_prov_hw.h:939:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC; /* not possible */
                        ^
/usr/include/cxi_prov_hw.h:983:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC;
                        ^
/usr/include/cxi_prov_hw.h:1052:11: error: use of undeclared identifier 'EINVAL'
                return -EINVAL;
                        ^
/usr/include/cxi_prov_hw.h:1320:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC;
                        ^
/usr/include/cxi_prov_hw.h:1349:11: error: use of undeclared identifier 'ENOSPC'
                return -ENOSPC;
                        ^
7 errors generated.

I presume one of the file misses #include "errno.h", but it's unclear to me which one should get it.
Do you have any guidance on how to fix the error?

@jswaro
Copy link
Contributor

jswaro commented Feb 6, 2024

The problem lies in the two header files, not the provider.

To work-around this problem, use the following patch applied to the prov/cxi/configure.m4

diff --git a/prov/cxi/configure.m4 b/prov/cxi/configure.m4
index ec50e18f3..a73e86e31 100644
--- a/prov/cxi/configure.m4
+++ b/prov/cxi/configure.m4
@@ -46,11 +46,18 @@ AC_DEFUN([FI_CXI_CONFIGURE],[
                [
                        AC_CHECK_HEADER(cxi_prov_hw.h,
                                [],
-                               [cxi_happy=0])
+                               [cxi_happy=0],
+                               [AC_INCLUDES_DEFAULT
+                               #include <errno.h>])

                        AC_CHECK_HEADER(uapi/misc/cxi.h,
                                [],
-                               [cxi_happy=0])
+                               [cxi_happy=0],
+                               [AC_INCLUDES_DEFAULT
+                               #include <stdbool.h>
+                               #ifndef __user
+                               #define __user
+                               #endif])

In an upcoming release of the software, SHS 2.2.0, the compilation problem reported in this ticket will be fixed.

@jswaro jswaro added the prov/cxi label Feb 6, 2024
@thomasgillis
Copy link
Contributor Author

the diff provided has been implemented successfully and is available at: https://github.com/thomasgillis/libfabric/tree/dev-cxi

@jain-jainendra
Copy link

The problem lies in the two header files, not the provider.

To work-around this problem, use the following patch applied to the prov/cxi/configure.m4

diff --git a/prov/cxi/configure.m4 b/prov/cxi/configure.m4
index ec50e18f3..a73e86e31 100644
--- a/prov/cxi/configure.m4
+++ b/prov/cxi/configure.m4
@@ -46,11 +46,18 @@ AC_DEFUN([FI_CXI_CONFIGURE],[
                [
                        AC_CHECK_HEADER(cxi_prov_hw.h,
                                [],
-                               [cxi_happy=0])
+                               [cxi_happy=0],
+                               [AC_INCLUDES_DEFAULT
+                               #include <errno.h>])

                        AC_CHECK_HEADER(uapi/misc/cxi.h,
                                [],
-                               [cxi_happy=0])
+                               [cxi_happy=0],
+                               [AC_INCLUDES_DEFAULT
+                               #include <stdbool.h>
+                               #ifndef __user
+                               #define __user
+                               #endif])

In an upcoming release of the software, SHS 2.2.0, the compilation problem reported in this ticket will be fixed.

The main code still does not have this changes. If added manually it fails to build. Any solution for this?

@thomasgillis
Copy link
Contributor Author

The full patch should be available here: https://github.com/thomasgillis/libfabric/tree/dev-cxi

Let me know if it doesn't work

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

No branches or pull requests

3 participants