3dem / relion

Image-processing software for cryo-electron microscopy
https://relion.readthedocs.io/en/latest/
GNU General Public License v2.0
444 stars 197 forks source link

Cannot make on xubuntu 17.10 #318

Closed shintaroaibara closed 3 years ago

shintaroaibara commented 6 years ago

Dear Devs,

I am having issues building in the latest xubuntu 17.10 kernel version 4.14.0-041400 I am using GCC/G++ version 4.8, CUDA8.0 and openmpi 3.0.0 all which are in my path correctly

cmake ../ finishes as expected, however make gives this kind of error:

[ 2%] Building NVCC (Device) object src/apps/CMakeFiles/relion_gpu_util.dir//gpu_utils/relion_gpu_util_generated_cuda_autopicker.cu.o /home/szhang/software/relion/relion/src/rwMRC.h(371): error: namespace "std" has no member "isfinite" detected during: instantiation of "void Image::_write(const FileName &, fImageHandler &, long, __nv_bool, int) [with T=double]" /home/szhang/software/relion/relion/src/image.h(409): here instantiation of "void Image::write(FileName, long, nv_bool, int) [with T=double]"

eriklindahl commented 6 years ago

HI Shintaro,

gcc-4.8 is a pretty old compiler (first released in 2013), and it might not support C++11.

As far as I know, even Ubuntu-16.04 comes with gcc-5.4 as the default, so I'm not sure why you have such an old compiler on 17.10?

Cheers,

Erik

On Mon, Dec 4, 2017 at 10:58 PM, shintaroaibara notifications@github.com wrote:

Dear Devs,

I am having issues building in the latest xubuntu 17.10 kernel version 4.14.0-041400 I am using GCC/G++ version 4.8, CUDA8.0 and openmpi 3.0.0 all which are in my path correctly

cmake ../ finishes as expected, however make gives this kind of error:

[ 2%] Building NVCC (Device) object src/apps/CMakeFiles/relion_ gpu_util.dir//gpu_utils/relion_gpu_util_generated_cuda_autopicker.cu.o /home/szhang/software/relion/relion/src/rwMRC.h(371): error: namespace "std" has no member "isfinite" detected during: instantiation of "void Image::_write(const FileName &, fImageHandler &, long, __nv_bool, int) [with T=double]" /home/szhang/software/relion/relion/src/image.h(409): here instantiation of "void Image::write(FileName, long, nv_bool, int) [with T=double]"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/3dem/relion/issues/318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFpemtEh5ch8_rgiliDmTJZjbWMdaI9ks5s9GsjgaJpZM4Q1Yxh .

-- Erik Lindahl erik.lindahl@dbb.su.se Professor of Biophysics, Dept. Biochemistry & Biophysics, Stockholm University Science for Life Laboratory, Box 1031, 17121 Solna, Sweden

shintaroaibara commented 6 years ago

Hi Erik

The default gcc on 17.10 was 7.x.x which wasn't allowed. and 4.8 is what I used on 16.04 with another issue (which Bjorn resolved by suggesting to use 4.8) so I thought I'd stick to it.

is there a version I should use?

Best wishes Shintaro

On 5 Dec 2017 00:17, "Erik Lindahl" notifications@github.com wrote:

HI Shintaro,

gcc-4.8 is a pretty old compiler (first released in 2013), and it might not support C++11.

As far as I know, even Ubuntu-16.04 comes with gcc-5.4 as the default, so I'm not sure why you have such an old compiler on 17.10?

Cheers,

Erik

On Mon, Dec 4, 2017 at 10:58 PM, shintaroaibara notifications@github.com wrote:

Dear Devs,

I am having issues building in the latest xubuntu 17.10 kernel version 4.14.0-041400 I am using GCC/G++ version 4.8, CUDA8.0 and openmpi 3.0.0 all which are in my path correctly

cmake ../ finishes as expected, however make gives this kind of error:

[ 2%] Building NVCC (Device) object src/apps/CMakeFiles/relion_ gpu_util.dir//gpu_utils/relion_gpu_util_generated_cuda_autopicker.cu.o /home/szhang/software/relion/relion/src/rwMRC.h(371): error: namespace "std" has no member "isfinite" detected during: instantiation of "void Image::_write(const FileName &, fImageHandler &, long, __nv_bool, int) [with T=double]" /home/szhang/software/relion/relion/src/image.h(409): here instantiation of "void Image::write(FileName, long, nv_bool, int) [with T=double]"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/3dem/relion/issues/318, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFpemtEh5ch8_ rgiliDmTJZjbWMdaI9ks5s9GsjgaJpZM4Q1Yxh .

-- Erik Lindahl erik.lindahl@dbb.su.se Professor of Biophysics, Dept. Biochemistry & Biophysics, Stockholm University Science for Life Laboratory, Box 1031, 17121 Solna, Sweden

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/3dem/relion/issues/318#issuecomment-349139305, or mute the thread https://github.com/notifications/unsubscribe-auth/Agqp2TPOVAdtJNc2i_jhuEfPy5sD2sbyks5s9H1LgaJpZM4Q1Yxh .

bforsbe commented 6 years ago

You should find that the reported line (src/image.h:409) contains a call to isfinite(). Could you try the workaround to add this line before that call?

using namespace std;

You might get the same error reported on a new line, but it should be a workaround for now.

quoquaque commented 6 years ago

Same error as reported by @shintaroaibara here: RELION-2.1.0 on Ubuntu 17.10, kernel 4.13.0-21-generic, g++ 7.2.0-8ubuntu3, cmake 3.9.1, CUDA 8.0, libopenmpi-dev 2.1.1-6 Workaround: simply edit the makro in line 40 relion/src/rwMRC.h from #define SAFESET(var, value) ( var = (std::isfinite(value)) ? value : var ) to #define SAFESET(var, value) ( var = (__builtin_isfinite((float)value)) ? value : var ).

A similar second error occurred: relion/src/ml_optimiser.cpp:6151:43: error: ‘__builtin_isnan’ is not a member of ‘std’ if (exp_thisparticle_sumweight == 0. || std::isnan(exp_thisparticle_sumweight)) As suggested here https://github.com/voidlinux/void-packages/issues/7324 the build works after adding #define _GLIBCXX11_USE_C99_MATH 1 in /usr/include/c++/6.3/x86_64-unknown-linux-gnu/bits/c++config.h.

@bforsbe - thank you for your effort with relion...

bforsbe commented 6 years ago

I think you have a legitimate workaround, but I would still recommend to adhere to the supported combination of compilers and tools. CUDA 8.0 supports at most gcc 5.3 (on ubuntu 16.04) or even gcc 4.8.2 (on ubuntu 14.04). There are no specs from NVIDIA on cuda 8 on 17.04, but you should either;

  1. Downgrade gcc to at least 5.3
  2. Upgrade to CUDA 9 and still downgrade gcc to at least 6.3

Summary gcc 7 is a no-go. We're working on it, but not intensely, because there's not even native CUDA-support for it at any level. You might be able to compile it at some point, but there's no guarantee that the combination of toolkit and compilers hasn't invented an illegal combination that crashes at some (undefined/unpredictable) point.