ANTsX / ITKR

port of ITK to R
6 stars 14 forks source link

Problen installing ITKR #63

Closed vinferrer closed 1 month ago

vinferrer commented 1 month ago

While installing ITKR with devtools I have this error:

Building CXX object Modules/Filtering/MathematicalMorphology/src/CMakeFiles/ITKMathematicalMorphology.dir/itkMathematicalMorphologyEnums.cxx.o
In file included from /tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:19:
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:41:8: warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword
   41 |   enum class Algorithm : uint8_t
      |   ~~~~ ^~~~~
      |        -----
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:41:14: error: use of enum ‘Algorithm’ without previous declaration
   41 |   enum class Algorithm : uint8_t
      |              ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:41:26: error: ‘uint8_t’ was not declared in this scope
   41 |   enum class Algorithm : uint8_t
      |                          ^~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:23:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   22 | #include "ITKMathematicalMorphologyExport.h"
  +++ |+#include <cstdint>
   23 | 
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:42:3: error: default member initializer for unnamed bit-field
   42 |   {
      |   ^
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/include/itkMathematicalMorphologyEnums.h:52:107: error: ‘Algorithm’ in ‘class itk::MathematicalMorphologyEnums’ does not name a type
   52 |                                         operator<<(std::ostream & out, const MathematicalMorphologyEnums::Algorithm value);
      |                                                                                                           ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:25:67: error: ‘Algorithm’ in ‘class itk::MathematicalMorphologyEnums’ does not name a type
   25 | operator<<(std::ostream & out, const MathematicalMorphologyEnums::Algorithm value)
      |                                                                   ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx: In lambda function:
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:30:41: error: ‘itk::MathematicalMorphologyEnums::Algorithm’ has not been declared
   30 |       case MathematicalMorphologyEnums::Algorithm::BASIC:
      |                                         ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:32:41: error: ‘itk::MathematicalMorphologyEnums::Algorithm’ has not been declared
   32 |       case MathematicalMorphologyEnums::Algorithm::HISTO:
      |                                         ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:34:41: error: ‘itk::MathematicalMorphologyEnums::Algorithm’ has not been declared
   34 |       case MathematicalMorphologyEnums::Algorithm::ANCHOR:
      |                                         ^~~~~~~~~
/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itks/Modules/Filtering/MathematicalMorphology/src/itkMathematicalMorphologyEnums.cxx:36:41: error: ‘itk::MathematicalMorphologyEnums::Algorithm’ has not been declared
   36 |       case MathematicalMorphologyEnums::Algorithm::VHGW:
      |                                         ^~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-c++11-long-long’ may have been intended to silence earlier diagnostics
make[3]: Leaving directory '/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itkb'
make[3]: *** [Modules/Filtering/MathematicalMorphology/src/CMakeFiles/ITKMathematicalMorphology.dir/build.make:76: Modules/Filtering/MathematicalMorphology/src/CMakeFiles/ITKMathematicalMorphology.dir/itkMathematicalMorphologyEnums.cxx.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:6826: Modules/Filtering/MathematicalMorphology/src/CMakeFiles/ITKMathematicalMorphology.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX static library ../../../../../../../lib/libitkgdcmMEXD-5.3.a
make[3]: Leaving directory '/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itkb'
[ 98%] Built target gdcmMEXD
make[2]: Leaving directory '/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itkb'
make[1]: *** [Makefile:156: all] Error 2
make[1]: Leaving directory '/tmp/Rtmp1ZTyqe/R.INSTALLa3b0120541af1/ITKR/src/itkb'
make: *** [Makevars:8: libs] Error 2
ERROR: compilation failed for package ‘ITKR’
* removing ‘/home/vicente/R/ITKR’

System:

Ubuntu 24.02 R 4.3.3 gcc version 13.2.0 GNU Make 4.3

I believe is an issue with ITK, if it cannot be solve here where should I post it?

cookpa commented 1 month ago

It's been a long time since I've attempted devtools, but on my Mac, R CMD INSTALL ./ITKR works

System details in case they are helpful:

cmake version 3.30.5 Apple clang version 16.0.0 (clang-1600.0.26.3) R version 4.3.1 (2023-06-16) -- "Beagle Scouts"

stnava commented 1 month ago

I just pushed an update that bumps the ITK version ... it worked for me on R 4.3 via

but failed on

unfortunately our auto-builds are not working ATM - any help with that appreciated. @cookpa - do you know how these are supposed to be setup?

vinferrer commented 1 month ago

Thank you both, I was installing it with devtools because I needed the dependency for another R package and it was installing it automaticly with devtools. @cookpa command worked , ITKR can be imported with library(). If there is any problem I will open another issue.