Hi,

I made the following changes

$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fc2ef2b..bea5db2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,7 +62,7 @@ endif()

 # Set BOOST_ROOT to help CMake to find the right Boost version
 find_package(Boost 1.46.0
-  REQUIRED date_time filesystem system iostreams regex unit_test_framework
+  REQUIRED date_time filesystem system iostreams regex unit_test_framework
   ${BOOST_PYTHON})

 include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
diff --git a/src/pyledger.cc b/src/pyledger.cc
index ee7b99c..069823f 100644
--- a/src/pyledger.cc
+++ b/src/pyledger.cc
@@ -39,7 +39,7 @@ namespace ledger {
   extern void initialize_for_python();
 }

-BOOST_PYTHON_MODULE(ledger)
+BOOST_PYTHON_MODULE(libpyledger)
 {
   using namespace ledger;



I got a libpyledger.so, but upon doing an import libpyledger in python, I 
get the following error

ImportError: ./libpyledger.so: undefined symbol: __gmpq_add

Any ideas about this? I have absolutely no idea about this since I'm not a 
C++ programmer.

Thanks,
cb

On Wednesday, June 19, 2013 11:46:23 PM UTC-7, c b wrote:
>
> Hi Tim and John,
>
> Thanks for looking into this. I dug around a little bit in the CMake 
> documentation and changed src/CMakeLists.txt as follows.
>
>
> $ git diff
> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
> index 2d6b22f..1ca4362 100644
> --- a/src/CMakeLists.txt
> +++ b/src/CMakeLists.txt
> @@ -243,6 +243,7 @@ add_pch_rule(${PROJECT_BINARY_DIR}/system.hh 
> LEDGER_SOURCES main.cc global.cc)
>  
>  if(BUILD_LIBRARY)
>    add_library(libledger ${LEDGER_SOURCES} 
> ${PROJECT_SOURCE_DIR}/lib/sha1.cpp)
> +  add_library(pyledger SHARED ${LEDGER_SOURCES} 
> ${PROJECT_SOURCE_DIR}/lib/sha1.cpp)
>    set_target_properties(libledger PROPERTIES OUTPUT_NAME ledger)
>  
>    add_executable(ledger main.cc global.cc)
>
> I now get a libpyledger.so shared library built, but adding it to 
> PYTHONPATH and trying import ledger  in a python script still results in 
> an error.
> Any tips on how to proceed are appreciated.
>
>
> Thanks,
> cb
> On Monday, June 17, 2013 10:47:56 PM UTC-7, Tim Crews wrote:
>>
>>
>>
>> On Monday, June 17, 2013 10:06:15 PM UTC-7, John Wiegley wrote:
>>>
>>> >>>>> c b <[email protected]> writes: 
>>>
>>> Where is pyledger.so?  If you built with Python support, it should be 
>>> somewhere on your system. 
>>>
>>> John 
>>>
>>
>> John,
>>
>> I don't see anything that would produce this library.  In 
>> src/CMakeLists.txt, the HAVE_BOOST_PYTHON flag just causes all of the 
>> py_.cc files to be appended to the list of source files that are built into 
>> either libledger or ledger.  I don't see anything building a pyledger 
>> library.
>>
>> Did this maybe get lost in the shuffle during the CMake conversion?  
>> Looking at the git history, it looks like it's been this way from the very 
>> beginning of the CMake-based build system.
>>
>> Tim Crews
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to