Discussion:
[Pyublas] build error with cmake
Dzhelil Rufat
2009-08-06 09:58:15 UTC
Permalink
Hello,

I am trying to port the build system to cmake in order to better
integrate into my project, however, I am getting the following error
during compilation:

~/pyublas/src/cpp/pyublas/numpy.hpp: In constructor
?pyublas::numpy_vector<T>::numpy_vector(int, const npy_intp*, const
boost::numeric::ublas::vector_expression<E>&)?:
~/pyublas/src/cpp/pyublas/numpy.hpp:742: error: there are no
arguments to ?size? that depend on a template parameter, so a
declaration of ?size? must be available
~/pyublas/src/cpp/pyublas/numpy.hpp:742: error: (if you use
?-fpermissive?, G++ will accept your code, but allowing the use of
an undeclared name is deprecated)
make[2]: *** [CMakeFiles/_internal.dir/src/wrapper/converters.cpp.o]
Error 1
make[1]: *** [CMakeFiles/_internal.dir/all] Error 2
make: *** [all] Error 2


I am using:

Darwin 9.7.0 Darwin Kernel Version 9.7.0
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
numpy.__version__
'1.4.0.dev7153'


Has anybody else tried to compile with CMake? I've noticed that the
Jamfile.v2 is using python 2.5. Could this error be due to
incompatibility with Python 2.6 or am I doing something wrong?

Here is what I have so far in my cmake file:

cmake_minimum_required(VERSION 2.6)

project(PyUblas)

# hack to get SITE_PACKAGES directory
include(FindPythonInterp)
string( REPLACE /bin/ /lib/ PYTHON_SITE_PACKAGES
${PYTHON_EXECUTABLE}/site-packages )

include(FindPythonLibs)

find_package(Boost)
find_package(Boost COMPONENTS python)

include_directories(${PyUblas_SOURCE_DIR}/src/cpp)
include_directories(${Boost_INCLUDE_DIR})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${PYTHON_SITE_PACKAGES}/numpy/core/include)

file(GLOB files src/wrapper/*.cpp)
add_library (_internal MODULE ${files})

Note that this file doesn't do the linking yet, but it should at least
compile all the object files without errors.

I also tried compiling with msvc on windows and there I get tons of
warnings:

C:\boost_1_39_0\boost/numeric/ublas/storage.hpp(94) : warning C4996:
'std::unini
tialized_copy': Function call with parameters that may be unsafe -
this call rel
ies on the caller to check that the passed values are correct. To
disable this w
arning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to
use Visual C+
+ 'Checked Iterators'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\memory(98) : see
declaration of 'std::uninitialized_copy'
C:\boost_1_39_0\boost/numeric/ublas/storage.hpp(89) : while compiling cl
ass template member function
'boost::numeric::ublas::unbounded_array<T>::unbound
ed_array(const boost::numeric::ublas::unbounded_array<T> &)'
with
[
T=std::complex<double>
]
C:\boost_1_39_0\boost/numeric/ublas/matrix_sparse.hpp(3963) : see refere
nce to class template instantiation
'boost::numeric::ublas::unbounded_array<T>'
being compiled
with
[
T=std::complex<double>
]
C:\pyublas\src\wrapper\sparse_execute.cpp(26) : see reference to class t
emplate instantiation
'boost::numeric::ublas::compressed_matrix<T,L,IB,IA>' bein
g compiled
with
[
T=std::complex<double>,
L=boost::numeric::ublas::column_major,
IB=0,
IA=boost::numeric::ublas::unbounded_array<int>
]
C:\pyublas\src\wrapper\sparse_execute.cpp(35) : see reference to functio
n template instantiation 'void
exposeAll<std::complex<double>>(ValueType,const s
td::string &)' being compiled
with
[
ValueType=std::complex<double>
]
Dzhelil Rufat
2009-08-07 18:25:02 UTC
Permalink
Hello,

I resolved the problem.

In order for the program to compile successfully the -DNDEBUG flag has
to best.

Without this flag ublas would be really slow, but the compilatoin should
not crash as it does now.

The expected behavior is for the program to compile with or without this
flag.

Regards,
Dzhelil
Post by Dzhelil Rufat
Hello,
I am trying to port the build system to cmake in order to better
integrate into my project, however, I am getting the following error
~/pyublas/src/cpp/pyublas/numpy.hpp: In constructor
?pyublas::numpy_vector<T>::numpy_vector(int, const npy_intp*, const
~/pyublas/src/cpp/pyublas/numpy.hpp:742: error: there are no
arguments to ?size? that depend on a template parameter, so a
declaration of ?size? must be available
~/pyublas/src/cpp/pyublas/numpy.hpp:742: error: (if you use
?-fpermissive?, G++ will accept your code, but allowing the use of
an undeclared name is deprecated)
make[2]: *** [CMakeFiles/_internal.dir/src/wrapper/converters.cpp.o]
Error 1
make[1]: *** [CMakeFiles/_internal.dir/all] Error 2
make: *** [all] Error 2
Darwin 9.7.0 Darwin Kernel Version 9.7.0
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
numpy.__version__
'1.4.0.dev7153'
Has anybody else tried to compile with CMake? I've noticed that the
Jamfile.v2 is using python 2.5. Could this error be due to
incompatibility with Python 2.6 or am I doing something wrong?
cmake_minimum_required(VERSION 2.6)
project(PyUblas)
# hack to get SITE_PACKAGES directory
include(FindPythonInterp)
string( REPLACE /bin/ /lib/ PYTHON_SITE_PACKAGES
${PYTHON_EXECUTABLE}/site-packages )
include(FindPythonLibs)
find_package(Boost)
find_package(Boost COMPONENTS python)
include_directories(${PyUblas_SOURCE_DIR}/src/cpp)
include_directories(${Boost_INCLUDE_DIR})
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${PYTHON_SITE_PACKAGES}/numpy/core/include)
file(GLOB files src/wrapper/*.cpp)
add_library (_internal MODULE ${files})
Note that this file doesn't do the linking yet, but it should at least
compile all the object files without errors.
I also tried compiling with msvc on windows and there I get tons of
'std::unini
tialized_copy': Function call with parameters that may be unsafe -
this call rel
ies on the caller to check that the passed values are correct. To
disable this w
arning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to
use Visual C+
+ 'Checked Iterators'
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\memory(98) : see
declaration of 'std::uninitialized_copy'
C:\boost_1_39_0\boost/numeric/ublas/storage.hpp(89) : while
compiling cl
ass template member function
'boost::numeric::ublas::unbounded_array<T>::unbound
ed_array(const boost::numeric::ublas::unbounded_array<T> &)'
with
[
T=std::complex<double>
]
C:\boost_1_39_0\boost/numeric/ublas/matrix_sparse.hpp(3963) : see refere
nce to class template instantiation
'boost::numeric::ublas::unbounded_array<T>'
being compiled
with
[
T=std::complex<double>
]
C:\pyublas\src\wrapper\sparse_execute.cpp(26) : see reference to class t
emplate instantiation
'boost::numeric::ublas::compressed_matrix<T,L,IB,IA>' bein
g compiled
with
[
T=std::complex<double>,
L=boost::numeric::ublas::column_major,
IB=0,
IA=boost::numeric::ublas::unbounded_array<int>
]
C:\pyublas\src\wrapper\sparse_execute.cpp(35) : see reference to functio
n template instantiation 'void
exposeAll<std::complex<double>>(ValueType,const s
td::string &)' being compiled
with
[
ValueType=std::complex<double>
]
Loading...