SebWouters / CheMPS2

CheMPS2: a spin-adapted implementation of DMRG for ab initio quantum chemistry
GNU General Public License v2.0
68 stars 34 forks source link

-ipo flag isn't supported by clang #64

Closed yurivict closed 6 years ago

yurivict commented 6 years ago

It prints a lot of messages 'option not supported'.

SebWouters commented 6 years ago

Does the build crash due to the unsupported option by clang? If not, it's just a warning message from the compiler..

yurivict commented 6 years ago

There are a lot of warnings. You shouldn't be passing the flag when the compiler is clang.

SebWouters commented 6 years ago

I'm using

With this combination I indeed get:

clang: warning: argument unused during compilation: '-ipo' [-Wunused-command-line-argument]

The relevant lines on -ipo are master/CMakeLists.txt lines 82-85:

check_cxx_compiler_flag (-ipo HAS_IPO)
if (HAS_IPO)
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ipo")
endif()

On which the CMake v3.9 help (https://cmake.org/cmake/help/v3.9/module/CheckCXXCompilerFlag.html) notes the following:

The result only tells that the compiler does not give an error message when it encounters the flag. If the flag has any effect or even a specific one is beyond the scope of this module.

Please note that the CMake v3.10 help (https://cmake.org/cmake/help/v3.10/module/CheckCXXCompilerFlag.html) notes the following:

A positive result from this check indicates only that the compiler did not issue a diagnostic message when given the flag. Whether the flag has any effect or even a specific one is beyond the scope of this module.

@yurivict, which version of cmake are you using? If below 3.10.0-rc5, please upgrade to the latest CMake for resolving your issue.

SebWouters commented 6 years ago

@yurivict,

Thank you for the confirmation regarding "-flto".

Considering that the warning regarding the unused argument "-ipo" is merely a warning, and will resolve itself in time with cmake 3.10, do you consider that this issue can be closed?

Seb.