samtools / htslib

C library for high-throughput sequencing data formats
Other
785 stars 447 forks source link

Can't make install on OSX (apple sillicon), permission denied #1610

Closed etowahadams closed 1 year ago

etowahadams commented 1 year ago

Device: macOS 13.3, M2 chip To reproduce:

  1. Download HTSlib from webite. (htslib-1.17)
  2. Unzip
  3. cd to unzipped directory
  4. Follow installation instructions: ./configure, make, make install

For make install I get the below output:

$ make install
mkdir -p -m 755 /usr/local/bin /usr/local/include /usr/local/include/htslib /usr/local/lib /usr/local/share/man/man1 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/lib/pkgconfig
mkdir: /usr/local/include/htslib: Permission denied
mkdir: /usr/local/share/man/man5: Permission denied
mkdir: /usr/local/share/man/man7: Permission denied
mkdir: /usr/local/lib/pkgconfig: Permission denied
make: *** [installdirs] Error 1

Here are the outputs for the first two commands

./configure output Output ``` 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 for ranlib... ranlib checking for grep that handles long lines and -e... /usr/bin/grep checking for C compiler warning flags... -Wall checking whether C compiler accepts -mssse3 -mpopcnt -msse4.1... no checking whether C compiler accepts -mavx2... no checking whether C compiler accepts -mavx512f... no checking whether C compiler supports ARM Neon... yes checking for pkg-config... no checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no checking shared library type for unknown-Darwin... Darwin dylib checking whether the compiler accepts -fvisibility=hidden... yes checking how to run the C preprocessor... gcc -E checking for egrep... /usr/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 for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... yes checking for getpagesize... yes checking for working mmap... yes checking for gmtime_r... yes checking for fsync... yes checking for drand48... yes checking for srand48_deterministic... no checking whether fdatasync is declared... no checking for library containing log... none required checking for zlib.h... yes checking for inflate in -lz... yes checking for library containing recv... none required checking for bzlib.h... yes checking for BZ2_bzBuffToBuffCompress in -lbz2... yes checking for lzma.h... no checking for lzma_easy_buffer_encode in -llzma... yes checking whether htscodecs files are present... yes checking for libdeflate.h... no checking for libdeflate_deflate_compress in -ldeflate... no checking for curl/curl.h... yes checking for curl_easy_pause in -lcurl... yes checking for CCHmac... yes checking for library containing regcomp... none required checking whether PTHREAD_MUTEX_RECURSIVE is declared... yes configure: creating ./config.status config.status: creating config.mk config.status: creating htslib.pc.tmp config.status: creating config.h config.status: linking htscodecs_bundled.mk to htscodecs.mk ```
make output Output ``` gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o kfunc.o kfunc.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o kstring.o kstring.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o bcf_sr_sort.o bcf_sr_sort.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o bgzf.o bgzf.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o errmod.o errmod.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o faidx.o faidx.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o header.o header.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hfile.o hfile.c echo '#define HTS_VERSION_TEXT "1.17"' > version.h printf '#define HTS_CC "%s"\n#define HTS_CPPFLAGS "%s"\n#define HTS_CFLAGS "%s"\n#define HTS_LDFLAGS "%s"\n#define HTS_LIBS "%s"\n' \ 'gcc' \ '' \ '-Wall -g -O2 -fvisibility=hidden' \ '-fvisibility=hidden ' \ '-llzma -lbz2 -lz -lcurl ' > config_vars.h gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hts.o hts.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hts_expr.o hts_expr.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hts_os.o hts_os.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o md5.o md5.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o multipart.o multipart.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o probaln.o probaln.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o realn.o realn.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o regidx.o regidx.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o region.o region.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o sam.o sam.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o synced_bcf_reader.o synced_bcf_reader.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o vcf_sweep.o vcf_sweep.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o tbx.o tbx.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o textutils.o textutils.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o thread_pool.o thread_pool.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o vcf.o vcf.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o vcfutils.o vcfutils.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_codecs.o cram/cram_codecs.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_decode.o cram/cram_decode.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_encode.o cram/cram_encode.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_external.o cram/cram_external.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_index.o cram/cram_index.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_io.o cram/cram_io.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/cram_stats.o cram/cram_stats.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/mFILE.o cram/mFILE.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/open_trace_file.o cram/open_trace_file.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/pooled_alloc.o cram/pooled_alloc.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o cram/string_alloc.o cram/string_alloc.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/arith_dynamic.o htscodecs/htscodecs/arith_dynamic.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/fqzcomp_qual.o htscodecs/htscodecs/fqzcomp_qual.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/htscodecs.o htscodecs/htscodecs/htscodecs.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/pack.o htscodecs/htscodecs/pack.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/rANS_static4x16pr.o htscodecs/htscodecs/rANS_static4x16pr.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/rANS_static32x16pr_neon.o htscodecs/htscodecs/rANS_static32x16pr_neon.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/rANS_static32x16pr.o htscodecs/htscodecs/rANS_static32x16pr.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/rANS_static.o htscodecs/htscodecs/rANS_static.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/rle.o htscodecs/htscodecs/rle.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/tokenise_name3.o htscodecs/htscodecs/tokenise_name3.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htscodecs/htscodecs/utils.o htscodecs/htscodecs/utils.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hfile_libcurl.o hfile_libcurl.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hfile_gcs.o hfile_gcs.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hfile_s3.o hfile_s3.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o hfile_s3_write.o hfile_s3_write.c ar -rc libhts.a kfunc.o kstring.o bcf_sr_sort.o bgzf.o errmod.o faidx.o header.o hfile.o hts.o hts_expr.o hts_os.o md5.o multipart.o probaln.o realn.o regidx.o region.o sam.o synced_bcf_reader.o vcf_sweep.o tbx.o textutils.o thread_pool.o vcf.o vcfutils.o cram/cram_codecs.o cram/cram_decode.o cram/cram_encode.o cram/cram_external.o cram/cram_index.o cram/cram_io.o cram/cram_stats.o cram/mFILE.o cram/open_trace_file.o cram/pooled_alloc.o cram/string_alloc.o htscodecs/htscodecs/arith_dynamic.o htscodecs/htscodecs/fqzcomp_qual.o htscodecs/htscodecs/htscodecs.o htscodecs/htscodecs/pack.o htscodecs/htscodecs/rANS_static4x16pr.o htscodecs/htscodecs/rANS_static32x16pr_neon.o htscodecs/htscodecs/rANS_static32x16pr.o htscodecs/htscodecs/rANS_static.o htscodecs/htscodecs/rle.o htscodecs/htscodecs/tokenise_name3.o htscodecs/htscodecs/utils.o hfile_libcurl.o hfile_gcs.o hfile_s3.o hfile_s3_write.o ranlib libhts.a gcc -dynamiclib -install_name /usr/local/lib/libhts.3.dylib -current_version 3.1.17 -compatibility_version 3.1.17 -fvisibility=hidden -o libhts.dylib kfunc.o kstring.o bcf_sr_sort.o bgzf.o errmod.o faidx.o header.o hfile.o hts.o hts_expr.o hts_os.o md5.o multipart.o probaln.o realn.o regidx.o region.o sam.o synced_bcf_reader.o vcf_sweep.o tbx.o textutils.o thread_pool.o vcf.o vcfutils.o cram/cram_codecs.o cram/cram_decode.o cram/cram_encode.o cram/cram_external.o cram/cram_index.o cram/cram_io.o cram/cram_stats.o cram/mFILE.o cram/open_trace_file.o cram/pooled_alloc.o cram/string_alloc.o htscodecs/htscodecs/arith_dynamic.o htscodecs/htscodecs/fqzcomp_qual.o htscodecs/htscodecs/htscodecs.o htscodecs/htscodecs/pack.o htscodecs/htscodecs/rANS_static4x16pr.o htscodecs/htscodecs/rANS_static32x16pr_neon.o htscodecs/htscodecs/rANS_static32x16pr.o htscodecs/htscodecs/rANS_static.o htscodecs/htscodecs/rle.o htscodecs/htscodecs/tokenise_name3.o htscodecs/htscodecs/utils.o hfile_libcurl.o hfile_gcs.o hfile_s3.o hfile_s3_write.o -llzma -lbz2 -lz -lcurl ln -sf libhts.dylib libhts.3.dylib gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o bgzip.o bgzip.c gcc -fvisibility=hidden -o bgzip bgzip.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o htsfile.o htsfile.c gcc -fvisibility=hidden -o htsfile htsfile.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o tabix.o tabix.c gcc -fvisibility=hidden -o tabix tabix.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/hts_endian.o test/hts_endian.c gcc -fvisibility=hidden -o test/hts_endian test/hts_endian.o -llzma -lbz2 -lz -lcurl gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/fieldarith.o test/fieldarith.c gcc -fvisibility=hidden -o test/fieldarith test/fieldarith.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/hfile.o test/hfile.c gcc -fvisibility=hidden -o test/hfile test/hfile.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/pileup.o test/pileup.c gcc -fvisibility=hidden -o test/pileup test/pileup.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/pileup_mod.o test/pileup_mod.c gcc -fvisibility=hidden -o test/pileup_mod test/pileup_mod.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/plugins-dlhts.o test/plugins-dlhts.c gcc -fvisibility=hidden -o test/plugins-dlhts test/plugins-dlhts.o -llzma -lbz2 -lz -lcurl gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/sam.o test/sam.c gcc -fvisibility=hidden -o test/sam test/sam.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_bgzf.o test/test_bgzf.c gcc -fvisibility=hidden -o test/test_bgzf test/test_bgzf.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_expr.o test/test_expr.c gcc -fvisibility=hidden -o test/test_expr test/test_expr.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_faidx.o test/test_faidx.c gcc -fvisibility=hidden -o test/test_faidx test/test_faidx.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_kfunc.o test/test_kfunc.c gcc -fvisibility=hidden -o test/test_kfunc test/test_kfunc.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_kstring.o test/test_kstring.c gcc -fvisibility=hidden -o test/test_kstring test/test_kstring.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_mod.o test/test_mod.c gcc -fvisibility=hidden -o test/test_mod test/test_mod.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_realn.o test/test_realn.c gcc -fvisibility=hidden -o test/test_realn test/test_realn.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-regidx.o test/test-regidx.c gcc -fvisibility=hidden -o test/test-regidx test/test-regidx.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_str2int.o test/test_str2int.c gcc -fvisibility=hidden -o test/test_str2int test/test_str2int.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_time_funcs.o test/test_time_funcs.c gcc -fvisibility=hidden -o test/test_time_funcs test/test_time_funcs.o gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_view.o test/test_view.c gcc -fvisibility=hidden -o test/test_view test/test_view.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_index.o test/test_index.c gcc -fvisibility=hidden -o test/test_index test/test_index.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-vcf-api.o test/test-vcf-api.c gcc -fvisibility=hidden -o test/test-vcf-api test/test-vcf-api.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-vcf-sweep.o test/test-vcf-sweep.c gcc -fvisibility=hidden -o test/test-vcf-sweep test/test-vcf-sweep.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-bcf-sr.o test/test-bcf-sr.c gcc -fvisibility=hidden -o test/test-bcf-sr test/test-bcf-sr.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/fuzz/hts_open_fuzzer.o test/fuzz/hts_open_fuzzer.c gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-bcf-translate.o test/test-bcf-translate.c gcc -fvisibility=hidden -o test/test-bcf-translate test/test-bcf-translate.o libhts.a -lz -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-parse-reg.o test/test-parse-reg.c gcc -fvisibility=hidden -o test/test-parse-reg test/test-parse-reg.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test_introspection.o test/test_introspection.c gcc -fvisibility=hidden -o test/test_introspection test/test_introspection.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread gcc -Wall -g -O2 -fvisibility=hidden -I. -c -o test/test-bcf_set_variant_type.o test/test-bcf_set_variant_type.c gcc -fvisibility=hidden -o test/test-bcf_set_variant_type test/test-bcf_set_variant_type.o libhts.a -llzma -lbz2 -lz -lcurl -lpthread sed -n '/^static_libs=/s/[^=]*=/HTSLIB_static_LIBS = /p;/^static_ldflags=/s/[^=]*=/HTSLIB_static_LDFLAGS = /p' htslib.pc.tmp > htslib_static.mk sed -e 's#@-includedir@#'`pwd`'#g;s#@-libdir@#'`pwd`'#g' htslib.pc.tmp > htslib-uninstalled.pc ```
jkbonfield commented 1 year ago

The first error is the key one here:

mkdir: /usr/local/include/htslib: Permission denied

It's pretty much exactly what it says - you don't have permission to install this file. (This isn't an htslib issue therefore.)

You'll either need to get permission (eg sudo make install) or rerun configure with a --prefix /some/other/path where you do have permission to install.