python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python [2015/01/01 13:49] – [Cython Tutorial] donghee | python [2018/07/18 14:10] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 123: | Line 123: | ||
</ | </ | ||
+ | ---- | ||
+ | ===== xdress install ===== | ||
+ | llvm 3.4.2 in macos x 10.9 | ||
+ | < | ||
+ | wget http:// | ||
+ | #wget http:// | ||
+ | |||
+ | tar xvfz clang+llvm-3.4.2-x86_64-apple-darwin10.9.xz | ||
+ | mv clang+llvm-3.4.2-x86_64-apple-darwin10.9 llvm-3.4.2-build | ||
+ | |||
+ | export LLVM_CONFIG=llvm-3.4.2-build/ | ||
+ | |||
+ | git clone git:// | ||
+ | |||
+ | cd xdress | ||
+ | |||
+ | python setup.py build_ext --inplace | ||
+ | sudo python setup.py install | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | < | ||
+ | xdress --debug -p clang | ||
+ | |||
+ | </ | ||
---- | ---- | ||
===== xdress 사용하기 ===== | ===== xdress 사용하기 ===== | ||
Line 151: | Line 177: | ||
int i = 1; | int i = 1; | ||
double val = a; | double val = a; | ||
- | while (i < n){val *= a;}; | + | while (i < n){val *= a; i++;}; |
return val; | return val; | ||
}; | }; | ||
Line 169: | Line 195: | ||
</ | </ | ||
+ | jeh_setup.py | ||
< | < | ||
- | xdress --rc jeh_xdressrc.py | + | import os |
- | python3 | + | from distutils.core import setup |
+ | from distutils.extension import Extension | ||
+ | from Cython.Distutils import build_ext | ||
+ | |||
+ | import numpy as np | ||
+ | |||
+ | cwd = os.getcwd() | ||
+ | incdirs = [cwd, os.path.join(cwd, | ||
+ | |||
+ | ext_modules = [ | ||
+ | Extension(" | ||
+ | include_dirs=incdirs, | ||
+ | ] | ||
+ | |||
+ | setup( | ||
+ | name = ' | ||
+ | cmdclass = {' | ||
+ | ext_modules = ext_modules, | ||
+ | packages = [' | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | Makefile | ||
+ | |||
+ | < | ||
+ | all: | ||
+ | | ||
+ | | ||
+ | clean: | ||
+ | rm -rf build | ||
+ | rm -rf jehbuild | ||
+ | | ||
</ | </ | ||
Line 184: | Line 242: | ||
a.power(42) | a.power(42) | ||
</ | </ | ||
- |
python.1420120179.txt.gz · Last modified: 2018/07/18 14:09 (external edit)