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

Require C++17 #1893

Merged
merged 43 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
517f23b
Bump to C++17 to see what breaks.
olupton Jun 30, 2022
d6c9009
flex: require >= 2.6 to avoid register keyword.
olupton Jul 1, 2022
f6d09a1
More flex/c++ standard documentation and fixes.
olupton Jul 1, 2022
0156112
temporary: `neuronsimulator/neuron_wheel:cpp17`
alexsavulescu Jul 1, 2022
16865a0
Use std:: prefix on cout, endl, istream, ostream etc.
olupton Jul 1, 2022
dfb7e7b
GPU bits in `neuronsimulator/neuron_wheel:cpp17`
alexsavulescu Jul 1, 2022
7a3821d
C++17 in submodules.
olupton Jul 1, 2022
c3f5d88
pick up more c++17
olupton Jul 1, 2022
d2c893d
submodules
olupton Jul 1, 2022
ebcd4a8
submodule
olupton Jul 1, 2022
8bcd796
drop gcc5 and gcc6, do not explicitly specify default cmake option va…
olupton Jul 1, 2022
25cf499
Use newer python patch versions and target macOS 10.14 instead of 10.9.
olupton Jul 1, 2022
34a669d
another missing std::
olupton Jul 1, 2022
c37a55b
Try and make the setuptools build use the compiler its told to use
olupton Jul 1, 2022
b3d6658
submodule
olupton Jul 1, 2022
3174b8a
update coreneuron
olupton Jul 1, 2022
83c1505
Dockerfile: newer flex
alexsavulescu Jul 1, 2022
d4019ab
reduce diff to master
olupton Jul 1, 2022
fa699e5
new master of iv
olupton Jul 4, 2022
b768a6c
Bump to C++17 to see what breaks.
olupton Jun 30, 2022
77938d1
flex: require >= 2.6 to avoid register keyword.
olupton Jul 1, 2022
aa98331
More flex/c++ standard documentation and fixes.
olupton Jul 1, 2022
90811a3
temporary: `neuronsimulator/neuron_wheel:cpp17`
alexsavulescu Jul 1, 2022
11fcb8e
Use std:: prefix on cout, endl, istream, ostream etc.
olupton Jul 1, 2022
a3d9a53
GPU bits in `neuronsimulator/neuron_wheel:cpp17`
alexsavulescu Jul 1, 2022
f48312e
C++17 in submodules.
olupton Jul 1, 2022
37a9976
pick up more c++17
olupton Jul 1, 2022
dc309b5
submodules
olupton Jul 1, 2022
87264d8
submodule
olupton Jul 1, 2022
19771c6
drop gcc5 and gcc6, do not explicitly specify default cmake option va…
olupton Jul 1, 2022
0f803c9
Use newer python patch versions and target macOS 10.14 instead of 10.9.
olupton Jul 1, 2022
5800f65
another missing std::
olupton Jul 1, 2022
af30864
Try and make the setuptools build use the compiler its told to use
olupton Jul 1, 2022
c95404f
submodule
olupton Jul 1, 2022
d40b39e
update coreneuron
olupton Jul 1, 2022
5062d55
Dockerfile: newer flex
alexsavulescu Jul 1, 2022
1019f3c
reduce diff to master
olupton Jul 1, 2022
597497f
new master of iv
olupton Jul 4, 2022
ae699d5
Target macOS 10.14.
olupton Jul 5, 2022
a971f6b
Merge branch 'olupton/c++17' of github.com:neuronsimulator/nrn into o…
alexsavulescu Jul 5, 2022
ad70571
Dockerfile_gpu based on latest-x86_64
alexsavulescu Jul 5, 2022
12530f3
coreneuron: bump submodule past BlueBrain/CoreNeuron#834.
olupton Jul 5, 2022
655d2b1
Revert "GPU bits in `neuronsimulator/neuron_wheel:cpp17`"
alexsavulescu Jul 6, 2022
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
4 changes: 2 additions & 2 deletions .clang-format.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SortIncludes: false
Standard: c++14
StatementMacros: [MKDLL, MKDLLdec, MKDLLif, MKDLLvp, MKDLLvpf]
Standard: c++17
StatementMacros: [MKDLL, MKDLLdec, MKDLLif, MKDLLvp, MKDLLvpf]
21 changes: 12 additions & 9 deletions .github/workflows/neuron-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ jobs:
matrix:
os: [ macOS-10.15, ubuntu-18.04]
config:
- { matrix_eval : "CC=gcc CXX=g++" , build_mode: "cmake", cmake_option: "-DNRN_ENABLE_MPI=ON -DNRN_ENABLE_INTERVIEWS=ON -DNRN_ENABLE_CORENEURON=ON" }
- { matrix_eval : "CC=gcc-8 CXX=g++-8", build_mode: "setuptools" }
- { matrix_eval : "CC=gcc-5 CXX=g++-5", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_MPI=OFF -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_CORENEURON=ON" }
- { matrix_eval : "CC=gcc-6 CXX=g++-6", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_MPI=ON -DNRN_ENABLE_INTERVIEWS=ON -DNRN_ENABLE_CORENEURON=OFF" }
alexsavulescu marked this conversation as resolved.
Show resolved Hide resolved
- { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_PYTHON=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_CORENEURON=ON" }
- { matrix_eval : "CC=gcc-8 CXX=g++-8", build_mode: "cmake", python_dynamic : ON }
# GitHub Actions's ubuntu-18.04 image should provide g++ versions 9 and
# 10 even though those are not available in vanilla Ubuntu 18.04
- { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "setuptools"}
- { matrix_eval : "CC=gcc-8 CXX=g++-8", build_mode: "cmake"}
- { matrix_eval : "CC=gcc-9 CXX=g++-9", build_mode: "cmake", python_dynamic: ON}
- { matrix_eval : "CC=gcc-7 CXX=g++-7" , build_mode: "cmake", cmake_option: "-DNRN_ENABLE_CORENEURON=ON"}
- { matrix_eval : "CC=gcc-7 CXX=g++-7", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_MPI=OFF -DNRN_ENABLE_INTERVIEWS=OFF -DNRN_ENABLE_CORENEURON=ON"}
- { matrix_eval : "CC=gcc-10 CXX=g++-10", build_mode: "cmake", cmake_option: "-DNRN_ENABLE_PYTHON=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_CORENEURON=ON"}
include:
- os: ubuntu-22.04
config:
Expand Down Expand Up @@ -79,10 +81,11 @@ jobs:
- name: Install homebrew packages
if: startsWith(matrix.os, 'macOS')
run: |
brew install ccache coreutils doxygen mpich ninja xz
brew install ccache coreutils doxygen flex mpich ninja xz
brew unlink mpich
brew install openmpi
brew install --cask xquartz
echo /usr/local/opt/flex/bin >> $GITHUB_PATH
# Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
echo CMAKE_BUILD_PARALLEL_LEVEL=3 >> $GITHUB_ENV
echo CTEST_PARALLEL_LEVEL=3 >> $GITHUB_ENV
Expand All @@ -97,7 +100,7 @@ jobs:
openmpi-bin patchelf
# The sanitizer builds use ubuntu 22.04
if [[ "${{matrix.os}}" == "ubuntu-18.04" ]]; then
sudo apt-get install g++-5 g++-6 g++-8 g++-9
sudo apt-get install g++-7 g++-8
fi
# Core https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
echo CMAKE_BUILD_PARALLEL_LEVEL=2 >> $GITHUB_ENV
Expand Down Expand Up @@ -165,7 +168,7 @@ jobs:
run: |
# OS related
if [ "$RUNNER_OS" == "Linux" ]; then
eval $MATRIX_EVAL;
export ${MATRIX_EVAL};
olupton marked this conversation as resolved.
Show resolved Hide resolved
export SHELL="/bin/bash"
else
export CXX=${CXX:-g++};
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ project(
# =============================================================================
# CMake common project settings
# =============================================================================
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
olupton marked this conversation as resolved.
Show resolved Hide resolved
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down Expand Up @@ -251,7 +251,7 @@ include(cmake/SanitizerHelper.cmake)
# Find required packages
# =============================================================================
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
find_package(FLEX 2.6 REQUIRED)
olupton marked this conversation as resolved.
Show resolved Hide resolved

# When shipping the wheels we want to link readline libs statically.
if(NRN_WHEEL_STATIC_READLINE)
Expand Down
12 changes: 7 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ stages:
matrix:
Python37:
python.version: '3.7'
python.org.version: '3.7.7'
python.org.version: '3.7.9'
python.installer.name: 'macosx10.9.pkg'
Python38:
python.version: '3.8'
python.org.version: '3.8.2'
python.org.version: '3.8.10'
python.installer.name: 'macosx10.9.pkg'
Python39:
python.version: '3.9'
python.org.version: '3.9.0'
python.org.version: '3.9.13'
python.installer.name: 'macosx10.9.pkg'
Python310:
python.version: '3.10'
python.org.version: '3.10.0'
python.org.version: '3.10.5'
python.installer.name: 'macos11.pkg'

steps:
Expand Down Expand Up @@ -186,8 +186,10 @@ stages:
inputs:
secureFile: 'readline7.0.tar.gz'

# 10.14 is required for full C++17 support, see:
# https://cibuildwheel.readthedocs.io/en/stable/cpp_standards
- script: |
export MACOSX_DEPLOYMENT_TARGET=10.9
export MACOSX_DEPLOYMENT_TARGET=10.14
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export NRN_BUILD_FOR_UPLOAD=1
Expand Down
2 changes: 1 addition & 1 deletion bin/nrnivmodl_makefile_cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ endif
ifeq ($(origin CXX), default)
CXX = @CMAKE_CXX_COMPILER@
endif
CXXFLAGS = @BUILD_TYPE_CXX_FLAGS@ @CMAKE_CXX_FLAGS@ @CMAKE_CXX14_STANDARD_COMPILE_OPTION@
CXXFLAGS = @BUILD_TYPE_CXX_FLAGS@ @CMAKE_CXX_FLAGS@ @CMAKE_CXX17_STANDARD_COMPILE_OPTION@
CXXCOMPILE = $(CXX) $(CXXFLAGS) @NRN_COMPILE_DEFS_STRING@ @NRN_COMPILE_FLAGS_STRING@
CXX_LINK_EXE = $(CXX) $(CXXFLAGS) @CMAKE_EXE_LINKER_FLAGS@ @NRN_LINK_FLAGS_STRING@
CXX_LINK_SHARED = $(CXX) $(CXXFLAGS) @CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS@ @CMAKE_SHARED_LIBRARY_CXX_FLAGS@ @CMAKE_SHARED_LINKER_FLAGS@
Expand Down
6 changes: 0 additions & 6 deletions cmake/CompilerHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,3 @@ else()
set(USING_PGI_COMPILER_TRUE "#")
set(USING_PGI_COMPILER_FALSE "")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "PGI")
# CMake adds strict standard complaint PGI flag "-A" which breaks compilation of old codes (e.g.
# spdlog, fmt)
set(CMAKE_CXX14_STANDARD_COMPILE_OPTION --c++14)
endif()
olupton marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions docs/install/install_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ from source.
In order to build NEURON from source, the following packages must be available:

- Bison
- Flex
- C/C++ compiler suite
- Flex >= 2.6
- C/C++ compiler suite supporting C++17
olupton marked this conversation as resolved.
Show resolved Hide resolved
- CMake 3.15.0

The following packages are optional (see build options):
Expand Down
2 changes: 1 addition & 1 deletion external/iv
Submodule iv updated 173 files
13 changes: 12 additions & 1 deletion packaging/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,25 @@ RUN yum -y install \
curl \
unzip \
bison \
flex \
autoconf \
automake \
openssh-server \
libtool

# required for rpmbuild
RUN yum -y install \
gettext \
gcc-c++ \
help2man \
rpm-build

WORKDIR /root

# newer flex with rpmbuild (manylinux2014 based on Centos7 currently has flex < 2.6)
RUN rpmbuild --rebuild https://vault.centos.org/8-stream/AppStream/Source/SPackages/flex-2.6.1-9.el8.src.rpm \
&& yum install -y /root/rpmbuild/RPMS/x86_64/flex-2.6.1-9.el7.x86_64.rpm \
&& rm -rf rpmbuild
olupton marked this conversation as resolved.
Show resolved Hide resolved

RUN wget http://ftpmirror.gnu.org/ncurses/ncurses-6.2.tar.gz \
&& tar -xvzf ncurses-6.2.tar.gz \
&& cd ncurses-6.2 \
Expand Down
2 changes: 1 addition & 1 deletion packaging/python/Dockerfile_gpu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM neuronsimulator/neuron_wheel
FROM neuronsimulator/neuron_wheel:latest-x86_64
LABEL authors="Pramod Kumbhar, Olli Lupton, Fernando Pereira, Alexandru Savulescu"

WORKDIR /root
Expand Down
2 changes: 1 addition & 1 deletion src/ivoc/apwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void OcGlyph::def_size(Coord& w, Coord& h) const {
}
}

void OcGlyph::save(ostream&) {
void OcGlyph::save(std::ostream&) {
printf("OcGlyph::save (not implemented for relevant class)\n");
}

Expand Down
6 changes: 3 additions & 3 deletions src/ivoc/axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
GAxisItem(Glyph* g)
: GraphItem(g) {}
virtual ~GAxisItem(){};
virtual void save(ostream&, Coord, Coord) {}
virtual void save(std::ostream&, Coord, Coord) {}
virtual void erase(Scene* s, GlyphIndex i, int type) {
if (type & GraphItem::ERASE_AXIS) {
s->remove(i);
Expand Down Expand Up @@ -85,7 +85,7 @@ void Axis::size(float& min, float& max) {
max = float(amax_);
}

void Axis::save(ostream& o) {
void Axis::save(std::ostream& o) {
char buf[256];
int c;
if (d_ == Dimension_X) {
Expand All @@ -103,7 +103,7 @@ void Axis::save(ostream& o) {
nminor_,
invert_,
number_);
o << buf << endl;
o << buf << std::endl;
}

void Axis::update(Observable*) {}
Expand Down
2 changes: 1 addition & 1 deletion src/ivoc/axis.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Axis: public Glyph, public Observer {
int invert = 0,
bool number = true);
virtual ~Axis();
virtual void save(ostream&);
virtual void save(std::ostream&);
virtual void update(Observable*);
virtual void size(float&, float&);

Expand Down
4 changes: 2 additions & 2 deletions src/ivoc/epsprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ save 20 dict begin\n\
\n\
";

EPSPrinter::EPSPrinter(ostream* o)
EPSPrinter::EPSPrinter(std::ostream* o)
: Printer(o) {}

EPSPrinter::~EPSPrinter() {}

void EPSPrinter::eps_prolog(ostream& out, Coord width, Coord height, const char* creator) {
void EPSPrinter::eps_prolog(std::ostream& out, Coord width, Coord height, const char* creator) {
int bbw = int(width);
int bbh = int(height);
// need to describe it as EPSF = "encapsulated postscript"
Expand Down
4 changes: 2 additions & 2 deletions src/ivoc/epsprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

class EPSPrinter: public Printer {
public:
EPSPrinter(ostream*);
EPSPrinter(std::ostream*);
virtual ~EPSPrinter();

virtual void eps_prolog(ostream&,
virtual void eps_prolog(std::ostream&,
Coord width,
Coord height,
const char* creator = "InterViews");
Expand Down
Loading