diff --git a/3rd_party/simbody b/3rd_party/simbody index 37e5805bbd..7ef1b38ad3 160000 --- a/3rd_party/simbody +++ b/3rd_party/simbody @@ -1 +1 @@ -Subproject commit 37e5805bbd6c73552f4602effbc83489d9cc2a5d +Subproject commit 7ef1b38ad35a6b71cd2083a73b093a20313f9aa1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 22cdbefd34..92a9cb1887 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,15 +19,10 @@ if(EMSCRIPTEN) set(BUILD_WITH_SIMBODY 1) set(ONLY_3D 1) set(BUILD_TESTS 1) - set(BUILD_STATIC_LIBRARIES on) # Simbody - set(BUILD_DYNAMIC_LIBRARIES off) # Simbody - add_definitions(-DSIMBODY_WITHOUT_LAPACK) + add_definitions(-D__SIMBODY_WITHOUT_LAPACK__) + add_definitions(-D__EIGEN__) add_definitions(-D__EMSCRIPTEN__) - set(EIGEN_ROOT ${SPHINXSYS_PROJECT_DIR}/3rd_party/eigen) - message("${EIGEN_ROOT}") - include_directories("${EIGEN_ROOT}") - remove_definitions(-DTBB_2021_2_0) set(TBB_ROOT ${SPHINXSYS_PROJECT_DIR}/3rd_party/wasmtbb) include_directories("${TBB_ROOT}/include") @@ -38,6 +33,19 @@ else() add_definitions(-DBOOST_AVAILABLE) endif() +if(BUILD_WITH_SIMBODY) + add_definitions(-D__SIMBODY_WITHOUT_LAPACK__) + add_definitions(-D__EIGEN__) + set(EIGEN_ROOT ${SPHINXSYS_PROJECT_DIR}/3rd_party/eigen) + message("${EIGEN_ROOT}") + include_directories("${EIGEN_ROOT}") +endif() + +if(STATIC_BUILD) + set(BUILD_STATIC_LIBRARIES 1) # Simbody + set(BUILD_DYNAMIC_LIBRARIES 0) # Simbody +endif() + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) # Set the possible values of build type for cmake-gui diff --git a/build.sh b/build.sh deleted file mode 100755 index 5f1a14cd64..0000000000 --- a/build.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -BUILD_CONFIG=$1 -if [ -z "$1" ] ; then - BUILD_CONFIG=release -fi - -BUILD_PLATFORM=$2 -if [ -z "$2" ] ; then - BUILD_PLATFORM=wasm -fi - -BUILD_DIR=build_${BUILD_PLATFORM}_${BUILD_CONFIG} -INSTALL_DIR=install_${BUILD_PLATFORM}_${BUILD_CONFIG} - -if [ $BUILD_PLATFORM == "wasm" ]; then - - cd ./3rd_party/wasmtbb \ - && emmake make -j$(nproc) tbb \ - && cd ../.. - - echo 'Running wasm build ... ' - source /emsdk/emsdk_env.sh - cmake -G Ninja -B$BUILD_DIR -H.\ - -DEMSCRIPTEN=1 \ - -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} \ - -DCMAKE_MODULE_PATH=$EMSDK/upstream/emscripten/cmake \ - -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -fi - -if [ $BUILD_PLATFORM == "x64" ]; then - echo 'Running x64 build ... ' - cmake -G Ninja -B$BUILD_DIR -HSPHinXsys \ - -DBUILD_PLATFORM=${BUILD_PLATFORM} \ - -DCMAKE_BUILD_TYPE=${BUILD_CONFIG} \ - -DWASM_BUILD=0 -fi - -cd $BUILD_DIR && ninja && cd .. - -# if [ $BUILD_PLATFORM == "wasm" ]; then -# cp -r $BUILD_DIR/src/bin/* js/ -# fi \ No newline at end of file diff --git a/package.json b/package.json deleted file mode 100644 index f7b6b1d2c6..0000000000 --- a/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "sph-in-xsys", - "version": "1.0.0", - "description": "SPHinXsys_JS build", - "author": "Wen-Yang Chu & Bence Rochlitz", - "scripts": { - "build-docker": "docker build . -t sph-builder -f wasm-new.Dockerfile", - "interactive-docker": "docker run -it -v $PWD:/app sph-builder /bin/bash", - "build-wasm": "docker run -u $(id -u):$(id -g) -v $PWD:/app sph-builder ./build.sh release wasm", - "build-x64": "./build.sh release x64" - }, - "dependencies": {}, - "peerDependencies": { - "typescript": ">= 3.8.3" - } -} - \ No newline at end of file diff --git a/wasm-new.Dockerfile b/wasm-new.Dockerfile deleted file mode 100644 index a21cccab92..0000000000 --- a/wasm-new.Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ - -FROM emscripten/emsdk:latest - -ENV TZ=Europe/Berlin -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone - -RUN apt-get update && apt-get install -y \ - apt-utils \ - cmake \ - ninja-build \ - ccache \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - -ENV CCACHE_DIR /app/.ccache - -WORKDIR /app \ No newline at end of file