llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.35k stars 12.14k forks source link

[OpenMP] missing export for dynamic tracking patch on Linux #98046

Closed dcci closed 4 months ago

dcci commented 4 months ago

After dynamic tracker landed, we started seeing some of these undefined symbols problems:

ld.lld: error: undefined symbol: __kmpc_dispatch_deinit
>>> referenced by <redacted>

https://github.com/llvm/llvm-project/pull/97419 fixes the problem for Windows, exporting the symbol in dllexport, but it doesn't for Linux. I think there should be an entry in the Linux counterpart.

@doru1004 -- what do you think?

llvmbot commented 4 months ago

@llvm/issue-subscribers-openmp

Author: Davide Italiano (dcci)

After dynamic tracker landed, we started seeing some of these undefined symbols problems: ``` ld.lld: error: undefined symbol: __kmpc_dispatch_deinit >>> referenced by <redacted> ``` https://github.com/llvm/llvm-project/pull/97419 fixes the problem for Windows, exporting the symbol in dllexport, but it doesn't for Linux. I think there should be an entry in the Linux counterpart. @doru1004 -- what do you think?
dcci commented 4 months ago

Nevermind, it was a problem in our setup. Sorry for the noise.

joshua-zh commented 1 month ago

When I compiled R package source, the same error popped up under MacOS.

shiltian commented 1 month ago

@joshua-zh steps to reproduce?

joshua-zh commented 1 month ago

Thank you for getting back to me. The codes are as below:

remotes::install_github("lme4/lme4")
Downloading GitHub repo lme4/lme4@HEAD
── R CMD build ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✔  checking for file ‘/private/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T/Rtmp2r20DF/remotes72e83e3ccea1/lme4-lme4-bfd7a44/DESCRIPTION’ ...
─  preparing ‘lme4’:
✔  checking DESCRIPTION meta-information
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘lme4_1.1-35.6.tar.gz’

* installing *source* package ‘lme4’ ...
** using staged installation
** libs
using C++ compiler: ‘Homebrew clang version 19.1.2’
using SDK: ‘MacOSX15.0.sdk’
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Matrix/include' -I/opt/R/arm64/include    -DNDEBUG -DEIGEN_DONT_VECTORIZE -fPIC  -falign-functions=64 -Wall -g -O2  -c external.cpp -o external.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Matrix/include' -I/opt/R/arm64/include    -DNDEBUG -DEIGEN_DONT_VECTORIZE -fPIC  -falign-functions=64 -Wall -g -O2  -c glmFamily.cpp -o glmFamily.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Matrix/include' -I/opt/R/arm64/include    -DNDEBUG -DEIGEN_DONT_VECTORIZE -fPIC  -falign-functions=64 -Wall -g -O2  -c optimizer.cpp -o optimizer.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Matrix/include' -I/opt/R/arm64/include    -DNDEBUG -DEIGEN_DONT_VECTORIZE -fPIC  -falign-functions=64 -Wall -g -O2  -c predModule.cpp -o predModule.o
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include' -I'/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/Matrix/include' -I/opt/R/arm64/include    -DNDEBUG -DEIGEN_DONT_VECTORIZE -fPIC  -falign-functions=64 -Wall -g -O2  -c respModule.cpp -o respModule.o
In file included from external.cpp:8:
In file included from ./predModule.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:26:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseCore:61:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseCore/TriangularSolver.h:273:13: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  273 |       Index count = 0;
      |             ^
In file included from respModule.cpp:7:
In file included from ./respModule.h:12:
In file included from ./glmFamily.h:11:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:26:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseCore:61:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseCore/TriangularSolver.h:273:13: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  273 |       Index count = 0;
      |             ^In file included from optimizer.cpp:13
:
In file included from ./optimizer.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:26:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseCore:61:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseCore/TriangularSolver.h:273:13: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  273 |       Index couIn file included from nglmFamily.cpp:In file included from predModule.cpp:8:
In file included from ./predModule.h:12:
In file included from t8 = 0:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:In file included from 25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:26:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseCore:61:
./glmFamily.h;
      |             ^
:/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseCore/TriangularSolver.h11::
273In file included from :/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h13::25 :
warning: In file included from variable 'count' set but not used [-Wunused-but-set-variable]/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h
  :27329 | :
 In file included from  /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse : 26 :
 In file included from I/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseCoren:d61e:
x count =/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseCore/TriangularSolver.h:273:13: warning: variable 'count' set but not used [-Wunused-but-set-variable]
 0;  273 |      
       I| n            ^d
ex count = 0;
      |             ^
In file included from glmFamily.cpp:8:
In file included from ./glmFamily.h:11:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:29:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseLU:35:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h:78:9: warning: variable 'nsuper_et_post' set but not used [-Wunused-but-set-variable]
   78 |   Index nsuper_et_posIn file included from toptimizer.cpp := 0; // Number ofIn file included from  respModule.cpp:In file included from 13predModule.cpp:8:
In file included from ./optimizer.h:12re:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:7:
:
In file included from l./respModule.h25:a:
xIn file included from e/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.hd: 29s:
nIn file included from o/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparsed:e29s:
 In file included from i/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseLUn: 35p:
o/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.hs:t78o:r9d:e rwarning: evariable 'nsuper_et_post' set but not used [-Wunused-but-set-variable]d
 12:
In file included from e./predModule.h:t12In file included from :
./glmFamily.hIn file included from :/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:r11e:
eIn file included from  /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h
:      25| :
        ^In file included from 
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h   :2578:
 | In file included from  /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h :I2929:
:
nIn file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse:d/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.he:2979:
:9: In file included from In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseLUwarning: :variable 'nsuper_et' set but not used [-Wunused-but-set-variable]35::
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h29:
78:9: warning: variable 'nsuper_et_post' set but not used [-Wunused-but-set-variable]
x      7978 |   Index n | :
In file included from  /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseLU :n sIunpdseux35 ns:
e/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h:r78_:et_pouspt p9er:_ ewarning: te r=_=e t0_;p o/s/t  N=u m0b;e r/ /o fN urmeblearx eodf  srne variable 'nsuper_et_post' set but not used [-Wunused-but-set-variable]0
;o   78 |    In/ddeexs  nisnu ppeo/s tNumbelaoxerrdd esrneodd eest rien_ epto_sptoeorrd st =o f
       r| eere l        ^a
xed0 ; // Ndu/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.hs:n oedterse ei n
       |         ^
t79he /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.hm:ber of orri:g9i:n awarning: lvariable 'nsuper_et' set but not used [-Wunused-but-set-variable] 
etree79e    79
 |       lIn file included from a| x        ^ed
 :9: warning: variable 'nsuper_et' set but not used [-Wunused-but-set-variable]
sno    79 |   Inexternal.cppd:e8x:
dIn file included from  ./predModule.h:12 en:
supIn file included from Inde/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.hr:_se xe tn s=u p0e;r _/e/t  N=u m0b;e r/ /o fN urmeblearx eodf  srneoldaexse dinin pos tto25rd:
eIn file included from rheed/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h :e29t:
rIn file included from e/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/Sparse  :e29 :

In file included from       /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/SparseLU:35s| n        ^od:

/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h:78:9: warning: variable 'nsuper_et_post' set but not used [-Wunused-but-set-variable]
es/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h:79   o78r | i g iInnad e:9: warning: variable 'nsuper_et' set but not used [-Wunused-but-set-variable]
xli ne ttrhe   e79  | 
        | I        ^n
dee nsuper_et_pox  nsuosritg i=n a0l;  p/e/r _Neute t=r e0e;  
/      /|         ^
 Number of relaxed snodes in postordmeber of relaxed snodes inr tehde  eotrriginal eeter e
e       | 
        ^      
|         ^
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h:79:9: warning: variable 'nsuper_et' set but not used [-Wunused-but-set-variable]
   79 |   Index nsuper_et = 0; // Number of relaxed snodes in the original etree 
      |         ^
In file included from predModule.cpp:8:
In file included from ./predModule.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:31:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/IterativeSolvers:46:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/IterativeSolvers/IDRS.h:72:10: warning: variable 'replacements' set but not used [-Wunused-but-set-variable]
   72 |                         Index replacements = 0;
      |                               ^
In file included from optimizer.cpp:13:
In file included from ./optimizer.h:12:
In file included from In file included from respModule.cppexternal.cppIn file included from ::7:
8In file included from ./respModule.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h./glmFamily.h::1125:
:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.hIn file included from :/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h25::
31In file included from :
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:31:
In file included from ./predModule.h:In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/IterativeSolvers::
46:
12/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/IterativeSolvers/IDRS.h:
:In file included from 72/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h::1025::
 In file included from warning: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.hIn file included from variable 'replacements' set but not used [-Wunused-but-set-variable]/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/IterativeSolvers
:46:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/IterativeSolvers/IDRS.h:72:10: warning: variable 'replacements' set but not used [-Wunused-but-set-variable]:
31:
   In file included from 72/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/IterativeSolvers:   72 |                  |         I        n46:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/IterativeSolvers/IDRS.h:72        :10        :dIenxd  warning: variable 'replacements' set but not used [-Wunused-but-set-variable]
ex replacemen   ts 72= |          r                eIp0l;ac
e      m| e                              ^n
ts = 0;
      n| d                              ^e
x replacements = 0;
      |                               ^
In file included from glmFamily.cpp:8:
In file included from ./glmFamily.h:11:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:31:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/IterativeSolvers:46:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/IterativeSolvers/IDRS.h:72:10: warning: variable 'replacements' set but not used [-Wunused-but-set-variable]
   72 |                         Index replacements = 0;
      |                               ^
In file included from optimizer.cpp:13:
In file included from ./optimizer.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:37:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/SparseExtra:45:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/SparseExtra/MarketIO.h:246:7: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  246 |   int count = 0;
      |       ^
In file included from respModule.cpp:7:
In file included from ./respModule.h:12:
In file included from ./glmFamily.h:11:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:37:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/SparseExtra:45:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/SparseExtra/MarketIO.h:246:7: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  246 |   int count = 0;
      |       ^
In file included from predModule.cpp:8:
In file included from ./predModule.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:37:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/SparseExtra:45:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/SparseExtra/MarketIO.h:246:7: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  246 |   int count = 0;
      |       ^
In file included from glmFamily.cpp:8:
In file included from ./glmFamily.h:11:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:37:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/SparseExtra:45:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/SparseExtra/MarketIO.h:246:7: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  246 |   int count = 0;
      |       ^
In file included from external.cpp:8:
In file included from ./predModule.h:12:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigen.h:25:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/RcppEigenForward.h:37:
In file included from /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/SparseExtra:45:
/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppEigen/include/unsupported/Eigen/src/SparseExtra/MarketIO.h:246:7: warning: variable 'count' set but not used [-Wunused-but-set-variable]
  246 |   int count = 0;
      |       ^
5 warnings generated.
5 warnings generated.
5 warnings generated.
5 warnings generated.
5 warnings generated.
clang++ -arch arm64 -std=gnu++17 -flax-vector-conversions -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o lme4.so external.o glmFamily.o optimizer.o predModule.o respModule.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-lme4/00new/lme4/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘lme4’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-lme4/00new/lme4/libs/lme4.so':
  dlopen(/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-lme4/00new/lme4/libs/lme4.so, 0x0006): symbol not found in flat namespace '___kmpc_dispatch_deinit'
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/lme4’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/lme4’
Warning message:
In i.p(...) :
  installation of package ‘/var/folders/sj/jdgnsm9n14vgsjctfrk5x2_80000gn/T//Rtmp2r20DF/file72e8ffe335c/lme4_1.1-35.6.tar.gz’ had non-zero exit status
joshua-zh commented 1 month ago

The error is also mentioned herehttps://trac.macports.org/ticket/70877

v4hn commented 2 weeks ago

I see the same original error with Debian testing clang++ (Debian version 16.0.6 (27+b1)) and mold right now, where the same code base successfully compiles with g++ 14.2.0 (Debian 14.2.0-8) and mold.

I don't have the resources to debug this in detail right now, so it might be entirely unrelated.

shiltian commented 2 weeks ago

This looks like a mismatch of compiler and libomp. Do you know what version of libomp it is using?

v4hn commented 1 week ago

This looks like a mismatch of compiler and libomp. Do you know what version of libomp it is using?

Here's my cmake output:

The C compiler identification is Clang 16.0.6
The CXX compiler identification is Clang 16.0.6
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: /usr/bin/clang - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: /usr/bin/clang++ - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Found OpenMP_C: -fopenmp=libomp (found version "5.0")
Found OpenMP_CXX: -fopenmp=libomp (found version "5.0")
Found OpenMP: TRUE (found version "5.0")

I didn't do anything special over setting -DCMAKE_CXX_COMPILER=clang++ and using the default find_package(OpenMP) + link to OpenMP::OpenMP_CXX.