moinakg / pcompress

A Parallelized Data Deduplication and Compression utility
http://moinakg.github.com/pcompress/
GNU Lesser General Public License v3.0
277 stars 34 forks source link

Build failed on OS X #22

Open 191919 opened 10 years ago

191919 commented 10 years ago

I had several problems when I tried to build pcompress on OS X with clang. Here is how I managed to build it.

(1) ./config failed

Checking for GCC ...
Checking for 32-bit/64-bit platform ...
Checking OS ...
Checking GCC version ...
ERROR:
GCC version 4.4 or above is required.

I changed if [ $1 -lt 4 -o $2 -lt 4 ] to if [ $1 -lt 4 -o $2 -lt 2 ].

(2) make failure

I removed from Makefile the -floop-interchange, -floop-block, fsched-spec-load and -pthread flags which all were gcc-flavored options but rejected by clang.

(3) link failure

Undefined symbols for architecture x86_64:
  "_archive_read_disk_set_behavior", referenced from:
      _archiver_thread_func in pc_archive.o
  "_archive_read_free", referenced from:
      _archiver_thread_func in pc_archive.o
      _extractor_thread_func in pc_archive.o
  "_archive_write_free", referenced from:
      _archiver_thread_func in pc_archive.o
      _extractor_thread_func in pc_archive.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is due to the old version of lib archive.2.dylib in /usr/lib. I changed it to /usr/local/lib/libarchive.dylib.

Then I changed

KECCAK_SRCS = $(KECCAK_SRC_ASM1)

to

KECCAK_SRCS = $(KECCAK_SRC_OPT64)

  1. Finally I have a succeeded build.
moinakg commented 10 years ago

Thanks for the report. I do not yet have a config that can detect and handle clang compiler. Will update this soon.