• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SNOW-240
Type: Sub-task Sub-task
Status: Reopened Reopened
Priority: Normal Normal
Assignee: Unassigned
Reporter: Rob Linden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
6. Second Life Snowglobe - SNOW
SNOW-93

Fix up standalone builds to find jsoncpp (create FindJsonCpp.cmake)

Created: 22/Sep/09 03:06 PM   Updated: Friday 12:58 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. File FindJsonCpp.cmake (2 kB)
2. Text File SNOW-240.patch (0.3 kB)
3. File SNOW-240v1-2.diff (0.6 kB)


Last Triaged: 24/Sep/09 10:10 AM
Patch attached: Patch attached


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Rob Linden added a comment - 23/Sep/09 02:09 PM - edited
A possible temporary solution to quickly get going is to use this as your FindJsonCpp.cmake file:
use_prebuilt_binary(jsoncpp)
  if (WINDOWS)
    set(JSONCPP_LIBRARIES
      debug json_vc80d
      optimized json_vc80)
  elseif (DARWIN)
    set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt)
  elseif (LINUX)
    set(JSONCPP_LIBRARIES jsoncpp)
  endif (WINDOWS)
  set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/jsoncpp)

(that's just the JsonCpp.cmake without the if(standalone) conditional around it)

I've never tried this myself, so I can't vouch for if it's going to be remotely successful. I can easily see it failing at the "use_prebuild_library(jsoncpp)" part if standalone is defined. If that happens, you can try manually downloading the appropriate prebuilt, unpacking in your tree, and edit that line out of the file.

BTW, I compiled a 64-bit Linux version of JsonCpp while I was updating libraries yesterday, which you can grab from the location in the patch on SNOW-241. In particular, the Linux 64-bit library is http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/jsoncpp-svn-r69-linux64-20090922.tar.bz2


Shawn Kaufmat added a comment - 23/Sep/09 03:17 PM
Find jsoncpp headers and library, this library name depends on your gcc version. Should work for all Linux distributions. Maybe MacOS X also.

Aleric Inglewood added a comment - 23/Sep/09 06:02 PM
I added the attached file to indra/cmake.
Then my configure finished without errors, but the build failed here:
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp: In static member function 'static BOOL LLTranslate::parseGoogleTranslate(std::string, std::string&, std::string&)':
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:106: error: 'Json' has not been declared
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:106: error: expected `;' before 'root'
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:107: error: 'Json' has not been declared
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:107: error: expected `;' before 'reader'
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:108: error: 'reader' was not declared in this scope
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:108: error: 'root' was not declared in this scope

Rob Linden added a comment - 23/Sep/09 06:20 PM
You'll need to install jsoncpp, for which there's not yet a Debian package (though that work is well underway).

Here's the latest source:
http://bitbucket.org/rob_linden/jsoncpp/get/tip.tar.bz2

Here's the changelog of the Linden mods:
http://bitbucket.org/rob_linden/jsoncpp/changesets/

More info on the library can be found upstream:
http://jsoncpp.sourceforge.net/


lindenrobot added a comment - 23/Sep/09 06:37 PM
Revision 2785 by rob.linden on 2009-09-23 20:37:13 -0500 (Wed, 23 Sep 2009)

Fix for SNOW-240 (Fix up standalone builds to find jsoncpp)

Files affected:
U projects/2009/snowglobe/trunk/doc/contributions.txt
A projects/2009/snowglobe/trunk/indra/cmake/FindJsonCpp.cmake


Rob Linden added a comment - 23/Sep/09 07:16 PM
Attaching SNOW-240.patch to fix up JsonCpp.cmake. Aleric, the reason why the configure didn't fail for you was because JSONCPP_FIND_REQUIRED ON wasn't set. The attached patch does what all of the other .cmake files does, which sets that variable as well as the FIND_QUIETLY variable. That should make the build failure more intuitive.

Aleric Inglewood added a comment - 24/Sep/09 03:38 AM
Ok, with this the configure gives an error that it can't find jsconcpp
CMake Error at cmake/FindJsonCpp.cmake:44 (MESSAGE):
  Could not find JSONCpp library

I got the tip.tar.bz2 file, extracted it somewhere, read the README files
(no INSTALL file), but the instructions fail on linux 64bit.

After grepping the sources I finally did:

python scons.py platform=linux64-gcc libs

this results in a file

./buildscons/linux64-gcc-4.3.3/src/lib_json/libjson_linux64-gcc-4.3.3_libmt.so

There are no instructions to install this in any file, nor anything that even
hints me how it should be installed, or even can be installed at all.

How to install this?


Aleric Inglewood added a comment - 24/Sep/09 04:31 AM - edited
Rob,

the added FindJsonCpp.cmake fails for me because
${CMAKE_CXX_COMPILER} is equal to "/usr/bin/ccache"

You should use "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}" instead.

as is done in indra/cmake/00-Common.cmake line 98


Aleric Inglewood added a comment - 24/Sep/09 05:49 AM - edited
After fixing the missing ${CMAKE_CXX_COMPILER_ARG1} problem and installing
the header and the library manually so that FindJsonCpp.cmake finds them,
I still get the exact same compile error as before:
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:106: error: 'Json' has not been declared
/usr/src/secondlife/secondlife/snowglobe/snowglobe-svn/indra/newview/lltranslate.cpp:106: error: expected `;' before 'root'

etc.

Imho, the problem is that the headerfile is found, but never included.


Aleric Inglewood added a comment - 24/Sep/09 06:14 AM - edited
I have an additional problem with FindJsonCpp.cmake that it ignores
the values of ${CMAKE_EXE_LINKER_FLAGS} and ${CMAKE_CXX_FLAGS}.

The first can contain one or more strings -L/some/path/lib and then /some/path/lib should be
searched for the library, the second can contain one or more strings -I/some/path/include
and then /some/path/include should be used to search for the header.

I can't fix this myself, cause I don't know cmake :/


Shawn Kaufmat added a comment - 26/Sep/09 01:05 PM
Shouldn't need to, GNU ld looks for /lib[64] /usr/lib[64] automatically.

Same for include -I /usr/include is automatically searched by GCC.

Just check your cmake cache to make sure it found the locations

CMakeCache.txt:JSONCPP_INCLUDE_DIR:PATH=/usr/include
CMakeCache.txt:JSONCPP_LIBRARY:FILEPATH=/usr/lib/libjson_linux-gcc-4.4.1_libmt.so


Thickbrick Sleaford added a comment - 26/Sep/09 01:22 PM - edited
I think this commit message was supposed to go here, instead in SNOW-204 (i.e. s/204/240/)

lindenrobot added a comment - 26/Sep/09 01:07 PM
Revision 2794 by rob.linden on 2009-09-26 15:07:17 -0500 (Sat, 26 Sep 2009)

Fixup for SNOW-204 (setting JSONCPP_FIND_QUIETLY and JSONCPP_FIND_REQUIRED so that missing JsonCpp is reported)

Files affected:
U projects/2009/snowglobe/trunk/indra/cmake/JsonCpp.cmake


Aleric Inglewood added a comment - 26/Sep/09 05:10 PM
Attached SNOW-240v1-2.diff, needed if one uses ccache.

lindenrobot added a comment - 26/Sep/09 05:12 PM
Revision 2795 by aleric.inglewood on 2009-09-26 19:12:41 -0500 (Sat, 26 Sep 2009)

SNOW-240: Use CMAKE_CXX_COMPILER_ARG1 when invoking compiler.

Files affected:
U projects/2009/snowglobe/trunk/indra/cmake/FindJsonCpp.cmake


Rob Linden added a comment - 30/Sep/09 11:45 AM
I think this is pretty much done now, right?

Dzonatas Sol added a comment - 20/Nov/09 12:58 PM
If the failure message can point to a wiki page or to this issue to help resolve this dependency, this would be great and make compilation go smoother without being left in the dark about what to do next and more quickly achieve resolution. This is why I reopened it.

Thanks