-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding openvdb 8.0.1 #5257
Conversation
This comment has been minimized.
This comment has been minimized.
recipes/openvdb/8.0.1/conanfile.py
Outdated
"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"], |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😃
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from conans import ConanFile, CMake, tools | |
from conans import ConanFile, CMake, tools | |
from conans.errors import ConanInvalidConfiguration |
recipes/openvdb/8.0.1/conanfile.py
Outdated
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 |
There was a problem hiding this comment.
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.
self.requires("boost/1.69.0") # should be 1.66.0 but not in conan center | |
self.requires("boost/1.75.0") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
recipes/openvdb/8.0.1/conanfile.py
Outdated
|
||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.requires("tbb/2019_u9") # should be 2018 but not in conan center | |
self.requires("tbb/2020.3") |
recipes/openvdb/8.0.1/conanfile.py
Outdated
if self.options.use_blosc: | ||
self.requires("c-blosc/[>1.5.0]") | ||
if self.options.use_log4cplus: | ||
self.requires("log4cplus/[>1.1.2]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.requires("log4cplus/[>1.1.2]") | |
self.requires("log4cplus/2.0.5") |
recipes/openvdb/8.0.1/conanfile.py
Outdated
" find_package(Blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)", | ||
" find_package(c-blosc ${MINIMUM_BLOSC_VERSION} REQUIRED)", |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
recipes/openvdb/8.0.1/conanfile.py
Outdated
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options[ | ||
"boost" | ||
].shared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options[ | |
"boost" | |
].shared | |
self._cmake.definitions["Boost_USE_STATIC_LIBS"] = not self.options["boost"].shared |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😉
conan-center-index/.editorconfig
Line 12 in c8fa943
max_line_length = 200 |
recipes/openvdb/8.0.1/conanfile.py
Outdated
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options[ | ||
"openexr" | ||
].shared |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options[ | |
"openexr" | |
].shared | |
self._cmake.definitions["OPENEXR_USE_STATIC_LIBS"] = not self.options["openexr"].shared |
recipes/openvdb/8.0.1/conanfile.py
Outdated
].shared | ||
|
||
if self.settings.os == "Windows": | ||
self._cmake.definitions["OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING"] = False |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 😅
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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() | ||
""" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Uilian Ries <[email protected]>
This comment has been minimized.
This comment has been minimized.
All green in build 7 (
|
if self.settings.os == "Windows": | ||
del self.options.fPIC | ||
|
||
def _check_compilier_version(self): |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.requires("boost/1.75.0") | |
self.requires("boost/1.76.0") |
Specify library name and version: openvdb/8.0.1
conan-center hook activated.