micro-manager / pymmcore

Python bindings for MMCore, Micro-Manager's device control layer
https://pypi.org/project/pymmcore/
GNU Lesser General Public License v2.1
33 stars 8 forks source link

How to control c++ std locally? #62

Closed ianhi closed 2 years ago

ianhi commented 2 years ago

Hi @marktsuchida I was trying to get this to build locally (in the context of working on MMCore) and I keep running into the below error. Is there an easy way you can recommend to force this to be c++14?

(pymm) ian@fermented-beans:~/Documents/oss/micro/pymmcore$ python setup.py build_ext -j2
running build_ext
running build_clib
building 'MMDevice' library
gcc -pthread -B /home/ian/mambaforge/envs/pymm/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/ian/mambaforge/envs/pymm/include -fPIC -O2 -isystem /home/ian/mambaforge/envs/pymm/include -fPIC -DMODULE_EXPORTS -ImmCoreAndDevices/MMDevice -c mmCoreAndDevices/MMDevice/Debayer.cpp -o build/temp.linux-x86_64-3.10/mmCoreAndDevices/MMDevice/Debayer.o
In file included from mmCoreAndDevices/MMDevice/MMDevice.h:49,
                 from mmCoreAndDevices/MMDevice/ImgBuffer.h:29,
                 from mmCoreAndDevices/MMDevice/Debayer.h:29,
                 from mmCoreAndDevices/MMDevice/Debayer.cpp:26:
mmCoreAndDevices/MMDevice/ImageMetadata.h:325:58: error: ISO C++17 does not allow dynamic exception specifications
  325 |    MetadataSingleTag GetSingleTag(const char* key) const throw (MetadataKeyError)
      |                                                          ^~~~~
mmCoreAndDevices/MMDevice/ImageMetadata.h:332:56: error: ISO C++17 does not allow dynamic exception specifications
  332 |    MetadataArrayTag GetArrayTag(const char* key) const throw (MetadataKeyError)
      |                                                        ^~~~~
error: command '/usr/bin/gcc' failed with exit code 1
ianhi commented 2 years ago

Ahh it seems I can do: export CFLAGS='-std=c++14' but it does seem that this should be embedded somewhere in the definition of the build?