Skip to content

Commit

Permalink
Small changes for compiling for v1.0.12 release for Linux and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed May 5, 2024
1 parent eb39451 commit 82b668d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -236,7 +236,7 @@ if( InterSpec_FETCH_DEPENDENCIES )
else( InterSpec_FETCH_DEPENDENCIES )
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.68 REQUIRED COMPONENTS thread date_time system filesystem program_options regex random )
find_package(Boost 1.68 REQUIRED COMPONENTS thread date_time system filesystem program_options regex random process )

if( USE_REL_ACT_TOOL )
find_package( Eigen3 3.4 REQUIRED NO_MODULE )
Expand Down Expand Up @@ -688,7 +688,7 @@ target_include_directories( InterSpecLib
if( InterSpec_FETCH_DEPENDENCIES )
target_link_libraries( InterSpecLib
PUBLIC
Boost::math Boost::scope_exit Boost::uuid Boost::iostreams Boost::assign Boost::multi_array Boost::crc
Boost::math Boost::scope_exit Boost::uuid Boost::iostreams Boost::assign Boost::multi_array Boost::crc Boost::process
# Boost::signals2 Boost::asio Boost::multi_index
wt
# wttest
Expand Down
2 changes: 2 additions & 0 deletions target/electron/CMakeLists.txt
Expand Up @@ -39,6 +39,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_RE

target_include_directories( ${PROJECT_NAME} PUBLIC
node_modules/node-addon-api/
node_modules/node-api-headers/
node_modules/node-api-headers/include
${CMAKE_CURRENT_SOURCE_DIR}/../..
)

Expand Down
13 changes: 2 additions & 11 deletions target/electron/README.md
Expand Up @@ -12,7 +12,7 @@ To compile the InterSpec code, and package the Electron app, with the manually c
npm install -g cmake-js

# For macOS only, you may want to define a deployment target
export MACOSX_DEPLOYMENT_TARGET=10.12
export MACOSX_DEPLOYMENT_TARGET=10.13

cd /path/to/InterSpec/target/electron

Expand Down Expand Up @@ -146,7 +146,7 @@ docker pull quay.io/pypa/manylinux2014_x86_64:latest

# Start a shell session within the image, mapping the InterSpec source
# directory to /interspec. We'll also map port 8081 for testing.
docker run --rm -it -v `pwd`:/interspec quay.io/pypa/manylinux2014_x86_64:latest sh
docker run --rm -it -v `pwd`:/interspec quay.io/pypa/manylinux2014_x86_64:latest bash

# Get the dependancies we need to build InterSpec
yum update
Expand Down Expand Up @@ -184,15 +184,6 @@ cp ../../NOTICE.html ./release-builds/InterSpec-linux-x64/
## Linux Considerations
The `InterSpec` module is really a shared library that node.js loads, therefore you need the `-fPIC` C/C++ compiler flag enabled not just for the `InterSpec` code, but for all of the static libraries you link it against, including boost, Wt, and zlib - which isnt the default when compiling static libraries for any of them, so when building them you may want to add `-fPIC -std=c++11` flags to the flags.

## Building for 32-bit Windows
To build for 32-bit Windows, you should install 32bit node.js; you will then need to build the dependencies (boost, Wt, Eigen, etc) with the cmake flag `-A Win32`, or for boost, use the b2.exe flag `address-model=32 architecture=x86` (you may also need to create a `project-config.jam` file to explicitly point to the x86 cl.exe compiler).

You should also consider modifying package.json to make sure the Electron version used is compatible with the version of Windows you want to run it on.

Then to configure and build the project, you will need to use a command like:
```bash
cmake-js --generator "Visual Studio 17 2022" --CDBoost_USE_STATIC_RUNTIME=ON --CDCMAKE_BUILD_TYPE="Release" --CDUSE_LEAFLET_MAP=ON --CDLEAFLET_MAPS_KEY="..." --CDUSE_REL_ACT_TOOL=ON --CDInterSpec_FETCH_DEPENDENCIES=OFF --CDCMAKE_PREFIX_PATH="C:\Path\To\Prefix" --out="build_win_x86" --CDBoost_COMPILER="vc173" --CDZLIB_USE_STATIC_LIBS=ON --arch=ia32 --architecture ia32 --arch=ia32 --CDCMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE=x86 -A Win32 --target install
```

## Future Work
- In the future the build process may be improved to do the final packaging through CMake.
Expand Down
3 changes: 2 additions & 1 deletion target/electron/package.json
Expand Up @@ -23,7 +23,8 @@
},
"license": "LGPL-2.1-only",
"dependencies": {
"cmake-js": "^6.1.0"
"cmake-js": "^6.1.0",
"node-api-headers": "^1.1.0"
},
"devDependencies": {
"electron": "^21.4.4",
Expand Down
4 changes: 2 additions & 2 deletions target/ios/InterSpec/InterSpec.xcodeproj/project.pbxproj
Expand Up @@ -344,7 +344,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = G2VV85LMR5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "InterSpec/InterSpec-Prefix.pch";
Expand Down Expand Up @@ -447,7 +447,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 15;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = G2VV85LMR5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "InterSpec/InterSpec-Prefix.pch";
Expand Down

0 comments on commit 82b668d

Please sign in to comment.