简体   繁体   中英

Error during compilation using make, problem with C++/Gnu version?

I am trying to compile a library. I used Cmake and it worked saying:

"LibraryName requires the language dialect "CXX17", but CMake does not know the compile flags to use to enable it.

After that I compiled using make :but it gives the following errors in output (while compiling some cpp files):

    cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C [enabled by default]

    env.hpp:10:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11 [enabled by default]
         enum class PlacementMethod {
        
    alltoallv.cpp:19:7: error: ‘AlltoallvMethod’ is not a class or namespace
           if (AlltoallvMethod::NONE == environment::alltoallv) {
        
    alltoallv.cpp:44:8: error: ‘AlltoallvMethod’ is not a class or namespace
           case AlltoallvMethod::AUTO: {
       
    alltoallv.cpp:43:10: warning: enumeration value ‘AUTO’ not handled in switch [-Wswitch-enum]
        
    make[2]: *** [CMakeFiles/tempi.dir/src/alltoallv.cpp.o] Error 1
    make[1]: *** [CMakeFiles/tempi.dir/all] Error 2
    make: *** [all] Error 2

How can I solve this?

I cannot modify my environment or use "sudo" command, because I'm working on a public cluster and I do not own those privileges.

CMake output:

../../cmake-3.21.1-linux-x86_64/bin/cmake ..
-- Build type: Release
-- GIT_REFSPEC=refs/heads/master
-- GIT_HASH=fe16ae7692da83e9cd247782f596a46a1d010699
-- GIT_LOCAL_CHANGES=DIRTY
-- MPI include dir: /opt/ohpc/pub/mpi/openmpi-gnu/1.10.7/include
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- -march=native detected
-- define TEMPI_ENABLE_KAHIP
-- OpenMP support detected
-- -march=native detected
-- nvToolsExt found: /hpc/share/tools/cuda/10.2.89/lib64/libnvToolsExt.so
-- nvidia-ml found: /hpc/share/tools/cuda/10.2.89/lib64/stubs/libnvidia-ml.so
-- Configuring done
CMake Error in CMakeLists.txt:
  Target "tempi" requires the language dialect "CXX17" , but CMake does not
  know the compile flags to use to enable it.


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

"alltoallv.cpp:19:7: error: 'AlltoallvMethod' is not a class or namespace", so please check here to find the reason.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM