Comments (2)
Thanks for posting this @Destranix.
We typically use the blt_append_custom_compiler_flag()
macro to set flags for a specific compiler family, e.g. MSVC
and MSVC_INTEL
on Windows. Are these providing the wrong flags somewhere?
A specific example/reproducer would help us better understand the problem.
E.g. which flags are wrong?
Can you please provide more information about the errors that you're seeing and/or the desired behavior?
The following links might be helpful:
- API documentation for
blt_append_custom_compiler_flag
:
https://llnl-blt.readthedocs.io/en/develop/api/utility.html#blt-append-custom-compiler-flag - Code that checks for different compiler families on Windows:
blt/cmake/SetupCompilerOptions.cmake
Lines 19 to 25 in 8c22999
from blt.
"Are these providing the wrong flags somewhere?"
Yes. Compiling e.g. SAMRAI I got a "/Wextra"-Flag and others.
"A specific example/reproducer would help us better understand the problem."
Here a Build-File I used (Please note, that some platformspecific settings, especially the path, have to be adjusted):
@echo off
setlocal
cd /d %~dp0
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set arch_command_length=32 || set arch_command_length=64
echo "%PROCESSOR_ARCHITECTURE%" | find /i "arm" > NUL && goto ARM || goto AMD
:ARM
IF %arch_command_length% == 32 (
set arch_string=x86_arm
set arch_command_length_string=x86
) ELSE (
set arch_string=amd64_arm64
set arch_command_length_string=x64
)
goto VC_VARC_INIT
:AMD
IF %arch_command_length% == 32 (
set arch_string=x86
set arch_command_length_string=x86
) ELSE (
set arch_string=amd64
set arch_command_length_string=x64
)
goto VC_VARC_INIT
:VC_VARC_INIT
call vcvarsall.bat %arch_string% -vcvars_ver=
call D:\My_Programs\Fortran\setvars.bat
set compiler_path=%VCToolsInstallDir%\bin\Host%arch_command_length_string%\%arch_command_length_string%\cl.exe
set linker_path=%VCToolsInstallDir%\bin\Host%arch_command_length_string%\%arch_command_length_string%\link.exe
set archiver_path=%VCToolsInstallDir%\bin\Host%arch_command_length_string%\%arch_command_length_string%\lib.exe
call "%DevEnvDir%\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DENABLE_TOOLS=ON -DENABLE_OPENMP=ON -DCMAKE_AR:FILEPATH="%archiver_path%" -DCMAKE_LINKER:FILEPATH="%linker_path%" -DCMAKE_INSTALL_PREFIX:PATH="%CD%\out\install" -DCMAKE_CXX_COMPILER:FILEPATH="%compiler_path%" -DCMAKE_C_COMPILER:FILEPATH="%compiler_path%" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_MAKE_PROGRAM="%DevEnvDir%\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "D:\Destranix\Documents\00Uni\Simulation\SAMARAI-Builds\SAMRAI"
call "%DevEnvDir%\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" --build . --config Release
"Can you please provide more information about the errors that you're seeing and/or the desired behavior?"
Telling me, that the flag "/Wextra" is unkown and throwing an error, failing to compile.
I worked around the Issue by checking for compiler ID "MSVC" and setting the "COMPILER_FAMILY_IS_MSVC" flag accordingly.
from blt.
Related Issues (20)
- check to defend against bad linker flags?
- Do we still need CMP0076 set to old?
- Wrong compile flags passed to nvcc by gtest
- Missing include
- BLT_CXX_STD checks should work like standard cmake if
- Issue with dependency propagation for object libraries
- Error when blt_add_code_checks calls blt_add_yapf_target HOT 1
- `CUDA_SEPARABLE_COMPILATION` should just be removed HOT 1
- Internal test checking for c++1X but not c++2X
- Add new Quartz host-configs for gcc and clang
- blt_add_benchmark should take CONFIGURATIONS and OMP_NUM_THREADS arguments HOT 4
- BLT v0.5.3 has some build errors related to googletest HOT 7
- Create tutorial for static analysis and friends
- Modify behavior of `blt_list_append` ?
- CMake Install Logic Checklist
- bug: setting ENABLE_CLANG_CUDA and BLT_CXX_STD=c++17 causes error
- Missing case in `blt_patch_target` and `blt_determine_scope`
- C test enabled without checking if C is an enabled language
- Compiler error with gcc+hip
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 blt.