libomp

macOS ์—์„œ XGBoost, LightGBM ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์•ˆ ๋จ

โ€‹ pip install ์„ ํ•ด๋†“์•˜๋Š”๋ฐ, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š์€ ๊ฒƒ์€ ์ฒ˜์Œ์ด์˜€๋‹ค. ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๊ณ  ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ–ˆ๋Š”๋ฐ

Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/fakenerd/.envs/env-with-lightgbm/lib/python3.6/site-packages/lightgbm/__init__.py", line 8, in 
    from .basic import Booster, Dataset
  File "/Users/fakenerd/.envs/env-with-lightgbm/lib/python3.6/site-packages/lightgbm/basic.py", line 32, in 
    _LIB = _load_lib()
  File "/Users/fakenerd/.envs/env-with-lightgbm/lib/python3.6/site-packages/lightgbm/basic.py", line 27, in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/()/.envs/env-with-lightgbm/lib/python3.6/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/gcc/lib/gcc/7/libgomp.1.dylib
  Referenced from: /Users/()/.envs/env-with-lightgbm/lib/python3.6/site-packages/lightgbm/lib_lightgbm.so
  Reason: image not found

์ผ๋‹จ OSError ๋ž€๊ฑธ ์•Œ์•˜๋‹ค. ์ˆœ๊ฐ„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ microsoft ์˜ ๊ฒƒ์ด๋ž€๊ฒŒ ์ƒ๊ฐ๋‚˜๋ฉด์„œ, ์ดˆ๋ฐ˜์— ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์‹คํ–‰ ์•ˆ ๋œ๊ฒŒ ์ฒ˜์Œ์ด๋ผ๋Š” ๋‹นํ˜น๊ฐ์€ ์—†์–ด์ง€๊ณ , ์ผ์–ด๋‚  ์ผ์ด ์ผ์–ด๋‚ฌ๋‹ค๊ณ  ์ƒ๊ฐ์ด ๋“ค๋ฉด์„œ ์นจ์ฐฉํ•ด์กŒ๋‹ค.

gcc version trouble

โ€‹ ๋‚ด MacOS ์˜ gcc version ์€ 8 ์ด์ง€๋งŒ, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ gcc ์ปดํŒŒ์ผ๋Ÿฌ ๋ฒ„์ ผ์ด 7์ด๋ผ๋Š” closed issue ๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์—ˆ๋‹ค. MS/LightGBM issue#1369

โ€‹ MS ์—์„œ ์ฒ˜์Œ์— ์ œ์‹œํ•œ๊ฑด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ง€์šฐ๊ณ , git ๋ ˆํฌ์ง€ํ† ๋ฆฌ์—์„œ clone ํ•ด์„œ ์ง์ ‘ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ํ•˜๊ณ  cmake ํ•˜๊ณ  ๋””๋ ‰ํ† ๋ฆฌ ์ƒˆ๋กœ ์„ค์ •ํ•˜๊ณ  ์–ด์ฉŒ๊ตฌ ์ €์ฉŒ๊ตฌ;;

โ€‹ ๊ทธ๋ ‡์ง€๋งŒ ์ง€๊ธˆ์€ ์˜คํ”ˆ์†Œ์Šค์˜ ์‹œ๋Œ€. Issue comment ๋งจ ๋ฐ‘์— ์ฆˆ์Œ ๊ตฌ์›๊ฐ™์€ ํ•œ ๋ฌธ์žฅ

$ brew install libomp

โ€‹ ์‹ค์ œ๋กœ brew ๋กœ libomp ํŒจํ‚ค์ง€ ์„ค์น˜ํ•˜์ž๋งˆ์ž ๋ชจ๋“  ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์ •์ƒ์ ์œผ๋กœ loaded ๋˜์—ˆ๋‹ค;;

๊ตํ›ˆ

โ€‹ ๋” ์‰ฌ์šด ๋ฐฉ๋ฒ•์ด ์žˆ๋‹ค... ๋Š˜...

Last updated