pmem / ndctl

A "device memory" enabling project encompassing tools and libraries for CXL, NVDIMMs, DAX, memory tiering and other platform memory device topics.
Other
271 stars 139 forks source link

make error: 'NDCTL_KEYS_DIR' undeclared #179

Open graceleeis opened 3 years ago

graceleeis commented 3 years ago

Hi

I've installed ndctl in docker, but it got make error not matter how many times I've re-build load-keys.c: In function 'cmd_load_keys': load-keys.c:253:27: error: 'NDCTL_KEYS_DIR' undeclared (first use in this function); did you mean 'NDCTL_FWA_IDLE'? param.key_path = strdup(NDCTL_KEYS_DIR); ^~~~~~~~~~~~~~ NDCTL_FWA_IDLE load-keys.c:253:27: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [Makefile:630: load-keys.o] Error 1 make[2]: *** [Makefile:457: all] Error 2 make[1]: *** [Makefile:791: all-recursive] Error 1 make: *** [Makefile:548: all] Error 2 docker info: os: 18.04.6 LTS (Bionic Beaver) kernel: 5.11.22-100.fc32.x86_64

Here is my step:

  1. git clone https://github.com/pmem/ndctl.git
  2. ./autogen.sh
  3. ./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
  4. make

Can you please tell me what's wrong? Thanks!

graceleeis commented 3 years ago

./autogen.sh log

Activated pre-commit hook.
GIT_VERSION = 71.2.gea014c0
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: linking file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'
configure.ac:21: installing 'build-aux/compile'
configure.ac:26: installing 'build-aux/config.guess'
configure.ac:26: installing 'build-aux/config.sub'
configure.ac:10: installing 'build-aux/install-sh'
configure.ac:10: installing 'build-aux/missing'
Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'

----------------------------------------------------------------
Initialized build system. For a common configuration please run:
----------------------------------------------------------------

./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
graceleeis commented 3 years ago

./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib log

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for gcc option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for a sed that does not truncate output... (cached) /bin/sed
checking for asciidoctor... /usr/bin/asciidoctor
checking for typeof syntax and keyword spelling... typeof
checking whether byte ordering is bigendian... no
checking whether BUS_MCEERR_AR is declared... yes
checking whether MAP_SHARED_VALIDATE is declared... yes
checking whether MAP_SYNC is declared... yes
checking whether MAP_SHARED_VALIDATE is declared... no
checking whether MAP_SYNC is declared... no
configure: WARNING: MAP_SHARED_VALIDATE supported by kernel but not by <sys/mman.h>, consider installing glibc-2.28 or later.
configure: WARNING: MAP_SYNC supported by kernel but not by <sys/mman.h>, consider installing glibc-2.28 or later.
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for KMOD... yes
checking for UDEV... yes
checking for UUID... yes
checking for JSON... yes
checking for BASH_COMPLETION... yes
checking for linux/version.h... yes
checking for __secure_getenv... no
checking for secure_getenv... yes
checking for SYSTEMD... yes
checking keyutils.h usability... yes
checking keyutils.h presence... yes
checking for keyutils.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating daxctl/lib/Makefile
config.status: creating ndctl/lib/Makefile
config.status: creating ndctl/Makefile
config.status: creating daxctl/Makefile
config.status: creating test/Makefile
config.status: creating Documentation/ndctl/Makefile
config.status: creating Documentation/daxctl/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

        ndctl 71.2.gea014c0
        =====

        prefix:                 /usr
        sysconfdir:             /etc
        libdir:                 /usr/lib
        includedir:             ${prefix}/include

        compiler:               gcc
        cflags:                 -g -O2
        ldflags:

        logging:                yes
        debug:                  no
graceleeis commented 3 years ago

make log

 GEN      version.m4
make --no-print-directory all-recursive
  GEN      version.m4
Making all in .
  GEN      version.m4
  CC       ccan/str/str.o
  CC       ccan/str/debug.o
  CC       ccan/list/list.o
  AR       libccan.a
ar: `u' modifier ignored since `D' is the default (see `U')
  CC       util/parse-options.o
  CC       util/usage.o
  CC       util/size.o
  CC       util/main.o
  CC       util/help.o
  CC       util/strbuf.o
  CC       util/wrapper.o
  CC       util/filter.o
  CC       util/bitmap.o
  CC       util/abspath.o
  CC       util/iomem.o
  AR       libutil.a
ar: `u' modifier ignored since `D' is the default (see `U')
  GEN      rhel/ndctl.spec
  GEN      sles/ndctl.spec
Making all in daxctl/lib
  CC       ../../util/iomem.lo
  CC       ../../util/sysfs.lo
  CC       ../../util/log.lo
  CC       libdaxctl.lo
  CCLD     libdaxctl.la
  GEN      libdaxctl.pc
Making all in ndctl/lib
  CC       dimm.lo
  CC       inject.lo
  CC       nfit.lo
  CC       smart.lo
  CC       intel.lo
  CC       hpe1.lo
  CC       msft.lo
  CC       hyperv.lo
  CC       papr.lo
  CC       ars.lo
  CC       firmware.lo
  CC       libndctl.lo
  CCLD     libndctl.la
  GEN      libndctl.pc
Making all in ndctl
  GEN      config.h
  GEN      config.h
make --no-print-directory all-am
  CC       ndctl.o
  CC       bus.o
  CC       create-nfit.o
  CC       namespace.o
  CC       check.o
  CC       region.o
  CC       dimm.o
  CC       ../util/log.o
  CC       list.o
  CC       ../util/json.o
  CC       util/json-smart.o
  CC       inject-error.o
  CC       inject-smart.o
  CC       monitor.o
  CC       util/keys.o
  CC       load-keys.o
load-keys.c: In function 'cmd_load_keys':
load-keys.c:253:27: error: 'NDCTL_KEYS_DIR' undeclared (first use in this function); did you mean 'NDCTL_FWA_IDLE'?
   param.key_path = strdup(NDCTL_KEYS_DIR);
                           ^~~~~~~~~~~~~~
                           NDCTL_FWA_IDLE
load-keys.c:253:27: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [Makefile:630: load-keys.o] Error 1
make[2]: *** [Makefile:457: all] Error 2
make[1]: *** [Makefile:791: all-recursive] Error 1
make: *** [Makefile:548: all] Error 2