Jellyfish icon indicating copy to clipboard operation
Jellyfish copied to clipboard

Error in config due to swig

Open muppetjones opened this issue 9 years ago • 4 comments

I'm trying to use Jellyfish on a system where I can't mess with the system, so I'm trying to do a local installation. Unfortunately, the following configure call fails:

$ ./configure --prefix=/path/local --enable-python-binding=/path/local/lib/python3.4
...
configure: creating ./config.status
config.status: creating Makefile
config.status: creating tests/compat.sh
config.status: creating jellyfish-2.0.pc
config.status: error: cannot find input file: `swig/Makefile.in'

Just for the fun of it, I tried --enable-swig:

checking for swig... /usr/bin/swig
checking SWIG version... 1.3.29
configure: WARNING: SWIG version >= 3.0.0 is required.  You have 1.3.29.
configure: error: SWIG version 3 is required

So, I modified configure to prevent it (faster and easier than trying to figure out which swig conditional was failing):

# Enable compilation of SWIG and bindings
# Added empty assignment to prevent making swig [~line16560]
maybe_swig=
MAYBE_SWIG=$maybe_swig

if test -n "$maybe_swig"; then :
  ac_config_files="$ac_config_files swig/Makefile"
fi

which works fine:

...
config.status: creating Makefile
config.status: creating tests/compat.sh
config.status: creating jellyfish-2.0.pc
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Thanks!

muppetjones avatar Jul 22 '15 15:07 muppetjones

I am not sure I understand what the error is. If you work from the git tree, you must have SWIG (version 3 or higher) installed to compile the script bindings, and enable it. Like so:

./configure --enable-swig --enable-python-binding ...

If you are working from the release tarball, then you do not need to have SWIG installed as the generated code is already included in the tarball. So this will work:

./configure --enable-python-binding ...

The distinction on the need to have SWIG installed between the git tree and the release tarball is similar to the requirements to have yaggo installed, or autoconf/automake installed.

Given this, what is the error? Is it the fact that it requires SWIG version at least 3.0.0? Maybe older version would work as well, but at some point in time I switch to newer version to avoid some problems (maybe with C++11?). I don't remember what was the issue now.

gmarcais avatar Jul 22 '15 15:07 gmarcais

This is installing from the tarball.

However, after other Jellyfish related errors (I'm not yet sure if Jellyfish is causing them or a misuse of Jellyfish by kSNP), I decided to try installing from git again.

So, I installed local versions of more recent autotools, yaggo, and swig (the latter was a huge nuisance). Unfortunately, I'm getting the following errors (first with swig, then without):

[18:39:00 666] $ ./configure --prefix=/path/local --enable-python-binding --enable-perl-binding --enable-swig
...
[18:39:13 667] $ make
make  all-recursive
make[1]: Entering directory `/path/local/build/Jellyfish'
Making all in .
make[2]: Entering directory `/path/local/build/Jellyfish'
make[2]: Leaving directory `/path/local/build/Jellyfish'
Making all in swig
make[2]: Entering directory `/path/local/build/Jellyfish/swig'
  SWIG     python/swig_wrap.cpp
  SWIG     perl5/swig_wrap.cpp
make  all-am
make[3]: Entering directory `/path/local/build/Jellyfish/swig'
  CXX      perl5/perl5_jellyfish_la-swig_wrap.lo
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
In file included from ../include/jellyfish/bloom_counter2.hpp:25:0,
                 from ../include/jellyfish/mer_dna_bloom_counter.hpp:21,
                 from perl5/swig_wrap.cpp:1589:
../include/jellyfish/mapped_file.hpp:134:23: error: expected ‘)’ before ‘(’ token
../include/jellyfish/mapped_file.hpp:134:23: error: expected ‘;’ before ‘(’ token
../include/jellyfish/mapped_file.hpp:138:3: error: expected ‘;’ before ‘const’
make[3]: *** [perl5/perl5_jellyfish_la-swig_wrap.lo] Error 1
make[3]: Leaving directory `/path/local/build/Jellyfish/swig'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/path/local/build/Jellyfish/swig'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/path/local/build/Jellyfish'
make: *** [all] Error 2
[18:39:22 668] $ ./configure --prefix=/path/local --enable-python-binding --enable-perl-binding
...
[18:39:54 669] $ make
make  all-recursive
make[1]: Entering directory `/path/local/build/Jellyfish'
Making all in .
make[2]: Entering directory `/path/local/build/Jellyfish'
make[2]: Leaving directory `/path/local/build/Jellyfish'
Making all in swig
make[2]: Entering directory `/path/local/build/Jellyfish/swig'
make  all-am
make[3]: Entering directory `/path/local/build/Jellyfish/swig'
  CXX      perl5/perl5_jellyfish_la-swig_wrap.lo
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
In file included from ../include/jellyfish/bloom_counter2.hpp:25:0,
                 from ../include/jellyfish/mer_dna_bloom_counter.hpp:21,
                 from perl5/swig_wrap.cpp:1589:
../include/jellyfish/mapped_file.hpp:134:23: error: expected ‘)’ before ‘(’ token
../include/jellyfish/mapped_file.hpp:134:23: error: expected ‘;’ before ‘(’ token
../include/jellyfish/mapped_file.hpp:138:3: error: expected ‘;’ before ‘const’
make[3]: *** [perl5/perl5_jellyfish_la-swig_wrap.lo] Error 1
make[3]: Leaving directory `/path/local/build/Jellyfish/swig'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/path/local/build/Jellyfish/swig'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/path/local/build/Jellyfish'
make: *** [all] Error 2

Perhaps it's because you're using C++11? I can see if I can install gcc 4.8 and get things working.

Would you mind updating the requirements to state the versions, i.e., automake 1.15?

muppetjones avatar Jul 24 '15 23:07 muppetjones

Perl defines a lot of constants which have the potential to interact badly with other piece of software, in particular the C++ standard library. The documentation advised to use GCC 4.4 to compile the perl binding.

I recently fixed such a problem. If you pull the develop branch, it should compile with gcc 4.8 and 4.9. Please let me know if it works for you.

gmarcais avatar Jul 27 '15 15:07 gmarcais

I am currently using gcc 4.5.4. I haven't had a chance to try 4.8 yet, but I will soon.

muppetjones avatar Jul 27 '15 20:07 muppetjones