hms-dbmi / spp

SPP - R package for analysis of ChIP-seq and other functional sequencing data
39 stars 22 forks source link

SPP installation problem in Mac #12

Open dktanwar opened 7 years ago

dktanwar commented 7 years ago
$  R CMD INSTALL spp-1.14.tar.gz
Warning in untar2(tarfile, files, list, exdir, restore_times) :
  skipping pax global extended headers
* installing to library ‘/Users/dktanwar/Library/R/3.3/library’
* installing *source* package ‘spp’ ...
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 BZ2_bzDecompressInit in -lbz2... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking how to run the C++ preprocessor... g++ -E
checking for a sed that does not truncate output... /usr/bin/sed
configure: Detected BOOST_ROOT; continuing with --with-boost=/Users/dktanwar/Downloads/boost_1_63_0
checking for Boost headers version >= 1.41.0... /Users/dktanwar/Downloads/boost_1_63_0
checking for Boost's header version... 1_63
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include   -I./ -D_FASTMAP -DMAQ_LONGREADS    -I/Users/dktanwar/Downloads/boost_1_63_0 -fPIC  -Wall -mtune=core2 -g -O2  -c bed2vector.cpp -o bed2vector.o
In file included from bed2vector.cpp:1:
In file included from ./pc.h:4:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map:213:5: warning: Use of the header <ext/hash_map> is deprecated. Migrate to
      <unordered_map> [-W#warnings]
#   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
    ^
bed2vector.cpp:118:25: error: reference to 'hash' is ambiguous
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
bed2vector.cpp:118:30: error: unexpected type name 'string': expected expression
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                             ^
bed2vector.cpp:163:29: error: reference to 'hash' is ambiguous
      hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
bed2vector.cpp:163:34: error: unexpected type name 'string': expected expression
      hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
                                 ^
bed2vector.cpp:165:10: error: use of undeclared identifier 'li'
      if(li==cind_map.end()) {
         ^
bed2vector.cpp:165:14: error: use of undeclared identifier 'cind_map'
      if(li==cind_map.end()) {
             ^
bed2vector.cpp:169:2: error: use of undeclared identifier 'cind_map'
        cind_map[chr]=cind;
        ^
bed2vector.cpp:176:7: error: use of undeclared identifier 'li'
        cind=li->second;
             ^
bed2vector.cpp:254:25: error: reference to 'hash' is ambiguous
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
bed2vector.cpp:254:30: error: unexpected type name 'string': expected expression
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                             ^
bed2vector.cpp:296:29: error: reference to 'hash' is ambiguous
      hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
bed2vector.cpp:296:34: error: unexpected type name 'string': expected expression
      hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
                                 ^
bed2vector.cpp:298:10: error: use of undeclared identifier 'li'
      if(li==cind_map.end()) {
         ^
bed2vector.cpp:298:14: error: use of undeclared identifier 'cind_map'
      if(li==cind_map.end()) {
             ^
bed2vector.cpp:302:2: error: use of undeclared identifier 'cind_map'
        cind_map[chr]=cind;
        ^
bed2vector.cpp:311:7: error: use of undeclared identifier 'li'
        cind=li->second;
             ^
bed2vector.cpp:432:25: error: reference to 'hash' is ambiguous
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
bed2vector.cpp:432:30: error: unexpected type name 'string': expected expression
  hash_map<string, int, hash<string>,equal_to<string> > cind_map;
                             ^
bed2vector.cpp:476:29: error: reference to 'hash' is ambiguous
      hash_map<string, int, hash<string>,equal_to<string> >::const_iterator li=cind_map.find(chr);
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3159:29: note: candidate found by name lookup is 'std::__1::hash'
template <class _Tp> struct hash;
                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash:22:54: note: candidate found by name lookup is '__gnu_cxx::hash'
template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash { };
                                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [bed2vector.o] Error 1
ERROR: compilation failed for package ‘spp’
* removing ‘/Users/dktanwar/Library/R/3.3/library/spp’
dktanwar commented 7 years ago

Hi Peter, did you get a chance to look at it?

pkharchenko commented 7 years ago

Sorry, not yet. I suspect that you’re using a newer installation which somehow messed up backwards compatibility with the hash_map. We could switch to unordered_map, which will take a bit of code work. That will break compatibility with the older systems though … -peter.

On Feb 10, 2017, at 11:22 AM, Deepak Tanwar notifications@github.com wrote:

Hi Peter, did you get a chance to look at it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hms-dbmi/spp/issues/12#issuecomment-278989358, or mute the thread https://github.com/notifications/unsubscribe-auth/ALT78i6h9CCd0j84dNEEz9ZfV2GxLk81ks5rbI7ZgaJpZM4L4k-7.

rajithbt commented 7 years ago

I too have this issue

chengkeren commented 7 years ago

same issue as you, and I tried 1.14, still does not work.

sklasfeld commented 7 years ago

I am having this problem using a Linux machine and R version 3.4.0. Did anyone find a fix?

sklasfeld commented 7 years ago

I sent in a pull request with the fixes I made to get the installation to work...

jkanbar commented 7 years ago

@sklasfeld I tried to install using your fixes but look to be running into the same problem as @dktanwar

I'm using a macOS .... below is my error:

In file included from bed2vector.cpp:1: In file included from ./pc.h:4: /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/ext/hash_map:213:5: warning: Use of the header <ext/hash_map> is deprecated. Migrate to [-W#warnings] warning Use of the header <ext/hash_map> is deprecated. Migrate to ^ bed2vector.cpp:14:10: fatal error: 'hash_map' file not found

include

     ^

1 warning and 1 error generated. make: *** [bed2vector.o] Error 1 ERROR: compilation failed for package ‘spp’

sklasfeld commented 7 years ago

So I was able to run it on a linux server with my fixes, but I wonder what would happen if you ran the following commands: sed -e 's/hash_map/unordered_map/g' /PATH/TO/spp-1.14/src/bed2vector.cpp

From what I understand, the code has a lot of deprecations so the names of some of the commands have changed since the last time this code was updated.

daler commented 7 years ago

@pkharchenko I was able to build an OSX conda package for spp by patching Makevars.in to use -ferror-limit=0 -stdlib=libstdc++ (see https://github.com/bioconda/bioconda-recipes/pull/5108/files). Would it be possible to add these flags in an arch-dependent manner, or at least describe this workaround in documentation? Thanks.

mevers commented 7 years ago

Hi.

I am having the same issues as the OP (@dktanwar) and @jkanbar. I am unable to compile spp on any Mac (running macOS Sierra). Has there been any update on ensuring that spp compiles & runs successfully on a Mac? This seems to be a pretty serious issue, as it completely breaks functionality of spp on Mac-flavoured Unix systems.

Is there any advice on how to get spp to run on a current Mac?

Cheers, M

pkharchenko commented 7 years ago

@daler Unfortunately I don't have a mac dev environment set up. Not sure if simply making Makevars.osx with these additional directives would fix the issue ...

kthurimella commented 7 years ago

Hi,

I'm seeing another issue now when trying to install it on my Mac. Is there a way to be able to disable this in the clang step here?

clang -I/usr/local/Cellar/r/3.4.2/lib/R/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/include -I./ -D_FASTMAP -DMAQ_LONGREADS -std=c++11 -fPIC -g -O2 -c cdensum.c -o cdensum.o

error: invalid argument -std=c++11 not allowed with C/ObjC 
pkharchenko commented 7 years ago

Oh, that was actually a mistake in Makevars.in. The c++11 flag should be only for C++. I've just checked in a fix. Please try.

abdeltoure commented 6 years ago

Hi, I tried it and I still have the same error

muhammed-ali commented 6 years ago

I am on linux server and getting the following error: bed2vector.cpp(2530): error: "hash" is ambiguous hash_map<string, int, hash,equal_to >::const_iterator li=cind_map.find(chr); compilation aborted for bed2vector.cpp (code 2) /opt/apps/resif/data/production/v0.3-20170713/default/software/lang/R/3.4.0-intel-2017a-X11-20170314-bare/lib64/R/etc/Makeconf:168: recipe for target 'bed2vector.o' failed make: *** [bed2vector.o] Error 2 ERROR: compilation failed for package ‘spp’

The fix by @daler did not work as well. Any suggestions please?

fferrari commented 6 years ago

@muhammed-ali could you try the version in the development branch? https://github.com/hms-dbmi/spp/tree/development Do you get the same error?

muhammed-ali commented 6 years ago

@fferrari I was able to install the latest spp package from https://github.com/hms-dbmi/spp/archive/1.15.2.tar.gz