Reputation: 41
I wanted to compile EnergyPlus (https://github.com/NREL/EnergyPlus) to a WASM module.
These are steps I followed:
emcc --check
produces the outputemcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.37-git
shared:INFO: (Emscripten: Running sanity checks)
git clone https://github.com/NREL/EnergyPlus
cd EnergyPlus
mkdir build
cd build
emcmake cmake ..
This gave the error-- Using X11 for window creation
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find X11 (missing: X11_X11_LIB)
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.26/Modules/FindX11.cmake:481 (find_package_handle_standard_args)
third_party/penumbra/vendor/glfw/CMakeLists.txt:196 (find_package)
Since the EnergyPlus (https://github.com/NREL/EnergyPlus) project is using Cmake as the build system, I followed the section Integrating with a build system from the official documentation of Emscripton.
If emcmake cmake ..
succeeds, I would be able to run emcc [-Ox] project.o -o project.js
and this would generate the WASM (WebAssembly) module?
Update: For step 6, instead of using cmake .. -DGLFW_USE_OSMESA=1 -DBUILD_STATIC_ENERGYPLUS_API=1
gets rid of the previous error and instead the error I get now is,
CMake Error in src/EnergyPlus/CMakeLists.txt:
export called with target "energyplusapi" which requires target
"energypluslib" that is not in any export set.
CMake Error in src/EnergyPlus/CMakeLists.txt:
export called with target "energyplusapi" which requires target
"project_options" that is not in any export set.
CMake Error in src/EnergyPlus/CMakeLists.txt:
export called with target "energyplusapi" which requires target
"project_fp_options" that is not in any export set.
CMake Error in src/EnergyPlus/CMakeLists.txt:
export called with target "energyplusapi" which requires target
"project_warnings" that is not in any export set.
Upvotes: 1
Views: 150