Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails on ubuntu #55

Open
wzr1337 opened this issue Nov 12, 2022 · 7 comments
Open

build fails on ubuntu #55

wzr1337 opened this issue Nov 12, 2022 · 7 comments

Comments

@wzr1337
Copy link
Contributor

wzr1337 commented Nov 12, 2022

Please see below log

> [email protected] install
> node-gyp rebuild

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.10.6 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ubuntu/source/node-opendds/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/ubuntu/.cache/node-gyp/16.18.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/ubuntu/.cache/node-gyp/16.18.1',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/ubuntu/.cache/node-gyp/16.18.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/ubuntu/source/node-opendds',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/ubuntu/source/node-opendds/build'
  CXX(target) Release/obj.target/node_opendds/src/node-opendds.o
In file included from /home/ubuntu/source/OpenDDS-3.22/dds/DCPS/DataReaderImpl.h:20,
                 from ../src/NodeDRListener.h:11,
                 from ../src/node-opendds.cpp:1:
/home/ubuntu/source/OpenDDS-3.22/dds/DCPS/DomainParticipantImpl.h:34:12: fatal error: dds/DdsDcpsCoreTypeSupportC.h: No such file or directory
   34 | #  include <dds/DdsDcpsCoreTypeSupportC.h>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [node_opendds.target.mk:130: Release/obj.target/node_opendds/src/node-opendds.o] Error 1
make: Leaving directory '/home/ubuntu/source/node-opendds/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Linux 5.15.0-1019-aws
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/source/node-opendds
gyp ERR! node -v v16.18.1
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok 
npm ERR! code 1
npm ERR! path /home/ubuntu/source/node-opendds
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/...-debug-0.log

I used setenv.sh in the OpenDDS-3.22 folder

@wzr1337
Copy link
Contributor Author

wzr1337 commented Nov 12, 2022

I have configured minimal with:

./configure --no-tests --no-debug --no-rapidjson --no-built-in-topics --no-content-subscription --no-content-filtered-topic --no-multi-topic --no-query-condition --no-ownership-profile # --no-ownership-kind-exclusive --no-object-model-profile --no-persistence-profile 

@simpsont-oci
Copy link
Contributor

The header it's complaining about, dds/DdsDcpsCoreTypeSupportC.h, should be generated during the build. The fact that it's finding dds/DCPS/DomainParticipantImpl.h but not dds/DdsDcpsCoreTypeSupportC.h makes me think that OpenDDS hasn't actually been built in the location specified.

@wzr1337
Copy link
Contributor Author

wzr1337 commented Nov 13, 2022

that is what I thought first too, but it has actually been built there. might it be that the configure flags leads to missing header files?

@simpsont-oci
Copy link
Contributor

Looking at dds/DCPS/DomainParticipantImpl.h, it looks like the main issue is that you've configured without built in topics. The current node-gyp bindings aren't smart enough to set the C++ define DDS_HAS_MINIMUM_BIT based on OpenDDS configuration settings, so it's hitting an error when trying to build without BIT.
So the options here seems like they would be to either re-enable built in topics and rebuild, or add the appropriate C++ defines to bindings.gyp. This is probably most easily done locally and statically, but eventually should probably be done dynamically based on OpenDDS's configuration. Obviously we're not currently testing node-opendds with some of these defines set, so you may run into further issues if you go the second route.

@wzr1337
Copy link
Contributor Author

wzr1337 commented Nov 15, 2022

Ok, so I tried rebuilding OpenDDS3.22 with configuration

./configure --built-in-topics --no-tests --no-debug --no-rapidjson --no-content-subscription --no-content-filtered-topic --no-multi-topic --no-query-condition --no-ownership-profile --no-ownership-kind-exclusive --no-object-model-profile --no-persistence-profile 
source ./setenv.sh
make -j $(getconf _NPROCESSORS_ONLN) INSTALL_PREFIX=/usr/local 

as per your suggestion, but now I am stuck with linker errors in building opendds...

/usr/bin/ld: /home/ubuntu/source/OpenDDS-3.22/ACE_wrappers/lib/libTAO_IDL_FE.so: undefined reference to `__cxa_throw_bad_array_new_length'
/usr/bin/ld: /home/ubuntu/source/OpenDDS-3.22/ACE_wrappers/lib/libTAO_IDL_FE.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::rdbuf(std::basic_streambuf<char, std::char_traits<char> >*)'
/usr/bin/ld: /home/ubuntu/source/OpenDDS-3.22/lib/libOpenDDS_Util.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::c_str() const'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
make[1]: *** [GNUmakefile.opendds_idl:225: opendds_idl] Error 1
make[1]: Leaving directory '/home/ubuntu/source/OpenDDS-3.22/dds/idl'
make: *** [GNUmakefile.dist:471: opendds_idl] Error 2

@wzr1337
Copy link
Contributor Author

wzr1337 commented Nov 15, 2022

I opened another issue on the OpenDDS repo, so This can be generally fixed or documented better

OpenDDS/OpenDDS#3878

@simpsont-oci
Copy link
Contributor

I modified my draft PR for testing this issue to be pretty close to the configure command line you provided, and I was able to get OpenDDS to build using Ubuntu 20.04 (I believe that's still what GitHub's ubuntu-latest runner image maps to).

https://github.com/OpenDDS/node-opendds/actions/runs/3470717770/jobs/5799274572#step:15:4

The only thing that looks different is the --std=c++11 flag. I would try running configure on a clean checkout (the configure script is only designed to be run once per clean checkout) and see if that fixes the issue. If not, try specifying the C++11 standard (newer than c++11 should be fine if you project needs it).

That said, there are still obviously errors building node-opendds, but those now seem related to the C++ defines for content filtered topics. If you really want a minimal OpenDDS build to work with node-opendds, I'm guessing you'll need to manually modify binding.gyp to set the defines necessary for your particular build for now until we figure out a good way of pulling the required defines into binding.gyp automatically from MPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants