Sniff out 32/64 bit-ness of machines automatically
Sniff out 32/64 bit-ness of machines automatically to suitably set GMP_ARCH, SCOTCH_ARCH etc.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- 0.7.0
- Started by
- Harish Narayanan
- Completed by
- Harish Narayanan
Related branches
Related bugs
Sprints
Whiteboard
I have looked around and found on one list that uname -m can give false result in case we run 32 bit system on 64 bit machine.
On the other hand in the Board library I have found such check:
echo "Checking architecture"
cat > is64.c <<EOF
int main() {
unsigned long n = 0;
n = ~n;
return n == 0xFFFFFFFF;
}
EOF
cc -o is64 is64.c
if ./is64; then
CXX64FLAGS="-fPIC"
echo yes
else
CXX64FLAGS=""
echo no
fi
rm -f is64 is64.c
What about this check?
HN: Cool. This works on the few boxes I tested in, but I think I'd rather go with something uname. The reason is that uname is more likely to be on a target machine than a C compiler. And I don't want dorsal.sh to stall on first run because it doesn't find a compiler (which it is supposed to explain to users to install).
Let me think about this some more, though.