rcedgar / urmap

URMAP ultra-fast read mapper
GNU General Public License v2.0
39 stars 11 forks source link

Compile error at myutils.cpp:1403:27 #6

Closed sbresnahan closed 4 years ago

sbresnahan commented 4 years ago

/usr/local/opt/llvm/bin/clang -fopenmp -msse -mfpmath=sse -O3 -DNDEBUG -c -o o/myutils.o myutils.cpp myutils.cpp:928:2: error: 'va_start' cannot be used in a captured statement va_start(ArgList, Format);

/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stdarg.h:17:29: note: expanded from macro 'va_start'

define va_start(ap, param) __builtin_va_start(ap, param)

myutils.cpp:1403:27: warning: format specifies type 'unsigned long long' but the argument has type 'uint64' (aka 'unsigned long') [-Wformat] sprintf(Tmp, "%" PRIu64, i);

rcedgar commented 4 years ago

Looks like you're using clang, which is not supported, please try gcc.

sbresnahan commented 4 years ago

Looks like you're using clang, which is not supported, please try gcc.

When using gcc, I get:

g++ -fopenmp -msse -mfpmath=sse -O3 -DNDEBUG -c -o o/alignresult.o alignresult.cpp clang: error: unsupported option '-fopenmp' make: *** [o/alignresult.o] Error 1

I am on OSX, using the OSX make file.

rcedgar commented 4 years ago

Ah, ok. I haven't tested on OSX. The Makefile_osx is generated by an automatic conversion of the Visual Studio project file; it's worked for me with other projects but apparently not this one. So I guess I should not have implied that OSX is supported and I should delete the OSX makefile unless you can contribute a fix. My apologies for the mistake.

sbresnahan commented 4 years ago

Ah, ok. I haven't tested on OSX. The Makefile_osx is generated by an automatic conversion of the Visual Studio project file; it's worked for me with other projects but apparently not this one. So I guess I should not have implied that OSX is supported and I should delete the OSX makefile unless you can contribute a fix. My apologies for the mistake.

Installing llvm via Homebrew, installing macOS SDK headers to /usr/include, and directing CPP in the make file to /usr/local/opt/llvm/bin/clang fixes the issue. See: https://stackoverflow.com/questions/43555410/enable-openmp-support-in-clang-in-mac-os-x-sierra-mojave

However, a new issue occurs on compile:

myutils.cpp:928:2: error: 'va_start' cannot be used in a captured statement
        va_start(ArgList, Format);

/usr/local/Cellar/llvm/10.0.1/lib/clang/10.0.1/include/stdarg.h:17:29: note: 
      expanded from macro 'va_start'
#define va_start(ap, param) __builtin_va_start(ap, param)

myutils.cpp:1403:27: warning: format specifies type 'unsigned long long' but the
      argument has type 'uint64' (aka 'unsigned long') [-Wformat]
        sprintf(Tmp, "%" PRIu64, i);
rcedgar commented 4 years ago

Still clang-specific problems 😁, note the stdarg.h path. I think this should work if you use regular gcc, but regardless this is still a Mac-specific problem and regrettably I don't have time to commit to supporting urmap on Mac, not enough time vs. not enough users.