Closed loumalouomega closed 5 years ago
Could you please elaborate on how exactly you are compiling this (compiler, compile options)? For example, the following example:
#include <boost/range/iterator_range.hpp>
#include <vexcl/vexcl.hpp>
#include <amgcl/backend/vexcl.hpp>
#include <amgcl/adapter/crs_tuple.hpp>
#include <amgcl/make_solver.hpp>
#include <amgcl/amg.hpp>
#include <amgcl/relaxation/spai0.hpp>
#include <amgcl/coarsening/smoothed_aggregation.hpp>
#include <amgcl/solver/bicgstab.hpp>
int main() {
vex::Context ctx(vex::Filter::Env);
std::cout << ctx << std::endl;
typedef amgcl::backend::vexcl<double> Backend;
typedef amgcl::make_solver<
amgcl::amg<Backend, amgcl::coarsening::smoothed_aggregation, amgcl::relaxation::spai0>,
amgcl::solver::bicgstab<Backend>
> Solver;
// Fake CRS matrix:
int n = 0;
int *ptr = 0;
int *col = 0;
int *val = 0;
// This is enough to compile, but should fail at runtime.
Solver solver(boost::make_tuple(
n,
boost::make_iterator_range(ptr, ptr),
boost::make_iterator_range(col, col),
boost::make_iterator_range(val, val)
));
}
compiles for me with this cmake file:
cmake_minimum_required(VERSION 3.1)
project(hello)
find_package(amgcl)
find_package(VexCL)
add_executable(hello hello.cpp)
target_link_libraries(hello VexCL::OpenCL amgcl::amgcl)
It is enough to clone and configure both amgcl and vexcl for find_package
above to work. Configure means running cmake like this:
cd amgcl
mkdir build
cd build
cmake ..
If this does not help, could you provide a minimal example?
For the VexCL compilation I use the following script:
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBoost_NO_BOOST_CMAKE:BOOL=TRUE \
-DBoost_NO_SYSTEM_PATHS:BOOL=TRUE \
-DBOOST_ROOT="~/src/boost_1_66_0" \
-DUSE_LIBCPP:BOOL=TRUE \
-DCMAKE_C_COMPILER=/usr/bin/gcc-5 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-5 \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11 -O3 -g" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 -O3 -g" \
-DCUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS} -Xcompiler -std=c++11" \
-DCUDA_TOOLKIT_ROOT_DIR="/usr/lib/nvidia-cuda-toolkit/" \
# -DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-9.1/" \
#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j4
# sudo make install
Besides USE_LIBCPP does not work or it is recognized apparently.
And for the AMGL I use the following script:
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBOOST_ROOT="~/src/boost_1_66_0" \
-DCMAKE_C_COMPILER=/usr/bin/gcc-5 \
-DCMAKE_CXX_COMPILER=/usr/bin/g++-5 \
-DAMGCL_BUILD_EXAMPLES=ON \
-DAMGCL_BUILD_TESTS=ON \
-DPASTIX_INCLUDES="~/src/pastix_5.2.3/install/lib" \
-DPASTIX_LIBRARIES="~/src/pastix_5.2.3/install/include" \
-DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -msse3 -std=c++11 -O3 -g" \
-DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -msse3 -O3 -g" \
-DCUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS} -Xcompiler -std=c++11" \
-DEIGEN_INCLUDE="~/src/eigen" \
-DVIENNACL_INCLUDE="~/src/viennacl-dev" \
-DCUDA_TOOLKIT_ROOT_DIR="/usr/lib/nvidia-cuda-toolkit/" \
# -DVexCL_DIR="~/src/vexcl" \
# -DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-9.1/" \
#decomment this to have it verbose
# make VERBOSE=1 -j4
make -j4
# sudo make install
Thanks in advance, have a nice day
Additionally, boost has been compiled with:
./b2 stage --with-python --with-serialization --with-chrono --with-date_time --with-system --with-thread --with-test --with-atomic --with-program_options --with-filesystem cxxflags="-std=c++11" variant=release link=shared,static
@loumalouomega , sorry for the late reply, did you manage to solve this? If not, we could have a chat in telegram.
Sorry I haven't tried since then, I downgraded the drivers of the graphic card because of compatibility reasons, and CUDA wasn't working. I reinstalled the correct ones last Sunday, I will try again today and I will tell yiu
Try to not use the old configuration scripts; I would just try a clean configuration of vexcl and amgcl instead.
Greetings,
I am trying to compile AMGCL with support to VexCl and I am getting the following error:
It continues, but is more of the same error.
I am using boost 1.66 and compiling with c++11 support.
Best regards and thanks in advance