Hi all,
please find include an attempt of patch that should be apply on the last
bugfix changeset on 3.20 (revision: 4bdde5048fb2 ) to try to make last
OTB stable release compatible with Mavericks. This patch is a result of
the formula provided by Larry and the Greg feedback on otb-developers
mailing-list last week. I did not push I did not have a Mac to test and
I don't think that the patch should be pushed like this.
Here is the result of my investigation:
- *CMake/FindLibLAS.cmake* : apply Larry patch directly -> not that this
patch will be removed from OTBv4 as we've dropped libLAS support
- *CMake/ImportOpenThreads.cmake*: apply Larry patch with some renaming
for cmake statement to avoid warning (it allow to force internal support
for openthread which seems mandatory on some mac system)
- *Code/IO/otbDefaultConvertPixelTraits.h*: In my opinion the patch
provided in the homebrew formula is wrong and std::norm should be
replaced by:
-> "pixel.real()*pixel.real() +pixel.imag()*pixel.imag()" *instead of*
"pixel.real()>0?pixel.real():-pixel.real()
+pixel.imag()>0?pixel.imag():-pixel.imag()"
(thanks Julien for the second look)
- *Code/Visualization/otbImageLayer.txx* : add std:: for setiosflags
method (patch applied directly)
- *Code/UtilitiesAdapters/boost/type_traits/is_contiguous.h*: I do not
know exactly what should be done here...
If I apply the patch directly:
+#if 1
+#include <array>
+#include <vector>
+#else
namespace std {
template <typename T, std::size_t N> class
array;
template <typename T, typename TAllocator> class
vector;
} // std namespace
+#endif
It does not compile with gcc 4.6 as std::array is available only since
c++11. I am not sure the solution to apply to make it works on both
Mavericks and clang and gcc compiler:
-> Solution 1: the problem on Mavericks is only related to the forward
declaration of the vector class and this declaration can be replaced by
#include <vector>
-> Solution 2: include of array is mandatory so in this case the #if
should test for the support of c++11 (I found such preprocessor
directive: #if __cplusplus > 199711L)
-> Solution 3: forward declaration in the namespace std are not
necessary in the case of OGR wrappers are not mandatory and it can be
removed. I've just keep forward declarations related to boost which are
not modified in the patch available here:
https://github.com/dakcarto/homebrew-osgeo4mac/blob/master/Formula/orfeo.rb
The patch attached includes the solution 3 (comment the forward
declaration for std array and vector)
Regards,
Manuel
Le 18/02/2014 14:38, Manuel Grizonnet a écrit :
> Larry,
>
> I've got one question regarding your patch, your patch with forward
> declaration in your homebrew formula is slightly different than the
> patch apply by Greg. There is especially one patch apply by Greg in
> ITK in 'itkNumericTraitsVectorPixel.h'. I did not see this patch in
> your formula.
>
> Can you confirm that you've tested that your 2 patches make OTB 3.20
> build under Mavericks?
>
> Regards,
>
> Manuel
>
>
> Le 18/02/2014 14:05, Manuel Grizonnet a écrit :
>> Hi,
>>
>> thanks Larry, I'll have a look and try to integrate both patches.
>>
>> Manuel
>>
>> Le 17/02/2014 18:42, Larry Shaffer a écrit :
>>> Hi Manuel,
>>>
>>> On Mon, Feb 17, 2014 at 7:28 AM, Manuel Grizonnet
>>> <[email protected] <mailto:[email protected]>> wrote:
>>>
>>> Hi Greg,
>>>
>>> is it possible for you to provide the patch that need to be
>>> apply to OTB to make it compile on Mavericks? -> We planned to
>>> release a new version anytime soon and I think that it should be
>>> done before.
>>>
>>>
>>> With Greg's help, I updated the Homebrew formula to get OTB to build
>>> under Mavericks [0]. In that formula, under `def patches`, are the
>>> patches I made to fix issues with OTB 3.20.0.
>>>
>>> If you have the time, please review the formula and its comments.
>>> Any help towards specifying dependencies or default options, as well
>>> as which ones should be dropped/added, would be very helpful.
>>>
>>> [0]
>>> https://github.com/dakcarto/homebrew-osgeo4mac/blob/master/Formula/orfeo.rb
>>>
>>> Regards,
>>>
>>> Larry Shaffer
>>> Dakota Cartography
>>> Black Hills, South Dakota
>>>
>>>
>>>
>>> Thank you in advance.
>>>
>>> Manuel
>>>
>>> Le 10/02/2014 09:16, Grégoire MERCIER a écrit :
>>>> Dear Larry,
>>>>
>>>> Yes, it works fine, even monteverdi.
>>>> I installed the following mac port services:
>>>> sudo port install gdal +curl +expat +framework +geos +hdf4
>>>> +hdf5 +jasper +netcdf +odbc +opencl +poppler +sqlite3 +xerces
>>>> sudo port install gmake
>>>> sudo port install cmake +gui
>>>> sudo port install mercurial +zsh_completion
>>>> sudo port install hgview
>>>> sudo port install fltk-devel
>>>> sudo port install fftw fftw-long fftw-single proj
>>>>
>>>> As detailed in our previous mails, few things has to be changed
>>>> from the sources of OTB. I do not know if those modifications
>>>> are planned in the following version...
>>>>
>>>> All the best
>>>> Greg
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>> *From: *"Larry Shaffer" <[email protected]>
>>>> <mailto:[email protected]>
>>>> *To: *[email protected]
>>>> <mailto:[email protected]>
>>>> *Sent: *Saturday, February 8, 2014 10:58:29 PM
>>>> *Subject: *Re: [otb-users] Installation/compilation problems
>>>> with Mavericks
>>>>
>>>> Hi Greg and Julien,
>>>>
>>>> Did you get it to compile with Mavericks/clang/libc++ yet? I'm
>>>> looking to update the Homebrew formula for *orfeo* (current
>>>> work
>>>>
>>>> <https://github.com/dakcarto/homebrew-osgeo4mac/blob/master/Formula/orfeo.rb>).
>>>>
>>>> Regards,
>>>>
>>>> Larry
>>>> --
>>>> --
>>>> Check the OTB FAQ at
>>>> http://www.orfeo-toolbox.org/FAQ.html
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "otb-users" group.
>>>> To post to this group, send email to [email protected]
>>>> <mailto:[email protected]>
>>>> To unsubscribe from this group, send email to
>>>> [email protected]
>>>> <mailto:[email protected]>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/otb-users?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the
>>>> Google Groups "otb-users" group.
>>>> To unsubscribe from this group and stop receiving emails from
>>>> it, send an email to [email protected]
>>>> <mailto:[email protected]>.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>> --
>>>> --
>>>> Check the OTB FAQ at
>>>> http://www.orfeo-toolbox.org/FAQ.html
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "otb-users" group.
>>>> To post to this group, send email to [email protected]
>>>> <mailto:[email protected]>
>>>> To unsubscribe from this group, send email to
>>>> [email protected]
>>>> <mailto:[email protected]>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/otb-users?hl=en
>>>> ---
>>>> You received this message because you are subscribed to the
>>>> Google Groups "otb-users" group.
>>>> To unsubscribe from this group and stop receiving emails from
>>>> it, send an email to [email protected]
>>>> <mailto:[email protected]>.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>> --
>>> --
>>> Check the OTB FAQ at
>>> http://www.orfeo-toolbox.org/FAQ.html
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "otb-users" group.
>>> To post to this group, send email to [email protected]
>>> <mailto:[email protected]>
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> <mailto:otb-users%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/group/otb-users?hl=en
>>> ---
>>> You received this message because you are subscribed to the
>>> Google Groups "otb-users" group.
>>> To unsubscribe from this group and stop receiving emails from
>>> it, send an email to [email protected]
>>> <mailto:otb-users%[email protected]>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>> --
>>> --
>>> Check the OTB FAQ at
>>> http://www.orfeo-toolbox.org/FAQ.html
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "otb-users" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/otb-users?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "otb-users" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>> send an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>> --
>> --
>> Check the OTB FAQ at
>> http://www.orfeo-toolbox.org/FAQ.html
>>
>> You received this message because you are subscribed to the Google
>> Groups "otb-users" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/otb-users?hl=en
>> ---
>> You received this message because you are subscribed to the Google
>> Groups "otb-users" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>
> --
> --
> Check the OTB FAQ at
> http://www.orfeo-toolbox.org/FAQ.html
>
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/otb-users?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "otb-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
diff -r 4bdde5048fb2 CMake/FindLibLAS.cmake
--- a/CMake/FindLibLAS.cmake Wed Dec 18 13:48:52 2013 +0100
+++ b/CMake/FindLibLAS.cmake Tue Feb 18 15:43:22 2014 +0100
@@ -14,7 +14,7 @@
FIND_PATH( LIBLAS_INCLUDE_DIR liblas/capi/liblas.h )
FIND_LIBRARY( LIBLAS_LIBRARY
- NAMES liblas_c liblas )
+ NAMES liblas_c liblas las_c las )
# handle the QUIETLY and REQUIRED arguments and set LIBLAS_FOUND to TRUE if
# all listed variables are TRUE
diff -r 4bdde5048fb2 CMake/ImportOpenThreads.cmake
--- a/CMake/ImportOpenThreads.cmake Wed Dec 18 13:48:52 2013 +0100
+++ b/CMake/ImportOpenThreads.cmake Tue Feb 18 15:43:22 2014 +0100
@@ -7,7 +7,7 @@
MARK_AS_ADVANCED(OPENTHREADS_LIBRARY_DEBUG)
SET(OTB_USE_EXTERNAL_OPENTHREADS ON CACHE INTERNAL "")
-IF(OPENTHREADS_FOUND)
+IF(OPENTHREADS_FOUND AND OTB_USE_EXTERNAL_OPENTHREADS)
INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR})
LINK_DIRECTORIES( ${OPENTHREADS_LIBRARY} )
@@ -16,7 +16,7 @@
MESSAGE(STATUS " OpenThreads includes : ${OPENTHREADS_INCLUDE_DIR}")
MESSAGE(STATUS " OpenThreads library : ${OPENTHREADS_LIBRARY}")
-ELSE(OPENTHREADS_FOUND)
+ELSE(OPENTHREADS_FOUND AND OTB_USE_EXTERNAL_OPENTHREADS)
ADD_DEFINITIONS(-DOTB_USE_INTERNAL_OPENTHREADS)
SET(OTB_USE_EXTERNAL_OPENTHREADS OFF)
@@ -29,4 +29,4 @@
MESSAGE(STATUS " Using OpenThreads internal version")
-ENDIF(OPENTHREADS_FOUND)
+ENDIF(OPENTHREADS_FOUND AND OTB_USE_EXTERNAL_OPENTHREADS)
diff -r 4bdde5048fb2 Code/IO/otbDefaultConvertPixelTraits.h
--- a/Code/IO/otbDefaultConvertPixelTraits.h Wed Dec 18 13:48:52 2013 +0100
+++ b/Code/IO/otbDefaultConvertPixelTraits.h Tue Feb 18 15:43:22 2014 +0100
@@ -18,6 +18,8 @@
#ifndef __otbDefaultConvertPixelTraits_h
#define __otbDefaultConvertPixelTraits_h
+#include <vnl/vnl_math.h>
+
#include "itkOffset.h"
#include "itkCovariantVector.h"
#include "itkVector.h"
@@ -304,7 +306,10 @@
} \
static ComponentType GetScalarValue(const TargetType& pixel) \
{ \
- return std::norm(pixel); \
+ /*issue with std::norm on Mac OS X Mavericks*/ \
+ /*return std::norm(pixel); */ \
+ return static_cast<ComponentType>( pixel.real()*pixel.real() \
+ +pixel.imag()*pixel.imag() ); \
} \
}; \
diff -r 4bdde5048fb2 Code/UtilitiesAdapters/boost/type_traits/is_contiguous.h
--- a/Code/UtilitiesAdapters/boost/type_traits/is_contiguous.h Wed Dec 18 13:48:52 2013 +0100
+++ b/Code/UtilitiesAdapters/boost/type_traits/is_contiguous.h Tue Feb 18 15:43:22 2014 +0100
@@ -36,11 +36,14 @@
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_pointer.hpp>
+// Try to comment forward declarations not used in OGR wrapper and not
+// compatible with Mac OS X Mavericks
+
// forward declarations
-namespace std {
-template <typename T, std::size_t N> class array;
-template <typename T, typename TAllocator> class vector;
-} // std namespace
+// namespace std {
+// template <typename T, std::size_t N> class array;
+// template <typename T, typename TAllocator> class vector;
+// } // std namespace
namespace boost {
template <typename T, std::size_t N> class array;
diff -r 4bdde5048fb2 Code/Visualization/otbImageLayer.txx
--- a/Code/Visualization/otbImageLayer.txx Wed Dec 18 13:48:52 2013 +0100
+++ b/Code/Visualization/otbImageLayer.txx Tue Feb 18 15:43:22 2014 +0100
@@ -301,10 +301,10 @@
{
PointType point = this->GetPixelLocation (index);
- oss << setiosflags(std::ios::fixed) << std::setprecision(2) << "Ground spacing(in m): (" << m_ApproxGroundSpacing[0] << ";" << m_ApproxGroundSpacing[1] << ")" <<
+ oss << std::setiosflags(std::ios::fixed) << std::setprecision(2) << "Ground spacing(in m): (" << m_ApproxGroundSpacing[0] << ";" << m_ApproxGroundSpacing[1] << ")" <<
std::endl;
- oss << setiosflags(std::ios::fixed) << std::setprecision(6) << "Lon: " << point[0] << " Lat: " << point[1] << std::endl;
+ oss << std::setiosflags(std::ios::fixed) << std::setprecision(6) << "Lon: " << point[0] << " Lat: " << point[1] << std::endl;
if (m_Transform->GetTransformAccuracy() == Projection::PRECISE) oss << "(precise location)" << std::endl;
if (m_Transform->GetTransformAccuracy() == Projection::ESTIMATE) oss << "(estimated location)" << std::endl;