Library not working in Godbolt Compiler explorer
Closed this issue · 11 comments
I am not sure if you have added the library to Godbolt, but in case you did, it is not working.
I don't seem to be able to use it in there:
https://godbolt.org/z/fdvaEWjdM
A simple include cannot find the header after including it in the "green" libraries button.
#include <scn/scan.h>
<source>:7:10: fatal error: scn/scan.h: No such file or directory
7 | #include <scn/scan.h>
| ^~~~~~~~~~~~
compilation terminated.
Compiler returned: 1
I tried other variations with the same result.
Got it, the version in Godbolt is v1
. Godbolt can work with a "nightly" master if configured to do so, BTW
I sent a PR for v2.0.0 compiler-explorer/infra#1232
Thank you for doing the necessary legwork over at CE! I haven't done any contributions there myself, so it's dependent on people like you. Having a trunk-version there doesn't sound like a bad idea, either.
Closing this issue as WONTFIX, as the progress is tracked over at CE.
No problem.
To be conservative and not overstep I put the tag v2.0.0 in CE.
The CE PR is being processed still.
The infrastructure for CE is merged now.
compiler-explorer/compiler-explorer#6121
But I think I partially screwed up.
I mistakenly thought that scn was a header-only library, so the test code compiles, but it doesn't link, so it cannot be run:
https://godbolt.org/z/sf8v5zo1q
I don't know how to make non-header-only libraries in Godbolt.
The people that put libscn in CE have this:
https://github.com/correaa/infra/blob/main/bin/yaml/libraries.yaml#L1850C1-L1865C19
scnlib:
build_type: cmake
extra_cmake_arg:
- -DSCN_TESTS=OFF
- -DSCN_EXAMPLES=OFF
- -DSCN_BENCHMARKS=OFF
- -DSCN_DOCS=OFF
make_targets:
- scn
repo: eliaskosunen/scnlib
target_prefix: refs/tags/v
targets:
- '0.4'
- 1.1.2
- 2.0.0
type: github
I don't see immediately what can be wrong with it.
I am trying this now: compiler-explorer/infra#1232
Now it find -lscn
but fails to find other libraries like simdutf
. Since it is a dependency I am not sure how CE handles it.
Perhaps one has to add simdutf as a separate CE librari.
Yeah, simdutf
is a transitive dependency, and needs to be linked with the final binary alongside libscn.a
. I don't know what is the normal way of doing things in CE, but it must be included one way or another for it to work. I see some entries that have a staticliblink
, but I don't know if that's relevant.
They told me that they still had to "run the conan builds", I don't know how often that happens or if that will solve the problem. They seem to have approved the PR with the simdutf dependency.