Re: Help with new version of iqtree needed

2016-03-10 Thread Gert Wollny
Hi Andreas, 

I've update the sse3 patch to not enable sse3 and not define __SSE3,
and added an sse2 code path to emulate the _mm_hadd_pd instruction
where needed. 

It compiles, and the alignment sequence test reports the same "failures
"and "passed" like the completely unpatched version.

However, later I get errors like: 

  ERROR: Checkpoint (example.phy.ckp.gz) indicates that a previous run 
  successfully finished
  Use `-redo` option if you really want to redo the analysis and 
  overwrite all output files.
  Command exited with non-zero status 2

with and without patching the code. 

best, 
Gert



Re: Help with new version of iqtree needed

2016-03-10 Thread Gert Wollny
Hello, 


> _mm_hadd_pd is a sse3 intrinsic so you have to pass -msse3 to allow
> GCC to use it. However, this will cause a SIGILL on any amd64/i386
> processor without sse3 so instead the code should be replaced with
> something more portable.

Actually, the compile command defines -D__SSE3, and the according
headers are only included if this define is set. 

I've tried to add a patch that removes the according tests in the
CMakeLists.txt, but then I got 

/home/gerddie/debian-med/iqtree/phylokernel.h:19:2: error: 
   #error "You must compile with SSE3 enabled!"

within a function that does a so called horizontal add. 

I'll think of a patch to emulate the according code with sse2
instructions. 

Best, 
Gert 




Re: Help with new version of iqtree needed

2016-03-10 Thread Andreas Tille
Hi James,

thanks for the fast response:

On Thu, Mar 10, 2016 at 01:49:23PM +, James Cowgill wrote:
> On Thu, 2016-03-10 at 14:39 +0100, Andreas Tille wrote:
> > Hi,
> > 
> > I#m facing a C++ problem with the new version of iqtree.  If I build the
> > current state in Git[1] I get:
> > 
> > ...
> > [  7%] Building C object pll/CMakeFiles/pll.dir/evaluateGenericSpecial.c.o
> > cd /build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu/pll && /usr/bin/cc  
> > -DIQ_TREE -D_USE_PTHREADS -D__SSE3 -I/build/iqtree-1.4.0+dfsg 
> > -I/build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu  -g -O2 
> > -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
> > -D_FORTIFY_SOURCE=2  -pthread-o 
> > CMakeFiles/pll.dir/evaluateGenericSpecial.c.o   -c 
> > /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c
> > In file included from 
> > /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:46:0:
> > /build/iqtree-1.4.0+dfsg/pll/pllInternal.h:150:30: warning: inline function 
> > 'bitcount_64_bit' declared but never defined
> >  extern __inline unsigned int bitcount_64_bit(uint64_t i);
> >   ^
> > In file included from /build/iqtree-1.4.0+dfsg/pll/pll.h:79:0,
> >  from /build/iqtree-1.4.0+dfsg/pll/mem_alloc.h:16,
> >  from 
> > /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:31:
> > /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c: In function 
> > 'evaluateGTRCATPROT':
> > /usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h:86:1: error: inlining 
> > failed in call to always_inline '_mm_hadd_pd': target specific option 
> > mismatch
> >  _mm_hadd_pd (__m128d __X, __m128d __Y)
> >  ^
> 
> _mm_hadd_pd is a sse3 intrinsic so you have to pass -msse3 to allow GCC
> to use it. However, this will cause a SIGILL on any amd64/i386
> processor without sse3 so instead the code should be replaced with
> something more portable.

Since I have no idea about SSE my attempt to fix #813436 obviously
triggered this problem.  I admit I have no idea how to deal with this
sensibly.

Kind regards

 Andreas.


-- 
http://fam-tille.de



Re: Help with new version of iqtree needed

