lhe17 / coxmeg

2 stars 0 forks source link

Compiling error #1

Open jinghuazhao opened 7 months ago

jinghuazhao commented 7 months ago

I attempt to compile 1.1.1 but stuck with file cswei.cpp,

cswei.cpp:31:29: error: cannot convert 'Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, 1>, double, Eigen::internal::SingleRange> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, 1>, double, Eigen::internal::SingleRange>}' to 'Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar {aka double}' in assignment w_v_x(j) = temp(rs_rs(j)); ^ make: *** [cswei.o] Error 1 ERROR: compilation failed for package ‘coxmeg’

from this I change the function parameters from

Eigen::VectorXd cswei(const Eigen::Map w_v, const Eigen::Map rs_rs, const Eigen::MatrixXi & ind, const Eigen::VectorXd & rev) ...

to

Eigen::VectorXd cswei(const Eigen::Map w_v, const Eigen::MatrixXi & rs_rs, const Eigen::MatrixXi & ind, const Eigen::VectorXd & rev) {

it then proceeds giving the next error,

logdeth.cpp:248:17: required from here /rds/project/jmmh2/rds-jmmh2-public_databases/software/R/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h:1042:8: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits::type {aka __vector(2) double}' [-Wignored-attributes] make: *** [logdeth.o] Error 1 ERROR: compilation failed for package ‘coxmeg’

Would it be possible to provide a fix to this?

Thank you very much

lhe17 commented 7 months ago

Hi Jing Hua Zhao,

Thank you for reporting the issue.

This error is due to the recent release of RcppEigen 0.3.4. I'll try to update coxmeg to make it compatible with the latest version of RcppEigen as soon as possible. For now, you could circumvent this issue by uninstalling RcppEigen 0.3.4 and reinstalling a previous version (e.g., 0.3.3.9.4) listed on the archive website (https://cran.r-project.org/src/contrib/Archive/RcppEigen/).

Best regards, Liang

On Sat, Mar 2, 2024 at 9:31 AM Jing Hua Zhao @.***> wrote:

I attempt to compile 1.1.1 but stuck with file cswei.cpp,

cswei.cpp:31:29: error: cannot convert 'Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, 1>, double, Eigen::internal::SingleRange> >::type {aka Eigen::IndexedView<Eigen::Matrix<double, -1, 1>, double, Eigen::internal::SingleRange>}' to 'Eigen::DenseCoeffsBase<Eigen::Matrix<double, -1, 1>, 1>::Scalar {aka double}' in assignment w_v_x(j) = temp(rs_rs(j)); ^ make: *** [cswei.o] Error 1 ERROR: compilation failed for package ‘coxmeg’

from this I change the function parameters from

Eigen::VectorXd cswei(const Eigen::MapEigen::VectorXd w_v, const Eigen::MapEigen::VectorXd rs_rs, const Eigen::MatrixXi & ind, const Eigen::VectorXd & rev) ...

to

Eigen::VectorXd cswei(const Eigen::MapEigen::VectorXd w_v, const Eigen::MatrixXi & rs_rs, const Eigen::MatrixXi & ind, const Eigen::VectorXd & rev) {

it then proceeds giving the next error,

logdeth.cpp:248:17: required from here /rds/project/jmmh2/rds-jmmh2-public_databases/software/R/RcppEigen/include/Eigen/src/Core/CoreEvaluators.h:1042:8: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits::type {aka __vector(2) double}' [-Wignored-attributes] make: *** [logdeth.o] Error 1 ERROR: compilation failed for package ‘coxmeg’

  • removing ‘/rds/project/jmmh2/rds-jmmh2-public_databases/software/R/coxmeg’

Would it be possible to provide a fix to this?

Thank you very much

— Reply to this email directly, view it on GitHub https://github.com/lhe17/coxmeg/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGDISUSTCBC3KK5PVRNVZFLYWHPE3AVCNFSM6AAAAABEDEQ7ISVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3DIOBTGUYTAMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jinghuazhao commented 7 months ago

Hi Liang,, Thanks very much for getting back to me -- indeed that would work. It would be too much work/uncertainty for me to change your coding and I suppose this should also fix the issue on CRAN.. Best regards, Jing Hua

lhe17 commented 7 months ago

Hi Jing Hua,

I have now published a new version 1.1.5 (https://github.com/lhe17/coxmeg/releases/tag/v1.1.5), adding support for RcppEigen 0.3.4.

Best regards, Liang

jinghuazhao commented 7 months ago

Hi Liang,

Indeed both are compiled smoothly on our system. Thank yo so much!

Kind regards,

JIng Hua