Masalah ini https://github.com/Bioconductor/BiocParallel/issues/67 tampaknya mengarah ke
library(parallel)
library(data.table)
mclapply(1:2, sqrt)
menggantung, dengan
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] data.table_1.10.4-2
loaded via a namespace (and not attached):
[1] compiler_3.4.2
Terima kasih atas laporannya.
Butir 4 dari BERITA untuk 1.10.4-1 :
Upaya peningkatan pada Mac dengan Intel OpenMP ketika paket 'paralel' bercabang setelah data.table telah dilakukan secara paralel dengan OpenMP. Implementasi OpenMP itu tampaknya membiarkan utas berjalan setelah wilayah paralel selesai. Jika perbaikan ini masih tidak berhasil, panggil setDTthreads(1) segera setelah library(data.table) yang telah dilaporkan untuk memperbaiki masalah.
Di dev saya meningkatkan item yang sama tetapi mengabaikan backport bahwa item berita berubah ke patch CRAN. Dari file dev NEWS :
Upaya peningkatan hanya pada Mac ketika paket paralel juga digunakan (yang bercabang), #2137. Implementasi OpenMP Intel tampaknya membiarkan utas berjalan setelah wilayah paralel OpenMP (di dalam data.table) selesai tidak seperti libgomp GNU. Jadi, jika dan ketika garpu paralel dipanggil oleh pengguna setelah data.table telah berjalan secara paralel, ketidakstabilan terjadi. Masalah hanya terjadi dengan binari paket Mac dari CRAN karena dibuat oleh CRAN dengan perpustakaan OpenMP Intel. Tidak ada masalah yang diketahui pada Windows atau Linux dan tidak ada masalah yang diketahui pada platform apa pun saat paralel tidak digunakan. Jika perbaikan khusus Mac ini masih tidak berhasil, panggil setDTthreads(1) segera setelah library(data.table) yang telah dilaporkan untuk memperbaiki masalah dengan menempatkan data.table ke mode utas tunggal sebelumnya.
Namun, dalam kasus Anda, Anda bahkan belum pernah menggunakan data.table sebelum melakukan forking. Jadi itu adalah aspek baru yang belum pernah diberitakan sebelumnya. Apakah contoh Anda yang dapat direproduksi benar-benar benar karena 3 baris itu benar-benar semua yang terjadi dalam sesi R baru? yaitu tidak ada penggunaan data.table antara memuatnya dan memanggil mclapply
? Anda dapat mencoba menelepon setDTthreads(1)
segera setelah library(data.table)
, tapi saya ragu itu akan membantu jika benar-benar tidak ada penggunaan data.table sebelum mclapply
.
Sudahkah Anda menginstal biner mac CRAN, atau dari sumber? Tampaknya menjadi penting di MacOS, sehubungan dengan masalah mclapply
ini perpustakaan OpenMP yang Anda gunakan. Apakah Anda dapat menentukan apakah implementasi OpenMP Intel (libomp) atau GNU (libgomp) yang digunakan pada mesin?
Bisakah Anda mengkompilasi dari sumber menggunakan instruksi MacOS dan apakah itu membantu? Mungkin itu menautkan ke perpustakaan OpenMP yang tepat secara lokal untuk Anda, atau sesuatu seperti itu. Beberapa orang tidak mengikuti instruksi dengan cukup tepat, sehingga mereka harus diikuti dengan tepat di MacOS.
Apakah test.data.table()
bekerja untuk Anda? Tes 1705 menguji mclapply
dan itu meneruskan CRAN. Saya berasumsi CRAN menguji binari Mac di MacOS, tetapi mungkin saja saya mengira itu menguji build yang berbeda.
Butir 1 dari BERITA dari 1.10.4-2 Saya ragu terkait, tetapi saya akan menyebutkannya untuk kelengkapan:
OpenMP di MacOS sekarang didukung oleh CRAN dan disertakan dalam binari paket CRAN untuk Mac. Tetapi menginstal v1.10.4-1 dari sumber di MacOS gagal ketika OpenMP tidak diaktifkan pada waktu kompilasi, #2409. Terima kasih kepada Liz Macfie dan @fupangpangpang atas laporannya. Pesan startup saat OpenMP tidak diaktifkan telah diperbarui.
Berikut adalah masalah terkait:
https://github.com/Rdatatable/data.table/issues/2413
https://github.com/Rdatatable/data.table/issues/2409
https://github.com/Rdatatable/data.table/issues/2406
https://github.com/Rdatatable/data.table/issues/2137
Saya pada dasarnya berjuang dengan MacOS. Jika ada orang yang mendengarkan dari Apple dan/atau Intel yang dapat mendukung produk mereka, itu akan sangat bagus. Saya berjuang untuk melihat bagaimana ini benar-benar masalah data.table. Saya telah mencoba semua yang dapat saya pikirkan untuk mengatasinya dan mendokumentasikannya di NEWS. Bantuan dan saran sangat dihargai.
Ya, skrip sederhana hanya dengan
library(parallel)
library(data.table)
mclapply(1:2, sqrt)
Ini ada di mesin pembuat Biokonduktor. Saya percaya ini adalah instalasi biner sederhana, tetapi akan mengkonfirmasi. Kita punya
$ ls /Library/Frameworks/R.framework/Resources/lib
libR.dylib libRlapack.dylib.dSYM libquadmath.0.dylib
libR.dylib.dSYM libc++.1.dylib libreadline.5.2.dylib
libRblas.0.dylib libc++abi.1.dylib libreadline.dylib
libRblas.dylib libgcc_s.1.dylib libunwind.1.dylib
libRblas.dylib.dSYM libgfortran.3.dylib
libRlapack.dylib libomp.dylib
dan
$ otool -L /Library/Frameworks/R.framework/Resources/bin/exec/R
/Library/Frameworks/R.framework/Resources/bin/exec/R:
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libR.dylib (compatibility version 3.4.0, current version 3.4.2)
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.dylib (compatibility version 0.0.0, current version 0.0.0)
/Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libomp.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
Jadi mungkin menautkan ke libomp.
test.data.table()
mengatakan
Running test id 1705 Assertion failure at kmp_runtime.cpp(6480): __kmp_thread_pool == __null.
Assertion failure at kmp_runtime.cpp(6480): __kmp_thread_pool == __null.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6480).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6480).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Assertion failure at kmp_runtime.cpp(6480): __kmp_thread_pool == __null.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6480).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Assertion failure at kmp_runtime.cpp(6480): __kmp_thread_pool == __null.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6480).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Running test id 1750 Test 1751 not run. If required call library(nanotime) first.
endian==little, sizeof(long double)==16, sizeof(pointer)==8
All 5936 tests in inst/tests/tests.Rraw completed ok in 00:01:45 on Sat Oct 14 21:25:30 2017
Terima kasih untuk ini. Ya, panggilan __kmp_*
itu, saya yakin, khusus untuk Intel OpenMP Runtime dan saya pernah melihatnya dilaporkan sebelumnya. Tes 1705 secara khusus menguji itu. Ini menggunakan 2 utas OpenMP di dalam data.table itu sendiri diikuti dengan memanggil parallel::mclapply
. Kesalahan __kmp_
adalah karena, iiuc, implementasi Intel membiarkan utas berjalan bahkan setelah semua wilayah paralel selesai, sehingga percabangan berikutnya tidak stabil. Dalam hal ini sepertinya tidak crash, tapi itu hanya keberuntungan. Fakta bahwa Anda melihat output dengan 1.10.4-2 berarti upaya penyelesaian saya tidak berhasil. Ada panggilan balik pra-fork di mana ia sekarang memanggil omp_set_num_threads(1)
dengan harapan bahwa perpustakaan Intel akan menghapus utas yang berjalan sebelum fork. Tapi sepertinya tidak. Jadi, kita dibiarkan dengan apa yang dilaporkan berfungsi, yaitu memanggil setDTthreads(1)
segera setelah library(data.table)
untuk menghentikan OpenMP Intel membuat utas di tempat pertama.
Namun, dengan hanya 3 baris, apakah mungkin perpustakaan OpenMP Intel membuat utasnya setelah ditautkan atau diinisialisasi? Jika demikian, itu mungkin menjelaskannya. Kalau tidak, saya bingung tentang itu.
Selanjutnya, saya tidak tahu bagaimana kemampuan OpenMP dari clang
dan gcc
berhubungan dengan 3 perpustakaan OpenMP: libomp
, libiomp
dan libgomp
. Anda tampaknya memiliki libomp
. Tapi saya pikir CRAN dikompilasi dengan libiomp
? Mungkin itu ada hubungannya dengan itu. Juga, satu orang telah melaporkan ( di sini ) bahwa "mengubah llvm ke gcc" menghentikan kerusakan pada MacOS, tetapi mereka mengkompilasi dari sumber.
Saya baru saja menemukan kode sumber untuk runtime Intel OpenMP. Saya tidak tahu proyek apa ini karena saya pikir perpustakaan Intel adalah sumber tertutup. Tapi mungkin itu mungkin untuk mengkompilasinya dan men-debugnya. https://www.openmprtl.org/ Mungkin lebih mudah hanya dengan mengkompilasi secara lokal terlebih dahulu dan melihat apakah itu berhasil, atau menggunakan perpustakaan GNU.
Tes 1705 sedang meneruskan CRAN jadi itu mungkin penuh harapan, dengan mencari tahu apa yang berbeda antara mesin CRAN dan mesin Anda. Tes 1705 sebenarnya lulus untuk Anda dan di CRAN, tetapi libomp
mengeluarkan kesalahan pernyataan ke konsol yang tidak diambil oleh tes. Saya ingin tahu apakah mungkin untuk melihat log CRAN entah bagaimana untuk melihat apakah pesan __kmp
itu juga ada di log CRAN. Jika pesan tidak ada di log CRAN, mungkin ada baiknya menjelajahi perbedaan antara mesin CRAN dan mesin Anda.
Mungkin ini diperlukan dengan biner paket CRAN: http://macappstore.org/libiomp/
Atau mungkin libiomp dikompilasi secara statis ke dalam paket biner oleh CRAN? Saya perhatikan bahwa bagian 'Paket biner' dari ?install.packages
cukup rumit untuk MacOS dan ada beberapa opsi biner di sana untuk argumen type=
.
Perpustakaan Intel sedang mencetak:
OMP: Kesalahan #13: Kegagalan pernyataan di kmp_runtime.cpp(6480)
OMP: Petunjuk: Harap kirimkan laporan bug dengan pesan ini, kompilasi dan jalankan perintah yang digunakan, dan info konfigurasi mesin termasuk kompiler asli dan versi sistem operasi. Respon yang lebih cepat akan diperoleh dengan menyertakan semua sumber program. Untuk informasi tentang mengirimkan masalah ini, silakan lihat http://www.intel.com/software/products/support/.
Bisakah seseorang dengan masalah pada MacOS mengajukan masalah dengan Intel?
Hai, saya awalnya melaporkan masalah dengan repositori BiocParallel ketika saya mengalami masalah saat menggunakan fungsi dari paket itu. Mereka telah mempersempit masalah menjadi mclapply dipanggil saat data.table dimuat.
Saya mengikuti petunjuk di sini untuk menginstal versi terbaru dari data.table di MacOS saya, tetapi masih mengalami masalah.
Menariknya, seorang kolega menginstal versi terbaru dari data.table di Mac-nya dan tidak mengalami masalah apa pun. Namun, ia tidak menginstal OpenMP di sistemnya.
Saya dapat memperbaiki masalah dengan memutar kembali ke data.table 1.10.2.
@asenabouth Bisakah Anda mengajukan permintaan dukungan dengan Intel (lihat komentar saya di atas)? Tampaknya ada masalah dengan perpustakaan mereka. Atau, mungkin seseorang dari Apple dapat membantu. Apakah Anda bisa mendapatkan dukungan mereka sama sekali? Saya tidak yakin bahwa menginstal dari sumber tidak menyelesaikannya. Bisakah Anda menunjukkan perintah dan outputnya. Apakah ada orang lain yang tidak dapat menggunakan parallel::mclapply
setelah data.table 1.10.4 telah dimuat, bahkan setelah kompilasi dari sumber dan menghindari biner CRAN?
Saya akan mengajukan permintaan dukungan dengan Intel.
Adapun untuk menginstal dari sumber, berikut adalah instalasi dan pengujian selanjutnya:
```{r}
[Ruang kerja yang disimpan sebelumnya dipulihkan]
hapus.paket("data.tabel")
Menghapus paket dari '/Users/a.senabouth/Library/R/3.4/library'
(karena 'lib' tidak ditentukan)
install.packages("data.tabel", ketik = "sumber",
- repo = "http://Rdatatable.github.io/data.table")
Menginstal paket ke '/Users/a.senabouth/Library/R/3.4/library'
(karena 'lib' tidak ditentukan)
mencoba URL ' http://Rdatatable.github.io/data.table/src/contrib/data.table_1.10.5.tar.gz 'Jenis konten 'application/gzip' panjangnya 3312731 byte (3,2 MB)
diunduh 3,2 MB
uname -s
= 'Darwin' ]; fimenginstal ke /Users/a.senabouth/Library/R/3.4/library/data.table/libs* RPaket sumber yang diunduh ada di
'/private/var/folder/zz/zyxvpxvq6csfxvn_n0001lp0000cxh/T/Rtmpl7TqS4/downloaded_packages'
R
Kesalahan: objek 'R' tidak ditemukan
perpustakaan (paralel)
perpustakaan(data.tabel)
data.table 1.10.5 DALAM PEMBANGUNAN dibangun 16-10-2017 07:29:07 UTC; lalu lintas
Cara tercepat untuk belajar (oleh penulis data.table): https://www.datacamp.com/courses/data-analysis-the-data-table-way
Dokumentasi: ?data.tabel, contoh(data.tabel) dan browseVignettes("data.tabel")
Catatan rilis, video, dan slide: http://r-datatable.com
mclapply(1:2, kuadrat)
* tertangkap operasi ilegal *
alamat 0x7fffa9730ae4, menyebabkan 'opcode ilegal'
Melacak kembali:
1: mcfork()
2: MENYENANGKAN(X[[i]], ...)
3: lapply(seq_len(core), inner.do)
4: mclapply(1:2, kuadrat)
Tindakan yang mungkin:
1: batalkan (dengan dump inti, jika diaktifkan)
2: keluar R normal
3: keluar dari R tanpa menyimpan ruang kerja
4: keluar dari ruang kerja hemat R
And here's the session info:
```{r}
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] data.table_1.10.5
loaded via a namespace (and not attached):
[1] compiler_3.4.2
EDIT :
Saya membuatnya berfungsi dengan menginstal 1.10.4 dari sumber.
```{r}
membutuhkan (devtools)
Memuat paket yang diperlukan: devtools
install_version("data.table", versi = "1.10.4", repo = "http://cran.us.r-project.org")
Mengunduh paket dari url: http://cran.us.r-project.org/src/contrib/Archive/data.table/data.table_1.10.4.tar.gz
Menginstal data.table
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ
--no-save --no-restore --quiet CMD INSTALL
'/private/var/folder/zz/zyxvpxvq6csfxvn_n0001lp0000cxh/T/RtmpXDSgR8/devtoolsdf05280c79d9/data.table'
--library='/Users/a.senabouth/Library/R/3.4/library' --install-tests
uname -s
= 'Darwin' ]; lalu install_name_tool -id datatable.so datatable.so; fi[[2]]
[1] 1,414214
```
Saya telah memposting yang berikut https://software.intel.com/en-us/forums/intel-c-compiler/topic/746943
Itu mungkin di tempat yang salah dan saya mungkin akan terbakar, tetapi mudah-mudahan bolanya akan menggelinding.
@mattdowle beri tahu saya jika ada hal-hal yang Anda ingin saya tambahkan/lakukan
Ingin mengonfirmasi bahwa saya mereproduksi kesalahan yang sama dengan @asenabouth dan menginstal ulang 1.10.4 dari sumber memperbaiki masalah.
info sesi:
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] parallel stats graphics grDevices utils datasets base
other attached packages:
[1] data.table_1.10.4
loaded via a namespace (and not attached):
[1] compiler_3.4.2 methods_3.4.2
Hanya mencatat beberapa detail di mesin saya
library(parallel)
library(data.table)
mclapply(1:2, sqrt)
menghasilkan
*** caught illegal operation ***
address 0x7fffb500eae4, cause 'illegal opcode'
dengan sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] parallel stats graphics utils datasets grDevices methods
[8] base
other attached packages:
[1] data.table_1.10.4-2 testthat_1.0.2 devtools_1.13.3
loaded via a namespace (and not attached):
[1] compiler_3.4.2 magrittr_1.5 R6_2.2.2 withr_2.0.0 crayon_1.3.4
[6] memoise_1.1.0 digest_0.6.12
Menariknya,
> remove.packages("data.table")
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
(as ‘lib’ is unspecified)
> install.packages("data.table", type = "source",
+ repos = "http://Rdatatable.github.io/data.table")
menghasilkan
trying URL 'http://Rdatatable.github.io/data.table/src/contrib/data.table_1.10.5.tar.gz'
Content type 'application/gzip' length 3312726 bytes (3.2 MB)
==================================================
downloaded 3.2 MB
* installing *source* package ‘data.table’ ...
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fopenmp -fPIC -Wall -g -O2 -c assign.c -o assign.o
clang: error: unsupported option '-fopenmp'
make: *** [assign.o] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/data.table’
The downloaded source packages are in
‘/private/var/folders/48/q6ltldjs251000_wvjrdy_vm0000gn/T/Rtmp6eZFXj/downloaded_packages’
Warning message:
In install.packages("data.table", type = "source", repos = "http://Rdatatable.github.io/data.table") :
installation of package ‘data.table’ had non-zero exit status
Saya akan melihat apakah ini terkait
Saya juga mengikuti instruksi di https://github.com/Rdatatable/data.table/wiki/Installation dan masalah masih terjadi....
EDIT:
Masalah asli dengan mclapply
dan illegal operation
(bukan kesalahan kompiler unsupported option '-fopenmp'
- yang diperbaiki dengan mengikuti instruksi)
Terimakasih semuanya. Sangat menarik bahwa 1.10.4 tampaknya berfungsi dengan baik tetapi 1.10.4-2 tidak. Tampaknya crash segera setelah garpu dipanggil. Upaya yang saya sebutkan di NEWS ada di area itu.
Pertama, apa yang tidak berubah. Saat memuat data.table, init.c
memanggil ini di openmp-utils.c :
void avoid_openmp_hang_within_fork() {
// Called once on loading data.table from init.c
#ifdef _OPENMP
pthread_atfork(&when_fork, NULL, NULL);
#endif
}
jadi ketika parallel::mclapply
memanggil fork()
, fungsi when_fork
berjalan. Yang di 1.10.4-2 terlihat seperti ini:
void when_fork() { # v 1.10.4-2
// attempted workaround for Intel's OpenMP implementation which leaves threads
// running after parallel region; these crash when forked.
#ifdef _OPENMP
omp_set_num_threads(1);
#endif
DTthreads = 1;
}
sebelumnya (di 1.10.4), itu tidak digunakan untuk memanggil omp_set_num_threads(1)
, dan itu hanya mengatur variabel statis DTthreads
:
void when_fork() { # v 1.10.4
DTthreads = 1;
}
Yang bisa saya pikirkan hanyalah bahwa panggilan ke omp_set_num_threads(1)
membuat crash. Tapi itulah fungsi paling sederhana yang bisa Anda panggil di OpenMP. Mungkin belum terikat dengan benar ke perpustakaan, entah bagaimana?
Untuk orang-orang yang dapat mereproduksi kerusakan saat memanggil parallel::mclapply
, apakah fwrite()
sederhana berfungsi dengan baik untuk Anda dalam sesi baru tanpa memuat paket parallel
? Apakah itu menggunakan banyak CPU sebagaimana mestinya? Anda akan membutuhkan DT
besar untuk menguji jika tidak, ia hanya menggunakan 1 utas untuk data kecil. Jika crash pada penggunaan OpenMP maka kami memiliki masalah penautan. Adakah yang tahu apa arti tanda-tanda ini di garis tautan dan mungkinkah itu ada hubungannya dengan itu di MacOS? : -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
Saya dapat mencoba menghapus panggilan itu ke omp_set_num_threads(1)
lagi di dev dan seseorang dengan masalah sekarang dengan 1.10.5 dapat mencoba dev lagi setelah saya mengubahnya?
Yang aneh adalah bahwa tes melewati CRAN di MacOS tanpa crash. Tes 1705 tes memanggil parallel::mclapply
dan semua tes berjalan di CRAN menggunakan 2 utas. Apa perbedaan antara mesin CRAN dan mesin yang bermasalah?
@joethornley Itu aneh. Anda mendapatkan unsupported option '-fopenmp'
bahkan setelah menjalankan instruksi MacOS di sini . Adakah yang bisa menyarankan cara untuk maju? Aku bingung.
@joethornley Apakah Anda sudah menginstal gettext? Ternyata tidak. Saya dapat mengkompilasi paket dengan benar di sistem saya setelah selesai.
@mattdowle tidak kesalahan unsupported option '-fopenmp'
hilang setelah saya mengikuti instruksi di sini tetapi kesalahannya
*** caught illegal operation ***
address 0x7fffb500eae4, cause 'illegal opcode'
muncul.
Makevar saya adalah
CC=/usr/local/opt/llvm/bin/clang -fopenmp
CXX=/usr/local/opt/llvm/bin/clang++
# -O3 should be faster than -O2 (default) level optimisation ..
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include
Info sesi saya()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] stats graphics utils datasets grDevices methods base
other attached packages:
[1] testthat_1.0.2 devtools_1.13.3
loaded via a namespace (and not attached):
[1] compiler_3.4.2 magrittr_1.5 R6_2.2.2 withr_2.0.0 crayon_1.3.4
[6] memoise_1.1.0 digest_0.6.12
dan sesi R saya
> remove.packages("data.table")
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
(as ‘lib’ is unspecified)
> install.packages("data.table", type = "source", repos = "http://Rdatatable.github.io/data.table")
trying URL 'http://Rdatatable.github.io/data.table/src/contrib/data.table_1.10.5.tar.gz'
Content type 'application/gzip' length 3312684 bytes (3.2 MB)
==================================================
downloaded 3.2 MB
* installing *source* package ‘data.table’ ...
** libs
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c assign.c -o assign.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c between.c -o between.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c bmerge.c -o bmerge.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c chmatch.c -o chmatch.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c dogroups.c -o dogroups.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fastmean.c -o fastmean.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fcast.c -o fcast.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fmelt.c -o fmelt.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c forder.c -o forder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c frank.c -o frank.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fread.c -o fread.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c freadR.c -o freadR.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fsort.c -o fsort.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fwrite.c -o fwrite.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fwriteR.c -o fwriteR.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c gsumm.c -o gsumm.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c ijoin.c -o ijoin.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c init.c -o init.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c inrange.c -o inrange.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c openmp-utils.c -o openmp-utils.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c quickselect.c -o quickselect.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c rbindlist.c -o rbindlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c reorder.c -o reorder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c shift.c -o shift.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c subset.c -o subset.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c transpose.c -o transpose.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c uniqlist.c -o uniqlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c vecseq.c -o vecseq.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c wrappers.c -o wrappers.o
/usr/local/opt/llvm/bin/clang -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -o data.table.so assign.o between.o bmerge.o chmatch.o dogroups.o fastmean.o fcast.o fmelt.o forder.o frank.o fread.o freadR.o fsort.o fwrite.o fwriteR.o gsumm.o ijoin.o init.o inrange.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o subset.o transpose.o uniqlist.o vecseq.o wrappers.o -fopenmp -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
mv data.table.so datatable.so
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable.so datatable.so; fi
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/data.table/libs
** R
** 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
* DONE (data.table)
The downloaded source packages are in
‘/private/var/folders/48/q6ltldjs251000_wvjrdy_vm0000gn/T/RtmpWku3yc/downloaded_packages’
> library(parallel)
> library(data.table)
data.table 1.10.5 IN DEVELOPMENT built 2017-10-18 23:12:32 UTC; travis
The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way
Documentation: ?data.table, example(data.table) and browseVignettes("data.table")
Release notes, videos and slides: http://r-datatable.com
> mclapply(1:2, sqrt)
*** caught illegal operation ***
address 0x7fffb500eae4, cause 'illegal opcode'
@mattdowle
fwrite()
tampaknya berfungsi di mesin saya> mtcars <- rbind(mtcars, mtcars)
> nrow(mtcars)
[1] 16777216
> fwrite(mtcars, "mtcars.csv")
Written 45.1% of 16777216 rows in 2 secs using 8 threads. anyBufferGrown=no; max
Written 69.5% of 16777216 rows in 3 secs using 8 threads. anyBufferGrown=no; max
Written 93.9% of 16777216 rows in 4 secs using 8 threads. anyBufferGrown=no; max
@asenabouth Saya telah menginstal gettext dan saya dapat mengkompilasi paket dengan benar setelah saya mengikuti instruksi. Postingan saya agak kurang jelas jadi sudah saya edit.
@mattdowle
Menginstal 1.10.4.2 dari CRAN, baik sumber atau biner, menghasilkan mclapply hang. Menginstal github.com/Rdatatable/data. table@master dari sumber masih menghasilkan mclapply hang asli.
Menginstal versi modifikasi dari master saat ini
$ git diff
diff --git a/src/openmp-utils.c b/src/openmp-utils.c
index d6e3b70..bf104fc 100644
--- a/src/openmp-utils.c
+++ b/src/openmp-utils.c
@@ -78,7 +78,7 @@ void when_fork() {
void avoid_openmp_hang_within_fork() {
// Called once on loading data.table from init.c
#ifdef _OPENMP
- pthread_atfork(&when_fork, NULL, NULL);
+// pthread_atfork(&when_fork, NULL, NULL);
#endif
}
```
or this version
$ git diff
diff --git a/src/openmp-utils.cb/src/openmp-utils.c
indeks d6e3b70..8c0236d 100644
--- a/src/openmp-utils.c
+++ b/src/openmp-utils.c
@@ -62,7 +62,7 @@ batal when_fork() {
// mencoba solusi untuk implementasi OpenMP Intel yang membuat utas berjalan setelahnya
// daerah paralel; crash ini ketika bercabang.
#ifdef _OPENMP
// GNU OpenMP tampaknya ok dengan hanya mengatur DTthreads ke 1 yang membatasi wilayah paralel berikutnya
clears the hang for me.
The R we use (installed as a binary from CRAN) is the 3.4.2 release
R.versi
_
platform x86_64-apple-darwin15.6.0
lengkungan x86_64
darwin15.6.0
sistem x86_64, darwin15.6.0
status
utama 3
kecil 4.2
tahun 2017
bulan 09
hari 28
svn rev 73368
bahasa R
version.string R versi 3.4.2 (28-09-2017)
julukan Musim Panas Pendek
```
Menyetel variabel lingkungan OMP_NUM_THREADS=2 tidak mengubah hasilnya.
Saya dapat mengkonfirmasi berkomentar omp_set_num_threads(1);
di when_fork()
memperbaiki masalah pada mesin saya juga
> mclapply(1:2, sqrt)
[[1]]
[1] 1
[[2]]
[1] 1.414214
Terimakasih semuanya. Membuat perbaikan di dev dan sedang lewat. @joehorley Maukah Anda atau orang lain mengonfirmasi bahwa 1.10.5 terbaru sekarang ok. Saya akan mulai mempersiapkan 1.10.4-3 untuk pergi ke CRAN.
@mattdowle
Saya dapat mengkonfirmasi itu sudah diperbaiki.
$ R
R version 3.4.2 (2017-09-28) -- "Short Summer"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin15.6.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> remove.packages("data.table")
Removing package from ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library’
(as ‘lib’ is unspecified)
> install.packages("data.table", type = "source", repos = "http://Rdatatable.github.io/data.table")
trying URL 'http://Rdatatable.github.io/data.table/src/contrib/data.table_1.10.5.tar.gz'
Content type 'application/gzip' length 3313284 bytes (3.2 MB)
==================================================
downloaded 3.2 MB
* installing *source* package ‘data.table’ ...
** libs
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c assign.c -o assign.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c between.c -o between.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c bmerge.c -o bmerge.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c chmatch.c -o chmatch.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c dogroups.c -o dogroups.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fastmean.c -o fastmean.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fcast.c -o fcast.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fmelt.c -o fmelt.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c forder.c -o forder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c frank.c -o frank.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fread.c -o fread.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c freadR.c -o freadR.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fsort.c -o fsort.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fwrite.c -o fwrite.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c fwriteR.c -o fwriteR.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c gsumm.c -o gsumm.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c ijoin.c -o ijoin.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c init.c -o init.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c inrange.c -o inrange.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c openmp-utils.c -o openmp-utils.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c quickselect.c -o quickselect.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c rbindlist.c -o rbindlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c reorder.c -o reorder.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c shift.c -o shift.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c subset.c -o subset.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c transpose.c -o transpose.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c uniqlist.c -o uniqlist.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c vecseq.c -o vecseq.o
/usr/local/opt/llvm/bin/clang -fopenmp -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include -fopenmp -fPIC -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c wrappers.c -o wrappers.o
/usr/local/opt/llvm/bin/clang -fopenmp -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -o data.table.so assign.o between.o bmerge.o chmatch.o dogroups.o fastmean.o fcast.o fmelt.o forder.o frank.o fread.o freadR.o fsort.o fwrite.o fwriteR.o gsumm.o ijoin.o init.o inrange.o openmp-utils.o quickselect.o rbindlist.o reorder.o shift.o subset.o transpose.o uniqlist.o vecseq.o wrappers.o -fopenmp -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
mv data.table.so datatable.so
if [ "" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id datatable.so datatable.so; fi
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/data.table/libs
** R
** inst
** byte-compile and prepare package for lazy loading
session** help
In*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (data.table)
The downloaded source packages are in
‘/private/var/folders/48/q6ltldjs251000_wvjrdy_vm0000gn/T/RtmpmAMLnD/downloaded_packages’
> library(parallel)
> library(data.table)
data.table 1.10.5 IN DEVELOPMENT built 2017-10-19 19:32:41 UTC; travis
The fastest way to learn (by data.table authors): https://www.datacamp.com/courses/data-analysis-the-data-table-way
Documentation: ?data.table, example(data.table) and browseVignettes("data.table")
Release notes, videos and slides: http://r-datatable.com
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8
attached base packages:
[1] parallel stats graphics utils datasets grDevices methods
[8] base
other attached packages:
[1] data.table_1.10.5 testthat_1.0.2 devtools_1.13.3
loaded via a namespace (and not attached):
[1] compiler_3.4.2 magrittr_1.5 R6_2.2.2 tools_3.4.2 withr_2.0.0
[6] crayon_1.3.4 memoise_1.1.0 digest_0.6.12
> mclapply(1:2, sqrt)
[[1]]
[1] 1
[[2]]
[1] 1.414214
Terima kasih banyak @joethornley! Dikirim ke 1.10.4-3 ke CRAN dan semuanya baik-baik saja, dibutuhkan beberapa hari agar keajaiban CRAN berjalan dengan sendirinya.
Perubahan pada v1.10.4-3 (pada CRAN 20 Okt 2017)
- Memperbaiki crash/hang di MacOS ketika
parallel::mclapply
digunakan dan data.table hanya dimuat, #2418 . Anehnya, semua tes termasuk tes 1705 (yang mengujimclapply
dengan data.table) lulus dengan baik di CRAN. Tampaknya ada beberapa versi MacOS atau beberapa versi perpustakaan di MacOS, mungkin. Terima kasih banyak kepada Martin Morgan karena telah melaporkan dan mengonfirmasi bahwa perbaikan ini berhasil. Terima kasih juga kepada asenabouth, Joe Thorley dan Danton Noriega untuk pengujian, debug, dan konfirmasi bahwa paralelisme otomatis di dalam data.table (sepertifwrite
) bekerja dengan baik bahkan pada penginstalan MacOS ini. Lihat juga item berita di bawah untuk 1.10.4-1 dan 1.10.4-2.
Penutupan untuk saat ini. Silakan buka kembali atau buka edisi baru jika ada masalah dengan 1.10.4-3.
@mattdowle : sepertinya v1.10.4-2 masih versi yang didistribusikan oleh CRAN. Apakah v1.10.4-3 masih menunggu dalam antrian pengiriman CRAN, atau ada yang salah?
(terima kasih telah mendapatkan solusi untuk masalah ini dengan sangat cepat; sayangnya masalah ini tampaknya memengaruhi banyak pengguna di macOS)
@kevinushey Ya 1.10.4-3 sedang menunggu dalam antrian (dalam status 'cek ulang' yang saya tidak tahu apa artinya, selama 6 hari). Saya mengirim email ke CRAN dan sekarang dirilis ke CRAN.
mungkin saya membuat sesuatu yang salah tetapi saya masih memiliki masalah di mac saya.
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.1 R6_2.2.2 tools_3.4.1 withr_2.0.0 curl_3.0
[7] yaml_2.1.14 memoise_1.1.0 knitr_1.17 git2r_0.19.0 digest_0.6.12 devtools_1.13.3
Saat menginstal versi cran dari sumber, saya mendapatkan:
> install.packages("data.table", type = "source", repos = "https://cran.rstudio.com")
essai de l'URL 'https://cran.rstudio.com/src/contrib/data.table_1.10.4-3.tar.gz'
Content type 'application/x-gzip' length 3071833 bytes (2.9 MB)
==================================================
downloaded 2.9 MB
* installing *source* package ‘data.table’ ...
** package ‘data.table’ correctement décompressé et sommes MD5 vérifiées
** libs
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -fopenmp -fPIC -Wall -g -O2 -c assign.c -o assign.o
clang: error: unsupported option '-fopenmp'
make: *** [assign.o] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/data.table’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/data.table’
Les packages source téléchargés sont dans
‘/private/var/folders/51/6jygptvs3bb4njv0t6x7br900000gn/T/Rtmp8NJ0di/downloaded_packages’
Warning message:
In install.packages("data.table", type = "source", repos = "https://cran.rstudio.com") :
l'installation du package ‘data.table’ a eu un statut de sortie non nul
Saya dapat memberikan rincian lebih lanjut jika perlu.
@davidgohel : Silakan lihat panduan ini untuk menginstal toolchain R LLVM secara lokal. http://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/
Sebagai alternatif, saya akan merekomendasikan mengedit file di R.home("etc/Makeconf")
dan hanya menghapus setiap instance -fopenmp
yang Anda lihat di sana, sehingga kompilasi tidak mencoba menggunakan OpenMP dengan rantai alat sistem Apple.
@kevinushey OK, saya akan mencoba dengan solusi alternatif. Saya pikir saya mengacaukan sesuatu dengan solusi pertama.
Menambahkan ini ke file ~/.R/Makevars
saya berfungsi untuk mengkompilasi data.table tanpa OpenMP di High Sierra:
# Suppress `-fopenmp` in R.home("etc/Makeconf")
# MAIN_LDFLAGS = -fopenmp
# SHLIB_OPENMP_CFLAGS = -fopenmp
# SHLIB_OPENMP_CXXFLAGS = -fopenmp
# SHLIB_OPENMP_FCFLAGS = -fopenmp
# SHLIB_OPENMP_FFLAGS = -fopenmp
MAIN_LDFLAGS =
SHLIB_OPENMP_CFLAGS =
SHLIB_OPENMP_CXXFLAGS =
SHLIB_OPENMP_FCFLAGS =
SHLIB_OPENMP_FFLAGS =
@mjsteinbaugh @kevinushey terima kasih, itu berhasil
Saya mencoba mengedit file di R.home("etc/Makeconf")
tetapi saya tidak diizinkan untuk mengeditnya. Saya juga sepertinya tidak memiliki file bernama ~/.R/Makevars
. Ada saran lebih lanjut :) Terima kasih
@ValeriVoev File di ~/.R/Makevars
biasanya tidak ada; Anda harus membuatnya sendiri. (Artinya, buat folder bernama .R
di direktori home Anda, lalu buat file Makevars
di dalam folder itu)
Terima kasih @kevinushey - Saya akhirnya berhasil, menginstal data.table
1.10.4-3 dan R Studio tidak crash lagi. Saya juga menginstal dentang - tidak yakin apakah itu juga membantu atau tidak.
Saya masih melihat kesalahan ini secara acak
Assertion failure at kmp_runtime.cpp(6480): __kmp_thread_pool == __null.
OMP: Error #13: Assertion failure at kmp_runtime.cpp(6480).
OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/.
Dan kasusnya benar-benar rumit.
mclapply(1:2, sqrt)
di awal sketsa, merajut sketsa tidak lagi memiliki kesalahan!Ini semua tampaknya terkait dengan perubahan lingkungan. Sayangnya saya tidak memiliki contoh sederhana yang dapat direproduksi sekarang. Kode saya cukup kompleks dan melibatkan banyak hal lain.
Seperti dracodoc, minta (6480) tangkapan secara acak. macOS 10.13.3, R 3.4.3, data.tabel 1.10.4-3. Cukup R di sini dan kode yang terlalu rumit untuk direproduksi.
mclapply sederhana di awal kode berfungsi dan terkadang membuat sisa kode juga berfungsi. Dalam kasus saya, menambahkan mclapply(1:2, sqrt)
tidak akan berhasil, tetapi menjalankan sejumlah percobaan yang tampaknya acak (sekarang mulai kode dengan for (i in 1:10) mclapply(1:10000000, sqrt)
).
EDIT: Sayangnya, eksekusi tampaknya tidak stabil, dan meskipun mcmapply dimulai, hang setelah beberapa waktu.
Saya baru saja melihat komentar lebih lanjut ini. Silakan coba dev 1.10.5 atau tunggu rilis CRAN berikutnya (semoga segera). Jika masih ada masalah setelah itu, silakan angkat masalah baru.
Saya masih melihat masalah yang sama dengan dev 1.10.5. Masalah baru dibuat.
Komentar yang paling membantu
@davidgohel : Silakan lihat panduan ini untuk menginstal toolchain R LLVM secara lokal. http://thecoatlessprofessor.com/programming/openmp-in-r-on-os-x/
Sebagai alternatif, saya akan merekomendasikan mengedit file di
R.home("etc/Makeconf")
dan hanya menghapus setiap instance-fopenmp
yang Anda lihat di sana, sehingga kompilasi tidak mencoba menggunakan OpenMP dengan rantai alat sistem Apple.