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

illegal opcode on mac #100

Open
mattfidler opened this issue Dec 9, 2020 · 12 comments
Open

illegal opcode on mac #100

mattfidler opened this issue Dec 9, 2020 · 12 comments

Comments

@mattfidler
Copy link
Contributor

I tried out the new github runner and have the following when loading symengine on mac:

 *** caught illegal operation ***
address 0x106a04ed5, cause 'illegal opcode'

Traceback:
 1: dyn.load(file, DLLpath = DLLpath, ...)
 2: library.dynam(chname, package, lib.loc, ...)
 3: library.dynam_2("symengine", pkgname, libname)
 4: fun(libname, pkgname)
 5: doTryCatch(return(expr), name, parentenv, handler)
 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 7: tryCatchList(expr, classes, parentenv, handlers)
 8: tryCatch(fun(libname, pkgname), error = identity)
 9: runHook(".onLoad", env, package.lib, package)
10: loadNamespace("symengine")
11: new.env(parent = loadNamespace("symengine"))

https://github.com/nlmixrdevelopment/RxODE/runs/1521723803?check_suite_focus=true

@mattfidler
Copy link
Contributor Author

This uses the prebuilt mac binaries on CRAN which means they may not work correctly.

@Marlin-Na
Copy link
Member

Thanks for the report. I will look into this.

@mattfidler
Copy link
Contributor Author

Note that it works if I use devtools::install_github("symengine/symengine.R")

@isuruf
Copy link
Member

isuruf commented Dec 11, 2020

@mattfidler, what's the cpu model of the macos runner?

@mattfidler
Copy link
Contributor Author

Not sure; This is the output at the top:

Current runner version: '2.274.2'
Operating System
  Mac OS X
  10.15.7
  19H15
Virtual Environment
  Environment: macos-10.15
  Version: 20201130.3
  Included Software: https://github.com/actions/virtual-environments/blob/macOS-10.15/20201130.3/images/macos/macos-10.15-Readme.md
Prepare workflow directory
Prepare all required actions
Getting action download info
Download action repository 'actions/checkout@v2'
Download action repository 'r-lib/actions@v1'
Download action repository 'actions/cache@v2'
Download action repository 'actions/upload-artifact@main'

@mattfidler
Copy link
Contributor Author

More information about the virtual machine is here:

https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md

I believe it uses the Microsoft Azure framework if that helps.

@Marlin-Na
Copy link
Member

@mattfidler Thanks for the information. FYI, I can't reproduce the error on my computer (macOS 10.15.4), by R CMD checking RxODE with CRAN version of symengine.

I don't know the precise reason of the crash, but I guess we can try adding -mmacosx-version-min=10.13 to cmake flags. R uses it by default when compiling the package's source code, but I think we didn't pass it down when compiling the symengine C++ source bundled in the R package.
(Though that would be confusing as well, since I think CRAN is actually building binaries on macOS 10.13).

Meanwhile, I wonder if it is possible to configure github runner to use install.packages("symengine", type="source")?

@lkeegan
Copy link
Member

lkeegan commented Dec 11, 2020

@isuruf sysctl -n machdep.cpu.brand_string gives Intel(R) Xeon(R) CPU E5-1650 v2

these are quite old cpus that don't have support for instruction sets such as avx2, maybe the CRAN version of symengine was compiled with -march=native or a similar flag to enable such instructions?

@Marlin-Na this would also be consistent with it working for you, since this issue would only appear on older cpus.

@mattfidler
Copy link
Contributor Author

There flags are here:

CC="clang -mmacosx-version-min=10.13" CXX="clang++ -mmacosx-version-min=10.13" OBJC="clang -mmacosx-version-min=10.13" FC="gfortran -mmacosx-version-min=10.13" F77="gfortran -mmacosx-version-min=10.13" CFLAGS='-Wall -g -O2' CXXFLAGS='-Wall -g -O2' OBJCFLAGS='-Wall -g -O2' FCFLAGS='-Wall -g -O2' F77FLAGS='-Wall -g -O2' --enable-memory-profiling --x-libraries=/opt/X11/lib --x-includes=/opt/X11/include --enable-R-framework --build=x86_64-apple-darwin17.0

Thank from the R source project:
https://svn.r-project.org/R-dev-web/trunk/QA/Simon/R4/conf.high-sierra-x86_64

@mattfidler
Copy link
Contributor Author

mattfidler commented Dec 11, 2020

I'm unsure since the build hasn't completed, but install.packages("symengine", type="source") seems to work

https://github.com/nlmixrdevelopment/RxODE/runs/1538236241?check_suite_focus=true

@mattfidler
Copy link
Contributor Author

The build does work. My guess is that it has to do with the -mmacosx-version-min=10.13 flag.

@mattfidler
Copy link
Contributor Author

Note that travis is going away at the end of this year, others will probably use github actions as a replacement.

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

No branches or pull requests

4 participants