nagyistoce / sire

Automatically exported from code.google.com/p/sire
0 stars 0 forks source link

Compiling Error when compiling Sire corelib on Centos 6 #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Centos 6
2. Install dependencies 
3. Compiling the corelib of Sire

What is the expected output? What do you see instead?
A compiled corelib instead:

/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp:306: error:
ISO C++ forbids declaration of ‘__m128d’ with no type
/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp:306: error:
expected ‘,’ or ‘...’ before ‘&’ token
/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp: In function
‘QString toString(int)’:
/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp:308: error:
‘sseval’ was not declared in this scope
/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp: In member
function ‘void SireMM::GridFF::addToGrid(const
QVector<SireMM::GridFF::Vector4>&)’:
/home/georgeg/software/sire/corelib/src/libs/SireMM/gridff.cpp:525: warning:
comparison between signed and unsigned integer expressions

What version of the product are you using? 
From Julien's branch: Sire version 1786

Original issue reported on code.google.com by ggerogio...@gmail.com on 21 Mar 2013 at 2:05

GoogleCodeExporter commented 9 years ago
This looks like a problem with the SSE code. __m128d is an SSE intrinsic which 
should be defined in the header file "emmintrin.h". There is a test in the 
CMakeLists.txt in the top Sire directory that looks for emmintrin.h and, if it 
is available, it includes the file and turns on the SSE code (by adding the 
switch "-DSIRE_USE_SSE"). 

The switch makes sure that only code contained in sections "#ifdef 
SIRE_USE_SSE" to "#endif" is only compiled if SSE is available. Unfortunately, 
in the version of Julien's branch you are using, this switch is missing around 
the "toString" function on line 306. This was fixed in a later version of 
Julien's code (you are using 1786, while the top version is currently 1840). 
You can either update your code, or you can make the fix yourself. To do this, 
change the lines;

inline QString toString(const __m128d &sseval)
{
    return QString("{ %1, %2 }").arg(*((const double*)&sseval))   
                                .arg(*( ((const double*)&sseval) + 1));
}

to read

#ifdef SIRE_USE_SSE
inline QString toString(const __m128d &sseval)
{
    return QString("{ %1, %2 }").arg(*((const double*)&sseval))   
                                .arg(*( ((const double*)&sseval) + 1));
}
#endif

(this adds the "SIRE_USE_SSE" test around this code). This should fix all of 
the problems.

p.s. Which compiler are you using on which machine? It is strange that SSE has 
been disabled if you are using GCC on an x86 box.

Original comment by chryswo...@gmail.com on 3 Apr 2013 at 10:03

GoogleCodeExporter commented 9 years ago

Original comment by chryswo...@gmail.com on 3 Apr 2013 at 10:04

GoogleCodeExporter commented 9 years ago
Hi, I was using c++ compiler on centos 6 in both a VM on my xeon box and an
old pentium 4 box and still had the same error in both.

Original comment by ggerogio...@gmail.com on 3 Apr 2013 at 10:00