2016-03-10 Thread James Cowgill
On Thu, 2016-03-10 at 14:39 +0100, Andreas Tille wrote:
> Hi,
> 
> I#m facing a C++ problem with the new version of iqtree.  If I build the
> current state in Git[1] I get:
> 
> ...
> [  7%] Building C object pll/CMakeFiles/pll.dir/evaluateGenericSpecial.c.o
> cd /build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu/pll && /usr/bin/cc  
> -DIQ_TREE -D_USE_PTHREADS -D__SSE3 -I/build/iqtree-1.4.0+dfsg 
> -I/build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu  -g -O2 
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
> -D_FORTIFY_SOURCE=2  -pthread-o 
> CMakeFiles/pll.dir/evaluateGenericSpecial.c.o   -c 
> /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c
> In file included from 
> /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:46:0:
> /build/iqtree-1.4.0+dfsg/pll/pllInternal.h:150:30: warning: inline function 
> 'bitcount_64_bit' declared but never defined
>  extern __inline unsigned int bitcount_64_bit(uint64_t i);
>   ^
> In file included from /build/iqtree-1.4.0+dfsg/pll/pll.h:79:0,
>  from /build/iqtree-1.4.0+dfsg/pll/mem_alloc.h:16,
>  from 
> /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:31:
> /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c: In function 
> 'evaluateGTRCATPROT':
> /usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h:86:1: error: inlining 
> failed in call to always_inline '_mm_hadd_pd': target specific option mismatch
>  _mm_hadd_pd (__m128d __X, __m128d __Y)
>  ^

_mm_hadd_pd is a sse3 intrinsic so you have to pass -msse3 to allow GCC
to use it. However, this will cause a SIGILL on any amd64/i386
processor without sse3 so instead the code should be replaced with
something more portable.

James

signature.asc
Description: This is a digitally signed message part


Help with new version of iqtree needed

2016-03-10 Thread Andreas Tille
Hi,

I#m facing a C++ problem with the new version of iqtree.  If I build the
current state in Git[1] I get:

...
[  7%] Building C object pll/CMakeFiles/pll.dir/evaluateGenericSpecial.c.o
cd /build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu/pll && /usr/bin/cc  -DIQ_TREE 
-D_USE_PTHREADS -D__SSE3 -I/build/iqtree-1.4.0+dfsg 
-I/build/iqtree-1.4.0+dfsg/obj-x86_64-linux-gnu  -g -O2 
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
-D_FORTIFY_SOURCE=2  -pthread-o 
CMakeFiles/pll.dir/evaluateGenericSpecial.c.o   -c 
/build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c
In file included from 
/build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:46:0:
/build/iqtree-1.4.0+dfsg/pll/pllInternal.h:150:30: warning: inline function 
'bitcount_64_bit' declared but never defined
 extern __inline unsigned int bitcount_64_bit(uint64_t i);
  ^
In file included from /build/iqtree-1.4.0+dfsg/pll/pll.h:79:0,
 from /build/iqtree-1.4.0+dfsg/pll/mem_alloc.h:16,
 from /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:31:
/build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c: In function 
'evaluateGTRCATPROT':
/usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h:86:1: error: inlining 
failed in call to always_inline '_mm_hadd_pd': target specific option mismatch
 _mm_hadd_pd (__m128d __X, __m128d __Y)
 ^
/build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:2667:10: error: called 
from here
   tv = _mm_hadd_pd(tv, tv);
  ^
In file included from /build/iqtree-1.4.0+dfsg/pll/pll.h:79:0,
 from /build/iqtree-1.4.0+dfsg/pll/mem_alloc.h:16,
 from /build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:31:
/usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h:86:1: error: inlining 
failed in call to always_inline '_mm_hadd_pd': target specific option mismatch
 _mm_hadd_pd (__m128d __X, __m128d __Y)
 ^
/build/iqtree-1.4.0+dfsg/pll/evaluateGenericSpecial.c:2700:10: error: called 
from here
   tv = _mm_hadd_pd(tv, tv);
  ^
pll/CMakeFiles/pll.dir/build.make:113: recipe for target 
'pll/CMakeFiles/pll.dir/evaluateGenericSpecial.c.o' failed
...


Any hint how to fix this?

Kind regards

   Andreas.


[1] https://anonscm.debian.org/git/debian-med/iqtree.git

-- 
http://fam-tille.de