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

error: unterminated raw string #109

Closed
brianbreitsch opened this issue Aug 11, 2015 · 10 comments
Closed

error: unterminated raw string #109

brianbreitsch opened this issue Aug 11, 2015 · 10 comments
Assignees

Comments

@brianbreitsch
Copy link

G++ 4.8.2

I'm not 100% sure that I'm doing things correctly--nevertheless, the first error I get when running make is:

g++ -std=c++11  -Wall -Wextra -pedantic -Weffc++ -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch -Wundef -Wno-unused -Wnon-virtual-dtor -Wreorder -Wdeprecated -Wfloat-equal  -I src -I test test/unit.cpp  -o json_unit
test/unit.cpp:9675:32: error: unterminated raw string
             CHECK_NOTHROW(json(R"(
@nlohmann
Copy link
Owner

I'll check this. If I remember correctly, this error occurs in the following constellation:

  • g++-4.8
  • Catch (the unit test framework) we use
  • C++11 raw strings

If you cannot compile the unit tests, the library will still work. I'll check if there is anything I can do to fix this.

@nlohmann nlohmann self-assigned this Aug 11, 2015
@benloong
Copy link

this is a gcc bug Preprocessor macros with C++11 raw string literals fail to compile

no error using gcc 4.9 with c++11

nlohmann added a commit that referenced this issue Dec 7, 2015
@nlohmann
Copy link
Owner

nlohmann commented Dec 7, 2015

I close this issue, because it does not affect the code as such. I also added a note to the README file that the unit tests cannot be compiled using GCC 4.8.

@goswamig
Copy link

@nlohmann What is the way to bypass the unit test compilation ?

@nlohmann
Copy link
Owner

You can pass -DJSON_BuildTests=OFF to CMake.

@goswamig
Copy link

Thanks.

@goswamig
Copy link

?Can I try this in bazel build

@nlohmann
Copy link
Owner

I do not know what you mean.

@goswamig
Copy link

I am running build like below

export TF_NEED_GCP="0"
TF_NEED_HDFS="0"
GCC_HOST_COMPILER_PATH="/usr/bin/gcc"
TF_NEED_OPENCL="0"
CUDA_TOOLKIT_PATH="/usr/local/cuda-9.0"
TF_CUDA_COMPUTE_CAPABILITIES="3.0,3.5,5.2,7.0"
CUDNN_INSTALL_PATH="/usr/local/cuda-9.0"
TF_NEED_CUDA="1" TF_ENABLE_XLA="0"
PYTHON_BIN_PATH="/home/ec2-user/anaconda3/envs/tensorflow_p27/bin/python" TF_CUDNN_VERSION="7"
TF_NEED_JEMALLOC="0"
TF_CUDA_VERSION="9.0"
TF_UNOFFICIAL_SETTING="1"

bazel build -c opt --copt=-msse4.1 --copt=-msse4.2 --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-O3 --verbose_failures tensorflow_serving/...

@nlohmann
Copy link
Owner

Sorry, I am not familiar with bazel. But the library is a single header, so you just need to include it in your code - there is no need to compile the unit tests at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants