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

cnl_example fails #887

Open
johnmcfarlane opened this issue May 9, 2021 · 12 comments
Open

cnl_example fails #887

johnmcfarlane opened this issue May 9, 2021 · 12 comments
Labels

Comments

@johnmcfarlane
Copy link
Owner

Partly due to loss of Bintray, but also because it's not tested, cnl_example doesn't build.

  • Design a new workflow for cnl_example in which both cnl and cnl_example are built locally, but where cnl is installed into the local Conan cache.
@josmithiii
Copy link

The loss of bintray appears to prevent the unit tests as well.
Is there a new location for https://api.bintray.com/conan/johnmcfarlane/cnl
?

@johnmcfarlane
Copy link
Owner Author

Hi @josmithiii. Which tests do you mean?
Unfortunately yes, there isn't currently a package available in a public package repo. This issue tracks plans to remedy that in Conan Center. #773 tracks equivalent work for vcpkg.

@josmithiii
Copy link

Thanks for your reply! I'm trying to run the cnl tests:

conan profile update env.CONAN_CMAKE_TOOLCHAIN_FILE=../test/toolchain/clang.cmake default
setenv CONAN_REVISIONS_ENABLED 1
conan install --build=missing --options test=unit ..
Configuration:
[settings]
arch=armv8
arch_build=armv8
build_type=Release
compiler=apple-clang
compiler.libcxx=libstdc++
compiler.version=13
os=Macos
os_build=Macos
[options]
test=unit
[build_requires]
[env]
CONAN_CMAKE_TOOLCHAIN_FILE=../test/toolchain/clang.cmake
ERROR: 400: Couldn't perform replication, check server logs for more information.. [Remote: johnmcfarlane/cnl]
exit 0

@johnmcfarlane
Copy link
Owner Author

Please give me a few days to look into this. I'm currently en route to CppOnSea and don't have a lot of bandwidth right now.

@johnmcfarlane
Copy link
Owner Author

Sorry for the long delay. As well as the conference running a week longer than expected(!), I'm facing some disruption at home due to house renovations.

I'm not sure your issue is the same as #887. I'm not able to complete the repro steps above and when I work around them, I am not able to reproduce the issue. However, I'm very keen to help resolve the issue and adapt the project as necessary to avoid future problems.

Therefore, could you file a separate bug using the bug template.

Could you make sure that repro steps are from a system without a ~/.conan directory for maximum reproducibility.

I recommend you avoid the env.CONAN_CMAKE_TOOLCHAIN_FILE= parameter as this is a relative path (which later confuses the build system) and would likely set that path for all other projects using Conan's default profile. (Suggestion: specify that variable during the conan install step.)

Can you try and remove as many steps as possible that aren't necessary to reproduce the error?

For reference, here's the repro steps I followed to try and match your own:

# using llvm-14 as the default C and C++ compiler...
rm -rf ~/.conan/ ../build/*
CXX=/usr/bin/clang++ conan profile new --detect default
conan install --settings compiler.libcxx=libstdc++11 --build=missing --options test=unit ..
conan build ..

@josmithiii
Copy link

josmithiii commented Jul 24, 2022 via email

@johnmcfarlane
Copy link
Owner Author

What version of Clang are you using?

@josmithiii
Copy link

josmithiii commented Jul 25, 2022 via email

johnmcfarlane pushed a commit that referenced this issue Jul 30, 2022
- appears to take too many iterations on Apple Clang
- reported under #887 but is unrelated
@johnmcfarlane
Copy link
Owner Author

You don't appear to be using the clang profile and some tests are so complex that compiler limits on constant expressions are hit. I've tried hiding that particular test in the case there is no CNL testing profile in use but recommend using test/toolchain/clang.cmake or test/toolchain/clang-libc++.cmake for clang builds in order to enable all tests.

Please can you try branch, osx-clang-fix and see if that gets you past the error?

@josmithiii
Copy link

Near perfection!: 100% tests passed, 0 tests failed out of 114
However, I had to comment out a static_assert that failed:

index 2527f010..2d6a6747 100644
--- a/test/unit/scaled_int/elastic/elastic_scaled_int.cpp
+++ b/test/unit/scaled_int/elastic/elastic_scaled_int.cpp
@@ -187,7 +187,7 @@ namespace test_fraction_specific_long {
     static_assert(specific > .333333333333333);
     static_assert(specific < .333333333333334);
 #else
-    static_assert(identical(cnl::elastic_scaled_integer<63, cnl::power<-60>>{1.L / 3}, specific));
+  //    static_assert(identical(cnl::elastic_scaled_integer<63, cnl::power<-60>>{1.L / 3}, specific));
 #endif
 }

I am on a 64-bit ARM (Apple M1 Max).

johnmcfarlane pushed a commit that referenced this issue Aug 6, 2022
- appears to take too many iterations on Apple Clang
- reported under #887 but is unrelated
@johnmcfarlane
Copy link
Owner Author

Please, if possible could you create an issue with reproducible steps? Better still, do you have a branch in which you make an ARM build for OSX? I've tried setting arch=armv8 and clang still outputs what I assume to be x86 code.

@josmithiii
Copy link

This reproduces it on Mac OSX ARM just using the latest main branch:

bash
/bin/rm -rf ./build/
mkdir build
cd build
CXX=/usr/bin/clang++ conan profile new --detect default
conan install --settings compiler.libcxx=libc++ --build=missing --options test=unit ..
conan build ..

It makes it to 79% and then prints

[ 79%] Built target test-unit-scaled_int-overflow-elastic-int
/Users/jos/w/cnl/test/unit/scaled_int/elastic/elastic_scaled_int.cpp:191:5: error: static_assert failed due to requirement 'identical(cnl::_impl::wrapper<cnl::_impl::wrapper<long long, cnl::elastic_tag<63, int>>, cnl::power<-60, 2>>{1.L / 3}, specific)'
    static_assert(identical(cnl::elastic_scaled_integer<63, cnl::power<-60>>{1.L / 3}, specific));
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After that I see

[ 89%] Built target test-unit-overflow-elastic-safe_int
gmake[1]: *** [CMakeFiles/Makefile2:1243: test/unit/CMakeFiles/test-unit.dir/rule] Error 2
gmake: *** [Makefile:556: test-unit] Error 2
ERROR: conanfile.py (cnl/None): Error in build() method, line 68
	cmake.build(target={
	ConanException: Error 2 while executing cmake --build '/Users/jos/w/cnl/build' '--target' 'test-unit' '--' '-j10'
bash-3.2$ 

Are you saying the above should go in a new issue?

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

No branches or pull requests

2 participants