slow5tools icon indicating copy to clipboard operation
slow5tools copied to clipboard

Setting custom prefix is ignored during install

Open ForrestCKoch opened this issue 6 months ago • 2 comments

The supplied Makefile ignores the prefix variable set during configuration.

Steps to reproduce:

wget "https://github.com/hasindu2008/slow5tools/releases/download/v1.2.0/slow5tools-v1.2.0-release.tar.gz"
tar -xzf slow5tools-v1.2.0-release.tar.gz
cd slow4tools-v1.2.0
./configure --prefix=$HOME/.local # or any other directory
make
make install

Problem:

make install throws an error

mkdir -p /usr/local/bin
cp -f slow5tools /usr/local/bin
cp: cannot create regular file '/usr/local/bin/slow5tools': Permission denied
make: *** [Makefile:154: install] Error 1

Expected behavior:

The binaries should be installed into the requested location

Possible Solution:

There seem to be two problems. The config.mk file does not set the PREFIX variable. This is what mine looks like.

LIBS = -lhdf5 -lz 
LDFLAGS = 
CPPFLAGS = 

HDF5 = autoconf

disable_hdf5 = 

ifeq "locallibhdf5-no" "locallibhdf5-yes"
    CPPFLAGS += -I./hdf5/include/
    LDFLAGS += hdf5/lib/libhdf5.a -ldl
endif

ifeq "locallibzstd-no" "locallibzstd-yes"
    zstd_local = ../zstd/lib/
    LDFLAGS += zstd/lib/libzstd.a
endif

Even if it did set the PREFIX variable, the Makefile would overwrite at https://github.com/hasindu2008/slow5tools/blob/cdc52c81a8ba2bd97815b12774212dc89c8d8eb7/Makefile#L39

ForrestCKoch avatar Aug 29 '24 02:08 ForrestCKoch