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

Add TinyAD #24655

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add TinyAD #24655

wants to merge 2 commits into from

Conversation

jjcasmar
Copy link
Contributor

Summary

Changes to recipe: tinyad/cci.20240718

Motivation

TinyAD is a library for automatic differentiation, presented at Eurographics Symposium on Geometry Processing 2022

Details

Add the library


@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@valgur
Copy link
Contributor

valgur commented Jul 18, 2024

The project relies on OpenMP and warns when it is unavailable. The package would really benefit from #22360. For now you will have to export the appropriate compiler and linker flags for each separate compiler to make sure it's enabled and linked against by the consuming projects.

Comment on lines 32 to 38

def generate(self):
deps = CMakeDeps(self)
deps.generate()

tc = CMakeToolchain(self)
tc.generate()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()

The recipe is not building anything so these are not needed.

Comment on lines 46 to 64
self.cpp_info.set_property("cmake_target_name", "TinyAD")
self.cpp_info.components["tinyad"].set_property("cmake_target_name", "TinyAD::TinyAD")

self.cpp_info.components["tinyad"].bindirs = []
self.cpp_info.components["tinyad"].libdirs = []
self.cpp_info.components["tinyad"].includedirs = [os.path.join(self.package_folder, "include")]
self.cpp_info.components["tinyad"].requires = ["eigen::eigen"]

Copy link
Contributor

@valgur valgur Jul 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.cpp_info.set_property("cmake_target_name", "TinyAD")
self.cpp_info.components["tinyad"].set_property("cmake_target_name", "TinyAD::TinyAD")
self.cpp_info.components["tinyad"].bindirs = []
self.cpp_info.components["tinyad"].libdirs = []
self.cpp_info.components["tinyad"].includedirs = [os.path.join(self.package_folder, "include")]
self.cpp_info.components["tinyad"].requires = ["eigen::eigen"]
self.cpp_info.set_property("cmake_target_name", "TinyAD")
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
if is_msvc(self):
# https://github.com/patr-schm/TinyAD/blob/29417031c185b6dc27b6d4b684550d844459b735/CMakeLists.txt#L35
self.cpp_info.cxxflags.append("/bigobj")

Creating a component is not really beneficial in any way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also add /bigobj to self.cpp_info.cxxflags for MSVC to match the CMake config in the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cmake_target_name should be TinyAD alone, as that is the one used in the upstream CMake.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. I adjusted my adjusted change accordingly.

@conan-center-bot

This comment has been minimized.

1 similar comment
@conan-center-bot

This comment has been minimized.

@jcar87 jcar87 self-assigned this Jul 18, 2024
@jjcasmar
Copy link
Contributor Author

jjcasmar commented Jul 18, 2024

Is the CI not working?

@AbrilRBS AbrilRBS assigned perseoGI and jcar87 and unassigned jcar87 Jul 19, 2024
@AbrilRBS
Copy link
Member

@jjcasmar we're under maintenance, the service should be available again soon, thanks for your patience :)

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ❌

Failure in build 10 (cbb5afb16e63adbda030700d6cd7216f12d2c55e):

  • tinyad/cci.20240718:
    CI failed to create some packages (All logs)

    Logs for packageID 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5
    os=Linux
    
    [...]
    /home/conan/workspace/prod-v1/bsr/77743/faccf/.conan/data/tinyad/cci.20240718/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/TinyAD/Scalar.hh:1354:44: error: expected unqualified-id before ‘using’
     template <int k, bool with_hessian = true> using LongDouble = Scalar<k, long double, with_hessian>;
                                                ^
    /home/conan/workspace/prod-v1/bsr/77743/faccf/.conan/data/tinyad/cci.20240718/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/TinyAD/Scalar.hh:1370:29: error: template argument 3 is invalid
             : NumTraits<PassiveT>
                                 ^
    /home/conan/workspace/prod-v1/bsr/77743/faccf/.conan/data/tinyad/cci.20240718/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/TinyAD/Scalar.hh:1369:26: error: template argument 1 is invalid
     struct NumTraits<TinyAD::Scalar<k, PassiveT, with_hessian>>
                              ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp: In function ‘int main()’:
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:6:11: error: expected nested-name-specifier before ‘ADouble’
         using ADouble = TinyAD::Double<3>;
               ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:9:5: error: ‘Vector3’ is not a member of ‘Eigen’
         Eigen::Vector3<ADouble> x = ADouble::make_active({0.0, -1.0, 1.0});
         ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:9:20: error: ‘ADouble’ was not declared in this scope
         Eigen::Vector3<ADouble> x = ADouble::make_active({0.0, -1.0, 1.0});
                        ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:9:29: error: ‘x’ was not declared in this scope
         Eigen::Vector3<ADouble> x = ADouble::make_active({0.0, -1.0, 1.0});
                                 ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:9:33: error: ‘ADouble’ is not a class or namespace
         Eigen::Vector3<ADouble> x = ADouble::make_active({0.0, -1.0, 1.0});
                                     ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:9:54: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
         Eigen::Vector3<ADouble> x = ADouble::make_active({0.0, -1.0, 1.0});
                                                          ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:10:5: error: ‘Vector3’ is not a member of ‘Eigen’
         Eigen::Vector3<double> y(2.0, 3.0, 5.0);
         ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:10:20: error: expected primary-expression before ‘double’
         Eigen::Vector3<double> y(2.0, 3.0, 5.0);
                        ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:13:13: error: expected ‘;’ before ‘angle’
         ADouble angle = acos(x.dot(y) / (x.norm() * y.norm()));
                 ^
    /home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/test_package.cpp:14:25: error: ‘angle’ was not declared in this scope
         Eigen::Vector3d g = angle.grad;
                             ^
    make[2]: *** [CMakeFiles/test_package.dir/test_package.cpp.o] Error 1
    make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
    make: *** [all] Error 2
    WARN: *** Conan 1 is legacy and on a deprecation path ***
    WARN: *** Please upgrade to Conan 2 ***
    tinyad/cci.20240718 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    tinyad/cci.20240718 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
    ERROR: tinyad/cci.20240718 (test package): Error in build() method, line 21
    	cmake.build()
    	ConanException: Error 2 while executing cmake --build "/home/conan/workspace/prod-v1/bsr/cci-c2611638/recipes/tinyad/all/test_package/build/Release" '--' '-j3'
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline ❌

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

