Comments (12)
- I dislike the aesthetics as well, so we should get rid of the problem.
- 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.
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.
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.
Same with clang:
clang: warning: argument unused during compilation: '-cpp' [-Wunused-command-line-argument]
from schism.
Same here. Update: with intel compilers.
from schism.
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.
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.
.. so much for theory, I could not find and references to selecting CMAKE_CPP_PROCESSOR (or similar) in their documentation :=(
from schism.
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.
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.
@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.
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)
- Error copying Fortran module "include/schism_glbl.mod" HOT 23
- Incorrect Pi value in read_output10_xyz.f90 HOT 2
- Help SCHISM-WWM III HOT 1
- Update ugrid conventions HOT 13
- Help - pschism seems to not able to find the hdf5 libraries and netcdf-c libraries. HOT 3
- General Info: how to run Pschism on AWS pcluster with Spack HOT 1
- Format overflow in staout HOT 1
- Issue Running with Sflux generated from HAFS HOT 10
- No rule to make target 'pschism' / BLD_STANDALONE HOT 5
- Exit code is zero even when simulator fails HOT 3
- Compile GOTM 3.2.5 HOT 2
- Updating variable names in hotstart.nc HOT 6
- latest version in git wants deprecated NetCDF-Fotran build (with f90) HOT 7
- set_mask error during compilation of SCHISM-FABMv2-(ECOSMO) HOT 6
- FABM/SCHISM: UNFULFILLED DEPENDENCY: downwelling_photosynthetic_radiative_flux HOT 6
- Error when run a 2D model with tidal elevation and velocity ( 23: ABORT: STEP: wetted cross section length on open bnd <=0; boundary ndx= 1 , length= 0.000000000000000E+000) HOT 3
- Support for the Intel 2024+ compilers
- Julian Date Calculation Imprecision Leads to Issues with Time Indices Slicing in the sflux_air_1.0001.nc File HOT 3
- Missing inverse barometer effect? HOT 3
- Initial timesteps results for a hotstart run HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from schism.