Skip to content

WASM build fails #2

@mhpob

Description

@mhpob

Note

Migrated from meganwinton#16

This is not a priority IMO -- I don't think people should be running MCMC models in their web browser -- but just placing it here for tracking purposes.

R-Universe builds binaries for a few different OSes, including WebAssembly. The package fails to build in its current state.

This looks to be an issue with RcppParallel:

https://github.com/r-universe/ocean-tracking-network/actions/runs/15425099253/job/43410397140

em++ -std=gnu++17 -DNDEBUG -I"../inst/include" -I"/github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error -DUSE_STANC3 -D_HAS_AUTO_PTR_ETC=0 -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/BH/include' -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/Rcpp/include' -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppEigen/include' -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include' -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include' -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include' -I/opt/webr/wasm/include -I/opt/webr/R/build/R-4.5.0/build/include -I/opt/webr/R/build/R-4.5.0/src/include -s USE_BZIP2=1 -s USE_ZLIB=1  -I'/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include' -D_REENTRANT -DSTAN_THREADS   -fpic  -std=gnu++17 -Oz -fPIC -fwasm-exceptions -s SUPPORT_LONGJMP=wasm -DRCPP_DEMANGLER_ENABLED=0 -D__STRICT_ANSI__  -c stanExports_COA_Standard.cc -o stanExports_COA_Standard.o
In file included from stanExports_COA_Standard.cc:5:
In file included from ./stanExports_COA_Standard.h:23:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/rstaninc.hpp:4:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/stan_fit.hpp:43:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src/stan/io/dump.hpp:7:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim.hpp:15:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor.hpp:30:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor/reduce_sum.hpp:8:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task_arena.h:20:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task.h:21:
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:329:6: error: Unsupported machine word size.
  329 |     #error Unsupported machine word size.
      |      ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:334:9: error: use of undeclared identifier '__TBB_Yield'
  334 |         __TBB_Yield();
      |         ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:341:31: error: use of undeclared identifier '__TBB_full_memory_fence'
  341 | inline void atomic_fence () { __TBB_full_memory_fence(); }
      |                               ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:369:13: error: use of undeclared identifier '__TBB_Yield'
  369 |             __TBB_Yield();
      |             ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:462:47: error: use of undeclared identifier '__TBB_machine_cmpswp4'
  462 |         const uint32_t big_result = (uint32_t)__TBB_machine_cmpswp4( aligned_ptr, big_value, big_comparand );
      |                                               ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:482:12: error: use of undeclared identifier '__TBB_machine_cmpswp1'
  482 |     return __TBB_machine_cmpswp1(ptr,value,comparand);
      |            ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:491:12: error: use of undeclared identifier '__TBB_machine_cmpswp2'
  491 |     return __TBB_machine_cmpswp2(ptr,value,comparand);
      |            ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:498:21: error: use of undeclared identifier '__TBB_machine_cmpswp4'
  498 |     return (int32_t)__TBB_machine_cmpswp4(ptr,value,comparand);
      |                     ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:504:12: error: use of undeclared identifier '__TBB_machine_cmpswp8'
  504 |     return __TBB_machine_cmpswp8(ptr,value,comparand);
      |            ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:720:5: error: implicit instantiation of undefined template 'tbb::internal::machine_load_store<unsigned long, 4>'
  720 |     machine_load_store<size_t,sizeof(size_t)>::store_with_release( location, value );
      |     ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:125:8: note: template is declared here
  125 | struct machine_load_store;
      |        ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:733:5: error: implicit instantiation of undefined template 'tbb::internal::machine_load_store_seq_cst<unsigned long, 4>'
  733 |     machine_load_store_seq_cst<size_t,sizeof(size_t)>::store( location, value );
      |     ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:131:8: note: template is declared here
  131 | struct machine_load_store_seq_cst;
      |        ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:746:5: error: implicit instantiation of undefined template 'tbb::internal::machine_load_store_relaxed<unsigned long, 4>'
  746 |     machine_load_store_relaxed<size_t,sizeof(size_t)>::store( const_cast<size_t&>(location), value );
      |     ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:128:8: note: template is declared here
  128 | struct machine_load_store_relaxed;
      |        ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:883:28: error: use of undeclared identifier '__TBB_CompareAndSwapW'
  883 |         uintptr_t result = __TBB_CompareAndSwapW(operand, tmp|addend, tmp);
      |                            ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:893:28: error: use of undeclared identifier '__TBB_CompareAndSwapW'
  893 |         uintptr_t result = __TBB_CompareAndSwapW(operand, tmp&addend, tmp);
      |                            ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_machine.h:916:12: error: use of undeclared identifier '__TBB_machine_cmpswp1'
  916 |     return __TBB_machine_cmpswp1(&flag,1,0)==0;
      |            ^
