GithubHelp home page GithubHelp logo

Comments (12)

platipodium avatar platipodium commented on July 17, 2024 2
  1. I dislike the aesthetics as well, so we should get rid of the problem.
  2. It does create a real problem on some of my systems, where I have to sed '/-cpp/--preprocess/' CMaKeCache.txt. So the error message itself is helpful.

from schism.

platipodium avatar platipodium commented on July 17, 2024 1

So does it mean, it should pick up '--precpocess', '-cpp', '-fpp' based on the which fortran compiler it usues?

No, in theory, CMAKE should have settings for precompiled (CPP), C compiler (C/CXX) and fortran compiler. Whenever a compiler needs a preprocessor, it should use that one, compatible with PREPROCESS_FLAG. Unfortunately, most build systems seem to combine preprocess/build phase such that the compiler does also the precompiling ... At least that's how I perceive this (I may be wrong).

from schism.

platipodium avatar platipodium commented on July 17, 2024 1

Having a look at ./cmake/SCHISMCompile.cmake I see

if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "Intel")
    message(STATUS "DEBUG IS ${DEBUG}, SED IS ${USE_SED}, TVD_LIM IS ${TVD_LIM}")
    if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
         set ( CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2 /names:lowercase ${WIN_FORTRAN_OPTIONS}")
         set ( CMAKE_Fortran_FLAGS_DEBUG_INIT "/names:lowercase ${WIN_FORTRAN_OPTIONS}")
         set ( CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -debug inline_debug_info ${WIN_FORTRAN_OPTIONS}")
         set (CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT.lib;libifcoremt.lib ${WIN_LINKER_OPTIONS}")
         set( C_PREPROCESS_FLAG /cpp CACHE STRING "C Preprocessor Flag")
    else()
         set (SCHISM_INTEL_OPTIONS "-assume byterecl")
         set( CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2 ${SCHISM_INTEL_OPTIONS}")
         set( CMAKE_Fortran_FLAGS_DEBUG_INIT "-g ${SCHISM_INTEL_OPTIONS}")
         set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -debug inline_debug_info ${SCHISM_INTEL_OPTIONS}")
         set( C_PREPROCESS_FLAG -cpp CACHE STRING "C Preprocessor Flag")
    endif()

Penultimate line set( C_PREPROCESS_FLAG -cpp could probably deleted for this platform.... better than a post-hoc fix with switching off the diags.

from schism.

platipodium avatar platipodium commented on July 17, 2024

Same with clang:

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

from schism.

jamal919 avatar jamal919 commented on July 17, 2024

Same here. Update: with intel compilers.

from schism.

platipodium avatar platipodium commented on July 17, 2024

The problem is with clang needing --preprocess while gfortran needs -cpp . So when we do a regular compile based on gnu fortran and the system is autodetecting a C/CXX compiler for parmetis, it may select clang and hiccup at the -cpp option.

I have not yet found a solution to set CMAKE_PREPROCESS_FLAG dependent on Fortran vs C. There should be solution somewhere on the net...

from schism.

jamal919 avatar jamal919 commented on July 17, 2024

Thanks @platipodium for the clarification of these options. To add to my previous comment (now edited), I was using intel compilers. So does it mean, it should pick up '--precpocess', '-cpp', '-fpp' based on the which fortran compiler it usues?

I am not very used to CMAKE things. Could setting directory specific CFLAGS will work with cmake? (a discussion from 2011 is here - https://cmake.org/pipermail/cmake/2011-April/043703.html)

from schism.

platipodium avatar platipodium commented on July 17, 2024

.. so much for theory, I could not find and references to selecting CMAKE_CPP_PROCESSOR (or similar) in their documentation :=(

from schism.

jamal919 avatar jamal919 commented on July 17, 2024

Thanks again for the explanation of cmake behaviour (or the expected one). In your experience, did this cause any problem with building the exec/lib? I guess not, but the "bad" aesthetics of recurring error/warning does bother me too.

from schism.

zeekus avatar zeekus commented on July 17, 2024

Why not just tell icc to run like this ?

icc -no-cpp your_file.cpp -o your_output

If you are using MPIICC, you should be able to modify the wrapper to use different flags.

#CC="icc"
CC="/modeling/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.2.0/intel-oneapi-compilers-2022.1.0-wlkegy4fwz4gpx7joqmouc7uiiz4sg5b/compiler/2022.1.0/linux/bin/intel64/icc"
CFLAGS="-no-ccp"
LDFLAGS="-ldl"
MPILIBNAME="mpi"

from schism.

platipodium avatar platipodium commented on July 17, 2024

@zeekus the real problem are mixed gfortran/clang compilations where the C_PROPROCESS_FLAG is handled differently by the fortran (gcc) and C (clang) compiler frontend.

In principle, we could just not use the -cpp on intel systems, but somehow that has not worked for me, either.

from schism.

zeekus avatar zeekus commented on July 17, 2024

I put in "-no-cpp" as a flag it didn't work as expected, but the cflag of "-diag-disable=10006" will mute this noise. Note, these are just warning messages.

[ 80%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/wspace.c.o
icc: command line warning #10006: ignoring unknown option '-no-ccp'
icc: command line warning #10006: ignoring unknown option '-cpp'
icc: command line warning #10006: ignoring unknown option '-no-ccp'
icc: command line warning #10006: ignoring unknown option '-cpp'

Working solution.

#File: /opt/intel/mpi/2021.9.0/bin/mpiicc
CC="/modeling/spack/opt/spack/linux-centos7-skylake_avx512/gcc-9.2.0/intel-oneapi-compilers-2022.1.0-wlkegy4fwz4gpx7joqmouc7uiiz4sg5b/compiler/2022.1.0/linux/bin/intel64/icc"
CFLAGS="-diag-disable=10006"
LDFLAGS="-ldl"
MPILIBNAME="mpi"

Output:

[ 50%] Built target metis
[ 52%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/akwayfm.c.o
[ 52%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/ametis.c.o
[ 52%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/balancemylink.c.o
[ 54%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/comm.c.o
[ 54%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/csrmatch.c.o
[ 56%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/ctrl.c.o
[ 56%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/debug.c.o
[ 56%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/diffutil.c.o
[ 58%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/frename.c.o
[ 58%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/gkmetis.c.o
[ 60%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/gkmpi.c.o
[ 60%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/graph.c.o
[ 60%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/initbalance.c.o
[ 62%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/initmsection.c.o
[ 62%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/initpart.c.o
[ 64%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/kmetis.c.o
[ 64%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/kwayrefine.c.o
[ 64%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/match.c.o
[ 66%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/mdiffusion.c.o
[ 66%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/mesh.c.o
[ 66%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/mmetis.c.o
[ 68%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/move.c.o
[ 68%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/msetup.c.o
[ 70%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/node_refine.c.o
[ 70%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/ometis.c.o
[ 70%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/pspases.c.o
[ 72%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/redomylink.c.o
[ 72%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/remap.c.o
[ 74%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/renumber.c.o
[ 74%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/rmetis.c.o
[ 74%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/selectq.c.o
[ 76%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/serial.c.o
[ 76%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/stat.c.o
[ 78%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/timer.c.o
[ 78%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/util.c.o
[ 78%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/wave.c.o
[ 80%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/weird.c.o
[ 80%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/wspace.c.o
[ 80%] Building C object ParMetis-4.0.3/libparmetis/CMakeFiles/parmetis.dir/xyzpart.c.o
[ 82%] Linking C static library ../../lib/libparmetis.a

from schism.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.