change to Linux

This commit is contained in:
liuyihui 2022-10-16 17:08:54 +08:00
parent ad5afe448d
commit ed29db3699
6 changed files with 225 additions and 226 deletions

View File

@ -1,212 +1,212 @@
--- ---
Language: Cpp Language: Cpp
# BasedOnStyle: Google # BasedOnStyle: Google
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignArrayOfStructures: None AlignArrayOfStructures: None
AlignConsecutiveMacros: None AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left AlignEscapedNewlines: Left
AlignOperands: Align AlignOperands: Align
AlignTrailingComments: true AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes AlwaysBreakTemplateDeclarations: Yes
AttributeMacros: AttributeMacros:
- __capability - __capability
BinPackArguments: true BinPackArguments: true
BinPackParameters: true BinPackParameters: true
BraceWrapping: BraceWrapping:
AfterCaseLabel: false AfterCaseLabel: false
AfterClass: false AfterClass: false
AfterControlStatement: Never AfterControlStatement: Never
AfterEnum: false AfterEnum: false
AfterFunction: false AfterFunction: false
AfterNamespace: false AfterNamespace: false
AfterObjCDeclaration: false AfterObjCDeclaration: false
AfterStruct: false AfterStruct: false
AfterUnion: false AfterUnion: false
AfterExternBlock: false AfterExternBlock: false
BeforeCatch: false BeforeCatch: false
BeforeElse: false BeforeElse: false
BeforeLambdaBody: false BeforeLambdaBody: false
BeforeWhile: false BeforeWhile: false
IndentBraces: false IndentBraces: false
SplitEmptyFunction: true SplitEmptyFunction: true
SplitEmptyRecord: true SplitEmptyRecord: true
SplitEmptyNamespace: true SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true BreakStringLiterals: true
ColumnLimit: 120 ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4 ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
Cpp11BracedListStyle: true Cpp11BracedListStyle: true
DeriveLineEnding: true DeriveLineEnding: true
DerivePointerAlignment: true DerivePointerAlignment: true
DisableFormat: false DisableFormat: false
EmptyLineAfterAccessModifier: Never EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true FixNamespaceComments: true
ForEachMacros: ForEachMacros:
- foreach - foreach
- Q_FOREACH - Q_FOREACH
- BOOST_FOREACH - BOOST_FOREACH
IfMacros: IfMacros:
- KJ_IF_MAYBE - KJ_IF_MAYBE
IncludeBlocks: Regroup IncludeBlocks: Regroup
IncludeCategories: IncludeCategories:
- Regex: '^<ext/.*\.h>' - Regex: '^<ext/.*\.h>'
Priority: 2 Priority: 2
SortPriority: 0 SortPriority: 0
CaseSensitive: false CaseSensitive: false
- Regex: '^<.*\.h>' - Regex: '^<.*\.h>'
Priority: 1 Priority: 1
SortPriority: 0 SortPriority: 0
CaseSensitive: false CaseSensitive: false
- Regex: '^<.*' - Regex: '^<.*'
Priority: 2 Priority: 2
SortPriority: 0 SortPriority: 0
CaseSensitive: false CaseSensitive: false
- Regex: '.*' - Regex: '.*'
Priority: 3 Priority: 3
SortPriority: 0 SortPriority: 0
CaseSensitive: false CaseSensitive: false
IncludeIsMainRegex: '([-_](test|unittest))?$' IncludeIsMainRegex: '([-_](test|unittest))?$'
IncludeIsMainSourceRegex: '' IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false IndentAccessModifiers: false
IndentCaseLabels: true IndentCaseLabels: true
IndentCaseBlocks: false IndentCaseBlocks: false
IndentGotoLabels: true IndentGotoLabels: true
IndentPPDirectives: None IndentPPDirectives: None
IndentExternBlock: AfterExternBlock IndentExternBlock: AfterExternBlock
IndentRequires: false IndentRequires: false
IndentWidth: 4 IndentWidth: 4
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
InsertTrailingCommas: None InsertTrailingCommas: None
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
JavaScriptWrapImports: true JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature LambdaBodyIndentation: Signature
MacroBlockBegin: '' MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
NamespaceIndentation: None NamespaceIndentation: None
ObjCBinPackProtocolList: Never ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2 ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2 PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1 PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300 PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120 PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000 PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10 PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000 PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200 PenaltyReturnTypeOnItsOwnLine: 200
PenaltyIndentedWhitespace: 0 PenaltyIndentedWhitespace: 0
PointerAlignment: Left PointerAlignment: Left
PPIndentWidth: -1 PPIndentWidth: -1
RawStringFormats: RawStringFormats:
- Language: Cpp - Language: Cpp
Delimiters: Delimiters:
- cc - cc
- CC - CC
- cpp - cpp
- Cpp - Cpp
- CPP - CPP
- 'c++' - 'c++'
- 'C++' - 'C++'
CanonicalDelimiter: '' CanonicalDelimiter: ''
BasedOnStyle: google BasedOnStyle: google
- Language: TextProto - Language: TextProto
Delimiters: Delimiters:
- pb - pb
- PB - PB
- proto - proto
- PROTO - PROTO
EnclosingFunctions: EnclosingFunctions:
- EqualsProto - EqualsProto
- EquivToProto - EquivToProto
- PARSE_PARTIAL_TEXT_PROTO - PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO - PARSE_TEST_PROTO
- PARSE_TEXT_PROTO - PARSE_TEXT_PROTO
- ParseTextOrDie - ParseTextOrDie
- ParseTextProtoOrDie - ParseTextProtoOrDie
- ParseTestProto - ParseTestProto
- ParsePartialTestProto - ParsePartialTestProto
CanonicalDelimiter: pb CanonicalDelimiter: pb
BasedOnStyle: google BasedOnStyle: google
ReferenceAlignment: Pointer ReferenceAlignment: Pointer
ReflowComments: true ReflowComments: true
ShortNamespaceLines: 1 ShortNamespaceLines: 1
SortIncludes: CaseSensitive SortIncludes: CaseSensitive
SortJavaStaticImport: Before SortJavaStaticImport: Before
SortUsingDeclarations: true SortUsingDeclarations: true
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2 SpacesBeforeTrailingComments: 2
SpacesInAngles: Never SpacesInAngles: Never
SpacesInConditionalStatement: false SpacesInConditionalStatement: false
SpacesInContainerLiterals: true SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix: SpacesInLineCommentPrefix:
Minimum: 1 Minimum: 1
Maximum: -1 Maximum: -1
SpacesInParentheses: false SpacesInParentheses: false
SpacesInSquareBrackets: false SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both BitFieldColonSpacing: Both
Standard: Auto Standard: Auto
StatementAttributeLikeMacros: StatementAttributeLikeMacros:
- Q_EMIT - Q_EMIT
StatementMacros: StatementMacros:
- Q_UNUSED - Q_UNUSED
- QT_REQUIRE_VERSION - QT_REQUIRE_VERSION
TabWidth: 8 TabWidth: 8
UseCRLF: false UseCRLF: false
UseTab: Never UseTab: Never
WhitespaceSensitiveMacros: WhitespaceSensitiveMacros:
- STRINGIZE - STRINGIZE
- PP_STRINGIZE - PP_STRINGIZE
- BOOST_PP_STRINGIZE - BOOST_PP_STRINGIZE
- NS_SWIFT_NAME - NS_SWIFT_NAME
- CF_SWIFT_NAME - CF_SWIFT_NAME
... ...

View File

@ -1,23 +1,22 @@
{ {
"configurations": [ "configurations": [
{ {
"name": "Win32", "name": "Linux",
"includePath": [ "includePath": [
"${default}", "${default}",
"${workspaceFolder}/include", "${workspaceFolder}/include",
"D:/Geant4/dist/include/Geant4", "/home/fox/G4Kit/Geant4/include",
"D:/ROOT/include" "/home/fox/G4Kit/ROOT/include"
], ],
"defines": [ "defines": [
"_DEBUG", "_DEBUG",
"UNICODE", "UNICODE",
"_UNICODE" "_UNICODE"
], ],
"windowsSdkVersion": "10.0.19041.0", "compilerPath": "/usr/bin/gcc",
"compilerPath": "D:/Microsoft/VisualStudio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe",
"cStandard": "c17", "cStandard": "c17",
"cppStandard": "c++17", "cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64", "intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools" "configurationProvider": "ms-vscode.cmake-tools"
} }
], ],

View File

@ -1,5 +1,4 @@
{ {
"cmake.configureSettings": { "cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "D:/Microsoft/vcpkg/scripts/buildsystems/vcpkg.cmake" }
}
} }

View File

@ -8,6 +8,7 @@ project(B1)
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui # You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable # to build a batch mode only executable
# #
set(Geant4_DIR ${Geant4_DIR})
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON) option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS) if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all) find_package(Geant4 REQUIRED ui_all vis_all)
@ -52,7 +53,7 @@ set(EXAMPLEB1_SCRIPTS
foreach(_script ${EXAMPLEB1_SCRIPTS}) foreach(_script ${EXAMPLEB1_SCRIPTS})
configure_file( configure_file(
${PROJECT_SOURCE_DIR}/${_script} ${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/Release/${_script} ${PROJECT_BINARY_DIR}/${_script}
COPYONLY COPYONLY
) )
endforeach() endforeach()

View File

@ -1,6 +1,6 @@
#include "ActionInitialization.hh" // 用户初始化 #include "ActionInitialization.hh" // 用户初始化
#include "DetectorConstruction.hh" // 探测器构建文件 #include "DetectorConstruction.hh" // 探测器构建文件
#include "G4RunManagerFactory.hh" // 管理类 #include "G4MTRunManager.hh" // 管理类
#include "G4SteppingVerbose.hh" // step信息管理 verbose越大输出越丰富 #include "G4SteppingVerbose.hh" // step信息管理 verbose越大输出越丰富
#include "G4UIExecutive.hh" // UI操作 #include "G4UIExecutive.hh" // UI操作
#include "G4UImanager.hh" // UI管理 #include "G4UImanager.hh" // UI管理
@ -23,7 +23,7 @@ int main(int argc, char** argv) {
G4SteppingVerbose::UseBestUnit(precision); G4SteppingVerbose::UseBestUnit(precision);
// 构建运行管理器 // 构建运行管理器
auto* runManager = G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default); G4MTRunManager* runManager = new G4MTRunManager;
// 进行强制类的初始化 // 进行强制类的初始化
// //

View File

@ -7,7 +7,7 @@
/run/verbose 2 /run/verbose 2
# #
# Change the default number of threads (in multi-threaded mode) # Change the default number of threads (in multi-threaded mode)
#/run/numberOfThreads 4 /run/numberOfThreads 4
# #
# Initialize kernel # Initialize kernel
/run/initialize /run/initialize