Skip to content
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

Ice in blk_1m #455

Merged
merged 17 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 65 additions & 65 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,20 @@ endif()

############################################################################################
# Thrust, location of Thrust can be hinted by setting THRUST_INCLUDE_DIR
find_package(Thrust)

if (NOT THRUST_INCLUDE_DIR)
message(FATAL_ERROR "Thrust library not found.

* To install Thrust, please try:
* Debian/Ubuntu: sudo apt-get install libthrust-dev
* Fedora: TODO
* Homebrew: TODO
")
endif()
find_package(Thrust REQUIRED)

#if (NOT THRUST_INCLUDE_DIR)
# message(FATAL_ERROR "Thrust library not found.
#
#* To install Thrust, please try:
#* Debian/Ubuntu: sudo apt-get install libthrust-dev
#* Fedora: TODO
#* Homebrew: TODO
# ")
#endif()

# include thrust found here instead of the one shipped with cuda
target_include_directories(cloudphxx_lgrngn PRIVATE ${THRUST_INCLUDE_DIR})
#target_include_directories(cloudphxx_lgrngn PRIVATE ${THRUST_INCLUDE_DIR})

############################################################################################
# Boost libraries
Expand All @@ -296,59 +296,59 @@ endif()

############################################################################################
# BOOST ODEINT VERSION TEST
message(STATUS "Testing if Boost ODEINT version >= 1.58")
set(pfx "boost odeint check")
execute_process(COMMAND "mktemp" "-d" "/tmp/tmp.XXX" RESULT_VARIABLE status OUTPUT_VARIABLE tmpdir)
if (NOT status EQUAL 0)
message(FATAL_ERROR "${pfx}: mkdtemp failed")
endif()
file(WRITE "${tmpdir}/test.cpp" "
#define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CPP
#include <thrust/system/cpp/vector.h>

#include <boost/numeric/odeint.hpp>
#include <boost/numeric/odeint/external/thrust/thrust.hpp>
struct rhs
{
void operator()(
const thrust::cpp::vector<float> &psi,
thrust::cpp::vector<float> &dot_psi,
const float /* t */
)
{
assert(psi.size() == dot_psi.size());
}
};
int main()
{
boost::numeric::odeint::euler<
thrust::cpp::vector<float>, // state_type
float, // value_type
thrust::cpp::vector<float>, // deriv_type
float, // time_type
boost::numeric::odeint::thrust_algebra,
boost::numeric::odeint::thrust_operations
> chem_stepper;
thrust::cpp::vector<float> v(2);
chem_stepper.do_step(rhs(), v, 0, 1);
}
")
execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-std=c++14" "test.cpp" "-I${Boost_INCLUDE_DIR}" "-I${THRUST_INCLUDE_DIR}" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status ERROR_VARIABLE msg)
if (NOT status EQUAL 0)
message(FATAL_ERROR "${pfx}: c++ compiler failed\n ${msg}")
endif()
execute_process(COMMAND "./a.out" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status OUTPUT_VARIABLE msg)
if (NOT status EQUAL 0)
message(FATAL_ERROR "${pfx}: test program failed, install Boost odeint version >= 1.58")
endif()
unset(pfx)
unset(tmpdir)
unset(msg)
unset(status)
#message(STATUS "Testing if Boost ODEINT version >= 1.58")
#set(pfx "boost odeint check")
#execute_process(COMMAND "mktemp" "-d" "/tmp/tmp.XXX" RESULT_VARIABLE status OUTPUT_VARIABLE tmpdir)
#if (NOT status EQUAL 0)
# message(FATAL_ERROR "${pfx}: mkdtemp failed")
#endif()
#file(WRITE "${tmpdir}/test.cpp" "
# #define THRUST_DEVICE_SYSTEM THRUST_DEVICE_SYSTEM_CPP
#
# #include <thrust/system/cpp/vector.h>
#
# #include <boost/numeric/odeint.hpp>
# #include <boost/numeric/odeint/external/thrust/thrust.hpp>
#
# struct rhs
# {
# void operator()(
# const thrust::cpp::vector<float> &psi,
# thrust::cpp::vector<float> &dot_psi,
# const float /* t */
# )
# {
# assert(psi.size() == dot_psi.size());
# }
# };
#
# int main()
# {
# boost::numeric::odeint::euler<
# thrust::cpp::vector<float>, // state_type
# float, // value_type
# thrust::cpp::vector<float>, // deriv_type
# float, // time_type
# boost::numeric::odeint::thrust_algebra,
# boost::numeric::odeint::thrust_operations
# > chem_stepper;
#
# thrust::cpp::vector<float> v(2);
# chem_stepper.do_step(rhs(), v, 0, 1);
# }
#")
#execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-std=c++14" "test.cpp" "-I${Boost_INCLUDE_DIR}" "-I${THRUST_INCLUDE_DIR}" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status ERROR_VARIABLE msg)
#if (NOT status EQUAL 0)
# message(FATAL_ERROR "${pfx}: c++ compiler failed\n ${msg}")
#endif()
#execute_process(COMMAND "./a.out" WORKING_DIRECTORY ${tmpdir} RESULT_VARIABLE status OUTPUT_VARIABLE msg)
#if (NOT status EQUAL 0)
# message(FATAL_ERROR "${pfx}: test program failed, install Boost odeint version >= 1.58")
#endif()
#unset(pfx)
#unset(tmpdir)
#unset(msg)
#unset(status)

# generate a header file with git revision id
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
Expand Down
Loading
Loading