Skip to content

Commit f191857

Browse files
author
Dilawar Singh
committed
Merge branch 'devel' of https://github.com/dilawar/moose-core into devel
2 parents 0401d10 + 27f3f6e commit f191857

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

.docker/wheel/build_wheels.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -e
44

55
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
66
NPROC=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
7-
NUM_WORKERS=$((NPROC/2))
7+
NUM_WORKERS=$((NPROC-1))
88

99
if [ "$TRAVIS" == "true" ]; then
1010
NUM_WORKERS=2
@@ -27,7 +27,7 @@ GSL_STATIC_LIBS="/usr/local/lib/libgsl.a;/usr/local/lib/libgslcblas.a"
2727
CMAKE=/usr/bin/cmake3
2828

2929
# Build wheels here.
30-
for PYV in 36 27; do
30+
for PYV in 38 37 36 27; do
3131
PYDIR=/opt/python/cp${PYV}-cp${PYV}m
3232
cd $MOOSE_SOURCE_DIR
3333
echo "Building using $PYDIR in $PYVER"
@@ -40,8 +40,11 @@ for PYV in 36 27; do
4040
$PYTHON -m pip install matplotlib
4141
fi
4242
$PYTHON -m pip install wheel
43-
$PYTHON setup.py build --with-gsl-static
44-
$PYTHON setup.py bdist_wheel -w $WHEELHOUSE
43+
# $PYTHON setup.py build_ext --with-gsl-static
44+
# $PYTHON setup.py bdist_wheel
45+
# Don't build numpy. Use wheel.
46+
export GSL_USE_STATIC_LIBRARIES=1
47+
$PYTHON -m pip wheel --verbose --no-deps . -w $WHEELHOUSE
4548
echo "Content of WHEELHOUSE"
4649
ls -lh $WHEELHOUSE/*.whl
4750
done

cmake/FindGSL.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ IF(WIN32)
5555

5656
ELSE(WIN32)
5757
# UNIX
58-
IF(GSL_USE_STATIC_LIBRARIES)
58+
if(GSL_USE_STATIC_LIBRARIES OR $ENV{GSL_USE_STATIC_LIBRARIES})
5959
SET(GSL_LIB_NAMES libgsl.a)
6060
SET(GSL_CBLAS_LIB_NAMES libgslcblas.a)
61-
ELSE(GSL_USE_STATIC_LIBRARIES)
61+
else()
6262
SET(GSL_LIB_NAMES gsl)
6363
SET(GSL_CBLAS_LIB_NAMES gslcblas)
64-
ENDIF( )
64+
endif( )
6565

6666
if(GSL_ROOT_DIR)
6767
FIND_LIBRARY(GSL_LIB

setup.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
import datetime
2424

2525
try:
26-
cmakeVersion = subprocess.check_output(["cmake", "--version"])
26+
cmakeVersion = subprocess.call(["cmake", "--version"])
2727
except Exception as e:
28+
print(e)
2829
print("[ERROR] cmake is not found. Please install cmake.")
2930
quit(-1)
3031

@@ -57,7 +58,15 @@
5758
class CMakeExtension(Extension):
5859
def __init__(self, name, **kwargs):
5960
# don't invoke the original build_ext for this special extension
60-
Extension.__init__(self, name, sources=[], **kwargs)
61+
import tempfile
62+
# Create a temp file to create a dummy target. This build raises an
63+
# exception because sources are empty. With python3 we can fix it by
64+
# passing `optional=True` to the argument. With python2 there is no
65+
# getaway from it.
66+
f = tempfile.NamedTemporaryFile(suffix='.cpp', delete=False)
67+
f.write(b'int main() { return 1; }')
68+
Extension.__init__(self, name, sources=[f.name], **kwargs)
69+
f.close()
6170

6271
class TestCommand(Command):
6372
user_options = []
@@ -162,6 +171,6 @@ def build_cmake(self, ext):
162171
, os.path.join('chemUtil', 'rainbow2.pkl')
163172
]
164173
},
165-
ext_modules=[CMakeExtension('pymoose', optional=True)],
174+
ext_modules=[CMakeExtension('dummy', optional=True)],
166175
cmdclass={'build_ext': build_ext, 'test': TestCommand},
167176
)

0 commit comments

Comments
 (0)