Skip to content

Amalgamate Script Fails #998

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

Closed
teddybouch opened this issue Aug 2, 2019 · 3 comments
Closed

Amalgamate Script Fails #998

teddybouch opened this issue Aug 2, 2019 · 3 comments

Comments

@teddybouch
Copy link

I'm trying to use the amalgamate script to get a version of jsoncpp that I can use, since I'm having the cmake issue described in #970 and using the Meson build system requires version 0.50.0 and the latest I can get for my OS is 0.29.0. However, when I try to run that script, I get an error that the version.h file doesn't exist:

ava@3b97b310abf0:~/resources/jsoncpp$ python amalgamate.py 
Amalgamating header...
Traceback (most recent call last):
  File "amalgamate.py", line 155, in <module>
    main()
  File "amalgamate.py", line 147, in main
    header_include_path=options.header_include_path)
  File "amalgamate.py", line 69, in amalgamate_source
    header.add_file("include/json/version.h")
  File "amalgamate.py", line 30, in add_file
    f = open(os.path.join(self.top_dir, relative_input_path), "rt")
IOError: [Errno 2] No such file or directory: '/home/ava/resources/jsoncpp/include/json/version.h'

If I remove the line that includes this header from the meson.build, it will generate a 'dist' folder and the files that it's supposed to, but I don't know what the impact of that might be. While I'm asking questions, I assume that I'm meant to put the contents of that dist folder somewhere that is in my PATH like /usr/include, which will allow the header file to be included? Thanks!

System information:

  • OS: Ubuntu 16.04.4 LTS
  • Meson version: 0.29.0
  • Ninja version: 1.5.1
@BorisTestov
Copy link

You need to build jsoncpp first. This should work:

mkdir build && cd build
cmake ..
make
cd ..
python amalgamate.py

BTW, I had a problem with CMake when building in the same directory where CMakeLists.txt is stored. Building in another directory (e.g. build) works fine.

@dota17
Copy link
Member

dota17 commented Aug 14, 2019

You need to build jsoncpp first. This should work:

mkdir build && cd build
cmake ..
make
cd ..
python amalgamate.py

BTW, I had a problem with CMake when building in the same directory where CMakeLists.txt is stored. Building in another directory (e.g. build) works fine.

It's not a good way to build this project in the same directory where top CMakeLists.txt is stored. you may have a problem like:

/usr/include/c++/4.8/x86_64-suse-linux/bits/os_defines.h:44:19: error: missing binary operator before token "("
 #if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)

just using external compilation can avoid this unnecessary mistake.

@baylesj
Copy link
Contributor

baylesj commented Aug 14, 2019

This should be fixed with my latest patch. PTAL.

#997

@baylesj baylesj closed this as completed Aug 14, 2019
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

4 participants