opvious / highs.ts

Node.js bindings for the HiGHS optimization solver
Apache License 2.0
3 stars 0 forks source link

Compilation error building the addon #34

Closed chrr closed 1 year ago

chrr commented 1 year ago
/tmp/highs.ts-0.5.8/packages/highs-addon$ npm install

> highs-addon@0.5.8 postinstall
> pkg-prebuilds-verify ./binding-options.js || cmake-js build

info TOOL Using Unix Makefiles generator.
info CMD CONFIGURE
info RUN [
info RUN   'cmake',
info RUN   '/tmp/highs.ts-0.5.8/packages/highs-addon',
info RUN   '--no-warn-unused-cli',
info RUN   '-G',
info RUN   'Unix Makefiles',
info RUN   '-DCMAKE_JS_VERSION=7.2.1',
info RUN   '-DCMAKE_BUILD_TYPE=Release',
info RUN   '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/highs.ts-0.5.8/packages/highs-addon/build/Release',
info RUN   '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>',
info RUN   '-DCMAKE_JS_INC=/tmp/highs.ts-0.5.8/packages/highs-addon/node_modules/node-api-headers/include;/tmp/highs.ts-0.5.8/packages/highs-addon/node_modules/node-addon-api',
info RUN   '-DCMAKE_JS_SRC=',
info RUN   '-DNODE_RUNTIME=node',
info RUN   '-DNODE_RUNTIMEVERSION=16.18.1',
info RUN   '-DNODE_ARCH=x64',
info RUN   '-DCMAKE_JS_LIB=',
info RUN   '-DCMAKE_CXX_FLAGS=-DBUILDING_NODE_EXTENSION'
info RUN ]
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/highs.ts-0.5.8/packages/highs-addon/build
info CMD BUILD
info RUN [
info RUN   'cmake',
info RUN   '--build',
info RUN   '/tmp/highs.ts-0.5.8/packages/highs-addon/build',
info RUN   '--config',
info RUN   'Release'
info RUN ]
Scanning dependencies of target highs_addon
[  8%] Building CXX object CMakeFiles/highs_addon.dir/src/exports.cc.o
In file included from /tmp/highs.ts-0.5.8/packages/highs-addon/src/solver.h:4,
                 from /tmp/highs.ts-0.5.8/packages/highs-addon/src/exports.cc:1:
/tmp/highs.ts-0.5.8/packages/highs-addon/src/util.h:5:10: fatal error: Highs.h: No such file or directory
    5 | #include <Highs.h>
      |          ^~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/highs_addon.dir/build.make:63: CMakeFiles/highs_addon.dir/src/exports.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/highs_addon.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
ERR! OMG Process terminated: 2
chrr commented 1 year ago

The CMakeLists.txt includes external project setup, but on my machine, I don't see that it downloads anything. It creates a few empty directories though. Any help highly appreciated!

mtth commented 1 year ago

Hi @chrr. What are your underlying OS/architecture and CMake version?

Edit: I'm able to reproduce this issue with CMake <3.22. If your version is older than this, please upgrade and report back.

chrr commented 1 year ago

Thank you! OS is Ubuntu 20.04, with cmake 3.16.

Upgraded now to 3.26.4, and the problem vanished.