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 15:58] – donghee | python [2018/07/18 14:10] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 125: | Line 125: | ||
---- | ---- | ||
===== xdress install ===== | ===== xdress install ===== | ||
- | mac | + | llvm 3.4.2 in macos x 10.9 |
- | + | ||
- | llvm 3.4.2 | + | |
< | < | ||
wget http:// | wget http:// | ||
+ | #wget http:// | ||
tar xvfz clang+llvm-3.4.2-x86_64-apple-darwin10.9.xz | tar xvfz clang+llvm-3.4.2-x86_64-apple-darwin10.9.xz | ||
Line 141: | Line 140: | ||
cd xdress | cd xdress | ||
- | python setup.py build_ext | + | python setup.py build_ext |
sudo python setup.py install | sudo python setup.py install | ||
</ | </ | ||
Line 147: | Line 146: | ||
+ | < | ||
+ | xdress --debug -p clang | ||
+ | |||
+ | </ | ||
---- | ---- | ||
===== xdress 사용하기 ===== | ===== xdress 사용하기 ===== | ||
Line 174: | 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 192: | 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 207: | Line 242: | ||
a.power(42) | a.power(42) | ||
</ | </ | ||
- |
python.1420127898.txt.gz · Last modified: 2018/07/18 14:09 (external edit)