LBEM-CH / focus

High Throughput Electron Microscopy Image Processing Software
http://www.focus-em.org
GNU General Public License v2.0
35 stars 14 forks source link

Compilation Error: Using '-std=c++11' on a C file #251

Open walidabualafia opened 2 months ago

walidabualafia commented 2 months ago

Hi all,

I'm trying to install focus on our cluster, but I keep erroring out with the following:

cc1: warning: command line option '-std=c++11' is valid for C++/ObjC++ but not for C
cc1: error: too many filenames given.  Type cc1 --help for usage
cc1: fatal error: CMakeFiles/byte_swap_map.dir/byte_swap_map.c.d: No such file or directory
compilation terminated.
make[2]: *** [kernel/mrc/source/CMakeFiles/byte_swap_map.dir/build.make:76: kernel/mrc/source/CMakeFiles/byte_swap_map.dir/byte_swap_map.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4846: kernel/mrc/source/CMakeFiles/byte_swap_map.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Build failed for Focus

Any idea why this is happening? I am using gcc 8.4.1 to compile this. I have qt5, cmake 3.27.3, CUDA 11.8, and libfftw in my environment.

Also, the No such file or directory is concerning me. I'm wondering if the latest release ships without this file, or if this is an intermediate file that is not generating correctly.

Anyway, all help is appreciated! :)

sthennin commented 2 months ago

Could it be that the file kernel/mrc/source/byte_swap_map.c is a C file but not a C++ file, and if you add the option -std=c++11, that is not valid for the C file? The file is there, in any case.

sthennin commented 2 months ago

Did you look at these? https://lbem-focus.epfl.ch/wiki/doku.php?id=1_0:movies

walidabualafia commented 2 months ago

@sthennin,

Thanks for your response. I am not adding the -std=c++11 myself. It seems that it is already in CMakeLists.txt. I am trying to compile as per the video here: https://lbem-focus.epfl.ch/wiki/doku.php?id=1_0:movies

I am wondering if it's an issue with my toolchain, so I'm rebuilding right now. I will keep you posted on what happens. :)

Thanks, Walid

walidabualafia commented 2 months ago

@sthennin,

I removed the option for -std=c++11 from CMakeLists.txt. I got 2% further.

[ 58%] Building C object kernel/mrc/source/CMakeFiles/byte_swap_map.dir/byte_swap_map.c.o
cc1: error: too many filenames given.  Type cc1 --help for usage
cc1: fatal error: CMakeFiles/byte_swap_map.dir/byte_swap_map.c.d: No such file or directory
compilation terminated.
make[2]: *** [kernel/mrc/source/CMakeFiles/byte_swap_map.dir/build.make:76: kernel/mrc/source/CMakeFiles/byte_swap_map.dir/byte_swap_map.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4846: kernel/mrc/source/CMakeFiles/byte_swap_map.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Build failed for Focus

Too many filenames given seems to be a hint. Do you know where in the CMakeLists.txt file this is getting invoked?

I'm on RHEL 8.8 / Linux64 / x86_64 arch

Thank you for your support! :smile:

walidabualafia commented 2 months ago

Hi @sthennin,

Any updates regarding this issue?

Thank you! :smile: