Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with intel compilers #199

Closed
gareth-d-ga opened this issue Sep 15, 2022 · 2 comments · Fixed by #200
Closed

Building with intel compilers #199

gareth-d-ga opened this issue Sep 15, 2022 · 2 comments · Fixed by #200

Comments

@gareth-d-ga
Copy link

When trying to install s2 on a machine that uses the Intel compilers, I get this error message:

icpc -std=gnu++11 -I"/apps/R/4.2.1/lib64/R/include" -DNDEBUG -I../src -DSTRICT_R_HEADERS -I'/home/547/gxd547/R/x86_64-pc-linux-gnu-library/4.2/Rcpp/include' -I'/home/547/gxd547/R/x86_64-pc-linux-gnu-library/4.2/wk/include' -I/usr/local/include  -DIS_LITTLE_ENDIAN -pthread -fpic  -g -O2  -c absl/strings/cord.cc -o absl/strings/cord.o
In file included from ../src/absl/strings/cord.h(84),
                 from absl/strings/cord.cc(15):
../src/absl/strings/internal/string_constant.h(43): error: expression must have a constant value
    static_assert(value.empty() || 2 * value[0] != 1,
                  ^
../src/absl/strings/internal/string_constant.h(43): note: expression cannot be interpreted
    static_assert(value.empty() || 2 * value[0] != 1,
                                ^

compilation aborted for absl/strings/cord.cc (code 2)
make: *** [/apps/R/4.2.1/lib64/R/etc/Makeconf:175: absl/strings/cord.o] Error 2
ERROR: compilation failed for package ‘s2’

I'm not a c++ programmer, but was wondering if you could have a look to see if the code is valid c++ (or else, it's a compiler issue)?

You might ask why I don't just use gcc. On this machine, it will be difficult as I would need to build a lot of dependencies myself, which have been pre-built by the administrators with Intel. While I only recently started using sf and dependencies, for many years previously I could successfully used R spatial packages with these compilers.

My sessionInfo() is copied below.

Thanks,
Gareth

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Rocky Linux 8.6 (Green Obsidian)

Matrix products: default
BLAS/LAPACK: /apps/intel-oneapi/mkl/2022.1.0/lib/intel64/libmkl_intel_lp64.so.2

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1    tcltk_4.2.1   
@gareth-d-ga
Copy link
Author

gareth-d-ga commented Sep 15, 2022

Confirming that if I comment out the static_assert statement flagged above (lines 43-44 of s2/src/absl/strings/internal/string_constant.h), then I can build s2 OK.

I am using the following software:

[XXXXX@gadi-login-05 s2]$ module list
Currently Loaded Modulefiles:
 1) intel-compiler/2021.6.0   3) netcdf/4.7.3(default)   5) R/4.2.1              7) python3/3.10.4   9) udunits/2.2.26  
 2) gcc/system                4) geos/3.8.0              6) intel-mkl/2021.4.0   8) gdal/3.5.0      10) proj/6.2.1      

@paleolimbot
Copy link
Collaborator

Thanks for tracking this down! I'm happy to include these changes in our vendored Abseil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants