Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build step for ICPC #3229

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,15 @@ jobs:
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: cmake --build build --target ci_cuda_example

ci_icpc:
runs-on: ubuntu-latest
container: ghcr.io/nlohmann/json-ci:v2.2.0
steps:
- uses: actions/checkout@v2
- name: cmake
run: cmake -S . -B build -DJSON_CI=On
- name: build
run: >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest using the literal style block scalar | over the flow style one > for multiline commands:

        run: |
          . /opt/intel/oneapi/setvars.sh
          cmake --build build --target ci_icpc

. /opt/intel/oneapi/setvars.sh ;
cmake --build build --target ci_icpc
16 changes: 16 additions & 0 deletions cmake/ci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,22 @@ add_custom_target(ci_cuda_example
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_cuda_example
)

###############################################################################
# Intel C++ Compiler
###############################################################################

add_custom_target(ci_icpc
COMMAND ${CMAKE_COMMAND}
-DCMAKE_BUILD_TYPE=Debug -GNinja
-DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc
-DCMAKE_CXX_FLAGS="-DJSON_HAS_FILESYSTEM=0 -DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0"
Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears as -DJSON_HAS_FILESYSTEM=0\ -DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0 on the commandline and results in:

/__w/json/json/single_include/nlohmann/json.hpp(4116): error: this operator is not allowed in a constant expression
  #elif JSON_HAS_FILESYSTEM

Remove? Don't know why <filesystem> detection was an issue on ICPC but might have been fixed by now?
Edit: Remove. Works (almost; see below) without.

-DJSON_BuildTests=ON -DJSON_FastTests=ON
-S${PROJECT_SOURCE_DIR} -B${PROJECT_BINARY_DIR}/build_icpc
COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR}/build_icpc
COMMAND cd ${PROJECT_BINARY_DIR}/build_icpc && ${CMAKE_CTEST_COMMAND} --parallel ${N} --exclude-regex "test-unicode" --output-on-failure
COMMENT "Compile and test with ICPC"
)

###############################################################################
# Clean up all generated files.
###############################################################################
Expand Down
3 changes: 3 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ target_compile_options(test_main PUBLIC
# https://github.com/nlohmann/json/issues/1114
$<$<CXX_COMPILER_ID:MSVC>:/bigobj> $<$<BOOL:${MINGW}>:-Wa,-mbig-obj>

# https://github.com/nlohmann/json/pull/3229
$<$<CXX_COMPILER_ID:Intel>:-diag-disable=2196>
Copy link
Contributor

@falbrechtskirchinger falbrechtskirchinger May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need a version check. It's -wd2196 for older versions but I'm not familiar with ICPC, so I don't know since when the new flag is available. 🤷‍♂️

Also, 1786 to suppress deprecation warnings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a version number in the documentation.


$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal>
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
)
Expand Down