The v2 pipeline failed. Please, review the errors and note this is required for pull requests to be merged. In case this recipe is still not ported to Conan 2.x, please, ping @conan-io/barbarians on the PR and we will help you.

Failure in build 10 (cbb5afb16e63adbda030700d6cd7216f12d2c55e):

  • tinyad/cci.20240718:
    CI failed to create some packages (All logs)

    Logs for packageID da39a3ee5e6b4b0d3255bfef95601890afd80709:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=apple-clang
    compiler.cppstd=17
    compiler.libcxx=libc++
    compiler.version=13
    os=Macos
    
    [...]
    tools.apple:sdk_path=/Applications/conan/xcode/13.0/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    
    ======== Launching test_package ========
    
    ======== Computing dependency graph ========
    eigen/3.4.0: Not found in local cache, looking in remotes...
    eigen/3.4.0: Checking remote: conan-center
    eigen/3.4.0: Downloaded recipe revision 2e192482a8acff96fe34766adca2b24c
    llvm-openmp/18.1.8: Not found in local cache, looking in remotes...
    llvm-openmp/18.1.8: Checking remote: conan-center
    llvm-openmp/18.1.8: Downloaded recipe revision 5e371038846bf9a660dc7746beb21e04
    cmake/3.30.1: Not found in local cache, looking in remotes...
    cmake/3.30.1: Checking remote: conan-center
    cmake/3.30.1: Downloaded recipe revision 6d832cf2d46f6ec969ca5ed5b41f91eb
    Graph root
        tinyad/cci.20240718 (test package): /Users/jenkins/workspace/prod-v2/bsr/cci-18f9a68d/recipes/tinyad/all/test_package/conanfile.py
    Requirements
        eigen/3.4.0#2e192482a8acff96fe34766adca2b24c - Downloaded (conan-center)
        llvm-openmp/18.1.8#5e371038846bf9a660dc7746beb21e04 - Downloaded (conan-center)
        tinyad/cci.20240718#53017d28720cabc5562769b7bbe45d18 - Cache
    Build requirements
        cmake/3.30.1#6d832cf2d46f6ec969ca5ed5b41f91eb - Downloaded (conan-center)
    Resolved version ranges
        cmake/[>=3.20 <4]: cmake/3.30.1
    
    ======== Computing necessary packages ========
    Requirements
        eigen/3.4.0#2e192482a8acff96fe34766adca2b24c:da39a3ee5e6b4b0d3255bfef95601890afd80709#b2e7c2d86c5d1dbefc534889aa72e12c - Download (conan-center)
        llvm-openmp/18.1.8#5e371038846bf9a660dc7746beb21e04:ec2a9de6feab3c0b86da78a55456ffb819b1912b#a999c48a1563d42955e90c4a7918883e - Download (conan-center)
        tinyad/cci.20240718#53017d28720cabc5562769b7bbe45d18:da39a3ee5e6b4b0d3255bfef95601890afd80709#c0d5bd019eccdb6e4d46a95902c9cd92 - Download (c3i_PR-v2-24655)
    Build requirements
    Skipped binaries
        cmake/3.30.1
    
    ======== Installing packages ========
    
    -------- Downloading 3 packages --------
    eigen/3.4.0: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'conan-center' 
    eigen/3.4.0: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
    eigen/3.4.0: Downloaded package revision b2e7c2d86c5d1dbefc534889aa72e12c
    llvm-openmp/18.1.8: Retrieving package ec2a9de6feab3c0b86da78a55456ffb819b1912b from remote 'conan-center' 
    llvm-openmp/18.1.8: Package installed ec2a9de6feab3c0b86da78a55456ffb819b1912b
    llvm-openmp/18.1.8: Downloaded package revision a999c48a1563d42955e90c4a7918883e
    tinyad/cci.20240718: Retrieving package da39a3ee5e6b4b0d3255bfef95601890afd80709 from remote 'c3i_PR-v2-24655' 
    tinyad/cci.20240718: Package installed da39a3ee5e6b4b0d3255bfef95601890afd80709
    tinyad/cci.20240718: Downloaded package revision c0d5bd019eccdb6e4d46a95902c9cd92
    ERROR: tinyad/cci.20240718: Required package 'eigen' not in component 'requires'
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@jjcasmar
Copy link
Contributor Author

Any update on this?

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

Successfully merging this pull request may close these issues.

6 participants