pmem / ndctl

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

Option for libndctl-dev? #140

Closed jerryajay closed 4 years ago

jerryajay commented 4 years ago

I'm looking for sources for libndctl-dev. When makeing pmdk I get the error: src/common.inc:382: *** Please install libndctl-dev/libndctl-devel >= 63. Stop. I tried the option of adding the path of .pc files, but nothing was related to the -dev(el) release but rather libndctl is found when installed the sources of this repository. Looking for hints to proceed.

djbw commented 4 years ago

I believe pmdk is directing you to install the development package from your distribution, not the source from this repository so:

apt-get install libndctl-dev 

...on Debian / Ubuntu, or:

dnf install ndctl-devel

...on Fedora / Redhat, or:

zypper install libndctl-devel

...on SUSE.

jerryajay commented 4 years ago

@djbw This option has been tried out in ubuntu. The issue is that the apt repository has an older version of ndctl-dev , i.e., 61.2 . However, to compile the sources for npctl I need to install libndctl-devel >= 63. So, I'm looking for the sources of libndctl-dev to compile it myself.

pbalcer commented 4 years ago

PMDK uses pkg config to check for existence of ndctl. By default the build requires ndctl 63 or newer.

Which version of Ubuntu is that? If it doesn't have the appropriate version of ndctl in the apt repository, then it's likely that it won't have a new enough kernel to fully use PMDK features that are dependent on ndctl. In that case, I recommend just disabling ndctl at build time (NDCTL_ENABLE=n) - this however is highly discouraged in production environments.

sscargal commented 4 years ago

@jerryajay - If you build ndctl from source, you will get all the necessary headers and .pc files.

Ubuntu 19.10 has ndctl v65 available.

jerryajay commented 4 years ago

@sscargal : That is not the issue. The make command for pmdk displays src/common.inc:382: *** Please install libndctl-dev/libndctl-devel >= 63. Stop. in the very first line. Output of ndctl --version : 64.1

@pbalcer Output of uname -r: 5.6.4 Ubuntu version : 18.04 LTS

With NDCTL_ENABLE ?= n the make completed fine. However, I would like to have NDCTL_ENABLEed for managing the persistent memory functionality.

pbalcer commented 4 years ago

What's the output of pkg-config libndctl --modversion?

jerryajay commented 4 years ago

61.2+ . If this version is what is available to pkg-config, how to fix it ?

pbalcer commented 4 years ago

Remove the version provided by the distro, install ndctl somewhere, and then use PKG_CONFIG_PATH to point to that installation.

sscargal commented 4 years ago

@jerryajay Where did you get ndctl v64.1 from? If it was a package, you should find the same v64.1 version of libndctl-dev from the same repo or download site.

Adding to the response from @pbalcer. You can download the ndctl packages from the 19.10 or 20.04 repo and manually install them, or build ndctl from source.

jerryajay commented 4 years ago

@pbalcer The fix regarding PKG_CONFIG_PATH worked and the make process executed fine. However, while executing sudo make install I get the same error: src/common.inc:382: *** Please install libndctl-dev/libndctl-devel >= 63. Stop. .

I believe it's a minor issue to fix. Somehow, I don't know which exact path variable to change.

@sscargal : I got v64.1 from the official github repo and checking out the v64.1 branch. Building ndctl from source is what I'm currently doing.

pbalcer commented 4 years ago

sudo doesn't preserve the env variables. Either set the variable after sudo (sudo FOO=BAR ./abc) or use -E to preserve the environment (export FOO=BAR; sudo -E ./abc).

jerryajay commented 4 years ago

Perfect, perfect, perfect! Thank you so much!!! Just one last issue:

install -p -m 0755 pmempool /usr/local/bin
install -d /usr/local/etc/bash_completion.d
install: cannot create directory ‘/usr/local/etc/bash_completion.d’: File exists
../Makefile.inc:266: recipe for target 'install' failed
make[3]: *** [install] Error 1
make[3]: Leaving directory '/home/jerry/PersistentMemory/pmem/pmdk/src/tools/pmempool'
Makefile:61: recipe for target 'pmempool' failed
make[2]: *** [pmempool] Error 2
make[2]: Leaving directory '/home/jerry/PersistentMemory/pmem/pmdk/src/tools'
Makefile:162: recipe for target 'tools-install' failed
make[1]: *** [tools-install] Error 2
make[1]: Leaving directory '/home/jerry/PersistentMemory/pmem/pmdk/src'
Makefile:153: recipe for target 'install' failed
make: *** [install] Error 2

I get this error towards the end of the sudo -E make install. Again, I'm presuming it should be some simple issue and not sure whether should I go about deleting the /usr/local/etc/bash_completion.d directory.

I believe it was put in there by a docker-machine since it has the content:

base=https://raw.githubusercontent.com/docker/machine/v0.14.0
for i in docker-machine-prompt.bash docker-machine-wrapper.bash docker-machine.bash
do
  sudo wget "$base/contrib/completion/bash/${i}" -P /etc/bash_completion.d
done
jerryajay commented 4 years ago

Anyway, Never mind. I decided to remove the File bash_completion.d and allow the creation of bash_completion.d directory instead. The make install worked like a breeze. Thanks a lot!

pbalcer commented 4 years ago

I'm not exactly sure what's the problem there, because AFAIK install -d shouldn't fail when the directory already exists.

quaaanLee commented 1 year ago

How about Mac?