In file included from stanExports_COA_Standard.cc:5:
In file included from ./stanExports_COA_Standard.h:23:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/rstaninc.hpp:4:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/stan_fit.hpp:43:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src/stan/io/dump.hpp:7:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim.hpp:15:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor.hpp:30:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor/reduce_sum.hpp:8:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task_arena.h:20:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task.h:22:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_profiling.h:120:
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:194:1: error: use of undeclared identifier '__TBB_machine_cmpswp1'
  194 | __TBB_DECL_ATOMIC_PRIMITIVES(1)
      | ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:149:20: note: expanded from macro '__TBB_DECL_ATOMIC_PRIMITIVES'
  149 |             return __TBB_machine_cmpswp##S(location,new_value,comparand);                                \
      |                    ^
<scratch space>:178:1: note: expanded from here
  178 | __TBB_machine_cmpswp1
      | ^
In file included from stanExports_COA_Standard.cc:5:
In file included from ./stanExports_COA_Standard.h:23:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/rstaninc.hpp:4:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/stan_fit.hpp:43:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src/stan/io/dump.hpp:7:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim.hpp:15:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor.hpp:30:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor/reduce_sum.hpp:8:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task_arena.h:20:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task.h:22:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_profiling.h:120:
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:194:1: error: use of undeclared identifier '__TBB_machine_fetchadd1'
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:152:20: note: expanded from macro '__TBB_DECL_ATOMIC_PRIMITIVES'
  152 |             return __TBB_machine_fetchadd##S(location,addend);                                           \
      |                    ^
<scratch space>:179:1: note: expanded from here
  179 | __TBB_machine_fetchadd1
      | ^
In file included from stanExports_COA_Standard.cc:5:
In file included from ./stanExports_COA_Standard.h:23:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/rstaninc.hpp:4:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/stan_fit.hpp:43:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src/stan/io/dump.hpp:7:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim.hpp:15:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor.hpp:30:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor/reduce_sum.hpp:8:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task_arena.h:20:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task.h:22:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_profiling.h:120:
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:194:1: error: use of undeclared identifier '__TBB_machine_fetchstore1'
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:155:20: note: expanded from macro '__TBB_DECL_ATOMIC_PRIMITIVES'
  155 |             return __TBB_machine_fetchstore##S(location,value);                                          \
      |                    ^
<scratch space>:180:1: note: expanded from here
  180 | __TBB_machine_fetchstore1
      | ^
In file included from stanExports_COA_Standard.cc:5:
In file included from ./stanExports_COA_Standard.h:23:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/rstaninc.hpp:4:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/rstan/include/rstan/stan_fit.hpp:43:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/src/stan/io/dump.hpp:7:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim.hpp:15:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor.hpp:30:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/StanHeaders/include/stan/math/prim/functor/reduce_sum.hpp:8:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task_arena.h:20:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/task.h:22:
In file included from /github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/tbb_profiling.h:120:
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:195:1: error: use of undeclared identifier '__TBB_machine_cmpswp2'
  195 | __TBB_DECL_ATOMIC_PRIMITIVES(2)
      | ^
/github/home/R/x86_64-pc-linux-gnu-library/4.5/RcppParallel/include/tbb/atomic.h:149:20: note: expanded from macro '__TBB_DECL_ATOMIC_PRIMITIVES'
  149 |             return __TBB_machine_cmpswp##S(location,new_value,comparand);                                \
      |                    ^
<scratch space>:181:1: note: expanded from here
  181 | __TBB_machine_cmpswp2
      | ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [/opt/R/4.5.0/lib/R/etc/Makeconf:209: stanExports_COA_Standard.o] Error 1
ERROR: compilation failed for package ‘TelemetrySpace’

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions