Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit ba85c4c

Browse files
pramodkolupton
andauthored
Set compilation flags for different build types with Clang (#734)
* Set compilation flags for different build types with Clang: - Clang compiler flags were not added. - Because of this, no flags were set for RelWithDebInfo or any other build types. * Update tqperf test: - Change repository URL. - Copy mod files into single directory. - Pass extra linker flags. Co-authored-by: Olli Lupton <oliver.lupton@epfl.ch>
1 parent 318e25a commit ba85c4c

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

CMake/config/CompilerFlagsHelpers.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,17 @@ foreach(COMPILER_LANGUAGE ${SUPPORTED_COMPILER_LANGUAGE_LIST})
9999

100100
# CLANG
101101
elseif(CMAKE_${COMPILER_LANGUAGE}_COMPILER_IS_CLANG)
102+
set(CMAKE_${COMPILER_LANGUAGE}_WARNING_ALL "-Wall")
103+
set(CMAKE_${COMPILER_LANGUAGE}_DEBUGINFO_FLAGS "-g")
104+
105+
set(CMAKE_${COMPILER_LANGUAGE}_OPT_NONE "-O0")
106+
set(CMAKE_${COMPILER_LANGUAGE}_OPT_NORMAL "-O2")
107+
set(CMAKE_${COMPILER_LANGUAGE}_OPT_AGGRESSIVE "-O3")
108+
set(CMAKE_${COMPILER_LANGUAGE}_OPT_FASTEST "-Ofast -march=native")
109+
110+
set(CMAKE_${COMPILER_LANGUAGE}_STACK_PROTECTION "-fstack-protector")
111+
set(CMAKE_${COMPILER_LANGUAGE}_POSITION_INDEPENDENT "-fPIC")
112+
102113
# Force same ld behavior as when called from gcc --as-needed forces the linker to check whether
103114
# a dynamic library mentioned in the command line is actually needed by the objects being
104115
# linked. Symbols needed in shared objects are already linked when building that library.

tests/jenkins/Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ pipeline {
139139
stage('tqperf'){
140140
steps{
141141
dir('tqperf'){
142-
git url: 'https://github.com/nrnhines/tqperf.git'
142+
git url: 'https://github.com/neuronsimulator/tqperf'
143143
}
144144
}
145145
}

tests/jenkins/nrnivmodl-core.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ mkdir -p ${CORENRN_TYPE}
1515
pushd ${CORENRN_TYPE}
1616

1717
set +x
18+
19+
# tqperf has extra mod files under modx
20+
if [ "${TEST_DIR}" = "tqperf" ]; then
21+
cp ../modx/*.mod ../mod/
22+
extra_args="-l -lcrypto"
23+
fi
24+
1825
if [ "${TEST_DIR}" = "ringtest" ]; then
1926
echo "Running install_${CORENRN_TYPE}/bin/nrnivmodl-core ."
2027
$WORKSPACE/install_${CORENRN_TYPE}/bin/nrnivmodl-core .
2128
else
2229
echo "Running install_${CORENRN_TYPE}/bin/nrnivmodl-core ../mod"
23-
$WORKSPACE/install_${CORENRN_TYPE}/bin/nrnivmodl-core ../mod
30+
$WORKSPACE/install_${CORENRN_TYPE}/bin/nrnivmodl-core ${extra_args} ../mod
2431
fi
2532
set -x
2633

tests/jenkins/nrnivmodl.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ set -x
88
TEST_DIR="$1"
99

1010
cd $WORKSPACE/${TEST_DIR}
11-
nrnivmodl mod
11+
12+
# tqperf has extra mod files under modx
13+
if [ "${TEST_DIR}" = "tqperf" ]; then
14+
cp modx/*.mod mod/
15+
fi
16+
17+
nrnivmodl -loadflags -lcrypto mod

0 commit comments

Comments
 (0)