Hi! I just finished a Linux port that might be worth sharing because I wanted to try out flip for some stuff I'm doing, but almost exclusively work on Linux. I'm very comfortable with CMake, so I ended up writing a minimal CMake build to build both flip and flip-cuda.
Here's what is in this MR:
CMake scripts that:
require C++11
build the flip executable
provide an option FLIP_ENABLE_CUDA, which when turned on builds flip-cuda using CMake's built-in CUDA support
install flip (and flip-cuda) into CMAKE_INSTALL_PREFIX/bin via make install
in theory this build is 100% cross-platform, but I have only tried it on Ubuntu 21.04...there are no platform-specific parts to it
Use C++ overload-based version of math functions in std::
For some reason gcc doesn't seem to include the precision-specific math functions in the std:: namespace. I chose to use the generic versions which are overloaded based on the operand instead (this ends up calling the same thing in the end).
M_PI as an identifier name collides with a macro definition of the value from the gcc standard library, so I renamed it to just PI.
FLIP::filename using \ to divide paths and final file name caused issues on Linux
I conditionally compiled this based on platform (#ifdef _WIN32) to keep Windows behavior constant (not sure if this matters)
The definition of image::FLIP() needed to be moved below other functions to ensure declaration ordering is satisfied (MSVC appears to be more permissive here)
README edits to mention that CMake is a build option for C++/CUDA
Note that I did not change anything wrt the VS project files, so existing users should not be affected.
Hi! I just finished a Linux port that might be worth sharing because I wanted to try out flip for some stuff I'm doing, but almost exclusively work on Linux. I'm very comfortable with CMake, so I ended up writing a minimal CMake build to build both
flip
andflip-cuda
.Here's what is in this MR:
flip
executableFLIP_ENABLE_CUDA
, which when turned on buildsflip-cuda
using CMake's built-in CUDA supportflip
(andflip-cuda
) intoCMAKE_INSTALL_PREFIX
/bin viamake install
std::
std::
namespace. I chose to use the generic versions which are overloaded based on the operand instead (this ends up calling the same thing in the end).M_PI
as an identifier name collides with a macro definition of the value from the gcc standard library, so I renamed it to justPI
.\
to divide paths and final file name caused issues on Linux#ifdef _WIN32
) to keep Windows behavior constant (not sure if this matters)image::FLIP()
needed to be moved below other functions to ensure declaration ordering is satisfied (MSVC appears to be more permissive here)Note that I did not change anything wrt the VS project files, so existing users should not be affected.
I'm happy to revise per anyone's request.
Cheers, Jeff