GithubHelp home page GithubHelp logo

Comments (8)

SylvainCorlay avatar SylvainCorlay commented on June 8, 2024

cc @JohanMabille

from cxxopts.

jarro2783 avatar jarro2783 commented on June 8, 2024

I thought putting it in an anonymous namespace would fix it, and I also thought that I tested this.

Can you show me a snippet of code that breaks?

from cxxopts.

SylvainCorlay avatar SylvainCorlay commented on June 8, 2024

OK, I can put one together tomorrow. This came up in a rather large project.

Basically, we are working on a C++ kernel for the Jupyter notebook, backed by the cling C++ interpreter:

peek 2017-08-16 12-45

We have a notion of "cell magic" that allows user to enter non-c++ commands to perform some operations (fetching help on a certain module etc).

We use cxxopts to parse options for these commands. So basically, our usecase is quite difference from the usual argument parsing for a command-line application but cxxopts does the job, hence the multiple compilation units.

from cxxopts.

jarro2783 avatar jarro2783 commented on June 8, 2024

This really sounds like a bug in the compiler if anything. I'm pretty sure that according to the standard, something declared in an anonymous namespace has internal linkage in the translation unit, so it shouldn't result in multiple references.

If you can give me some code that reproduces the problem then I can have a look at it.

from cxxopts.

SylvainCorlay avatar SylvainCorlay commented on June 8, 2024

The code that breaks is the compilation of xeus-cling.

Building it locally is a bit cumbersome because it has a lot of dependencies which need to be built or for which you will need to get a binary package. (For this reason, I use the conda package manager for which I have built all the dependency tree).

I do get multiple versions of gcc (4.9, 5.x anx 6.x) to complain cxxopts::values::integer_pattern. However, I don't get why this should not work.

FYI, the version with a singleton does work and also prevents recompiling the regex.

from cxxopts.

jarro2783 avatar jarro2783 commented on June 8, 2024

In fact I'm not sure why you get an error with integer_pattern and not option_matcher, option_specifier.

from cxxopts.

jarro2783 avatar jarro2783 commented on June 8, 2024

I'm trying to build xeus-cling, to reproduce this. I followed the instructions on that repo to install conda, and cloned the xeus-cling source, but I'm stuck here:

cmake -DCMAKE_INSTALL_PATH=$HOME/miniconda3 -DCMAKE_INSTALL_LIBDIR=$HOME/miniconda3 .
-- The C compiler identification is GNU 7.1.1
-- The CXX compiler identification is GNU 7.1.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found LLVM_CONFIG as /home/jbeck/miniconda3/bin/llvm-config
CMake Error at /usr/lib/cmake/clang/ClangTargets.cmake:419 (message):
  The imported target "clangApplyReplacements" references the file

     "/usr/lib/libclangApplyReplacements.a"

What am I missing here?

from cxxopts.

jarro2783 avatar jarro2783 commented on June 8, 2024

I was never able to reproduce this, but it will be fixed when I address #281

from cxxopts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.