Skip to content
Snippets Groups Projects
Verified Commit f59f35c7 authored by Tadej Novak's avatar Tadej Novak
Browse files

Add IDE / VS Code helpers

parent 702c5ad8
No related branches found
No related tags found
No related merge requests found
......@@ -13,13 +13,14 @@
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"git.path": "/opt/rh/sclo-git25/root/usr/bin/git",
"python.envFile": "/workspaces/build/env.txt",
"python.envFile": "${workspaceFolder}/../build/env.txt",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--select=ATL,F,E7,E9,W6",
"--enable-extension=ATL902"
"--select=ATL,F,E101,E7,E9,W6",
"--ignore=ATL238,ATL9,E701,E702,E704,E741",
"--enable-extensions=ATL902"
]
},
......
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
message( STATUS "Preparing IDE helpers" )
# singularity settings
set( ATLAS_SINGULARITY_IMAGE "" CACHE PATH
"Use singularity wrapper" )
set( ATLAS_SINGULARITY_ARGS "" CACHE STRING
"Singularity weapper args" )
# Common prefix
set( ATLAS_IDE_PREFIX "${CMAKE_BINARY_DIR}/ide_" )
# Dump python environment variables
set( ATLAS_DUMP_ENV_FILE "${CMAKE_BINARY_DIR}/env.txt" CACHE FILEPATH
"File containing dump of environment variables" )
if( ATLAS_DUMP_ENV_FILE )
execute_process(
COMMAND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh" printenv
COMMAND grep -w ^PYTHONPATH
OUTPUT_FILE "${ATLAS_DUMP_ENV_FILE}" )
endif()
# compiler
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CXX_COMPILER}" "${ATLAS_IDE_PREFIX}compiler"
OUTPUT_FILE "${ATLAS_IDE_PREFIX}compiler" )
# python
find_package( Python COMPONENTS Interpreter )
execute_process(
COMMAND ${CMAKE_COMMAND} -E create_symlink "${Python_EXECUTABLE}" "${ATLAS_IDE_PREFIX}python"
OUTPUT_FILE "${ATLAS_IDE_PREFIX}python" )
# flake8 wrapper
configure_file( "${CMAKE_CURRENT_LIST_DIR}/flake8_wrapper.sh.in" "${ATLAS_IDE_PREFIX}flake8" @ONLY )
# gdb wrappers
configure_file( "${CMAKE_CURRENT_LIST_DIR}/gdb_wrapper.sh.in" "${ATLAS_IDE_PREFIX}gdb_wrapper" @ONLY )
if( ATLAS_SINGULARITY_IMAGE )
configure_file( "${CMAKE_CURRENT_LIST_DIR}/gdb_runner_singularity.sh.in" "${ATLAS_IDE_PREFIX}gdb_runner" @ONLY )
else()
configure_file( "${CMAKE_CURRENT_LIST_DIR}/gdb_runner_plain.sh.in" "${ATLAS_IDE_PREFIX}gdb_runner" @ONLY )
endif()
#!/bin/bash
"@CMAKE_BINARY_DIR@@CMAKE_FILES_DIRECTORY@/atlas_build_run.sh" "@Python_EXECUTABLE@" -m flake8 "$@"
#!/bin/bash
echo "Running GDB wrapper at '@ATLAS_IDE_PREFIX@gdb_wrapper'"
echo
"@ATLAS_IDE_PREFIX@gdb_wrapper" "$@"
#!/bin/bash
echo "Using singularity 'singularity exec @ATLAS_SINGULARITY_ARGS@ \"@ATLAS_SINGULARITY_IMAGE@\"'"
echo "Running GDB wrapper at '@ATLAS_IDE_PREFIX@gdb_wrapper'"
echo
singularity exec @ATLAS_SINGULARITY_ARGS@ "@ATLAS_SINGULARITY_IMAGE@" "/bin/bash" "@ATLAS_IDE_PREFIX@gdb_wrapper" "$@"
#!/bin/bash
args=("$@")
set --
export ATLAS_LOCAL_ROOT_BASE="/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase"
source "${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh"
echo
binary_dir="@CMAKE_BINARY_DIR@"
pushd "${binary_dir}" || exit
asetup --restore
source "@ATLAS_PLATFORM@/setup.sh"
popd || exit
echo
echo "Running gdb with args '${args[*]}'"
gdb "${args[@]}"
......@@ -6,7 +6,7 @@
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "${env:CXX}",
"compilerPath": "${workspaceFolder}/../build/ide_compiler",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
......
{
"remote.SSH.defaultExtensions": [
"ms-vscode.cpptools",
"ms-python.python",
"twxs.cmake"
],
"remote.SSH.lockfilesInTmp": true,
"gitlab.instanceUrl": "https://gitlab.cern.ch"
"gitlab.instanceUrl": "https://gitlab.cern.ch",
"python.pythonPath": "${workspaceFolder}/../build/ide_python",
"python.envFile": "${workspaceFolder}/../build/env.txt",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "${workspaceFolder}/../build/ide_flake8",
"python.linting.flake8Args": [
"--select=ATL,F,E101,E7,E9,W6",
"--ignore=ATL238,ATL9,E701,E702,E704,E741",
"--enable-extensions=ATL902"
]
}
......@@ -110,16 +110,11 @@ lcg_generate_env( SH_FILE ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh )
install( FILES ${CMAKE_BINARY_DIR}/${ATLAS_PLATFORM}/env_setup.sh
DESTINATION . )
# Dump some environment variables for IDE use:
set( CMAKE_DUMP_ENV_FILE ${CMAKE_BINARY_DIR}/env.txt CACHE FILEPATH
"File containing dump of environment variables" )
if( CMAKE_DUMP_ENV_FILE )
execute_process(
COMMAND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/atlas_build_run.sh printenv
COMMAND grep -w ^PYTHONPATH
OUTPUT_FILE "${CMAKE_DUMP_ENV_FILE}" )
endif()
# Setup IDE integration:
set( ATLAS_IDEHELPERSCRIPTS_SETUP
"${CMAKE_SOURCE_DIR}/../../.vscode/IDEHelperScripts/Setup.cmake"
CACHE FILEPATH "Setup file for the IDE / VS Code helpers" )
include( "${ATLAS_IDEHELPERSCRIPTS_SETUP}" OPTIONAL )
# Set up CPack:
atlas_cpack_setup()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment