gabyx / ApproxMVBB

Fast algorithms to compute an approximation of the minimal volume oriented bounding box of a point cloud in 3D.
Mozilla Public License 2.0
441 stars 93 forks source link

macos cmake fpu_control problem #22

Closed wheelBL closed 6 years ago

wheelBL commented 6 years ago

My system is macOS 10.13.3. When I execute cmake .. in folder ApproxMVBB/Build It generated two errors and I paste them below. I searched google found that fpu_control.h is not a macOS header. So how do I build it? Thank you!

image

image

image

gabyx commented 6 years ago

Could you send me the whole output text based and post it here? I have one Apple macOS build. I develop on macOs, (not Sierra). The latest release from yesterday, might still have some problems, since I changed everything to a modern cmake...

wheelBL commented 6 years ago

Ok. This is the result of executing cmake command.

wheel@wheeldeMacBook-Pro:~/tmp_xbl/ApproxMVBB/build% cmake .. -- Module path is now set to: /Users/wheel/tmp_xbl/ApproxMVBB/cmake/ -- Project name is: ApproxMVBB- -- The CXX compiler identification is AppleClang 9.0.0.9000039 -- The C compiler identification is AppleClang 9.0.0.9000039 -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Set make program to /Users/wheel/tmp_xbl/ApproxMVBB/build/parallelmake.sh -- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "2.91.0") -- Meta: find meta -- Meta: Setup External Projext -- /Users/wheel/tmp_xbl/ApproxMVBB/build/src/meta/include -- Found Meta: /Users/wheel/tmp_xbl/ApproxMVBB/build/src/meta/include -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) -- Added '' to CMAKE_CXX and CMAKE_C_FLAGS: and -- Adding ApproxMVBB - Diameter ====================== -- ==================================================== -- Adding ApproxMVBB - GeometryPredicates ============ -- Performing Test HAVEFPU_SETCW -- Performing Test HAVE__FPU_SETCW - Failed -- Performing Test HAVE_FPSETPREC -- Performing Test HAVE_FPSETPREC - Failed -- Performing Test HAVECONTROLFP -- Performing Test HAVECONTROLFP - Failed -- Performing Test HAVECONTROLFP_S -- Performing Test HAVE__CONTROLFP_S - Failed -- Performing Test HAVE_FPU_INLINE_ASM_X86 -- Performing Test HAVE_FPU_INLINE_ASM_X86 - Success -- Floating point control: HAVEFPU_SETCW HAVE_FPSETPREC HAVECONTROLFP HAVE__CONTROLFP_S HAVE_FPU_INLINE_ASM_X86 1 -- ==================================================== -- ApproxMVBB: Write config file /Users/wheel/tmp_xbl/ApproxMVBB/build/include/ApproxMVBB/Config/Config.hpp, -- ApproxMVBB Version: 2.1.0 extracted from git tags! -- Dependecy Libs (public): eigenLib CMake Error at cmake/SetTargetCompileOptions.cmake:42 (message): Could not set compile flags for compiler id: AppleClang Call Stack (most recent call first): lib/CMakeLists.txt:14 (setTargetCompileOptions) lib/CMakeLists.txt:38 (add_approxmvbb_lib) -- Configuring incomplete, errors occurred! See also "/Users/wheel/tmp_xbl/ApproxMVBB/build/CMakeFiles/CMakeOutput.log". See also "/Users/wheel/tmp_xbl/ApproxMVBB/build/CMakeFiles/CMakeError.log".

This is CMakeOutput.log in ApproxMVBB/build/CMakeFiles: CMakeOutput.log

This is CMakeError.log in ApproxMVBB/build/CMakeFiles: CMakeError.log

Thanks. And do you need other files or information?

gabyx commented 6 years ago

Ok, I did not yet properly add AppleClang to the CmakeBuild... I will correct that, today or tomorrot. In the meanwhile you can try to compile with gcc on macOS. brew install gcc7.0 -> make sure to put somthing like the following into your ~/.bash_profile

comp="gcc@7.0"
if [[ ${comp} == "clang" ]] ; then
    echo "enabling clang7.0"
    export PATH="/usr/local/opt/llvm/bin:$PATH"
    export CC="/usr/local/opt/llvm/bin/clang"
    export CXX="${CC}++"
    export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
    export CPPFLAGS="-I/usr/local/opt/llvm/include -I/usr/local/opt/llvm/include/c++/v1/"
    export CXXFLAGS="$CPPFLAGS"
elif [[ ${comp} == "gcc@7.0" ]] ; then
    echo "enabling gcc@7.0"
    export PATH="/usr/local/opt/$comp/bin:$PATH"
    export CC="/usr/local/opt/$comp/bin/gcc-7"
    export CXX="/usr/local/opt/$comp/bin/g++-7"
    export LDFLAGS="-L/usr/local/opt/$comp/lib/gcc/7 -Wl,-rpath,/usr/local/opt/$comp/lib/gcc/7"
    export CPPFLAGS="-I/usr/local/opt/$comp/include -I/usr/local/opt/$comp/include/c++/7.2.0"
  export CXXFLAGS="$CPPFLAGS"
elif [[ ${comp} == "gcc@4.9" ]] ; then
    echo "enabling gcc@4.9"
    export PATH="/usr/local/opt/$comp/bin:$PATH"
    export CC="/usr/local/opt/$comp/bin/gcc-4.9"
    export CXX="/usr/local/opt/$comp/bin/g++-4.9"
    export LDFLAGS="-L/usr/local/opt/$comp/lib/gcc/4.9 -Wl,-rpath,/usr/local/opt/$comp/lib/gcc/4.9"
    export CPPFLAGS="-I/usr/local/opt/$comp/include -I/usr/local/opt/$comp/include/c++/4.9.4/"
    export CXXFLAGS="$CPPFLAGS"
fi
wheelBL commented 6 years ago

Thanks a lot! It works. But there was a flaw in it for my system. comp should be "gcc@7"

gabyx commented 6 years ago

Ah ok really, strange for me its 7.0 lol, thanks for the update. But its weird why it does not work for AppleClang... I will look in to that, strange because travis builds it with AppleClang as far as I saw ;)