-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch back to internal builds of igraph and HDF5. (#89)
This avoids headaches from guessing ABI compatibility across different Emscripten versions and build flags. With suitable caching, we can avoid achieve prebuilt binaries but with more suitable integration with our own CI. We also abandon the dedicated scran.js Docker image in favor of the generic emsdk + CMake image. This reduces the complexity of the CI and avoids stale object files in the CMake build. We use more caching to save the Wasm binary so that it doesn't need to be rebuilt if the C++ code hasn't changed. Also got rid of preamble.js as it's no longer needed in the new toolchain.
- Loading branch information
Showing
10 changed files
with
186 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
extern/installed | ||
build_* | ||
docs/html/ | ||
docs/latex/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
hdf5* | ||
package.json | ||
build-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
|
||
HDF5_VERSION=1.14.5 | ||
HDF5_HASH=ec2e13c52e60f9a01491bb3158cb3778c985697131fc6a342262d32a26e58e44 | ||
SOURCE_DIR=hdf5-${HDF5_VERSION} | ||
|
||
if [[ ! -e ${SOURCE_DIR} ]] | ||
then | ||
wget -q https://github.com/HDFGroup/hdf5/releases/download/hdf5_${HDF5_VERSION}/hdf5-${HDF5_VERSION}.tar.gz -O hdf5.tar.gz | ||
OBSERVED_HASH=($(shasum -a 256 hdf5.tar.gz)) | ||
if [[ ${OBSERVED_HASH} != ${HDF5_HASH} ]] | ||
then | ||
echo "hash mismatch for ${HDF5_VERSION} (got ${OBSERVED_HASH})" | ||
exit 1 | ||
fi | ||
tar -xf hdf5.tar.gz | ||
|
||
# Some source-editing shenanigans are required to deal with the lack of | ||
# FE_INVALID in Emscripten, see emscripten-core/emscripten#22005. Hey, | ||
# I don't make the rules. | ||
offender=${SOURCE_DIR}/src/H5Tinit_float.c | ||
cat ${offender} | sed "s/feclearexcept(FE_INVALID)/0/" > tmp | ||
mv tmp ${offender} | ||
fi | ||
|
||
BUILD_DIR=build-${HDF5_VERSION} | ||
if [ ! -e ${BUILD_DIR} ] | ||
then | ||
mkdir -p ../installed | ||
coreflags="-pthread" # propagating compile flags from the root scran.js CMakeLists.txt. | ||
echo "{}" > package.json # avoid assuming ES6 module syntax from the root scran.js package.json. | ||
emcmake cmake \ | ||
-S ${SOURCE_DIR} \ | ||
-B ${BUILD_DIR} \ | ||
-DCMAKE_C_FLAGS="${coreflags}" \ | ||
-DCMAKE_CXX_FLAGS="${coreflags}" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=$(pwd)/../installed \ | ||
-DBUILD_SHARED_LIBS=OFF \ | ||
-DBUILD_TESTING=OFF \ | ||
-DHDF5_BUILD_EXAMPLES=OFF \ | ||
-DHDF5_BUILD_TOOLS=OFF \ | ||
-DHDF5_BUILD_UTILS=OFF \ | ||
-DHDF5_BUILD_CPP_LIB=ON \ | ||
-DHDF5_ENABLE_Z_LIB_SUPPORT=ON \ | ||
-DZLIB_USE_EXTERNAL=OFF \ | ||
-DHDF5_ENABLE_SZIP_SUPPORT=OFF | ||
fi | ||
|
||
cd ${BUILD_DIR} | ||
emmake make | ||
emmake make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
igraph* | ||
package.json | ||
build-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -u | ||
|
||
IGRAPH_VERSION=0.10.13 | ||
IGRAPH_HASH=c6dc44324f61f52c098bedb81f6a602365d39d692d5068ca4fc3734b2a15e64c | ||
SOURCE_DIR=igraph-${IGRAPH_VERSION} | ||
|
||
if [[ ! -e ${SOURCE_DIR} ]] | ||
then | ||
wget -q https://github.com/igraph/igraph/releases/download/${IGRAPH_VERSION}/igraph-${IGRAPH_VERSION}.tar.gz -O igraph.tar.gz | ||
OBSERVED_HASH=($(shasum -a 256 igraph.tar.gz)) | ||
if [[ ${OBSERVED_HASH} != ${IGRAPH_HASH} ]] | ||
then | ||
echo "hash mismatch for ${IGRAPH_VERSION} (got ${OBSERVED_HASH})" | ||
exit 1 | ||
fi | ||
tar -xf igraph.tar.gz | ||
fi | ||
|
||
BUILD_DIR=build-${IGRAPH_VERSION} | ||
if [ ! -e ${BUILD_DIR} ] | ||
then | ||
mkdir -p ../installed | ||
coreflags="-pthread" # propagating compile flags from the root scran.js CMakeLists.txt. | ||
echo "{}" > package.json # avoid assuming ES6 module syntax from the root scran.js package.json. | ||
emcmake cmake \ | ||
-S ${SOURCE_DIR} \ | ||
-B ${BUILD_DIR} \ | ||
-DCMAKE_C_FLAGS="${coreflags}" \ | ||
-DCMAKE_CXX_FLAGS="${coreflags}" \ | ||
-DIGRAPH_WARNINGS_AS_ERRORS=OFF \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_INSTALL_PREFIX=$(pwd)/../installed | ||
fi | ||
|
||
cd ${BUILD_DIR} | ||
emmake make | ||
emmake make install |
This file was deleted.
Oops, something went wrong.