dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
41 stars 18 forks source link

Minor update of math_libs.cmake #263

Closed miroi closed 1 year ago

miroi commented 4 years ago

allow setting the -mkl flag only if a one of used compilers (Fortran, C or C++) is Intel

miroi commented 4 years ago

Hi Rado,

could you please check travis setting for gcc Xcode: xcode11 C++ , https://travis-ci.org/dev-cafe/autocmake/jobs/652387212?utm_medium=notification&utm_source=github_status ?

bast commented 4 years ago

CMAKE_C_COMPILER_ID MATCHES C seems wrong.

Also what will happen if you mix compiler vendors? In this case the if statement will work but it might still fail, right?

miroi commented 4 years ago

Ok, I fixed it.

If one mixes vendors, does not matter, because it is user's responsibility to ensure that -mkl flag goes to proper compiler in his project. Example: ifort+gcc+-mkl-flag in DIRAC.

bast commented 1 year ago

Shouldn't we leave this to users to set the mkl flag if it is meaningful? This looks to me like we are trying to fix a user-side mistake on the library side.

miroi commented 1 year ago

Shouldn't we leave this to users to set the mkl flag if it is meaningful? This looks to me like we are trying to fix a user-side mistake on the library side.

Now, 3 years after, I fully agree. Setting of the mkl library has to be on shoulders of user, based on https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html#gs.oie2q1 . MKL library develps, mkl links are changing, we can not catch all with autocmake.

bast commented 1 year ago

OK thanks for feedback and patience. Dropping this PR but I am trying to somehow revive/fix this autocmake library since a couple of codes are starting to complain.

miroi commented 1 year ago

because of variery of libraries (mk, acml, essl, openblas, atlas, gnu etc) the math_libs.cmake should be very minimalistic, just throwing info and warnings for users

bast commented 1 year ago

I agree