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

Adding openvdb 8.0.1 #5257

Merged
merged 9 commits into from
May 19, 2021
Merged

Adding openvdb 8.0.1 #5257

merged 9 commits into from
May 19, 2021

Conversation

AlvaroFS
Copy link
Contributor

Specify library name and version: openvdb/8.0.1

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

@conan-center-bot

This comment has been minimized.

Comment on lines 18 to 24
"shared": [True, False],
"fPIC": [True, False],
"use_blosc": [True, False],
"use_zlib": [True, False],
"use_log4cplus": [True, False],
"use_exr": [True, False],
"simd": ["None", "SSE42", "AVX"],
Copy link
Contributor

Choose a reason for hiding this comment

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

This repo has a (soft) convention to use with_XXX when it causes an extra dependency to be included.
e.g. with_zlib, with_log4cplus, ...
The simd is ok as it is a feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I was just naming them as defined by the library

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand.
Using option names that correspond with those of other packages makes the use of conan more consistent.

It's easier to tell users to use -o *:with_zlib=False to disable zlib support then to tell: -o lib1:enable_zlib=False -o lib2:with_zlib=False -o lib3:zlib=False ....
I hope I made my point 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I understand. I had already changed it for the next commit

if self.options.shared:
del self.options.fPIC
if self.settings.compiler.cppstd:
tools.check_min_cppstd(self, 14)
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
tools.check_min_cppstd(self, 14)
tools.check_min_cppstd(self, 14)
if self.settings.arch not in ("x86", "x86_64"):
if self.options.simd != "None":
raise ConanInvalidConfiguration("Only intel architectures support SSE4 or AVX.")

@@ -0,0 +1,250 @@
import os

from conans import ConanFile, CMake, tools
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
from conans import ConanFile, CMake, tools
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration

tools.check_min_cppstd(self, 14)

def requirements(self):
self.requires("boost/1.69.0") # should be 1.66.0 but not in conan center
Copy link
Contributor

Choose a reason for hiding this comment

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

It's ok to aim higher.
When this package would be built manually on a recent linux distribution, a recent boost version would get used as well.

Suggested change
self.requires("boost/1.69.0") # should be 1.66.0 but not in conan center
self.requires("boost/1.75.0")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was following their recommendations

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should interpret that table as:
"we have tested our library with this version and guarantee it to work"

As long as the library doesn't use any non-public or unstable features, I think we're ok with bumping the versions.


def requirements(self):
self.requires("boost/1.69.0") # should be 1.66.0 but not in conan center
self.requires("tbb/2019_u9") # should be 2018 but not in conan center
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
self.requires("tbb/2019_u9") # should be 2018 but not in conan center
self.requires("tbb/2020.3")

if self.options.use_blosc:
self.requires("c-blosc/[>1.5.0]")
if self.options.use_log4cplus:
self.requires("log4cplus/[>1.1.2]")
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
self.requires("log4cplus/[>1.1.2]")
self.requires("log4cplus/2.0.5")

Comment on lines 106 to 107
" find_package(Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)",
" find_package(c-blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)",
Copy link
Contributor

Choose a reason for hiding this comment

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

I have doubts this renaming is enough.

In a patch, you can create a proxy FindBlosc.cmake package that diverts maps the expected variabled/targets to to the one provided by conan's Findc-blosc.cmake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure either but that sounds like a better option than renaming some of the targets to match the ones set by conan

Comment on lines 172 to 174
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options[
"boost"
].shared
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
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options[
"boost"
].shared
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm using Black with a 79 characters limit per line. Is it correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we all have wide screens 😉

max_line_length = 200

Comment on lines 175 to 177
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options[
"openexr"
].shared
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
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options[
"openexr"
].shared
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options["openexr"].shared

].shared

if self.settings.os == "Windows":
self._cmake.definitions["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = False
Copy link
Contributor

Choose a reason for hiding this comment

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

Does implicit linking mean use of #pragma lib(...)?
If so, then I think it's better to disable this because the name of the boost library provided by the conan package may different then the name hardcoded in the openvdb sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. I only set it to false because it's the default value in the cmake file but I agree that it's better to disable it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I think I had it all wrong from the cmake file 😅

@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

This comment has been minimized.

recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
recipes/openvdb/8.0.1/conanfile.py Outdated Show resolved Hide resolved
Comment on lines +99 to +108
with open("FindBlosc.cmake", "w") as f:
f.write(
"""find_package(c-blosc)
if(c-blosc_FOUND)
add_library(blosc INTERFACE)
target_link_libraries(blosc INTERFACE c-blosc::c-blosc)
add_library(Blosc::blosc ALIAS blosc)
endif()
"""
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
with open("FindBlosc.cmake", "w") as f:
f.write(
"""find_package(c-blosc)
if(c-blosc_FOUND)
add_library(blosc INTERFACE)
target_link_libraries(blosc INTERFACE c-blosc::c-blosc)
add_library(Blosc::blosc ALIAS blosc)
endif()
"""
)
with open("FindBlosc.cmake", "w") as f:
f.write(
"""find_package(c-blosc)
if(c-blosc_FOUND)
add_library(blosc INTERFACE)
target_link_libraries(blosc INTERFACE c-blosc::c-blosc)
add_library(Blosc::blosc ALIAS blosc)
endif()
"""
)

Did you try cmake_find_package generator instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did, but package names are different so instead of patching the CMakelists I wrapped the conan libraries with the expected name as @madebr suggested here

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

All green in build 7 (f8af7fbd29499594eaa6bdbde993f76089d614c9):

  • openvdb/8.0.1@:
    All packages built successfully! (All logs)

if self.settings.os == "Windows":
del self.options.fPIC

def _check_compilier_version(self):
Copy link
Contributor

@prince-chrismc prince-chrismc May 16, 2021

Choose a reason for hiding this comment

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

Fro my tracking conan-io/conan#8002

self._check_compilier_version()

def requirements(self):
self.requires("boost/1.75.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we bump to 76?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so. I'll change it.

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
self.requires("boost/1.75.0")
self.requires("boost/1.76.0")

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

Successfully merging this pull request may close these issues.

7 participants